// JavaScript Document
function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
 }

function isBlank(str){
//alert("*"+str+"*");
	var check=true;
		if (str==""){
			check=false;
		}
		if (str==" "){
			check=false
		}
		//alert(check);
	return check
	
}
 
function validateFrm(frm){

	//clientname
	var errMsg="";
	if (!isBlank(frm.clientname.value)){
		alert("You left the name field blank.");
		frm.clientname.focus();
	}else{
		if (!isBlank(frm.email.value)){
			alert("You left the email field blank.");
			frm.email.focus();
		}else{
			if (!isValidEmail(frm.email.value)){
					alert("That's not a valid email address. Try again.");
					frm.email.focus();
			}else{
				frm.submit();	
			}
		}
	}


}
