/* Phone Validator */

PhoneFormatArea = /^(\d{3})$/

function ValidAreaCode(myField) {
	if (PhoneFormatArea.exec(myField.value)) {
	} else {
		myField.className = 'AreaHighlightField'; 
		myField.focus()
		myField.select()
		alert("Area Code not formated correctly.  Only THREE Numbers are allowed")
		
	}
}
PhoneFormat = /^(\d{3})(\-)(\d{4})$/

function ValidPhone(myField) {
	if (PhoneFormat.exec(myField.value)) {
	} else {
		myField.className = 'PhoneHighlightField'; 
		myField.focus()
		myField.select()
		alert("Phone not formated correctly.  Use the format XXX-XXXX")
		
		
	}
}

EmailFormat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/

function ValidEmail(myField) {
	if (EmailFormat.exec(myField.value)) {
	} else {
		myField.className = 'EmailHighlightField'; 
		alert("Email not formated correctly. ")
		myField.focus()
		myField.select()
		
	}
}
function ValidEmailLongField(myField) {
	if (EmailFormat.exec(myField.value)) {
	} else {
		myField.className = 'NameFieldHighlight'; 
		alert("Email not formated correctly. ")
		myField.focus()
		myField.select()
		
	}
}

/* Function to Copy Address Data */
function CopyAddress() {

	if (document.form1.SameAddress.checked){
		document.form1.MailAddressA.value=document.form1.PhysicalAddressA.value;
		document.form1.MailAddressB.value=document.form1.PhysicalAddressB.value;
		document.form1.MailCity.value=document.form1.PhysicalCity.value;
		if (document.form1.PhysicalState.value == "Other") {
			document.form1.MailState.value=document.form1.PhysicalState.value;
			document.form1.MailOtherState.value=document.form1.PhysicalOtherState.value;
			document.form1.MailOtherCountry.value=document.form1.PhysicalOtherCountry.value;
		} else {
		document.form1.MailState.value=document.form1.PhysicalState.value;
		}
		document.form1.MailZip.value=document.form1.PhysicalZip.value;
		
	} else {
		document.form1.MailAddressA.value="";
		document.form1.MailAddressB.value="";
		document.form1.MailCity.value="";
		document.form1.MailState.value="";
		document.form1.MailOtherState.value="";
		document.form1.MailZip.value="";
		document.form1.MailOtherCountry.value="";
	}
}

function NoEmptyCat(myField) {
	if (myField.value == "") {
		myField.className = 'DropDownHighlight'; 
		alert("Select a category for the new address");
	}
}

/* Functions to hide - unhide State - Country */
function OtherState(myField, myOtherDiv) {
	if (myField.value == "Other" && myOtherDiv == "PhysicalState") {
		document.getElementById('PhysicalOtherStateDiv').className = 'unhidden'; 
		document.getElementById('PhysicalOtherState').value = ""; 
		document.getElementById('PhysicalOtherCountryDiv').className = 'unhidden'; 
	}
	if (myField.value != "Other" && myOtherDiv == "PhysicalState") {
		document.getElementById('PhysicalOtherStateDiv').className = 'hidden'; 
		document.getElementById('PhysicalOtherCountryDiv').className = 'hidden'; 
	}
	if (myField.value == "Other" && myOtherDiv == "MailState") {
		document.getElementById('MailOtherStateDiv').className = 'unhidden'; 
		document.getElementById('MailOtherState').value = ""; 
		document.getElementById('MailOtherCountryDiv').className = 'unhidden'; 
	}
	if (myField.value != "Other" && myOtherDiv == "MailState") {
		document.getElementById('MailOtherStateDiv').className = 'hidden'; 
		document.getElementById('MailOtherCountryDiv').className = 'hidden'; 
	}
}

/* Functions to validate Registration Form before submitting it */
function SubmitRegistration(myForm) {
	var reason = "";
	reason += validateEmpty(myForm.FirstName, 'First Name');
	reason += validateEmpty(myForm.LastName, "Last Name");
	reason += validateEmpty(myForm.Email, "Email");
	reason += validateCategory(myForm);
	if (reason != "") {
		alert("Some fields need correction:\n" + reason);
		return false;
	}
	
	return true;
}

/* Functions to validate Conference Registration Form before submitting it */
function SubmitCRegistration(myForm) {
	var reason = "";
	reason += validateEmpty(myForm.FirstName, 'First Name');
	reason += validateEmpty(myForm.LastName, "Last Name");
	reason += validateEmpty(myForm.Email, "Email");
	if (reason != "") {
		alert("Some fields need correction:\n" + reason);
		return false;
	}
	
	return true;
}

