function Process_Form() {

	form_validated = Validate_Form(document.form1);

	if (form_validated == true) {
			//set_Date()
			document.form1.submit();
		} else {
			return false;
		}
} // STOP PROCESS FORM FUNCTION



// START VALIDATE FORM FUNCTION
function Validate_Form(formx)  {
	
	var form_validated = 0;
	 
		
		if (formx.last_name.value == "")  {
			alert ("Please enter your last name.");
			formx.last_name.focus()
			return false;
		}

        if (formx.company.value == "") {
        	alert("Please enter your company name.");
			formx.company.focus()
        	return false;
        }
  
 		 if  (isEmail(formx.email)   == false ) {
			alert("Please enter a Valid e-mail address.");
			formx.email.focus();
			
			return false;
        }
		
	  
 		 if  (isPhone(formx.phone.value)   == false ) {
		 	alert("Please enter a valid phone number");
			formx.phone.focus();
			
			return false;
        }	
		
			
		if (formx.elements[13].value == "") {
                alert("Please select your country.");
                formx.elements[13].focus()
				return false;
        }
		
		  if (formx.description.value == "") {
        	alert("Please enter a description of what you are contacting Benzlers about.");
			formx.description.focus()
        	return false;
        }

				if (formx.spamfilter.value != "8")  {
					alert("Sorry you have not answered the last question correctly.");
			formx.spamfilter.focus()
			return false;
		}

	form_validated = 0;
	return true;	
}
	 
	function isEmail(email) {

        if ((email.value != "") && (email.value.indexOf("@") != -1) && (email.value.indexOf(".") != -1) && (email.value.indexOf(" ") == -1 )){
                 return true;
				}
         else {
		      return false;
			}
	}
	
	

   // --------------------------------------------------
   // Functions used by isPhone, phone number validation
   
	function isInteger(s)
	{   var i;
    	for (i = 0; i < s.length; i++)
    	{   
        	// Check that current character is number.
        	var c = s.charAt(i);
        	if (((c < "0") || (c > "9"))) return false;
    	}
    	// All characters are numbers.
    	return true;
	}

	function stripCharsInBag(s, bag)
	{   var i;
		var returnString = "";
		// Search through string's characters one by one.
		// If character is not in bag, append to returnString.
		for (i = 0; i < s.length; i++)
		{   
			// Check that current character isn't whitespace.
			var c = s.charAt(i);
			if (bag.indexOf(c) == -1) returnString += c;

		}
		return returnString;
	}

	function checkInternationalPhone(strPhone){
		// non-digit characters which are allowed in phone numbers
		var phoneNumberDelimiters = "()- ";
		// a leading + is also OK for international phone numbers
		var validWorldPhoneChars = phoneNumberDelimiters + "+";
		
		// Minimum no of digits in a phone number
		var minDigitsInIPhoneNumber = 10;
				
		s=stripCharsInBag(strPhone, validWorldPhoneChars);
		return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
	}

	
	function isPhone(pNum){
		if ((pNum==null)||(pNum=="")){
			//alert("Please enter your phone number");
			//document.form1.phone.focus();
			return false;
		}
		if (checkInternationalPhone(pNum)==false){
			//alert("Please enter a valid phone number");
			//document.form1.phone.value="";
			//document.form1.phone.focus();
			return false;
		}
		return true;
	}
