$(document).ready(function() {

$(".multiFilialen div").hide();

//Navigation
	$("ul.n2").addClass("ulHeight");
	
	
	//When mouse rolls over
	$("li.navE1", this).mouseover(function(){
	
		$("ul", this).toggleClass("ulHeight").addClass("ulHeightx");
		
		var hoch = $("ul.n2", this).height() + 50;
		$(this).stop().animate({height: hoch},{queue:false, duration:200});	

		return false;
	});
	
	//When mouse is removed
	$("li.navE1", this).mouseout(function(){
	
		$("ul", this).addClass("ulHeight").toggleClass("ulHeightx");
		$(this).stop().animate({height:'33px'},{queue:false, duration:200})

		return false;
	});
	

//Multi filialen action
	
	$(".multiFilialen", this).mouseover(function() {	
		$("div", this).show();
		return false;
	});

	$(".multiFilialen", this).mouseout( function() { 
      	$("div", this).hide();
      	return false; 
		});
		
		
// Center Stage Home
	
	$("div.centerStage-2, div.centerStage-3, div.illuZoomStage").hide();
	
	$("a.arrowFilialen").css({backgroundPosition: "0 -98px"});

	$("a.arrowFilialen").mouseover(function(){
		$(".centerStage-2, .centerStage-2").fadeOut (250);
		$(".centerStage-1").fadeIn (250);
		$(this).css({backgroundPosition: "0 -98px"});
		$("a.arrowPaedakustik").css({backgroundPosition: "0 -196px"});
		$("a.arrowLeistungen").css({backgroundPosition: "0 -392px"});
		return false;
	});
	
	$("a.arrowPaedakustik").mouseover(function(){
		$(".centerStage-1, .centerStage-3").fadeOut (250);
		$(".centerStage-2").fadeIn (250);
		$(this).css({backgroundPosition: "0 -294px"});
		$("a.arrowFilialen").css({backgroundPosition: "0 0"});
		$("a.arrowLeistungen").css({backgroundPosition: "0 -392px"});		
		return false;
	});
	
	$("a.arrowLeistungen").mouseover(function(){
		$(".centerStage-1, .centerStage-2").fadeOut (250);
		$(".centerStage-3").fadeIn (250);
		$(this).css({backgroundPosition: "0 -490px"});
		$("a.arrowFilialen").css({backgroundPosition: "0 0"});
		$("a.arrowPaedakustik").css({backgroundPosition: "0 -196px"});		
		return false;
	});


	$('a.illuZoomLink').click(function() {	
		$('div.illuZoomStage').fadeIn(300);
	});
	
	$('a.illuCloseLink').click(function() {	
		$('div.illuZoomStage').fadeOut(300);
	});
	
	$('a.printPlan').click(function() {
	
		$(this).css ({"visibility": "hidden"});
		$('body').css("backgroundColor", "black");
		$('div.leftRow, div.header').fadeTo("fast", 0.20);
		$('a.illuZoomLink').toggle (); 
		$('a.printCloseLink').show ();
	});
	
	$('a.printCloseLink').click(function() {
		$('body').css("backgroundColor", '');
		$('div.leftRow, div.header').fadeTo("fast", 100);
		$('a.illuZoomLink').show ();
		$('a.printPlan').css ({"visibility": "visible"});
		$('a.printCloseLink').hide ();
	 });
	 
// IE bug Fixes	
	
   	if($.browser.msie) {
   
    	$("html").attr("id",'ie' + $.browser.version.substring(0,1));

    	$("a, button").click(function() {
    		$(this).blur();
    	});
    	
    	try {document.execCommand("BackgroundImageCache",false, true);}catch(err){}

    	}
    	
// jQuery SmoothScroll
	$('a[href*=#]').click(function() {

   // duration in ms
   var duration=1000;

   // easing values: swing | linear
   var easing='swing';

   // make sure it's the same location      
   if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'') && location.hostname==this.hostname && 		this.hash.replace(/#/,''))
   {
      // get parameters
      var hash=this.hash;
      var target=$(hash).offset().top;

      // animate to target and set the hash to the window.location after the animation
      $("html:not(:animated),body:not(:animated)").animate({ scrollTop: target }, duration, easing, function() { location.hash=hash; });

      // cancel default click action
      return false;
   }

});
    	
/*
    $('.boxMap').click(function(event){
      var x = event.pageX - this.offsetLeft;
      var y = event.pageY - this.offsetTop;
    
      alert('X: '+x+'  Y:'+y);
    });
*/
		
// Snippets to use 		
	// equal height for divs
	// $(function(){ $('#equalize').equalHeights(); });
	
	
/*
	 $(".boxMap a").find(":contains('t')")
            .hover(function () { $(this).addClass("hilite"); },
                   function () { $(this).removeClass("hilite"); })
          .end()
          .find(":contains('t')")
            .css({"font-style":"italic", "font-weight":"bolder"});

 $(".standorteList a").hover(function () { 
 		
 		 $(".boxMap").find(":contains(this)")
 					$(this).addClass("hilite");
 					}
                  
                  
$('div:contains("' + name + '")');

$(this).removeClass('hover');}}};
*/
		
});
		



    

		

