
function validate_form(){
var error="There is information missing that is required to process your profile\nMissing required field(s)\n";
var msg ="";

var emailFilter=/^.+@.+\..{2,3}$/;
var string_phone_number = document.mainform.phone.value;

var string_email = document.mainform.email.value;
var string_email_confirm = document.mainform.confirmemail.value;

	if(document.mainform.fullname.value==''){
		msg =  msg + "Your Full Name \n";
		document.mainform.fullname.focus();
	}
	if(document.mainform.phone.value==''){
		msg =  msg + "Your Phone Number \n";
		document.mainform.phone.value='';
		document.mainform.phone.focus();
	}
	if (!(emailFilter.test(string_email))) { 
     	 msg = msg + "Please enter a valid email address.\n";
 		document.mainform.email.value='';
		document.mainform.email.focus()
	}
	if (!(emailFilter.test(string_email_confirm))) { 
     	 msg = msg + "Please confirm that you have entered a valid email address.\n";
 		document.mainform.confirmemail.value='';
		document.mainform.confirmemail.focus()
	}
	if(string_email != string_email_confirm){
			msg = msg + "Emails did not match\n";
	}
	if(document.mainform.company.value==''){
		msg =  msg + "Your Company \n";
		document.mainform.company.value='';
		document.mainform.company.focus();
	}
	if(document.mainform.message.value=='Enter Message Here' || document.mainform.message.value==''){
		msg =  msg + "Enter a message \n";
		document.mainform.message.value='';
		document.mainform.message.focus();
	}
	if(document.mainform.pass.value==''){
		msg =  msg + "Please enter a valid security code! \n";
		document.mainform.pass.value='';
		document.mainform.pass.focus();
	}
	if (msg != "") {
       alert(error + msg);
       return false;
    }
return true;
}
