	// MSIE 6 Erkennung
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
		var ieversion=new Number(RegExp.$1);
		if (ieversion<7 && ieversion>=6)
			var msie6 = 1;
		else
			var msie6 = 0;
	}
	
	// jQuery Funktionen
	$(document).ready(function(){ 
		// Kleiner Teaser rechts
		if (!msie6) {
			$("#teaser_small .teaser_small_overlay").hover(function () {
				$(this).animate({opacity:0}, "slow");
				$(this).fadeOut("slow");
			});
			$("#teaser_small .teaser_small_box").mouseleave(function () {
				$("#teaser_small .teaser_small_overlay").fadeIn("fast");
				$("#teaser_small .teaser_small_overlay").animate({opacity:0.4});
			});
		}
		
		// News, die nach oben rollen
		$('#news').cycle({
			fx:      'scrollVert',
			timeout:  0,
			prev:    '#prev',
			next:    '#next'
		});
		
		// Specials, beim Start nach 5 Sekunden verstecken
		$('#specialsopen').click(function(){
			$('#specials').fadeIn('slow');
		});
		$('#specials span').click(function(){
			$('#specials').fadeOut('slow');
		});
		$('#specials').fadeOut(5000);
		$("#specials").mouseleave(function () {
			stimeout = setTimeout(function(){
				$('#specials').fadeOut('slow');
			}, 2000);
		});
		$('#specials').mouseenter(function(){
			if (false) {
				clearTimeout(stimeout);
			}
		});
		
		// Schnellnavigation
		$('#quicknavi').click(function(){
			$('#quicknavigation').fadeIn('slow');
		});
		$('#qnheader').click(function(){
			$('#quicknavigation').fadeOut('slow');
		});
		$("#quicknavigation").mouseleave(function () {
			qtimeout = setTimeout(function(){
				$('#quicknavigation').fadeOut('slow');
			}, 2000);
		});
		$('#quicknavigation').mouseenter(function(){
			if (false) {
				clearTimeout(qtimeout);
			}
		});
		
		// Download im Quickmenü
		$('#download').click(function(){
			$('#downloadwindow').toggle('slow');
		});
		$('#downloadwindow li span').click(function(){
			$('#downloadwindow').toggle('slow');
		});
		$('#downloadwindow').fadeOut(0);
		
		// Drucken im Quickmenü
		$('#print').click(function(){
			window.print();
		});
		
		// Hauptmenü
		$("ul.sf-menu").superfish({ 
			pathClass:   'current',
			pathLevels:  3,
			delay:       3000,
			animation:   {opacity:'show'},
			speed:       0,
			autoArrows:  false,
			dropShadows: false,
			onInit:      function(){
				setTimeout(function(){
					$("ul.sf-menu ul").hide();
				}, 5000);
			}
		});
		
		// Menü im Kopfbild
		$('#bildmenu li').hover(function(){
			$(this).find('.bildmenutext').slideDown('slow');
			$(this).find('.bildmenubild').slideDown('slow');
		});
		$('.bildmenutext').mouseleave(function(){
			btimeout = setTimeout(function(){
				$('.bildmenubild').slideUp('slow');
				$('.bildmenutext').slideUp('slow');
			}, 1);
		});
		$('.bildmenubild').mouseleave(function(){
			btimeout = setTimeout(function(){
				$('.bildmenubild').slideUp('slow');
				$('.bildmenutext').slideUp('slow');
			}, 1);
		});
		$('.bildmenubild').mouseenter(function(){
			clearTimeout(btimeout);
		});
		$('.bildmenutext').mouseenter(function(){
			clearTimeout(btimeout);
		});
		
		// Login Box
		$('.login').click(function(){
			$("#greyout").show();
			$("#loginbox").fadeIn("slow");
		});
		$('#greyout').click(function(){
			$("#greyout").hide();
			$("#loginbox").fadeOut("slow");
		});
		$('.loginbox_header').click(function(){
			$("#greyout").hide();
			$("#loginbox").fadeOut("slow");
		});
			
		if ($(".content_left").height() > $(".last_column").height())
			$(".rheight").css("height", $(".content_left").height() - $(".last_column").height());
		
		// Hauptmenü einblenden
		$("#submenu").show();
	});
	
	// Suchfeld mit vorbelegtem Text
	function searchfocus(s, t) {
		if (s.value == t)
			s.value = '';
	}
	function searchblur(s, t) {
		if (s.value == '')
			s.value = t;
	}
	
	// hidden field setzen für Kalendersuche
	function setHiddenDateField() {
		hiddenField_date = document.getElementById("calendar_layout_hidden_date");
		select_day = document.getElementById("select_day").value;
		select_month = document.getElementById("select_month").value;
		select_year = document.getElementById("select_year").value;
		
		hiddenField_date.value = select_day + '.' + select_month + '.' + select_year;
	}
	