function KeyPress(what,e,max,action) {
    if (document.layers) {
        if (e.target.value.length >= max)
            eval(action);
    }
    else if (document.all) {
        if (what.value.length > (max-1))
            eval(action);
    }
}

function verifyName(input, strMsg) {
	var msg = "'" + input.value + "' " + "is invalid."
	sStr = input.value;
	if (sStr.length < 2) {
		input.focus();
		if (strMsg.length > 1)
			alert(strMsg);
		else
			alert(msg);
		return false;
	}
	return true;
}

function verifyPhoneEmail(input) {
	var msg = "Phone value " + "'(" + request.area_code.value  + ")" + request.prefix.value  + "-" + request.suffix.value + "' and email value "  + "' " + request.email.value  + " '" + " are invalid: Please enter a valid phone or email."
	sStre = request.email.value;
	phonenumlength = request.area_code.value.length + request.prefix.value.length + request.suffix.value.length;

	if (phonenumlength == 10) {
	return true;
	}
	else if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(sStre)){
	return true;
	}
	else alert(msg)
	input.focus();
	return false;

}

function checknotify() {
 	if (!verifyName(document.request.yourname, "Enter your name")) return false;
 	if (!verifyPhoneEmail(document.request.email, "Enter your phone or email")) return false;
	return true;
}

