
function IsNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }
   
function verify() {
var intro = "Please enter valid results for the following fields:\r\n\r\n";
var themessage = intro;
if (document.quote_form.zip_from.value.length != 5 || !IsNumeric(document.quote_form.zip_from.value) || document.quote_form.zip_from.value=="") {
themessage = themessage + "  Shipping From: Zip Code\r\n";
}
if (document.quote_form.zip_to.value.length != 5 || !IsNumeric(document.quote_form.zip_to.value) || document.quote_form.zip_to.value=="") {
themessage = themessage + "  Shipping To: Zip Code\r\n";
}
if (!IsNumeric(document.quote_form.total_weight.value) || document.quote_form.total_weight.value=="") {
themessage = themessage + "  Weight and Quantity: Total Weight (Pounds)\r\n";
}
if (!IsNumeric(document.quote_form.number_items.value) || document.quote_form.number_items.value=="") {
themessage = themessage + "  Weight and Quantity: Number of Items\r\n";
}
if (document.quote_form.units.selectedIndex==0) {
themessage = themessage + "  Weight and Quantity: Shipping Units\r\n";
}
if (document.quote_form.shipment_class.selectedIndex==0 && document.quote_form.desc.value=="") {
themessage = themessage + "  Shipment Description: Class or Description\r\n";
}
if (document.quote_form.email_from.value.indexOf(' ') != -1 || document.quote_form.email_from.value.indexOf('@') < 2 || document.quote_form.email_from.value.indexOf('@')+4 > document.quote_form.email_from.value.length || document.quote_form.email_from.value.length < 9 || document.quote_form.email_from.value=="") {
themessage = themessage + "  Contact: Email Address\r\n";
}
if (document.quote_form.first.value.length < 2 || document.quote_form.first.value=="") {
themessage = themessage + "  Contact: First Name\r\n";
}
if (document.quote_form.last.value.length < 2 || document.quote_form.last.value=="") {
themessage = themessage + "  Contact: Last Name\r\n";
}
if (document.quote_form.p1.value.length < 3 || document.quote_form.p2.value.length < 3 || document.quote_form.p3.value.length < 4 || !IsNumeric(document.quote_form.p1.value) || !IsNumeric(document.quote_form.p2.value) || !IsNumeric(document.quote_form.p3.value) || document.quote_form.p1.value=="" || document.quote_form.p2.value=="" || document.quote_form.p3.value=="") {
themessage = themessage + "  Contact: Phone Number\r\n";
}

if (document.quote_form.desc.value.length > 500) {
themessage = themessage + "\r\n\r\nYour shipment description is too long, please limit it to 500 characters or less.";
}

if (document.quote_form.ImageCode.value=="") {
themessage = themessage + "  Image Code: Enter the word that is shown in the black box.\r\n";
}

//alert if fields are empty and cancel form submit
if (themessage == intro) {
	return true;
} else {
	alert(themessage);
	return false;
}

}
