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 != "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.";
		}else{
			document.login.action = "http://www.";
		}

}

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);
	}
}

function getmessage() {
  var locurl=window.location.href;
  var startplace=locurl.indexOf("?");
  if (startplace != -1){
      var getit=locurl.substr(startplace+1,locurl.len);
      document.getElementById("uid").value=getit;
	  //if(getit=="error")
	  //{
      //alert("用户名不存在或密码错误，请输入有效用户和密码名！");
	  //}
  }
}



