function pickHearAboutVBS() { //alert(document.vbsRegistration.hearAboutVBSList.value ); if (document.vbsRegistration.hearAboutVBSList.value == 'Invitation') document.vbsRegistration.hearAboutVBSInvite.disabled = false; else if (document.vbsRegistration.hearAboutVBSList.value == 'Other') document.vbsRegistration.hearAboutVBSInvite.disabled = false; else document.vbsRegistration.hearAboutVBSInvite.disabled = true; } function pickChurchAffiliation() { if (!document.vbsRegistration || !document.vbsRegistration.churchAffiliation) return; //alert(document.vbsRegistration.churchAffiliation.value ); if (document.vbsRegistration.churchAffiliation.value == 2) { // Other var selectedIdx = document.vbsRegistration.churchAffiliation.selectedIndex; if (document.vbsRegistration.churchAffiliation.options[selectedIdx].text == "Other:") { //document.vbsRegistration.churchName.value = ''; document.getElementById('churchNameRow').style.display = ''; // show the church name field } else { // For option 2 (not "Other:"), put the selected church into the church name field. document.vbsRegistration.churchName.value = document.vbsRegistration.churchAffiliation.options[selectedIdx].text; //alert(document.vbsRegistration.churchName.value); if (document.getElementById('churchNameRow')) { document.getElementById('churchNameRow').style.display = 'none'; // hide the church name field } } } else { if (document.getElementById('churchNameRow')) { document.getElementById('churchNameRow').style.display = 'none'; // hide the church name field document.vbsRegistration.churchName.value = ''; } } var el = document.getElementById("churchMessage"); if (el) { var selectedIdx = document.vbsRegistration.churchAffiliation.selectedIndex; if (document.vbsRegistration.churchAffiliation.options[selectedIdx].className == "msg") el.style.display = 'block'; //show else el.style.display = 'none'; //hide } } function initialLoad() { pickChurchAffiliation(); if (document.forms.vbsRegistration && document.forms.vbsRegistration.fname) document.forms.vbsRegistration.fname.focus();} function showElement(el, torf) { if (!el) return; if (torf) el.style.display = ''; else el.style.display = 'none'; } // end hideElement function hideElement(el) { if (!el) return; el.style.visibility = 'hidden'; } // end hideElement