/* Functions to validate New Contact Form before submitting it */
function SubmitNewContact(myForm) {
	var reason = "";
	reason += validateRadioButton(myForm.Gender, "Gender");
	reason += validateAddress(myForm.PhysicalAddressA, "Physical Address");
	reason += validateAddress(myForm.PhysicalCity, "Physical City");
	reason += validateAddress(myForm.PhysicalState, "Physical State");
	reason += validateOther(myForm.PhysicalState, "Physical Other State", myForm.PhysicalOtherState);
	reason += validateAddress(myForm.PhysicalZip, "Physical Zip Code");
	reason += validateOther(myForm.PhysicalState, "Physical Other Country", myForm.PhysicalOtherCountry);
	reason += validateAddress(myForm.MailAddressA, "Mailing Address");
	reason += validateAddress(myForm.MailCity, "Mailing City");
	reason += validateAddress(myForm.MailState, "Mailing State");
	reason += validateOther(myForm.MailState, "Physical Other State", myForm.MailOtherState);
	reason += validateAddress(myForm.MailZip, "Mailing Zip Code");
	reason += validateOther(myForm.MailState, "Physical Other Country", myForm.MailOtherCountry);
	reason += validatePhoneCat(myForm.PhoneCategory1, myForm.Phone1, "Main Phone Category")
	reason += validatePhoneCat(myForm.PhoneCategory2, myForm.Phone2, "Phone Category")
	reason += validatePhoneCat(myForm.PhoneCategory3, myForm.Phone3, "Phone Category")
	reason += validatePhoneCat(myForm.PhoneCategory4, myForm.Phone4, "Phone Category")
	reason += validatePhoneCat(myForm.PhoneCategory5, myForm.Phone5, "Phone Category")
	reason += validateArea(document.getElementById('AreaCode1'), "Area Code");
	reason += validatePhone(document.getElementById('Phone1'), "Phone Number");
	  
	if (reason != "") {
		alert("Some fields need correction:\n" + reason);
		return false;
	}
	
	return true;
}

/* Functions to validate Contact Form before submitting it */
function SubmitContact(myForm) {
	var reason = "";
	reason += validateRadioButton(myForm.Gender, "Gender");
	reason += validateAddress(myForm.PhysicalAddressA, "Physical Address");
	reason += validateAddress(myForm.PhysicalCity, "Physical City");
	reason += validateAddress(myForm.PhysicalState, "Physical State");
	reason += validateOther(myForm.PhysicalState, "Physical Other State", myForm.PhysicalOtherState);
	reason += validateAddress(myForm.PhysicalZip, "Physical Zip Code");
	reason += validateOther(myForm.PhysicalState, "Physical Other Country", myForm.PhysicalOtherCountry);
	reason += validateAddress(myForm.MailAddressA, "Mailing Address");
	reason += validateAddress(myForm.MailCity, "Mailing City");
	reason += validateAddress(myForm.MailState, "Mailing State");
	reason += validateOther(myForm.MailState, "Physical Other State", myForm.MailOtherState);
	reason += validateAddress(myForm.MailZip, "Mailing Zip Code");
	reason += validateOther(myForm.MailState, "Physical Other Country", myForm.MailOtherCountry);
	reason += validatePhoneCat(myForm.PhoneCategory1, myForm.Phone1, "Main Phone Category");
	reason += validateArea(document.getElementById('AreaCode1'), "Area Code");
	reason += validatePhone(document.getElementById('Phone1'), "Phone Number");
	  
	if (reason != "") {
		alert("Some fields need correction:\n" + reason);
		return false;
	}
	
	return true;
}

function validateRadioButton3(fld, fldName) {
    var error = "";
	
	if ( ( fld[0].checked == false ) && ( fld[1].checked == false ) && ( fld[2].checked == false ) ) {
		if (fldName == "Select Yes or No Donation") {
			document.getElementById("DonationBlock").style.backgroundColor =  "#FF0"; 
			document.getElementById("DonationBlock").style.padding =  "3px"; 
			document.getElementById("DonationBlock").style.border =  "2px solid #C00"; 
		}
		error = "The highlighted field " +fldName+ " has not been filled in.\n"
    } else {
    }
    return error;  
}
	
