function checkEmail(emailaddress) {
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(emailaddress)) 
	{
		return false;
	}
	else
	{
	 return true;
	 }		
}

function validateDesc(descEntry) {
	if (descEntry == "") {
		return false;
	} else {
		return true;
	}
}
   
   
function validateForm() {	
	
	//alert("Hello");
	//document.theform.submit();
	//return;
	
	var fixThis = "";
  	if (!(validateDesc(document.theform.firstname.value))){
		fixThis += "Please enter First Name.\n";
	}
	if (!(validateDesc(document.theform.lastname.value))){
		fixThis += "Please enter Location.\n";
	}
	if (!(validateDesc(document.theform.email.value))){
		fixThis += "Please enter a Email Address.\n";
	}
	else
	{
		if (checkEmail(document.theform.email.value)==false)	
		{
			fixThis += "Please enter a VALID Email Address.\n";
		}
	}
	
	if (!(validateDesc(document.theform.zip.value))){
		fixThis += "Please enter Zip or Liberty Number.\n";
	}

	//if (!(validateDesc(document.theform.couponcode.value))){
//		fixThis += "Please enter Coupon.\n";
//	}
//	else
//	{
//		var y=document.theform.couponcode.value;
//		var couponcode = y.toUpperCase(); 
//		//if (couponcode != "CIRCLEK0209")
//		//{
//		
//		//	fixThis += "Invalid Coupon.\n";		
//		//}
//	}
		
	if (fixThis != "") {
		alert(fixThis);		
	} else {
		document.theform.submit();
		//alert("Submit the form");
	}
	
}
