function checkInput(form){
    var n, e, dumb;
    n=document.forms[0].Name.value;
    if (n==''){
        alert("Name is mandatory");
        return false;
    }
    e=document.forms[0].Email.value;
    if (e==''){
        alert("Email address is mandatory");
        return false;
    }
    if (! isValidEmail(e)) {
        alert("Email address is invalid");
	    return false;
	}
    return true;
}

// function to check valid email address
function isValidEmail(strEmail){
    validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
    // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) {
      return false;
    }
    return true;
}
