var iOnFocus = "leer";

function AskBrowser()
	{
		var Browser = navigator.appName;
		var UserAgent = navigator.userAgent;
		var BrowserVersion;
		
			
		if (Browser == "Microsoft Internet Explorer")
			{
				var Ergebnis = (UserAgent.search(/MSIE.+/));
						
				if (Ergebnis != -1)
						 {
							 //alert(Ergebnis);
							BrowserVersion = (UserAgent.substring(Ergebnis+5,Ergebnis+6));
							
							if(BrowserVersion <= 7)
								{
									// CSS für IE nachladen
									//html,body {overflow:hidden}
									document.getElementsByTagName("body")[0].style.overflow = "hidden";
								} else{
										document.getElementsByTagName("body")[0].style.overflow = "scroll";
									  }
								
							if (BrowserVersion < 7 )
								{	
									alert("This page is optimized for Microsoft Internet Explorer version 7 or newer!")
								}
						}
				
				
				
				
				//
			}
		
		if (Browser == "Netscape" || Browser == "Opera")
			{
				
				var Ergebnis = (UserAgent.search(/Mozilla.+/));
				if (Ergebnis != -1)
						 {
							 
							BrowserVersion = (UserAgent.substring(Ergebnis+8,Ergebnis+9));
							
							if (BrowserVersion < 5 )
								{	
									alert("This page is optimized for Mozilla Firefox 4 or newer Browser!")
								}
						}
				
				// CSS für Mozilla, Safari, Opera nachladen
				document.getElementsByTagName("html")[0].style.overflow = "scroll";
			}
		
	}


function lade_Menue(Focus)
	{
		iOnFocus = Focus;
		$('#container_menue').load('menue.php', function() {
			if(iOnFocus != "leer")
				{
					cVisited(iOnFocus);
					iOutOfFocus = iOnFocus;
					iOnFocus = "leer";	  
				}
		});
	}

function lade_Seite(Link, Focus, bool)
{
	if (bool == 'True')
		{
			lade_Menue(Focus);
		}
	


	$('#container_mitte').load(Link + '',function(){
	
	$(".popup").each(function(){
			var $a = $(this);
			var h = $a.data("height")
			var w = $a.data("width");
			$a.fancybox({
					'width' : w, 
					'height': h,
					'type': 'iframe',
					'autoScale':false
			});
	})});
	
	
}

function cVisited(Focus)
{
		/* entspricht: a:visited.menue */
		document.getElementsByTagName("a")[Focus].style.Zindex = "500";
		document.getElementsByTagName("a")[Focus].style.background = "url(bilder/menue2.gif) no-repeat";
        document.getElementsByTagName("a")[Focus].style.backgroundPosition = "-10px -40px";
        document.getElementsByTagName("a")[Focus].style.marginLeft = "-21px";
		document.getElementsByTagName("a")[Focus].style.paddingLeft = "26px";
		
		/* entspricht: a:visited.menue span */	
		document.getElementsByTagName("span")[Focus].style.padding = "0px 30px 0px 6px";	
		document.getElementsByTagName("span")[Focus].style.Zindex = "500";
        document.getElementsByTagName("span")[Focus].style.background = "url(bilder/menue.gif) no-repeat top right";
        document.getElementsByTagName("span")[Focus].style.backgroundPosition = " right -80px";
			
}

	

