/* FORM VALIDATION */

/* contact form */

function validateContact() {
    
    var name = document.getElementById('contact_name');
    var phone = document.getElementById('contact_phone');
    var email = document.getElementById('contact_email');
    var comments = document.getElementById('contact_comments');
    
    if(name.value=='') {
        alert("Please Enter Your Name");
        name.focus();
        return false;
    }
    else if(email.value=='') {
        alert("Please Enter Your Email Address");
        email.focus();
        return false;
    }
    else if(!isEmail(email.value)) {
        alert("Invalid Email Address");
        email.focus();
        return false;
    }
    else if(phone.value=='') {
        alert("Please Enter Your Phone Number");
        phone.focus();
        return false;
    }
    else if(comments.value=='') {
        alert("Got Nothing to Say??");
        comments.focus();
        return false;
    }
    else {
        return true;
    }
    
}





/* validate Email */
//////////////////////////////////////////////////
//	<Email Validator>			//
// 	(c) 2003 Premshree Pillai		//
//	Written on: 29/04/03 (dd/mm/yy)		//
//	http://www.qiksearch.com		//
//	http://premshree.resource-locator.com	//
//	Email : qiksearch@rediffmail.com	//
//////////////////////////////////////////////////
/* With RegExp */
function isEmail(who) {
	var email=/^[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,4}$/i;
	return(email.test(who));
}