function dspErrors(elID,mesg) {
	window.alert(mesg);
	document.getElementById(elID).style.color = "red";
	return false;
}
function isAlphebetic(sentVal,elID,mesg) {
	if(sentVal.match(/^[a-zA-Z\s]+$/)) {
		document.getElementById(elID).style.color = "black";
		return true;
	}
	else {
		dspErrors(elID,mesg);
	}
}

function isPassword(sentVal,elID,mesg,secdPass) {
	if(sentVal.match(/^[a-zA-Z0-9]*$/)) {
		if(sentVal == secdPass) {
			document.getElementById(elID).style.color = "black";
			return true;
		}
		else {
			dspErrors(elID,"Your passwords do not match.");
		}
	}
	else {
		dspErrors(elID,mesg);
	}
}

function isPhone(sentVal,elID,mesg) {
	if(sentVal.match(/^[^a-zA-Z]+$/)) {
		document.getElementById(elID).style.color = "black";
		return true;
	}
	else {
		dspErrors(elID,mesg);
	}
}

function isEmail(sentVal,elID,mesg) {
	if(sentVal.match(/^([a-zA-Z0-9])+([.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-]+)+/)) {
		document.getElementById(elID).style.color = "black";
		return true;
	}
	else {
		dspErrors(elID,mesg);
	}
}
