<!-- Begin
function echeck(str) {
 
  var at="@"
  var dot="."
  var lat=str.indexOf(at)
  var lstr=str.length
  var ldot=str.indexOf(dot)
  var themessage = "You are required to complete the following fields:\r";
  if (str.indexOf(at)==-1){
     //alert("Invalid E-mail ID")
	 //themessage = themessage + "- Email Address \r";
     return false
  }
 
  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
     //alert("Invalid E-mail ID")
	 //themessage = themessage + "- Valid Email Address \r";
     return false
  }
 
  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
      //alert("Invalid E-mail ID")
      return false
  }
 
   if (str.indexOf(at,(lat+1))!=-1){
      //alert("Invalid E-mail ID")
      return false
   }
 
   if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
      //alert("Invalid E-mail ID")
      return false
   }
 
   if (str.indexOf(dot,(lat+2))==-1){
      //alert("Invalid E-mail ID")
      return false
   }
  
   if (str.indexOf(" ")!=-1){
      //alert("Invalid E-mail ID")
      return false
   }
 
    return true     
 }
 
function verify_info() {
var themessage = "You are required to complete the following fields:\r";
var emailID=document.sales.EmailAddress;
if (document.sales.Name.value=="") {
themessage = themessage + "- Name \r";
}
if (document.sales.PhoneNumber.value=="") {
themessage = themessage + "- Phone Number \r";
}
if (echeck(emailID.value)==false){
  emailID.value=""
  themessage = themessage + "- Valid Email Address \r";
 }
if (document.sales.Address.value=="") {
themessage = themessage + "- Address \r";
}
if (document.sales.City.value=="") {
themessage = themessage + "- City \r";
}
if (document.sales.StateOrProvince.value=="") {
themessage = themessage + "- State or Province \r";
}
if (document.sales.Zip.value=="") {
themessage = themessage + "- Zip Code \r";
}
if (document.sales.InfoRequest.value=="") {
themessage = themessage + "- Information Request \r";
}
if (themessage == "You are required to complete the following fields:\r") {
document.sales.submit();
}
else {
alert(themessage);
return false;
   }
}

function verify_support() {
var themessage = "You are required to complete the following fields:\r";
var emailID=document.support.EmailAddress;
if (document.support.Name.value=="") {
themessage = themessage + "- Name \r";
}
if (document.support.PhoneNumber.value=="") {
themessage = themessage + "- Phone Number \r";
}
if (echeck(emailID.value)==false){
  emailID.value=""
  themessage = themessage + "- Valid Email Address \r";
 }
if (document.support.Address.value=="") {
themessage = themessage + "- Address \r";
}
if (document.support.City.value=="") {
themessage = themessage + "- City \r";
}
if (document.support.StateOrProvince.value=="") {
themessage = themessage + "- State or Province \r";
}
if (document.support.Zip.value=="") {
themessage = themessage + "- Zip Code \r";
}
if (document.support.Product.value=="") {
themessage = themessage + "- Product (@Road, Magellan) \r";
}
if (document.support.ModelNumber.value=="") {
themessage = themessage + "- Model Number (XT3, ILM2500) \r";
}
if (document.support.OrderDate.value=="") {
themessage = themessage + "- Order Date \r";
}
if (document.support.OrderID.value=="") {
themessage = themessage + "- OrderID \r";
}
if (document.support.ProblemDesc.value=="") {
themessage = themessage + "- Problem Description \r";
}
//alert if fields are empty and cancel form submit
if (themessage == "You are required to complete the following fields:\r") {
document.support.submit();
}
else {
alert(themessage);
return false;
   }
}
// End -->
