function emailvalidation(field, alertbox) {
	var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
	apos=field.value.indexOf("@");
	dotpos=field.value.lastIndexOf(".");
	lastpos=field.value.length-1;
	var badEmail = (apos<1 || dotpos-apos<2 || lastpos-dotpos<2)
	if (goodEmail && !badEmail) {
	return true;
}
else {
	alert(alertbox);
	field.focus();
	field.select();
	return false;
   }
}
function emptyvalidation(entered, alertbox)
{
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}
function formvalidation(thisform)
{
with (thisform)
{

	if (emptyvalidation(name,"Please enter your name")==false) {name.focus(); return false;};
	
	if (emailvalidation(email,"Please enter your valid email address")==false) {email.focus(); return false;};

}

}
