/*  
Project Name		: dwightanddavid.com 
Program name		: front_end.php
Program function	: Front end form validation
Created Date  		: 25 May, 2005
Author				: Shalini B
Developed by	    : Colbridge Web Logics - www.colbridge.com 
	
Update History
-------------------------------------------------------------------
Date       	 		Author 				short desc. of what updated 

---------------------------------------------------------------------*/
function validate(theform){
	if(isEmpty(theform.firstname.value)){
		alert("Please enter your First Name");
		theform.firstname.focus();
		return false;
	}
	if(isEmpty(theform.lastname.value)){
		alert("Please enter your Last Name");
		theform.lastname.focus();
		return false;
	}
	if(isEmpty(theform.phone.value)){
		alert("Please enter your Phone Number");
		theform.phone.focus();
		return false;
	}
	if(isEmpty(theform.email.value)){
		alert("Please enter your Email Address");
		theform.email.focus();
		return false;
	}else{
		var retval = emailCheck(theform.email.value);  // email validation example
		if (retval == false){
			theform.email.focus();
  			return false;
		}
	}		
	return true;
}
