function promoCodeDef(){
        alert('If you have a promo code from beachtravellers, please enter it here. this code may be used for promotional tracking purposes.');
        }
function dynPromoCode(status){
        if (status=='on'){
                hideRow('promoCode1');
                showRow('promoCode2');
                showRow('promoCode3');
                showRow('promoCode4');
                showRow('promoCode5');
                }
        else{
                showRow('promoCode1');
                hideRow('promoCode2');
                hideRow('promoCode3');
                hideRow('promoCode4');
                hideRow('promoCode5');
                }
        }
function dynWaiver(status){
        if (status=='on'){
                hideRow('waiver1');
                showRow('waiver2');
                showRow('waiver3');
                showRow('waiver4');
                showRow('waiver5');
                }
        else{
                showRow('waiver1');
                hideRow('waiver2');
                hideRow('waiver3');
                hideRow('waiver4');
                hideRow('waiver5');
                }
        }
function dynLandOnly(sel1,countryVal) {
        radios = document.getElementsByName('land_only');
        if(sel1.value=='Other'||countryVal!='38'){ 
                for(var i in radios) {
                        if (radios[i].value=='Yes'){ radios[i].checked = true; radios[i].disabled = true; }
                        if (radios[i].value=='No'){ radios[i].checked = false; }
                        }
                showRow('landOnlyNote');
                }
        else {
                for(var i in radios) {
                       radios[i].disabled = false;
                       }
                hideRow('landOnlyNote');
                }
        }
function dynProvince(sel1) {
        if(sel1.value=='38'){ //38 is Canada
                hideRow('id_countryNote');
                showRow('id_province');
				showS('id_province');
                }
        else if(sel1.value=='') {
                hideRow('id_countryNote');
                hideRow('id_province');
				hideS('id_province');
                }
        else {
                showRow('id_countryNote');
                hideRow('id_province');
				hideS('id_province');
                }
        }
function dynHeardFrom(sel1) {
        var allArr=['hhFbSource','hhFrEmail','hhEvent','hhWhere','hhSchool','hhCity','hhWords','hhWho'];
        switch (sel1.value) {
                //beg: heardfrom options
                //facebook
                case 'fb': var showArr=['hhFbSource']; break;
                //friend
                case 'fr': var showArr=['hhFrEmail']; break;
                //event
                case 'ev': var showArr=['hhEvent','hhCity']; break;
                //info-session
                case 'is': var showArr=['hhSchool']; break;
                //info-table
                case 'it': var showArr=['hhSchool']; break;
                //poster
                case 'po': var showArr=['hhWhere']; break;
                //flyer
                case 'fl': var showArr=['hhWhere']; break;
                //google
                case 'go': var showArr=['hhWords'];break;
                //guides,coaches,staff
                case 'gu': var showArr=['hhWho']; break;
                //other
                case 'ot': var showArr=['hhWho']; break;
                //handbook
                //case 'hb': var showArr=[];break;
                //end: heardfrom options
                //beg: hhWhere options
                case 'School': var showArr=['hhWhere','hhSchool']; break;
                case 'Shop': var showArr=['hhWhere','hhCity']; break;
                case 'Bus': var showArr=['hhWhere','hhCity']; break;
                case 'Other': var showArr=['hhWhere','hhCity']; break;
                //end: hhWhere options
                default: var showArr=[];break;
                }
                showHideRows(allArr,showArr);
        }
function showHideRows(allArr,showArr) {
        var allCt=0;
        while (allCt<allArr.length) {
                var ck=0;
                var showCt=0;
                while (showCt<showArr.length) {
                        if (allArr[allCt]==showArr[showCt]) {
                                showRow(allArr[allCt]);ck=1;
								showS(allArr[allCt]);
                                //alert('show:'+allArr[allCt]);
                                }
                        showCt++;
                        }
                if (!ck) {
                        hideRow(allArr[allCt]);
						hideS(allArr[allCt]);
                        //alert('hide:'+allArr[allCt]);
                        }
                allCt++;
                }
        }

function resFormPart0(url) {
        //alert(url);return;
        document.resForm1.action=url;
        document.resForm1.submit();
        }
function resFormPart1(url) {
        //alert(url);return;
        document.resForm2.action=url;
        document.resForm2.submit();
        }
function resFormPart2(url) {
        //alert(url);return;
        document.resForm3.action=url;
        document.resForm3.submit();
        }
function resFormPart3(url) {
        //alert(url);return;
        document.resForm4.action=url;
        document.resForm4.submit();
        }		

//beg: show/hide row functions
function hideS(rowId) {
        row=document.getElementById(rowId);row.style.display='none';
        }
function showS(rowId) {
        row=document.getElementById(rowId);row.style.display='';
        }
//beg: show/hide row functions
function hideRow(rowId) {
        row=document.getElementById(rowId+'Row');row.style.display='none';
        }
function showRow(rowId) {
        row=document.getElementById(rowId+'Row');row.style.display='';
        }
//end: show/hide row functions
