function emptyvalidation(entered, alertbox) {
	with (entered) {
		if (value==null || value=="") {
			if (alertbox!="") {
				alert(alertbox);
			} return false;
		}
		else {
			return true;
		}
	}
}

function checkEmail(myForm) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(contact.email.value)){
	return (true)
	}
	alert("Invalid E-mail Address! Please re-enter.")
	return (false)
}

function formvalidation(thisform)
{
	with (thisform)
	{
	if (emptyvalidation(name,"Please enter your Name.")==false) {name.focus(); return false;};
	if (emptyvalidation(email,"Please enter a valid Email address.")==false) {email.focus(); return false;};
	if (checkEmail(thisform)==false) {email.focus(); return false;};
	if (emptyvalidation(subject,"Please enter a Subject.")==false) {subject.focus(); return false;};
	if (emptyvalidation(message,"Please enter a Message.")==false) {message.focus(); return false;};
	if (emptyvalidation(security_code,"Please enter the Security Code as shown.")==false) {security_code.focus(); return false;};
	}
}
