//author: B.G. Ulrich
//publisher: Kunstverein Trier Junge Kunst e.V.
//copyright: Kunstverein Trier Junge Kunst e.V.
//Letzte Aktualisierung: 21.11.09

var isIE4=false; //Microsoft Internet Explorer 4.x
var isIE5=false; //Microsoft Internet Explorer 5.x
var isIE55=false; //Microsoft Internet Explorer 5.5
var isIE6=false; //Microsoft Internet Explorer ab 6.x
var isNc4=false; //Netscape Navigator 4.x
var isNc5=false; //Netscape Navigator ab Mozilla 5.x
var isOp5=false; //Opera 5.x bis 6.x
var isOp7=false; //Opera ab 7.x
var isMo5=false; //andere Browser ab Mozilla 5.x
var isW3C=false; //Netscape ab 5.x, Opera ab 7.x, Internet Explorer ab 6.x

if (navigator.appName=="Microsoft Internet Explorer")
{
	reIE=/(.*)MSIE (.*)/i;
	matchIE=navigator.appVersion.match(reIE);
	if (matchIE)
	{
		if (matchIE[2].charAt(0)=='4')
		{
			isIE4=true;
		}
		else if (matchIE[2].charAt(0)=='5')
		{
			isIE5=true;
			if (matchIE[2].charAt(2)=='5')
			{
				isIE55=true;
			}
		}
		else if (matchIE[2].charAt(0)>='6')
		{
			isIE6=true;
			isW3C=true;
		}
	}
}
else if (navigator.appName=="Netscape")
{
	if (navigator.appVersion.charAt(0)=='4')
	{
		isNc4=true;
	}
	else if (navigator.appVersion.charAt(0)=='5')
	{
		isNc5=true;
		isW3C=true;
	}
}
else if (navigator.appName=="Opera")
{
	if (navigator.appVersion.charAt(0)=='4')
	{
		isNc4=true;
	}
	else if (navigator.appVersion.charAt(0)=='5' || navigator.appVersion.charAt(0)=='6')
	{
		isOp5=true;
	}
	else if (navigator.appVersion.charAt(0)>='7')
	{
		isOp7=true;
		isW3C=true;
	}
}
else if (navigator.appVersion.charAt(0)>="5")
{
	isMo5=true;
}

function NavLeiste(art)
{
	if (parent.parent.frames["NavigationFrame"])
	{	
		if (screen.height>600)
		{
			if (isW3C || isMo5)
			{
				parent.parent.frames["NavigationFrame"].location="juku3a16"+art+".htm";
			}
			else
			{
				parent.parent.frames["NavigationFrame"].location="juku3a1"+art+".htm";
			}
		}
		else
		{
			//keine subMenüs
			if (screen.height>480)
			{
				parent.parent.frames["NavigationFrame"].location="juku3a.htm";
			}
			else
			{
				parent.parent.frames["NavigationFrame"].location="juku3a3.htm";
			}
		}	
	}	
}

function NavLeisteRelativ(pfad)
{
	//keine subMenüs
	if (parent.parent.frames["NavigationFrame"])
	{	
		if (screen.height>600)
		{
			if (isW3C || isMo5)
			{
				parent.parent.frames["NavigationFrame"].location=pfad+"juku3a16.htm";
			}
			else
			{
				parent.parent.frames["NavigationFrame"].location=pfad+"juku3a1.htm";
			}
		}
		else
		{
			if (screen.height>480)
			{
				parent.parent.frames["NavigationFrame"].location=pfad+"juku3a.htm";
			}
			else
			{
				parent.parent.frames["NavigationFrame"].location=pfad+"juku3a3.htm";
			}
		}	
	}	
}

function ein(derLayer)
{
	moveLayer(derLayer,"20px");
}

function aus(derLayer)
{
	moveLayer(derLayer,"-300px");
}

function meineNavLeiste(ich)
{
	var subnav="";
	var pos=ich.indexOf("-");
	if (pos>0)
	{
		subnav=ich.substr(pos,2);
	}
	if (screen.height>600)
	{
		if (isW3C || isMo5)
		{
			if (ich!="juku3a16"+subnav+".htm")
			{
				window.location.replace("juku3a16"+subnav+".htm");
			}
		}
		else
		{
			if (ich!="juku3a1"+subnav+".htm")
			{
				window.location.replace("juku3a1"+subnav+".htm");
			}
		}
	}
	else
	{
		//keine subMenüs
		if (screen.height>480)
		{
			if (ich!="juku3a.htm")
			{
				window.location.replace("juku3a.htm");
			}
		}
		else
		{
			if (ich!="juku3a3.htm")
			{
				window.location.replace("juku3a3.htm");
			}
		}
	}	
}

function getLayer(name)
{
	if (parent.parent.frames["NavigationFrame"])
	{
		if (isIE4 || isIE5)
		{
			return parent.parent.frames["NavigationFrame"].document.all[name].style;
		}
		else if (isW3C)
		{
			return parent.parent.frames["NavigationFrame"].document.getElementById(name).style;
		}
	}
}

function moveLayer(name,x)
{
	var tmpLayer=getLayer(name);
	if (tmpLayer)
	{
		if (isIE5 || isW3C)
		{
			tmpLayer.left=x;
		}
		else if (isIE4)
		{
			tmpLayer.pixelLeft=x;
		}
	}
}

function getHeight() 
{  
	var myHeight = 0;      
	if( window.innerWidth && typeof( window.innerWidth ) == 'number' ) 
	{  
		//Non-IE  
		myHeight = window.innerHeight;  
	} 
	else if( document.documentElement && document.documentElement.offsetHeight ) 
	{  
		//IE 7+  
		myHeight = document.documentElement.offsetHeight;  
		if (isIE55)
		{
			//IE5.5 gibt anscheinend die höhe des browserfensters zurück
			myHeight = myHeight - 175;  
		}
	} 
	else if( document.documentElement && document.documentElement.clientHeight ) 
	{  
		//IE 6 in 'standards compliant mode'  
		myHeight = document.documentElement.clientHeight;  
	} 
	else if( document.body && document.body.clientHeight ) 
	{  
		//IE 4 compatible  
		myHeight = document.body.clientHeight;  
	}  
	return myHeight; //aktuelle höhe des fensters bzw. frames
}  

function sizeTab()
{
	//aufruf in intro3a.htm, um die suchtabelle zu positionieren
	//aufruf in intro4a.htm, um die tabellengröße zu begrenzen
	if(getHeight()>500)
	{
		window.document.write("<style>");
		window.document.write("table.intro {height:500px}");
		window.document.write("table.intro3a {height:466px}");
		window.document.write("</style>");
	}
	else
	{
		window.document.write("<style>");
		window.document.write("table.intro3a {height:"+(getHeight()-14)+"px}");
		window.document.write("</style>");
	}
}

function pruefeBrowser()
{
	if (!(isW3C || isMo5))
	{
		window.location.replace("juku3a0.htm");
	}
}
