<!--//

var name = "Please enter your Full Name"
var coName = "Please enter your Company Name"
var coReg = "Please fill in the Company Registration No"
var address ="Please fill in the address"
var city = "Please fill in the city"
var state = "Please fill in the state"
var postcode = "Please fill in the postcode"
var telNo = "Please enter your telephone No"
var isNum = "Please enter only numbers in the phone field"	
var email = "Please fill in the email"
var missing1 = "Invalid Email Address, @ Is Not Found"
var missing2 = "Invalid Email Address, . Is Not Found"

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 validate_form(f){	
		
		if (f.name.value==''){
			window.alert(name)
			f.name.focus();
			return false;
		}
	
		if (f.coName.value==''){
			window.alert(coName)
			f.coName.focus();
			return false;
		}
		
		if (f.coReg.value==''){
			window.alert(coReg)
			f.coReg.focus();
			return false;
		}	
		
		if (f.address.value==''){
			window.alert(address)
			f.address.focus();
			return false;
		}
		
		if (f.city.value==''){
			window.alert(city)
			f.city.focus();
			return false;
		}
		
		if (f.state.value==''){
			window.alert(state)
			f.state.focus();
			return false;
		}	
		
		if (f.postcode.value==''){
			window.alert(postcode)
			f.postcode.focus();
			return false;
		}
		
		if (f.telNo.value==''){
			window.alert(telNo)
			f.telNo.focus();
			return false;
		}
		
		if (!IsNumeric(f.telNo.value)) { 
      		window.alert(isNum); 
      		f.telNo.focus(); 
      		return false; 
 		} 
		
		if (f.email.value==''){
			window.alert(email)
			f.email.focus();
			return false;
		}
		
		if (f.email.value.indexOf("@")==-1) {
			window.alert(missing1)
			f.email.focus();
			return false;
		}
		
		if (f.email.value.indexOf(".")==-1) {
			window.alert(missing2)
			f.email.focus();
			return false;
		}
		
		return true;	
	}