
$(document).ready(function($){

	// ie < 7.0 kann kein li:hover
	if ($.browser.msie && $.browser.version < '7') {
	    var ie6navigation = function (e) {
			if (this.hovering) {
				this.hovering = false;
			} else {
				this.hovering = true;
			}
			$(this).toggleClass('hover');
		};
		function buttonHover(e) {
			ie6navigation.call(this, e);
			$(this.parentNode).toggleClass(this.className);
		}
		function hideInputs(e) {
			ie6navigation.call(this, e);
			$(this).nextAll().find('input, select').toggle();
		}
		$('ul.nav > li').hover(ie6navigation, ie6navigation);
		//$(' ul.nav li.first > a').hover(ie6navigation, ie6navigation);
		//$(' ul.nav ul li > a').hover(ie6navigation, ie6navigation);
		//$('.homePage .Navigation').hover(ie6navigation, ie6navigation);
		//$('.branchen .Navigation').hover(ie6navigation, ie6navigation);
		$('.intranetLogin > div.tipp, div.einstieg > div.tipp, div.einstieg > div.suchfeld').hover(ie6navigation, ie6navigation);
		$('.buttonGo').hover(ie6navigation, ie6navigation);
		
		
	}
	
	/*function toggleTeaser(elements, delay, fade) {
		delay = delay || 1000;
		fade = fade || 3000;
		var homeTeaser = $(elements);
		homeTeaser.filter(':eq(0)').show();
		homeTeaser.filter(':not(:eq(0))').hide();
		var current;
		var last;
		var paused = false;
		function toggle(i) {
			if (paused) {
				return false;
			}
			current = i % homeTeaser.length;
			homeTeaser.filter(':not(:eq(' + last + '))').hide();
			homeTeaser.filter(':eq(' + last + ')').css({'z-index': 9, position:'static'});
			last = current;
			homeTeaser.filter(':eq(' + current + ')').css({'opacity':0, 'z-index': 10, position: 'absolute', top: 0, left:0}).animate({'opacity': 1.0}, delay).fadeIn(fade, function () {toggle(current + 1)} );
			return true;
		};
		toggle.pause = function () {
			paused = true;
		}
		toggle.start = function () {
			last = 0;
			paused = false;
			toggle(1);
		}
		return toggle;
	};
	var toggleHomeTeaser = toggleTeaser('.buehne #section-0 .buehneImg', 1000, 3000);
	toggleHomeTeaser.start();
*/

	// schriftgrößen
	$("a#toggleMinus").bind('click', function(){
		$("body").addClass("minus");
		$("body").removeClass("standard");
		$("body").removeClass("plus");
		return false;
	});
	$("a#toggleStandard").bind('click', function(){
		$("body").addClass("standard");
		$("body").removeClass("minus");
		$("body").removeClass("plus");
		return false;
	});
	$("a#togglePlus").bind('click', function(){
		$("body").addClass("plus");
		$("body").removeClass("standard");
		$("body").removeClass("minus");
		return false;
	});
	
	// print-links
	$('*.fn-print').click(function (e) {
		e.preventDefault && e.preventDefault();
		e.returnValue = false;
		self.print();
		return false;
	});
	
	
	var buehne = $("div.buehne > div")
	$('ul.reiter').mouseout(function (e) {
		buehne.hide().filter(':eq(0)').show();
		return false;
	}).children().each(function (i, item) {
		$(this).find('a').mouseover(function (e) {
			buehne.filter(':eq(' + (i + 1) + ')').show().siblings().hide();
			return false;
		});
	});
	


	$('.date-pick').datePicker({createButton:true}).each(function (i, item) {
		$this = $(this);
		$this.siblings('.dp-choose-date').mouseover(function (e) {
			$this.dpDisplay(this);
		});
	
	});


	function umfangOnChange() {
		switch (this.value) {
		case 'Teilzeit':
			$(this).siblings('input.showZeiten').attr('disabled', false).removeClass('disabled');
			$(this).siblings('label.showZeiten').removeClass('disabled');
			break;
		default:
			$(this).siblings('input.showZeiten').attr('disabled', true).addClass('disabled');
			$(this).siblings('label.showZeiten').addClass('disabled');
		}
	}
	$('.Aktivieren').change(umfangOnChange);
	
	
	// popup-fenster
	var mini;
	function pop(){
		var a = this.href;
		mini=window.open(a,'Pop','toolbar=0,location=0,directories=0,status=0,menubar=1,menubar=yes, scrollbars=1,resizable=0,copyhistory=0,height=724,width=700,top=0,left=0');
		mini.focus();
		return false;
	}
	$('a.popup').click(pop);
		
	
	function popKlein(){
		var a = this.href;
		mini=window.open(a,'PopKlein','toolbar=0,location=0,directories=0,status=0,menubar=1,menubar=yes, scrollbars=1,resizable=0,copyhistory=0,height=420,width=480,top=0,left=0');
		mini.focus();
		return false;
	}
	$('a.popupKlein').click(popKlein);
	
		
	function popLarge(){
		var a = this.href;
		mini=window.open(a,'PopLarge','toolbar=0,location=0,directories=0,status=0,menubar=1,menubar=yes, scrollbars=1,resizable=0,copyhistory=0,height=550,width=935,top=0,left=0');
		mini.focus();
		return false;
	}
	$('a.popupLarge').click(popLarge);
});




