function validate(contactform) {

	//validate first name 
if (contactform.firstname.value.length < 2) {
		alert("Please enter your FIRST NAME");
		contactform.firstname.focus();
		return false;
	}
	//validate last name 
if (contactform.lastname.value.length < 2) {
		alert("Please enter your LAST NAME");
		contactform.lastname.focus();
		return false;
	}
	//validate email 
if(contactform.email.value.length <6) {
		alert("Please enter your email");
		contactform.email.focus();
		return false;
	 }
	//Now check if email is valid 
	//assign regular expression to variable
var em = /[\-a-z0-9\_]+(\.[\-a-z0-9\_]+)*\@[\-a-z0-9\_]+(\.[\-a-z0-9]+)+/i 
if ( ! em.test( contactform.email.value ) ) {
		alert("That doesn't appear to be a valid email address"); 
        contactform.email.focus(); 
        return false; 
      	}     
	
	//Now check if subject is selected
        if (contactform.pertainsto.selectedIndex == 0) {
	alert("Please select a subject");
	contactform.pertainsto.focus();
	return false;
    }


	//Make Sure something is in comments
	if (contactform.comments.value.length < 10)	{
		alert("Please enter a more descriptive comment");
		contactform.comments.focus();
		return false;
	}
      
	//validate first name 
	if (contactform.ishuman.value =='') {
		alert("Please enter the code");
		contactform.ishuman.focus();
		return false;
	}

	//if we got this far then everything is cool
else
return true;
}