function validateRadioButton(fld, fldName) {
    var error = "";
 
    if ( ( fld[0].checked == false ) && ( fld[1].checked == false ) ) {
		if (fldName == "Gender") {
			document.getElementById("GenderBlock").style.backgroundColor =  "#FF0"; 
			document.getElementById("GenderBlock").style.padding =  "3px"; 
			document.getElementById("GenderBlock").style.border =  "2px solid #C00"; 
		}
		if (fldName == "Member Status") {
			document.getElementById("MemberStatusBlock").style.backgroundColor =  "#FF0"; 
			document.getElementById("MemberStatusBlock").style.padding =  "3px"; 
			document.getElementById("MemberStatusBlock").style.border =  "2px solid #C00"; 
		}
		if (fldName == "Are You a Host?") {
			document.getElementById("HostStatusBlock").style.backgroundColor =  "#FF0"; 
			document.getElementById("HostStatusBlock").style.padding =  "3px"; 
			document.getElementById("HostStatusBlock").style.border =  "2px solid #C00"; 
		}
		if (fldName == "Are You a Traveler?") {
			document.getElementById("TravelerStatusBlock").style.backgroundColor =  "#FF0"; 
			document.getElementById("TravelerStatusBlock").style.padding =  "3px"; 
			document.getElementById("TravelerStatusBlock").style.border =  "2px solid #C00"; 
		}
		if (fldName == "Traveler Type") {
			document.getElementById("TravelerTypeBlock").style.backgroundColor =  "#FF0"; 
			document.getElementById("TravelerTypeBlock").style.padding =  "3px"; 
			document.getElementById("TravelerTypeBlock").style.border =  "2px solid #C00"; 
		}
		if (fldName == "Select Yes or No Renewal") {
			document.getElementById("RenewalBlock").style.backgroundColor =  "#FF0"; 
			document.getElementById("RenewalBlock").style.padding =  "3px"; 
			document.getElementById("RenewalBlock").style.border =  "2px solid #C00"; 
		}
		if (fldName == "Select Yes or No To Become a Voter") {
			document.getElementById("VoteBlock").style.backgroundColor =  "#FF0"; 
			document.getElementById("VoteBlock").style.padding =  "3px"; 
			document.getElementById("VoteBlock").style.border =  "2px solid #C00"; 
		}
        error = "The highlighted field " +fldName+ " has not been filled in.\n"
    } else {
    }
    return error;  
}

function validateEmpty(fld, fldName) {
    var error = "";
 
    if (fld.value == "") {
        fld.className = 'NameFieldHighlight'; 
        error = "The highlighted field " +fldName+ " has not been filled in.\n"
    } else {
    }
    return error;  
}
function validateEmptyShortField(fld, fldName) {
    var error = "";
 
    if (fld.value == "") {
        fld.className = 'NameFieldHighlightShort'; 
        error = "The highlighted field " +fldName+ " has not been filled in.\n"
    } else {
    }
    return error;  
}
function validateEmptyTextArea(fld, fldName) {
    var error = "";
 
    if (fld.value == "") {
        fld.className = 'TextAreaFieldHighlight'; 
        error = "The highlighted field " +fldName+ " has not been filled in.\n"
    } else {
    }
    return error;  
}

function validateAddress(fld, fldName) {
    var error = "";
 
    if (fld.value == "") {
        fld.className = 'AddressHighlightField'; 
        error = "The highlighted field " +fldName+ " has not been filled in.\n"
    } else {
    }
    return error;  
}
function validateOther(fld, fldName, fld2) {
    var error = "";
 
    if (fld.value == "Other" && fld2.value == "") {
        fld2.className = 'AddressHighlightField'; 
        error = "The highlighted field " +fldName+ " has not been filled in.\n"
    } else {
    }
    return error;  
}
function validatePhoneCat(fld, fld2, fldName) {
	var error = "";
	if (fldName == "Main Phone Category") {
		if (fld.value == "" ) {
			fld.style.backgroundColor =  "#FF0"; 
			fld.style.border =  "2px solid #C00"; 
			error = "The highlighted field " +fldName+ " has not been filled in.\n"
		}
    } else {
		if (fld.value == "" && fld2.value != "" ) {
			fld.style.backgroundColor =  "#FF0"; 
			fld.style.border =  "2px solid #C00"; 
			error = "The highlighted field " +fldName+ " has not been filled in.\n"
		}
    }
    return error;  
}


