$(document).ready(function(){
	
	//Fix Errors - http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/
	
	//Remove outline from links
	$("a").click(function(){
		$(this).blur();
	});
	
	// get user agent: smartphone or tablet
	var agent = navigator.userAgent.toLowerCase();
	var otherBrowser = (agent.indexOf("series60") != -1) || (agent.indexOf("symbian") != -1) || (agent.indexOf("windows ce") != -1) || (agent.indexOf("blackberry") != -1);
  var mobileOS = typeof orientation != 'undefined' ? true : false;
	var touchOS = ('ontouchstart' in document.documentElement) ? true : false;
	var iOS = (navigator.platform.indexOf("iPhone") != -1) || (navigator.platform.indexOf("iPad") != -1) ? true : false;
	var android = (agent.indexOf("android") != -1) || (!iOS && !otherBrowser && touchOS && mobileOS) ? true : false;
  
	// @ menu slide
	if(mobileOS || touchOS || iOS || android) {
		$('li.anzeige').toggle(
      function()
      {
        $(this).stop().animate({height:'595px'},{queue:false, duration:300, easing: 'linear'});
      },
      function()
      {
        $(this).stop().animate({height:'30px'},{queue:false, duration:300, easing: 'linear'});
      }
		);
	}
	else {	
	  $("li.anzeige").hover(
		  // in
		  function () {
        $(this).addClass('activeMenu').stop().animate({height:'595px'},{queue:false, duration:300, easing: 'linear'});
			  $('li.activeMenu').click(function(){
		      $(this).stop().animate({height:'30px'},{queue:false, duration:300, easing: 'linear'}).removeClass('activeMenu');
			  });
      },
		  // out
      function () {
        $(this).removeClass('activeMenu').stop().animate({height:'30px'},{queue:false, duration:300, easing: 'linear'});
      }		
	  );
	}
	
	
	

	

});
function wechsel(WER, TIEFE) {
		window.setTimeout(function () { seitenwechsel(WER, TIEFE);}, 1000);
}

function seitenwechsel(WER, TIEFE){
	pfad = WER+".php";
	switch (TIEFE){
		case 0: window.location.href=pfad; break;
		case 1: pfad= "../"+pfad; window.location.href=pfad; break;
		case 2: pfad= "../../"+pfad; window.location.href=pfad; break;
		
		}
	window.location.href=pfad;
}
