function checkupgradeform(){
var num = window.document.upgradeform.phone.value.replace(/[^\d]/g,'');
var faxnum = window.document.upgradeform.fax.value.replace(/[^\d]/g,'');
if (window.document.upgradeform.company.value==""){
	  alert("You Must Enter Your Company Name!");
	  window.document.upgradeform.company.focus();
	  return false;
    
}else if (window.document.upgradeform.company.value.length > 43){
    alert("Your Company Text Can Not Contain More Than 43 Characters!");
	  window.document.upgradeform.company.focus();
	  return false;
}
if (window.document.upgradeform.street.value==""){
	  alert("Please Enter A Street Address!");
	  window.document.upgradeform.street.focus();
	  return false;
}
if (window.document.upgradeform.state.value==""){
	  alert("Please Enter A State!");
	  window.document.upgradeform.state.focus();
	  return false;
}else if (window.document.upgradeform.state.value.length > 2){
    alert("Please Enter The 2 Character Abbreviation For Your State!");
	  window.document.upgradeform.state.focus();
	  return false;
}
if (window.document.upgradeform.zip.value==""){
	  alert("Please Enter A Zip Code!");
	  window.document.upgradeform.zip.focus();
	  return false;
}else if (window.document.upgradeform.zip.value.length < 5){
    alert("Please Enter A 5 Digit Zipcode!");
	  window.document.upgradeform.zip.focus();
	  return false;
}else if (window.document.upgradeform.zip.value.length > 5){
    alert("Please Enter A 5 Digit Zipcode!");
	  window.document.upgradeform.zip.focus();
	  return false;
}

if (window.document.upgradeform.phone.value=="")
	{
	alert("please enter your phone number!");
	window.document.upgradeform.phone.focus();
	return false;
	}
  else if (num.length != 10)
   {
   alert('Please enter a valid phone number including area code');                   
   window.document.upgradeform.phone.focus();
	 return false;
   } 
   else if(window.document.upgradeform.phone.value != "(" + num.substring(0,3) + ")" + num.substring(3, 6) + "-" + num.substring(6))  
  { 
   alert('Please enter your phone number in the following format (xxx)xxx-xxxx');                   
   window.document.upgradeform.phone.focus();
   return false;
   }

if (window.document.upgradeform.fax.value=="")
	{
	alert("please enter your fax number. If you do not have a fax number you can enter a secondary number like a cell phone or a toll free number.");
	window.document.upgradeform.fax.focus();
	return false;
	}
  else if (faxnum.length != 10)
   {
   alert('Please enter a valid fax number including area code');                   
   window.document.upgradeform.fax.focus();
	 return false;
   } 
   else if(window.document.upgradeform.fax.value != "(" + faxnum.substring(0,3) + ")" + faxnum.substring(3, 6) + "-" + faxnum.substring(6))  
  { 
   alert('Please enter your fax number in the following format (xxx)xxx-xxxx');                   
   window.document.upgradeform.fax.focus();
   return false;
   }   

if (window.document.upgradeform.email.value=="")
	{
	alert("please enter your email address!");
	window.document.upgradeform.email.focus();
	return false;
	}else{
   var testresults
   var str=document.upgradeform.email.value
   var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
     if (filter.test(str)){
     }else{
     alert("Please enter a valid email address!")
     window.document.upgradeform.email.focus();
	   return false;
     }
     }
if (window.document.upgradeform.description.value==""){
	  alert("Please Enter A Short Description!");
	  window.document.upgradeform.description.focus();
	  return false;
    
}else if (window.document.upgradeform.description.value.length > 130){
    alert("Your Description Text Can Not Contain More Than 130 Characters!");
	  window.document.upgradeform.description.focus();
	  return false;
}
}//end function checkupgradeform

