window.onload = function() {
   if (!document.all || !document.getElementById){
       return;
   }
   nodes = document.getElementById("topNav").getElementsByTagName("li");
   for (i=0; i != nodes.length; i++) {
       nodes[i].onmouseover = function() {
           this.className += "_over";
       }
       nodes[i].onmouseout = function() {
           this.className = this.className.replace("_over", "");
       }
   }
}

function login_kn(){
	
	
	if(document.visibilityAndMonitoring.trackingno.value != ""){
	
		if(document.visibilityAndMonitoring.nrtype.value != "knReference") {
			document.visibilityAndMonitoring.knReference.value = "";
		}else{
			document.visibilityAndMonitoring.knReference.value = document.visibilityAndMonitoring.trackingno.value;		
		}
		if(document.visibilityAndMonitoring.nrtype.value != "containerNo") {
			document.visibilityAndMonitoring.containerNo.value = "";
		}else{
			document.visibilityAndMonitoring.containerNo.value = document.visibilityAndMonitoring.trackingno.value;		
		}
		if(document.visibilityAndMonitoring.nrtype.value != "packageNo") {
			document.visibilityAndMonitoring.packageNo.value = "";
		}else{
			document.visibilityAndMonitoring.packageNo.value = document.visibilityAndMonitoring.trackingno.value;		
		}		
		if(document.visibilityAndMonitoring.nrtype.value != "balEcb") {
			document.visibilityAndMonitoring.balEcb.value = "";
		}else{
			document.visibilityAndMonitoring.balEcb.value = document.visibilityAndMonitoring.trackingno.value;		
		}
		if(document.visibilityAndMonitoring.nrtype.value != "customerReferenceNo") {
			document.visibilityAndMonitoring.customerReferenceNo.value = "";
		}else{
			document.visibilityAndMonitoring.customerReferenceNo.value = document.visibilityAndMonitoring.trackingno.value;		
		}
		if(document.visibilityAndMonitoring.nrtype.value != "hawb") {
			document.visibilityAndMonitoring.hawb.value = "";
		}else{
			document.visibilityAndMonitoring.hawb.value = document.visibilityAndMonitoring.trackingno.value;		
		}
		if(document.visibilityAndMonitoring.nrtype.value != "lwisShipmentNumber") {
			document.visibilityAndMonitoring.lwisShipmentNumber.value = "";
		}else{
			document.visibilityAndMonitoring.lwisShipmentNumber.value = document.visibilityAndMonitoring.trackingno.value;		
		}	
		return true;
	}
	return false;
}

function kn_login(){
		
		if(document.login.ssl.checked){
			document.login.action = "https://www.kuehne-nagel.com/cgi-bin/ws_er.sh/mfer100000upd.p";
		}else{
			document.login.action = "http://www.kuehne-nagel.com/cgi-bin/ws_er.sh/mfer100000upd.p";
		}

}

function toogleLocations(triggerId, toogleId, showMsg, hideMsg) {
	state = document.getElementById(toogleId).style.display;
	if (state != 'block') {
		document.getElementById(toogleId).style.display = 'block';
		var newLinkLabel = document.createTextNode(hideMsg);
		document.getElementById(triggerId).replaceChild(newLinkLabel, document.getElementById(triggerId).firstChild);
	}
	else {
		document.getElementById(toogleId).style.display = 'none';
		var newLinkLabel = document.createTextNode(showMsg);
		document.getElementById(triggerId).replaceChild(newLinkLabel, document.getElementById(triggerId).firstChild);
	}
}