/*
 * Function: Simple Layer-Script for the Navigation
 * Author: Oliver Arnoczky, UPDATE AG
 * Date: 06-13-2003
 * Purpose: This Navigation script is only used for the HTML-Prototyping an can be replaced afterwards, if needed
 */


/* Browserabfrage: Layer-Object bekannt? */
if (document.layers)
      {ns = 1; ie = 0;}
else  {ns = 0; ie = 1;}


function browserCheck()
{
	// Based on concepts discussed at http://developer.apple.com/internet/javascript/nn6dhtml.html
	if (!document.getElementById) {
		//window.location = "/upgrade.html";
  		alert("This browser is not compliant with the W3C Document Object Model standard!\nAs a result, these pages may not display properly.\nTo ensure the best browsing experience, please upgrade your browser.");
	}
}

/* Funktion Dokument initialisieren - nicht notwendig */
function init()
{
	if (ns)
		layer = document.Layer1;
	if (ie)
		layer = Layer1.style;
}

// ------------------
// layers
// ------------------
var aktuellerLayer="";

// mouse out -> closeMenu
function menuOut(layerx)
{
	hideLayer(layerx);
}

// mouseover -> openMenu
function menuIn(layerx)
{
	// alert(''+layerx);
	hideAll();
	displayLayer(layerx);
}


// layerfunctions
function Is()
{
	var agent = navigator.userAgent.toLowerCase();

	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);

	this.ns = ((agent.indexOf('mozilla')!=-1) && (agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1) );
	this.ns2 = (this.ns && (this.major == 2));
	this.ns3 = (this.ns && (this.major == 3));
	this.ns4b = (this.ns && (this.minor < 4.04));
	this.ns4 = (this.ns && (this.major >= 4));
	this.ns6 = (this.ns && (this.major >= 6));
	
	this.ie = (agent.indexOf('msie') != -1);
	this.ie3 = (this.ie && (this.major == 2));
	this.ie4 = (this.ie && (this.major >= 4));
	this.op3 = (agent.indexOf('opera') != -1);
	this.ver5m=(this.major >= 5);
}

var is = new Is();

function displayLayer(lname)
{
	vis='visible';
	estr='';
	if (!is.ver5m)
	{
		if (is.ie)
			estr='document.all["'+lname+'"].style.visibility="'+vis+'"';
		if (is.ns6)
			estr='document.layers.'+lname+'.visibility="'+vis+'"';
		eval(estr);
	}
	else
		document.getElementById(lname).style.visibility=vis;
}

function hideLayer(lname)
{
	vis='hidden';
	estr='';
	if (!is.ver5m)
	{
		if (is.ie)
			estr='document.all["'+lname+'"].style.visibility="'+vis+'"';
		if (is.ns6)
			estr='document.layers.'+lname+'.visibility="'+vis+'"';
		eval(estr);
	}
	else
		document.getElementById(lname).style.visibility=vis;
}

function hideAll()
{
	hideLayer("nav1");
	hideLayer("nav2");
	hideLayer("nav3");
	hideLayer("nav4");
	hideLayer("nav5");
	hideLayer("nav6");
	hideLayer("nav7");
	hideLayer("nav8");
	hideLayer("nav9");
}

if (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion.substring(0,1)) >=3)) || ((navigator.appName == "Microsoft Internet  Explorer")&&(parseInt(navigator.appVersion.substring(0,1)) >=4)))
{
	var version=true
}

// nop = do nothing = no operation
function nop()
{

}
