var $j = jQuery.noConflict();
$j(document).ready(function($) {	
 	
	// Länder Menu li:hover for IE6
	if ( $.browser.msie ) {
  		//alert( $.browser.version );
		$("ul#langmenu li.current_language ul").css({"top":"-1px"});
		if ($.browser.version=="6.0") {
			$("ul#langmenu li.current_language ul").css({"top":"-2px"});
			$("ul#langmenu li.current_language").hover(
				function(){
					$("ul",this).show();
					$(this).css({ "background-image":"url(fileadmin/templates/images/lang_menu2_top_open.gif)" });
				},
				function(){
					$(this).css({ "background-image":"url(fileadmin/templates/images/lang_menu2_top_closed.gif)" });
					$("ul",this).hide();
					
				}
			);
		}
		if ($.browser.version=="7.0") {
			$("ul#langmenu li li span a").hover(
				function(){
					$(this).css({"background":"white"});
				},
				function(){
					$(this).css({"background":"none"});
				}
			);	
		}
		
	}
	
	// Bookmark Menu
	$("a#bm_menu_link").toggle(
		function(){
			$("div#bookmark_menu").animate({
				"right" : -90 						   
			},500);		
		},
		function(){
			$("div#bookmark_menu").animate({
				"right" : -17 						   
			},500);		
		}
	);
	
	$("a#bm_bottom_link").toggle(
		function(){
			$("div#bookmark_bottom").animate({
				"bottom" : 0
			},500);	
			$("div#bm_inner").css({"background" : "url(fileadmin/templates/images/bookmark_bottom_close.gif)  0px 0px no-repeat" });
		},
		function(){
			$("div#bookmark_bottom").animate({
				"bottom" : -90
			},500);	
			$("div#bm_inner").css({"background" : "url(fileadmin/templates/images/bookmark_bottom_bm.gif)  0px 0px no-repeat" });
		}
	);
	
	
	// Splash Slideshow
	setInterval( "slideSwitch()", 5000 );
	
	$("div#splash_menu ul li span > a").hover(
		function(){
			$(this).parent().parent("li").css({
				"background" : "white"							 
			});
		
		},
		function(){
			$(this).parent().parent("li").css({
				"background" : "url(fileadmin/templates/images/splash_li_opac.png)"
			});
		
		}
	);
	splashHover("div#splash_menu ul#corporate_menu li span > a","div#splash_menu ul#corporate_menu li span > a","span.co_no_link a img");
	splashHover("div#splash_menu li.ch_m span > a","div#splash_menu li.ch_m span > a","li.ch_m span.l_no_link img");
	splashHover("div#splash_menu li.be_m span > a","div#splash_menu li.be_m span > a","li.be_m span.l_no_link img");
	
	function splashHover(sel1, sel2, sel3){
		
		$(sel1).hover(
		function(){
			$(this).css({
				"background-position" : "0 -13px"
			});
			$(sel2).not(this).css({
				"background-position" : "0 -26px"
			});
			$(sel3).css({
				"top" : -13
			});
		
		},
		function(){
			$(this).css({
				"background-position" : "0 0"
			});
			$(sel2).not(this).css({
				"background-position" : "0 0"
			});
			$(sel3).css({
				"top" : 0
			});
		
		}
	);
		
		}
	
	
	
});	


/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch() {
    var $active = $j('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $j('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $j('#slideshow IMG:first');


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
	
}