var formError

function checkForm(){
formError = 0;
	if (document.regform.fullname.value.length < 5){//checks the sjname field
		alert("Please fill out your name correctly.")
		document.regform.fullname.focus()
		formError = 1
	}
	
	if (document.regform.email.value.length < 7 || document.regform.email.value.indexOf("@") == -1 ){//checks the email field
		alert("Please fill out your email correctly.")
		document.regform.email.focus()
		formError = 1
	}
	
	
	if (document.regform.streetaddress.value.length < 7  ){//checks the streetaddress field
		alert("Please fill out your address correctly.")
		document.regform.streetaddress.focus()
		formError = 1
	}
	
	if (document.regform.city.value.length < 2  ){//checks the city field
		alert("Please fill out the City correctly.")
		document.regform.city.focus()
		formError = 1
	}
		
		
	if (document.regform.zipcode.value.length < 5 || isNaN(document.regform.zipcode.value) ){//checks the zipcode field
		alert("Please enter your zip code correctly.")
		document.regform.zipcode.focus()
		formError = 1
	}
	
	if (document.regform.country.value == "" ){//checks the state field
		alert("Please enter your Country.")
		document.regform.country.focus()
		formError = 1
	}

	

	
	
/////////////////////////Submits the form if no errors were found
isNaN(document.regform.zipcode.value)
		if (formError == 0){ 
			//alert("no errors for would subit"  )
			document.regform.orderButton.disabled = 1
			document.regform.orderButton.value = "Processing User"
			document.regform.submit()
		}


}


function checkLogin()
{
loginError = 0;
//alert("About to login!")
	if (document.login.useremail.value.length < 7 || document.login.useremail.value.indexOf("@") == -1 ){//checks the email field
		alert("Please fill out your email correctly.")
		document.login.useremail.focus()
		loginError = 1
	}	

	if (document.login.pw.value.length != 6 ){//checks the email field
		alert("Invalid password.")
		document.login.pw.focus()
		loginError = 1
	}	


	if (loginError == 0)
		{
		document.login.submit()
		}
}//end checkLogin