/* Systems mnmReg Form validation script */

//------------------------------------------------------------------------------------
// function: formCheck
//           Function tells whether all require fields are filled in.
//------------------------------------------------------------------------------------

function formCheck(form) {
	if (document.mnmReg.customerName.value == "" ){
		document.mnmReg.customerName.style.background = "#EDC52B";
		document.mnmReg.customerName.focus();
		location.href('#top');
		alert("Oops, Customer Name field is incomplete.");
		return false;
	}
	
	if (document.mnmReg.customerHomePhone.value == "" ){
		document.mnmReg.customerHomePhone.style.background = "#EDC52B";
		document.mnmReg.customerHomePhone.focus();
		location.href('#top');
		alert("Oops, Home phone field is incomplete.");
		return false;
	}
	
	if (document.mnmReg.customerMobilePhone.value == "" ){
		document.mnmReg.customerMobilePhone.style.background = "#EDC52B";
		document.mnmReg.customerMobilePhone.focus();
		location.href('#top');
		alert("Oops, Mobile phone field is incomplete.");
		return false;
	}
	
	if (document.mnmReg.customerAge.value == "" ){
		document.mnmReg.customerAge.style.background = "#EDC52B";
		document.mnmReg.customerAge.focus();
		location.href('#top');
		alert("Oops, Age field is incomplete.");
		return false;
	}
	
	if ((document.mnmReg.customerDOBMonth.value == "") ||
		(document.mnmReg.customerDOBDay.value == "") ||
		(document.mnmReg.customerDOBYear.value == "")){
		document.mnmReg.customerDOBMonth.focus();
		document.mnmReg.customerDOBMonth.style.background = "#EDC52B";
		document.mnmReg.customerDOBDay.style.background = "#EDC52B";
		document.mnmReg.customerDOBYear.style.background = "#EDC52B";
		location.href('#top');
		alert("Oops, DOB field is incomplete.");
		return false;	
	}
		
	if (document.mnmReg.customerGender.value == "" ){
		document.mnmReg.customerGender.focus();
		document.mnmReg.customerGender.style.background = "#EDC52B";
		location.href('#top');
		alert("Oops, Gender field is incomplete.");
		return false;
	}
	
	if (document.mnmReg.customerAddress.value == "" ){
		document.mnmReg.customerAddress.focus();
		document.mnmReg.customerAddress.style.background = "#EDC52B";
		location.href('#top');
		alert("Oops, Address field is incomplete.");
		return false;
	}
	
	if (document.mnmReg.customerCity.value == "" ){
		document.mnmReg.customerCity.focus();
		document.mnmReg.customerCity.style.background = "#EDC52B";
		location.href('#top');
		alert("Oops, City field is incomplete.");
		return false;
	}
	
	if (document.mnmReg.customerState.value == "" ){
		document.mnmReg.customerState.focus();
		document.mnmReg.customerState.style.background = "#EDC52B";
		location.href('#top');
		alert("Oops, State field is incomplete.");
		return false;
	}
	
	if (document.mnmReg.customerZipcode.value == "" ){
		document.mnmReg.customerZipcode.focus();
		document.mnmReg.customerZipcode.style.background = "#EDC52B";
		location.href('#top');
		alert("Oops, Zipcode field is incomplete.");
		return false;
	}
	
	if (document.mnmReg.customerEmail.value == "" ){
		document.mnmReg.customerEmail.focus();
		document.mnmReg.customerEmail.style.background = "#EDC52B";
		location.href('#top');
		alert("Oops, Email address field is incomplete.");
		return false;
	}
	
	if (document.mnmReg.customerEmail2.value == "" ){
		document.mnmReg.customerEmail2.focus();
		document.mnmReg.customerEmail2.style.background = "#EDC52B";
		alert("Oops, Email address confirmation field is incomplete.");
		return false;
	}
	
	if (document.mnmReg.customerEmail.value != document.mnmReg.customerEmail2.value ){
		document.mnmReg.customerEmail.style.background = "#EDC52B";
		document.mnmReg.customerEmail2.style.background = "#EDC52B";
		alert("Oops, Please retype email - they do not match.");
		return false;
	}
}




