function checkFields() 
{
	missinginfo = "";
	var father = false;
	var mother = false;
	if(((document.register.ffirstName.value != "") && (document.register.flastName.value != "")) || ((document.register.ffirstName.value == "") && (document.register.flastName.value == "")))
		father = true;
	if(((document.register.mfirstName.value != "") && (document.register.mlastName.value != "")) || ((document.register.mfirstName.value == "") && (document.register.mlastName.value == "")))
		mother = true;

	if((document.register.ffirstName.value == "") && (document.register.flastName.value == "") &&
	   (document.register.mfirstName.value == "") && (document.register.mlastName.value == ""))
		{
		mother = false;
		father = false;
		}

	if(!(father && mother))
		{
		missinginfo += "\n     -  A Father First and Last Name and/or Mother First and Last Name must be entered";
		}
	if (document.register.address01.value == "") {
		missinginfo += "\n     -  Address";
		}
	if (document.register.city.value == "") {
		missinginfo += "\n     -  City";
		}
	if (document.register.st.value == "") {
		missinginfo += "\n     -  State";
		}
	if (document.register.zip.value == "") {
		missinginfo += "\n     -  Zip";
		}
	if (document.register.phone.value == "") {
		missinginfo += "\n     -  Daytime Phone";
		}

	if (document.register.login.value == "") {
		missinginfo += "\n     -  Login";
		}
	if (document.register.password.value == "") {
		missinginfo += "\n     -  Password";
		}

	if (document.register.email.value == "")
	    {
        alert("Please put in an email address. If you don't have an email address there \nare free ones available on yahoo.com and hotmail.com\nIf you cannot obtain one put: NONE in the email address box");
        document.register.email.focus();
        return false;
		}


	if(document.register.modupdate)
	      if (false == document.register.modupdate.checked)
	          {
		      alert("Please check 'Information Updated' checkbox before continuing");
		      return false;
		      }


//	if (document.register.password.value != document.register.password02.value) {
//		missinginfo += "\n     -  Passwords do not match";
//		}

	if (missinginfo != "") {
		missinginfo ="_____________________________\n" +
		"You failed to correctly fill in your:\n" +
		missinginfo + "\n_____________________________" +
		"\nPlease re-enter and submit again!";
		alert(missinginfo);
		return false;
	}
	else 
	    return true;
}

function checkout()
	{

    checkFields();
    return true;
/*
	if (false == document.register.modupdate.checked) {
		alert("Please check 'Information Updated' checkbox before continuing");
		return false;
		}
	else
		return true;
*/
	}

function checkLogin() {
	missinginfo = "";
	if (document.login.login.value == "") {
		missinginfo += "\n     -  Login";
		}
	if (document.login.password.value == "") {
		missinginfo += "\n     -  Password";
		}
	if (missinginfo != "") {
		missinginfo ="_____________________________\n" +
		"You failed to correctly fill in your:\n" +
		missinginfo + "\n_____________________________" +
		"\nPlease re-enter and submit again!";
		alert(missinginfo);
		return false;
	}
	else return true;
}


function checkStudent() 
{
	missinginfo = "";
	if (document.student.fname.value == "") {
		missinginfo += "\n     -  First Name";
		}
	if (document.student.lname.value == "") {
		missinginfo += "\n     -  Last Name";
		}
	if (document.student.address.value == "") {
		missinginfo += "\n     -  Address";
		}
	if (document.student.city.value == "") {
		missinginfo += "\n     -  City";
		}
	if (document.student.st.value == "") {
		missinginfo += "\n     -  State";
		}
	if (document.student.zip.value == "") {
		missinginfo += "\n     -  Zip";
		}
/*	if (document.student.dphone.value == "") {
		missinginfo += "\n     -  Day Phone";
		}
*/
	if (document.student.sex.value == "") {
		missinginfo += "\n     -  Sex";
		}
	if (document.student.bmonth.value == "") {
		missinginfo += "\n     -  Birth Month";
		}
	if (document.student.bday.value == "") {
		missinginfo += "\n     -  Birth Day";
		}
	if (document.student.byear.value == "") {
		missinginfo += "\n     -  Birth Year";
		}
	if (document.student.grade.value == "") {
		missinginfo += "\n     -  Grade Level";
		}
	if (document.student.school.value == "") {
		missinginfo += "\n     -  School";
		}

	if (missinginfo != "") {
		missinginfo ="_____________________________\n" +
		"You failed to correctly fill in your:\n" +
		missinginfo + "\n_____________________________" +
		"\nPlease re-enter and submit again!";
		alert(missinginfo);
		return false;
	}
	else return true;
}




function checkOut1()
{
	missinginfo = "";
	if((document.checkout1.membershipType.value == "") && (document.checkout1.lifetime.value != "Yes"))
		missinginfo += "\n     -  Membership Type";

	donation =	parseFloat(document.checkout1.donation.value)
	if(false == isNaN(donation))
		{
		if((0.0 == donation) && ("" != document.checkout1.donationType.value))
			missinginfo += "\n     -  Donation";
		if((0.0 != donation) && ("" == document.checkout1.donationType.value))
			missinginfo += "\n     -  Donation Type";		
		}
	else
		{
		if("" != document.checkout1.donationType.value)
			missinginfo += "\n     -  Donation";
		}


	if (missinginfo != "")
		{
		missinginfo ="_____________________________\n" +
		"You failed to correctly fill in your:\n" +
		missinginfo + "\n_____________________________" +
		"\nPlease re-enter and submit again!";
		alert(missinginfo);
		return false;
		}
	else
		return true;
}

function checkOut2()
{
	missinginfo = "";
	if(('0' > document.checkout2.paid.value.charAt(0)) || ('9' < document.checkout2.paid.value.charAt(0)))
		document.checkout2.paid.value = document.checkout2.paid.value.substr(1);
	var paid =	parseFloat(document.checkout2.paid.value);
	var total =	parseFloat(document.checkout2.total.value);
	
	if(true == isNaN(paid))
		missinginfo += "\n     -  Amount Paid";
	else
		{	
		if((('1' == document.checkout2.validMonth.value) || (document.checkout2.validMonth.value > '8')) && (total > paid)) {
			alert("You must pay the full amount");
			return false;
		}
		else if(total > paid * 2)
			{
			alert("You must pay at least one half of the total due");
			return false;
			}
		}

	if (missinginfo != "")
		{
		missinginfo ="_____________________________\n" +
		"You failed to correctly fill in your:\n" +
		missinginfo + "\n_____________________________" +
		"\nPlease re-enter and submit again!";
		alert(missinginfo);
		return false;
		}
	else
		return true;
}

function DoIt() {
/*
	var pbsLogin = document.form.Login.value;
	var finalpbsLogin = "==" + pbsLogin;
	document.form.Login.value = finalpbsLogin;
	var pbsPassword = document.form.Password.value;
	var finalpbsPassword = "==" + pbsPassword;
	document.form.Password.value = finalpbsPassword;
*/
}
