function CheckForm(theForm)
{
  
	var FormElements = new Object();
	
  FormElements["Please enter your name."] = theForm.contact_person;
  FormElements["Please enter your email address."] = theForm.email_address;
  
  
	for(FormElement in FormElements) {			
			if (FormElements[FormElement].value == "") {
			alert(FormElement);
			FormElements[FormElement].focus();
			return(false);
			}
 	} 
	
	
	if(CheckEmail(theForm.email_address)) {
  		return true;
			} else {
			return false;
			}
}

// check email
function CheckEmail(email)
{

var Temp     = email;
var AtSym    = Temp.value.indexOf('@');
var Period   = Temp.value.lastIndexOf('.');
var Space    = Temp.value.indexOf(' ');
var Length   = Temp.value.length - 1;   // Array is from 0 to length-1

if ((AtSym < 1) ||                     // '@' cannot be in first position
    (Period <= AtSym+1) ||             // Must be atleast one valid char btwn '@' and '.'
    (Period == Length ) ||             // Must be atleast one valid char after '.'
    (Space  != -1))                    // No empty spaces permitted
   {  
      alert('Please enter a valid e-mail address!');
      Temp.focus();
			return false;
   }

return true;
}