function validEmail(email){
	invalidChars = " /:,;"
	if(email == ""){return false;}
	for(i=0; i<invalidChars.length; i++){
		badChar = invalidChars.charAt(i);
		if(email.indexOf(badChar,0) > -1){return false;}
	}
	atPos = email.indexOf("@",1);
	if(atPos == -1){return false}
	if(email.indexOf("@",atPos+1) > -1){return false}
	periodPos = email.indexOf(".",atPos);
	if(periodPos == -1){return false}
	if(periodPos+3 > email.length){return false}
	return true;
}

function isNum(number){
	if(number == ""){return false}
	for (j=0;j<number.length;j++){
		if(number.charAt(j) < "0"){return false}
		if(number.charAt(j) > "9"){return false}
	}
	return true;
}

function validForm(passForm){
	if(passForm.firstname.value == ""){alert("Must Enter your first name");passForm.firstname.focus();return false}
	if(passForm.surname.value == ""){alert("Must Enter your Surname");passForm.surname.focus();return false}
	if(passForm.address.value == ""){alert("Must Enter your address");passForm.address.focus();return false}
	if(passForm.suburb.value == ""){alert("Must Enter your suburb");passForm.suburb.focus();return false}
	if(passForm.postcode.value == "" || !isNum(passForm.postcode.value)){alert("Must Enter your postcode as a number");passForm.postcode.focus();return false}
	if(passForm.contactphone.value == "" || !isNum(passForm.contactphone.value)){alert("Must Enter your contact number correctly");passForm.contactphone.focus();return false}
	if(!validEmail(passForm.email.value)){alert("Must Enter your Email Address");passForm.email.focus();return false}
	if(passForm.requirements.value == ""){alert("Must Enter Requirements");passForm.requirements.focus();return false}
	alert("Your order has been processed successfully, we will be in contact with you shortly to confirm order.")
	return true;
}








		
		
	
	
