function validateForm(frm){
	if( frm.Name.value.length != 0 ) {
		if(frm.Email.value.length != 0){
			if(isValidEmail(frm.Email.value)){
				return true;
			} else { 	// invalid email address
				errEmailFormat.style.display = "block";
				frm.Email.focus();
				return false;
				}
		} else { 		// email doesn't exist
			errEmail.style.display = "block";
			frm.Email.focus();
			return false;
			}
	} else { 			// name doesn't exist
		errName.style.display = "block";
		frm.Name.focus();
		return false;
		}
	}
function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}

