// Validate forms
<!--
		function validate_form(){
			var theForm = document.getElementById('contactform');

			if (!validRequired(document.getElementById('first_name'),"Your First Name")) {
				return false;
			}
						
			if (!validRequired(document.getElementById('last_name'),"Your Last Name")) {
				return false;
			}
			
			if (!validRequired(document.getElementById('company'), "Your Company")) {
				return false;
			}
			
			if (!validEmail(theForm.from,"Email Address", true)) {
				return false;
			}

			cust_industry = document.getElementById('cust_industry');
			if ( (cust_industry.selectedIndex == 0)){
				alert ("Please select an industry");
				cust_industry.focus();
				return false;
			}	
			
			if ( (theForm.consideringForgingSupplier.selectedIndex == 0)){
				alert ("Please select a forging supplier consideration");
				theForm.consideringForgingSupplier.focus();
				return false;
			}
			return true;
		}
		function checkvalue(valuetocheck) {
			if (valuetocheck.indexOf("<") != -1 || valuetocheck.indexOf(">") != -1) {
				return 1;
			}
			return -1;
		}
		function isEmailAddr(email){
		  regex = new RegExp(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/); // email regex
			if( !email.value.match(regex) ) return false;
			return true;
		}
    
		function validRequired(formField,fieldLabel){
			if (formField.value == "" || formField.value == null){
				alert('Please enter a value for the "' + fieldLabel +'" field.');
				formField.focus();
				return false;
			}
			
			if (checkvalue(formField.value) != -1) {
				alert('The "' + fieldLabel +'" field contains invalid characters.');
				formField.focus();
				return false;
			}
			return true;
		}
		function validEmail(formField,fieldLabel,required){
			if (required && !validRequired(formField,fieldLabel)) return false;

			if ( ((formField.value.length < 3) || !isEmailAddr(formField)) ){
				alert("Please enter a complete email address in the form: yourname@yourdomain.com");
				formField.focus();
				return false;
			}
		  return true;
		}
		function validRequiredDropDown(formField,fieldLabel){
			if (formField.value == ""){
				alert('Please tell us ' + fieldLabel +'.');
				formField.focus();
			}
			return true;
		}
// -->