// JavaScript Document
function validate(){
	x=document.form1
	name=x.Name.value
	email=x.Email.value.indexOf("@")
	password=x.Password.value
	password2=x.Password2.value
	hear=x.hear.selectedIndex
	hearDetail=x.hearDetail.value
	age=x.Age.checked
	policy=x.Privacy.checked
	submitOK="True"
	
	if (name.length<1)
	{
		alert("Please enter your name");
		submitOK="False";
	}
	
	if (email==-1) 
	{
		alert("Please enter a valid e-mail address");
		submitOK="False";
	}
	
	if (password.length<1)
	{
		alert("You must enter a password.");
		submitOK="False";
	}
	
	if (password!=password2)
	{
		alert("The passwords you have entered do not match. Please enter matching passwords.");
		submitOK="False";
	}
	
	if(hear==0)
	{
		alert("Please tell us how you heard of us.");
		submitOK="False";
	}
	
	if (hearDetail.length<1)
	{
		alert("Please provide additonal information about where you heard of us.");
		submitOK="False";
	}

	if (!age)
	{
		alert("You must be at least 13 years of age to register at this website.");
		submitOK="False";
	}
	
	if (!policy)
	{
		alert("Please read our privacy policy.");
		submitOK="False";
	}
		
	if (submitOK=="False")
	{
		return false
	}
}