var formError

function checkForm(){
formError = 0;
	if (document.juanform.fullname.value.length < 5){//checks the sjname field
		alert("Please fill out your name correctly.")
		document.juanform.fullname.focus()
		formError = 1
	}
	
	if (document.juanform.email.value.length < 7 || document.juanform.email.value.indexOf("@") == -1 ){//checks the email field
		alert("Please fill out your email correctly.")
		document.juanform.email.focus()
		formError = 1
	}
	

	if (document.juanform.company.value == "" ){//checks the state field
		alert("Please enter your Country.")
		document.juanform.company.focus()
		formError = 1
	}
	
	//if (document.juanform.streetaddress.value.length < 7  ){//checks the streetaddress field
	//	alert("Please fill out your address correctly.")
	//	document.juanform.streetaddress.focus()
	//	formError = 1
	//}
	
	//if (document.juanform.city.value.length < 2  ){//checks the city field
	//	alert("Please fill out the City correctly.")
	//	document.juanform.city.focus()
	//	formError = 1
	//}
		
	
	
	
	//if (document.juanform.zipcode.value.length < 5 || isNaN(document.juanform.zipcode.value) ){//checks the zipcode field
	//	alert("Please enter your zip code correctly.")
	//	document.juanform.zipcode.focus()
	//	formError = 1
	//}
	
	//if (document.juanform.shiptophone.value.length < 10  ){//checks the zipcode field
	//	alert("Please enter your phone number correctly.")
	//	document.juanform.shiptophone.focus()
	//	formError = 1
	//}
	

	

	
	
/////////////////////////Submits the form if no errors were found
isNaN(document.juanform.zipcode.value)
		if (formError == 0){ 
			//alert("no errors for would subit"  )
			document.juanform.orderButton.disabled = 1
			document.juanform.orderButton.value = "Processing User"
			document.juanform.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