function validateArea(fld, fldName) {
    var error = "";
 
    if (fld.value == "") {
        fld.className = 'AreaHighlightField'; 
        error = "The highlighted field " +fldName+ " has not been filled in.\n"
    }
	if (PhoneFormatArea.exec(fld.value)) {
	} else {
		fld.className = 'AreaHighlightField'; 
		error = "Area Code not formated correctly.  Only THREE Numbers are allowed.\n";
	}
    return error;  
}
function validatePhone(fld, fldName) {
    var error = "";
 
    if (PhoneFormat.exec(fld.value)) {
	} else if (fld.value == "") {
        fld.className = 'PhoneHighlightField'; 
        error = "The highlighted field " +fldName+ " has not been filled in.\n"
    } else {
		fld.className = 'PhoneHighlightField'; 
		error = "Phone not formated correctly.  Use the format XXX-XXXX.\n";
	}
    return error;  
}
function validateCategory(form) {
    var error = "";
	var t=0;
	var fld=form['CategoryDef[]'];
	for(var i=0; i<fld.length; i++){
		fld[i].checked?t++:null;
	}
	if (t == 0) {
		/*
		Use this for changing a whole Div Id
		var div_node = document.getElementById('CategoryBlock');
		div_node.id = 'CategoryHighlightBlock';
		*/
		document.getElementById("CategoryBlock").style.backgroundColor =  "#FF0"; 
		document.getElementById("CategoryBlock").style.padding =  "3px"; 
		document.getElementById("CategoryBlock").style.border =  "2px solid #C00"; 
		error = "You need to select at least one category.\n";
	} else {
		error = "";
	}
    
    return error;  
}

/* Functions to validate Host and Traveler Forms before submitting it */
var dateFormat = /^(\d{2})(\/)(\d{2})(\/)(\d{4})$/;

function ValidDate(myField, fldName) {
	var error = "";
	if (dateFormat.exec(myField.value) || myField.value == "") {
	} else {
		myField.style.backgroundColor =  "#FF0"; 
		myField.style.padding =  "3px"; 
		myField.style.border =  "2px solid #C00"; 
        error = fldName + " field formated incorrectly.  Use the format mm/dd/yyyy\n";
    }
    return error;  
}

function OtherPet(fld) {
	if (fld.value != "") {
		document.form1.Pets.value[4].checked = true;
	}
}

function SubmitHost(myForm) {
	var reason = "";
	
	reason += validateMenu(myForm.HostType, "Host Category");
	reason += validateMenu(myForm.HostStatus, "Host Status");
	reason += ValidDate(myForm.NotAvailDateFrom, "Not Available From Date");
	reason += ValidDate(myForm.NotAvailDateTo, "Not Available To Date");
	  
	if (reason != "") {
		alert("Some fields need correction:\n" + reason);
		return false;
	}
	
	return true;
}
function SubmitNewHost(myForm) {
	var reason = "";
	
	reason += validateMenu(myForm.HostType, "Host Category");
	reason += ValidDate(myForm.NotAvailDateFrom, "Not Available From Date");
	reason += ValidDate(myForm.NotAvailDateTo, "Not Available To Date");
	  
	if (reason != "") {
		alert("Some fields need correction:\n" + reason);
		return false;
	}
	
	return true;
}

function SubmitTraveler(myForm) {
	var reason = "";
	reason += validateRadioButton(myForm.TravelerType, "Traveler Type");
	reason += validateEmpty(myForm.LanguagesSpoken, 'Languages Spoken');
	reason += validateRadioButton(myForm.ServasHost, "Are You a Host?");
	reason += validateRadioButton(myForm.ServasTraveler, "Are You a Traveler?");
	reason += validateEmpty(myForm.EmergencyContact, 'Emergency Contact');
	reason += validateArea(document.getElementById('EmergencyArea'), "Area Code");
	reason += validatePhone(document.getElementById('EmergencyPhone'), "Phone Number");
	reason += validateEmptyTextArea(myForm.SelfDescription, 'Describe Yourself');
	reason += validateAgreeCheckBox(myForm.Signature, "Agree to the terms");
	reason += validateEmpty(myForm.PrintedName, 'Print Your Name');
	  
	if (reason != "") {
		alert("Some fields need correction:\n" + reason);
		return false;
	}
	
	return true;
}
function SubmitBillingInfo(myForm) {
	var reason = "";
	reason += validateEmpty(myForm.FirstName, 'First Name');
	reason += validateEmpty(myForm.LastName, 'Last Name');
	reason += validateAddress(myForm.PhysicalAddressA, "Physical Address");
	reason += validateAddress(myForm.PhysicalCity, "Physical City");
	reason += validateAddress(myForm.PhysicalState, "Physical State");
	reason += validateOther(myForm.PhysicalState, "Physical Other State", myForm.PhysicalOtherState);
	reason += validateAddress(myForm.PhysicalZip, "Physical Zip Code");
	reason += validateOther(myForm.PhysicalState, "Physical Other Country", myForm.PhysicalOtherCountry);
	reason += validateArea(document.getElementById('AreaCode'), "Area Code");
	reason += validatePhone(document.getElementById('Phone'), "Phone Number");
	reason += validateEmpty(myForm.Email, "Email");
	  
	if (reason != "") {
		alert("Some fields need correction:\n" + reason);
		return false;
	}
	
	return true;
}

