function cleartxt(val)
{
	return val.replace(/\W/g,'')
}

function checkForm()
{
	
	//added by chad thomas for the newspaper register page
	if(cleartxt(document.getElementById("newspapername").value) == ''){alert("Please enter newspapers name.");document.getElementById("newspapername").focus();return false;}
	if(cleartxt(document.getElementById("email").value) == ''){alert("Please enter your email address.");document.getElementById("email").focus();return false;}
	if(cleartxt(document.getElementById("fname").value) == ''){alert("Please enter your first name.");document.getElementById("fname").focus();return false;}
	if(cleartxt(document.getElementById("lname").value) == ''){alert("Please enter your last name.");document.getElementById("lname").focus();return false;}
	if(cleartxt(document.getElementById("address1").value) == ''){alert("Please enter your street address.");document.getElementById("address1").focus();return false;}
	if(cleartxt(document.getElementById("town").value) == ''){alert("Please enter your city of residence.");document.getElementById("town").focus();return false;}
	if(document.getElementById("country").value == 0){alert("Please select a country.");document.getElementById("country").focus();return false;}
	if(document.getElementById("location").value == 0){alert("Please select a state/region.");document.getElementById("location").focus();return false;}
	if(cleartxt(document.getElementById("postcode").value) == ''){alert("Please enter your post code.");document.getElementById("postcode").focus();return false;}
	if(cleartxt(document.getElementById("phone").value) == ''){alert("Please enter a phone number.");document.getElementById("phone").focus();return false;}
	if(cleartxt(document.getElementById("username").value) == ''){alert("Please enter a username.");document.getElementById("username").focus();return false;}
	if(cleartxt(document.getElementById("password").value) == ''){alert("Please enter a password.");document.getElementById("password").focus();return false;}
	if(cleartxt(document.getElementById("password").value)!= cleartxt(document.getElementById("conpass").value)){alert("Passwords do not match");document.getElementById("password").focus();return false;}
	if(cleartxt(document.getElementById("accountpassword").value) == ''){alert("Please enter an account password.");document.getElementById("accountpassword").focus();return false;}
	
	//if(cleartxt(document.getElementById("question").value) == ''){alert("Please enter a secret question.");document.getElementById("question").focus();return false;}
	//if(cleartxt(document.getElementById("answer").value) == ''){alert("Please enter a secret answer.");document.getElementById("answer").focus();return false;}
	
	
	
}