function check_user()
{	
		if (document.frmLogin) {
			var user_id = get_cookie('UserID'); 
			if (user_id) {
				document.frmLogin.UserID.value = user_id;
				document.frmLogin.svid.checked = true;
				document.frmLogin.Password.focus();
			}
			else document.frmLogin.UserID.focus();
		}
}

function validate_login()
{	var ret;
		ret = false;
		if ((document.frmLogin.UserID.value.length < 1)||(document.frmLogin.Password.value < 1))
		{	
			window.alert("Please ensure that User ID and Password fields contain a valid value, and re-submit.");
			return(ret);	
		}
		ret = true;
		return(ret);
}

function validate_tracking(trackPath) {
        var theForm;
        if (navigator.appName=="Netscape") { theForm = document.getElementById("frmTrack"); }
        else { theForm = document.all.frmTrack; }


        if (theForm.theno.value=="") {
          if (theForm.notype_tracking.checked) { alert("Please enter a tracking number."); }
          else { alert("Please enter a PO number."); }
          return false;
        }
        else {

	  if ((theForm.notype_tracking.checked) && !isInt(theForm.theno.value)){ 
		alert("The tracking number must be an integer."); 
	  	return false;
	  }
	  if (!trackPath) { trackPath = ""; }
          if (theForm.notype_po.checked) { theForm.action = trackPath + "trackpo.asp" }
          else { theForm.action = trackPath + "trackid.asp" }
          return true;
        }
}

function isInt(x) {
  intValue=parseInt(x)

  if (isNaN(x)) {
     return false;
  } else {
     return true;
  } 
}