CCFormat = /^(\d{15,16})$/
function ValidCardNumber(myField) {
	if (CCFormat.exec(myField.value)) {
	} else {
		myField.className = 'PhoneHighlightField'; 
		myField.focus()
		myField.select()
		alert("Credit Card Number not formated correctly.")
		
	}
}
CCVFormat = /^(\d{3,4})$/

function ValidCCV(myField) {
	if (CCVFormat.exec(myField.value)) {
	} else {
		myField.className = 'PhoneHighlightField'; 
		myField.focus()
		myField.select()
		alert("CCV Card Identification Number not formated correctly.  Only THREE Numbers are allowed")
		
	}
}

function SubmitCard(myForm) {
	var reason = "";
	reason += validateAddress(myForm.CardNumber, "Credit Card Number");
	reason += validateAddress(myForm.CCV, "CCV");
	reason += validateAddress(myForm.CreditCardType, "Credit Card Type");
	reason += validateAddress(myForm.ExpirationMonth, "Expiration Month");
	reason += validateAddress(myForm.ExpirationYear, "Expiration Year");
	  
	if (reason != "") {
		alert("Some fields need correction:\n" + reason);
		return false;
	}
	
	return true;
}

function SubmitRenewHost(myForm) {
	var reason = "";
	reason += validateRadioButton(myForm.Renew, "Select Yes or No Renewal");
	reason += validateRadioButton3(myForm.Donation, "Select Yes or No Donation");
	reason += validateRadioButton(myForm.Vote, "Select Yes or No To Become a Voter");
	  
	if (reason != "") {
		alert("Some fields need correction:\n" + reason);
		return false;
	}
	
	return true;
}

function NoDoubleClick(myForm) { 
	myForm.Submit.disabled = true; 
	myForm.Submit.value = "Please wait..."; 
	return true;
}


function validateAgreeCheckBox(fld, fldName) {
	var error = "";
	if (!fld.checked) {
		error = "You must " + fldName + ".\n";
		if (fldName == "Agree to the terms") {
			document.getElementById("SignatureBox").style.backgroundColor =  "#FF0"; 
			document.getElementById("SignatureBox").style.padding =  "3px"; 
			document.getElementById("SignatureBox").style.border =  "2px solid #C00"; 
		}
	}
	return error; 
}

function validateMenu(fld, fldName) {
    var error = "";
	FieldChoice = fld.selectedIndex;
 	
    if (fld.options[FieldChoice].value == "") {
		fld.className = 'HostDropDownHighlight'; 
        error = "You must pick a " + fldName + ".\n";
    } else {
    }
    return error;  
}

PassFormat = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])\w{8,}$/

function ValidPass(fld, fldName) {
    var error = "";
 
    if (PassFormat.exec(fld.value)) {
	} else if (fld.value == "") {
		fld.className = 'NameFieldHighlight'; 
        error = "The password field " +fldName+ " has not been filled in.\n"
    } else {
		fld.className = 'NameFieldHighlight'; 
		error = "Password not formated correctly.";
	}
    return error;  
}
function ComparePass(fld1, fld2) {
    var error = "";
 
    if (fld1.value == fld2.value) {
    } else {
		fld2.className = 'NameFieldHighlight';
		error = "New Password Fields does not match.  Re-type your passwords so that they are identical.";
	}
    return error;  
}
function SubmitPass(myForm) {
	var reason = "";
	reason += validateEmpty(myForm.OldPassword, 'Old Password');
	reason += ValidPass(document.getElementById('NewPassword1'), "New Password");
	reason += ValidPass(document.getElementById('NewPassword2'), "Type New Password Again");
	reason += ComparePass(document.getElementById('NewPassword1'), document.getElementById('NewPassword2'));
	  
	if (reason != "") {
		alert("Some fields need correction:\n" + reason);
		return false;
	}
	
	return true;
}

