<!--
// --- CLIENTCHECK ---

function getClient() {
    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase()
    var apv=navigator.appVersion.toLowerCase()
	this.major = parseInt(navigator.appVersion)
    this.minor = parseFloat(navigator.appVersion)
	// browserversion
    this.ns  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)))
    this.ns4 = (this.ns && (this.minor >= 4.03) && (this.major < 5))
	this.ns6 = (this.ns && (this.major == 5))
	this.gecko = (this.ns && (this.major >= 5))
    this.ie   = (agt.indexOf("msie") != -1)
    this.ie4  = (this.ie && (this.major == 3))
	this.ie45 = (agt.indexOf('msie 4.5') != -1);
    this.ie5  = (this.ie && (this.major == 4))
	// platform
	this.mac = (apv.indexOf("macintosh")>0);
	this.win = (apv.indexOf("win")>0);	
    // compatible browsers
	this.ie4comp = ((this.ie4 && !this.mac) || this.ie45 || this.ie5)
	this.ns4comp = (this.ns4);
	this.ns6comp = (this.gecko || this.ns6);
	this.comp = (this.ie4comp || this.ns4comp || this.ns6comp);
	return (this)
}

var is = new getClient();

// --- SECOND LEVEL NAVIGATION FUNCTS ---

var activeSub = "";
var activeItem = "";

function openMenu(thisId, thisRef, subId){
	if (is.comp){
		justOpen(thisId, thisRef, subId);
		setTimeout('closeMenu("'+ thisId + '","' + subId + '");', 1100);
	}
}

function justOpen(thisId, thisRef, subId){
	var urlimage = document.location.toString();
			
	var urlArr = urlimage.split('/');
	var dir = "/" + urlArr[3] + "/notdsimages/nav_arrow_ssh_ro.gif";
	
	var h;
	var ref;
	if ((activeSub != subId) && (activeSub != "")){
		hideIt(activeItem,activeSub);
	}
	activeSub = subId;
	activeItem = thisId;
	
	var y = 0;
	while( thisRef.offsetParent != null ) {
		y +=thisRef.offsetTop;
		thisRef = thisRef.offsetParent;
    }
	h = document.getElementById(thisId).offsetHeight;
	var posx = 162;
	var posy = y + h;

	ref = document.getElementById(thisId).childNodes[0];
	ref.style.color = "#990000";
	
	document.getElementById(thisId).style.background = "#CCDAE5 url(" + dir + ") no-repeat";
	document.getElementById(subId).style.left = posx + 'px';
	document.getElementById(subId).style.top = posy + 'px';  
}

function closeMenu(thisId, subId){
	if (is.comp){ 
		var y = 0;
		var x = 0;
		var thisRef = document.getElementById(thisId);
		while( thisRef.offsetParent != null ) {
			y +=thisRef.offsetTop;
			x += thisRef.offsetLeft;
			thisRef = thisRef.offsetParent;
	    }
		
		// link specifics
		var leftLink = x;
		var widthLink = document.getElementById(thisId).offsetWidth + leftLink;		
		var topLink = y;
		var bottomLink = topLink + document.getElementById(thisId).offsetHeight;
		
		// second level menu specifics
		var leftThis = document.getElementById(subId).offsetLeft;
		var widthThis = document.getElementById(subId).offsetWidth + leftThis;		
		var topThis = document.getElementById(subId).offsetTop;	
		var bottomThis = topThis + document.getElementById(subId).offsetHeight;	
		
		//iMouseX and _iMouseY are defined in file 'lib_menu.js'
		
		if(is.comp){
			if((_iMouseX>widthLink || _iMouseX<leftLink || _iMouseY>bottomLink || _iMouseY<topLink) && (_iMouseX>widthThis || _iMouseX<leftThis || _iMouseY>bottomThis || _iMouseY<topThis)){
				hideIt(thisId, subId);
			} else {
				setTimeout('closeMenu("'+ thisId + '","' + subId + '");', 1100);
			}
		}		
	}
}

function hideIt(thisId, subId){
	var urlimage = document.location.toString();
	
	var urlArr = urlimage.split('/');
	var dir = "/" + urlArr[3] + "/notdsimages/nav_arrow_ssh.gif";
	

	var ref = document.getElementById(thisId).childNodes[0];
	ref.style.color = "#FFFFFF";	
	document.getElementById(thisId).style.background = "#990000 url(" + dir + ") no-repeat";
	document.getElementById(subId).style.left = '-1000px';
}

// --- SUbhome rollover function:
/*	this function handle the changing of the background-color for the table-cell 
			that contains the navigation-links to the sub-subhomepages */
function shRoStep(id, state){
	var ref = id.parentNode;
	if(state == 'over'){				
		ref.style.backgroundColor = "#FFFFFF";
	} else {
		ref.style.backgroundColor = "#FFE7CF";			
	}
}

//-->