function NoEmptyLOI(fld, fldCat, fldStamp, fldSD, fldED, fldPD) {
	 var error = "";
	 if (fld.value != "") {
		if (fldCat.value == "") {
			fldCat.style.backgroundColor =  "#FF0"; 
			fldCat.style.padding =  "3px"; 
			fldCat.style.border =  "2px solid #C00"; 
			error = "You must select a Category.\n";
		}
		if (fldStamp.value == "") {
			fldStamp.style.backgroundColor =  "#FF0"; 
			fldStamp.style.padding =  "3px"; 
			fldStamp.style.border =  "2px solid #C00"; 
			error += "You must enter a Stamp Serial Number.\n";
		}
		if (fldSD.value == "") {
			fldSD.className = 'DateFieldHighlight'; 
			error += "You must select a Start Date.\n";
		}
		if (fldED.value == "") {
			fldED.className = 'DateFieldHighlight'; 
			error += "You must select a End Date.\n";
		}
		if (fldPD.value == "") {
			fldPD.className = 'DateFieldHighlight'; 
			error += "You must select a Processing Date.\n";
		}
	 }
	
    return error;  
}
function NoEmptyBook(fld, fld2, fld3) {
	 var error = "";
	 if (fld.value != "") {
		 if (fld2.value == "") {
			fld2.className =  "BookViaFieldHighlight"; 
			error = "You must select a Sent Method.\n";
		}
		if (fld3.value == "") {
			fld3.className =  "BookDateFieldHighlight"; 
			error += "You must enter a Sent Date.\n";
		}
	 }
    return error;  
}
function unhide(divID) {
	var item = document.getElementById(divID);
	if (item) {
		item.className='unhidden';
	}
}
function hide(divID) {
	var item = document.getElementById(divID);
	if (item) {
		item.className='hidden';
	}
}
function SelContactUp(divID) {
	var item = document.getElementById(divID);
	if (item) {
		item.className='Sup';
	}
}
function SelContactDown(divID) {
	var item = document.getElementById(divID);
	if (item) {
		item.className='Sdown';
	}
}
function textLimit(field, maxlen) {
	if (field.value.length > maxlen + 1) {
		alert('your input has been truncated!');
	}
	if (field.value.length > maxlen) {
		field.value = field.value.substring(0, maxlen);
	}
}
function SubmitSyle(myForm) {
	var reason = "";
	reason += validateRadioButton(myForm.Gender, "Gender");
	reason += validateEmpty(myForm.Name, 'Name');
	reason += validateEmpty(myForm.Address, 'Address');
	reason += validateEmpty(myForm.City, 'City');
	reason += validateEmpty(myForm.State, 'State');
	reason += validateEmpty(myForm.Zip, 'Zip');
	reason += validateEmpty(myForm.CountryResidence, 'CountryResidence');
	reason += validateEmptyShortField(myForm.AreaCode, 'AreaCode');
	reason += validateEmptyShortField(myForm.Phone, 'Phone');
	reason += validateEmpty(myForm.Zip, 'Zip');
	reason += validateEmpty(myForm.Email, 'Email');
	reason += validateEmptyTextArea(myForm.ServasExperience3, 'Why are you interested in participating in a SYLE?');
	reason += validateEmptyTextArea(myForm.ServasExperience5, 'How could your participation in the SYLE contribute to the development of Servas Youth in your country?');
	reason += validateEmptyShortField(myForm.BirthDay_Month, 'Birthday Month');
	reason += validateEmptyShortField(myForm.BirthDay_Day, 'Birthday Day');
	reason += validateEmptyShortField(myForm.BirthDay_Year, 'Birthday YEar');
	if (reason != "") {
		alert("Some fields need correction:\n" + reason);
		return false;
	}
	
	return true;
}
/* Function to See Password Letters */
function CheckPass(myform) {
	if (myform == "Loginform") {
		if (document.Loginform.SeePass.checked){
			document.Loginform.Password.type='text';
		} else {
			document.Loginform.Password.type='password';
		}
	}
	if (myform == "Loginform2") {
		if (document.Loginform2.SeePass.checked){
			document.Loginform2.Password.type='text';
		} else {
			document.Loginform2.Password.type='password';
		}
	}
}
//-->


