function nav ( navpage, selectedform ) { myformname = document.getElementById(selectedform); myformname.page.value = navpage; myformname.submit(); } function populateoptdays() { var programid = document.progreg.program_id; // Clear out the list of member_reg_type ClearOptions(document.progreg.prog_opt_days); if (programid[programid.selectedIndex].value == 1) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 1) { AddToOptionList(document.progreg.prog_opt_days, "3", "Tuesday"); } if (programid[programid.selectedIndex].value == 1) { AddToOptionList(document.progreg.prog_opt_days, "5", "Thursday"); } if (programid[programid.selectedIndex].value == 2) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 2) { AddToOptionList(document.progreg.prog_opt_days, "3", "Tuesday"); } if (programid[programid.selectedIndex].value == 2) { AddToOptionList(document.progreg.prog_opt_days, "5", "Thursday"); } if (programid[programid.selectedIndex].value == 3) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 3) { AddToOptionList(document.progreg.prog_opt_days, "", "No Elective Days"); } if (programid[programid.selectedIndex].value == 4) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 4) { AddToOptionList(document.progreg.prog_opt_days, "", "No Elective Days"); } if (programid[programid.selectedIndex].value == 5) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 5) { AddToOptionList(document.progreg.prog_opt_days, "", "No Elective Days"); } if (programid[programid.selectedIndex].value == 6) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 6) { AddToOptionList(document.progreg.prog_opt_days, "", "No Elective Days"); } if (programid[programid.selectedIndex].value == 8) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 8) { AddToOptionList(document.progreg.prog_opt_days, "", "No Elective Days"); } if (programid[programid.selectedIndex].value == 15) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 15) { AddToOptionList(document.progreg.prog_opt_days, "3", "Tuesday"); } if (programid[programid.selectedIndex].value == 15) { AddToOptionList(document.progreg.prog_opt_days, "5", "Thursday"); } if (programid[programid.selectedIndex].value == 16) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 16) { AddToOptionList(document.progreg.prog_opt_days, "3", "Tuesday"); } if (programid[programid.selectedIndex].value == 16) { AddToOptionList(document.progreg.prog_opt_days, "5", "Thursday"); } if (programid[programid.selectedIndex].value == 18) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 18) { AddToOptionList(document.progreg.prog_opt_days, "", "No Elective Days"); } if (programid[programid.selectedIndex].value == 19) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 19) { AddToOptionList(document.progreg.prog_opt_days, "", "No Elective Days"); } if (programid[programid.selectedIndex].value == 23) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 23) { AddToOptionList(document.progreg.prog_opt_days, "3", "Tuesday"); } if (programid[programid.selectedIndex].value == 23) { AddToOptionList(document.progreg.prog_opt_days, "5", "Thursday"); } if (programid[programid.selectedIndex].value == 24) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 24) { AddToOptionList(document.progreg.prog_opt_days, "3", "Tuesday"); } if (programid[programid.selectedIndex].value == 24) { AddToOptionList(document.progreg.prog_opt_days, "5", "Thursday"); } if (programid[programid.selectedIndex].value == 25) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 25) { AddToOptionList(document.progreg.prog_opt_days, "3", "Tuesday"); } if (programid[programid.selectedIndex].value == 25) { AddToOptionList(document.progreg.prog_opt_days, "5", "Thursday"); } if (programid[programid.selectedIndex].value == 26) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 26) { AddToOptionList(document.progreg.prog_opt_days, "3", "Tuesday"); } if (programid[programid.selectedIndex].value == 26) { AddToOptionList(document.progreg.prog_opt_days, "5", "Thursday"); } if (programid[programid.selectedIndex].value == 27) { AddToOptionList(document.progreg.prog_opt_days, "", "Select Elective Day"); } if (programid[programid.selectedIndex].value == 27) { AddToOptionList(document.progreg.prog_opt_days, "3", "Tuesday"); } if (programid[programid.selectedIndex].value == 27) { AddToOptionList(document.progreg.prog_opt_days, "5", "Thursday"); } } function populatememtypes() { var memtypes1 = document.display.display1; // Clear out the list of member_reg_type ClearOptions(document.display.display2); if (memtypes1[memtypes1.selectedIndex].value == 2) { AddToOptionList(document.display.display2, "", "All"); AddToOptionList(document.display.display2, "E1", "E1 - ANGSL"); AddToOptionList(document.display.display2, "E2", "E2 - ANGSL"); AddToOptionList(document.display.display2, "K1", "K1 - Kinder"); AddToOptionList(document.display.display2, "K2", "K2 - Kinder"); AddToOptionList(document.display.display2, "J1", "J1 - Junior"); AddToOptionList(document.display.display2, "J2", "J2 - Junior"); AddToOptionList(document.display.display2, "MA", "Master"); AddToOptionList(document.display.display2, "MS", "Master on NPL"); AddToOptionList(document.display.display2, "CO", "Coach"); AddToOptionList(document.display.display2, "GM", "General Member"); AddToOptionList(document.display.display2, "SR", "Senior"); AddToOptionList(document.display.display2, "J1-FIS", "FIS - J1"); AddToOptionList(document.display.display2, "J2-FIS", "FIS - J2"); AddToOptionList(document.display.display2, "SR-FIS", "FIS - Senior"); AddToOptionList(document.display.display2, "FIS-NAT", "FIS - National Team"); AddToOptionList(document.display.display2, "DSABC", "DSABC - Para Alpine"); } if (memtypes1[memtypes1.selectedIndex].value == 3) { AddToOptionList(document.display.display2, "", "All"); AddToOptionList(document.display.display2, "NGSL Sun", "NGSL Sunday"); AddToOptionList(document.display.display2, "KSTAR Sun", "KStar Sunday"); AddToOptionList(document.display.display2, "K1", "Kinder - 1"); AddToOptionList(document.display.display2, "K2", "Kinder - 2"); AddToOptionList(document.display.display2, "VST", "Vancouver Ski Team"); AddToOptionList(document.display.display2, "TNT+", "Tuesday Night Adult Training 9 sessions"); AddToOptionList(document.display.display2, "CD", "Coaching Development"); AddToOptionList(document.display.display2, "NGSL+", "NGSL Plus"); AddToOptionList(document.display.display2, "KSTAR+", "KStar Plus"); AddToOptionList(document.display.display2, "TNT", "Tuesday Night Adult Training 5 sessions"); AddToOptionList(document.display.display2, "VASS", "Vancouver Adaptive Snow Sports"); AddToOptionList(document.display.display2, "NGSL Sat", "NGSL Saturday"); AddToOptionList(document.display.display2, "KSTAR Sat", "KStar Saturday"); AddToOptionList(document.display.display2, "MTNSTAR Sat", "MountainStar Saturday"); AddToOptionList(document.display.display2, "MTNSTAR+", "MountainStar Plus"); AddToOptionList(document.display.display2, "MTNSTAR Sun", "MountainStar Sunday"); } if (memtypes1[memtypes1.selectedIndex].value == 4) { AddToOptionList(document.display.display2, "", "All"); AddToOptionList(document.display.display2, "1", "Communications"); AddToOptionList(document.display.display2, "2", "Social Events"); AddToOptionList(document.display.display2, "3", "Finance/Marketing"); AddToOptionList(document.display.display2, "4", "Membership"); AddToOptionList(document.display.display2, "5", "Parent Coordinators"); AddToOptionList(document.display.display2, "13", "N/A (Racers Only)"); } } function populateregtypes() { var regtypes = document.newmember.year; // Clear out the list of member_reg_type ClearOptions(document.newmember.member_reg_type); if ((regtypes[regtypes.selectedIndex].value >= 4) && (regtypes[regtypes.selectedIndex].value <= 8)) { AddToOptionList(document.newmember.member_reg_type, "E1", "E1 - ANGSL ($58.00)"); } if ((regtypes[regtypes.selectedIndex].value >= 9) && (regtypes[regtypes.selectedIndex].value <= 11)) { AddToOptionList(document.newmember.member_reg_type, "E2", "E2 - ANGSL ($58.00)"); } if ((regtypes[regtypes.selectedIndex].value >= 11) && (regtypes[regtypes.selectedIndex].value <= 12)) { AddToOptionList(document.newmember.member_reg_type, "K1", "K1 - Kinder ($93.00)"); } if ((regtypes[regtypes.selectedIndex].value >= 13) && (regtypes[regtypes.selectedIndex].value <= 14)) { AddToOptionList(document.newmember.member_reg_type, "K2", "K2 - Kinder ($103.00)"); } if ((regtypes[regtypes.selectedIndex].value >= 15) && (regtypes[regtypes.selectedIndex].value <= 16)) { AddToOptionList(document.newmember.member_reg_type, "J1", "J1 - Junior ($117.00)"); } if ((regtypes[regtypes.selectedIndex].value >= 17) && (regtypes[regtypes.selectedIndex].value <= 19)) { AddToOptionList(document.newmember.member_reg_type, "J2", "J2 - Junior ($117.00)"); } if ((regtypes[regtypes.selectedIndex].value >= 19) && (regtypes[regtypes.selectedIndex].value <= 99)) { AddToOptionList(document.newmember.member_reg_type, "MA", "Master ($65.00)"); } if ((regtypes[regtypes.selectedIndex].value >= 19) && (regtypes[regtypes.selectedIndex].value <= 99)) { AddToOptionList(document.newmember.member_reg_type, "MS", "Master on NPL ($85.00)"); } if ((regtypes[regtypes.selectedIndex].value >= 15) && (regtypes[regtypes.selectedIndex].value <= 99)) { AddToOptionList(document.newmember.member_reg_type, "CO", "Coach "); } if ((regtypes[regtypes.selectedIndex].value >= 1) && (regtypes[regtypes.selectedIndex].value <= 99)) { AddToOptionList(document.newmember.member_reg_type, "GM", "General Member ($30.00)"); } if ((regtypes[regtypes.selectedIndex].value >= 19) && (regtypes[regtypes.selectedIndex].value <= 99)) { AddToOptionList(document.newmember.member_reg_type, "SR", "Senior ($117.00)"); } if ((regtypes[regtypes.selectedIndex].value >= 15) && (regtypes[regtypes.selectedIndex].value <= 16)) { AddToOptionList(document.newmember.member_reg_type, "J1-FIS", "FIS - J1 "); } if ((regtypes[regtypes.selectedIndex].value >= 17) && (regtypes[regtypes.selectedIndex].value <= 19)) { AddToOptionList(document.newmember.member_reg_type, "J2-FIS", "FIS - J2 "); } if ((regtypes[regtypes.selectedIndex].value >= 19) && (regtypes[regtypes.selectedIndex].value <= 99)) { AddToOptionList(document.newmember.member_reg_type, "SR-FIS", "FIS - Senior "); } if ((regtypes[regtypes.selectedIndex].value >= 16) && (regtypes[regtypes.selectedIndex].value <= 99)) { AddToOptionList(document.newmember.member_reg_type, "FIS-NAT", "FIS - National Team "); } if ((regtypes[regtypes.selectedIndex].value >= 1) && (regtypes[regtypes.selectedIndex].value <= 99)) { AddToOptionList(document.newmember.member_reg_type, "DSABC", "DSABC - Para Alpine ($35.00)"); } } function ClearOptions(OptionList) { // Always clear an option list from the last entry to the first for (x = OptionList.length; x >= 0; x = x - 1) { OptionList[x] = null; } } function AddToOptionList(OptionList, OptionValue, OptionText) { // Add option to the bottom of the list OptionList[OptionList.length] = new Option(OptionText, OptionValue); } function validprogram( selectedform ) { myformname = document.getElementById(selectedform); valid = true; if (myformname.program_id.selectedIndex == 0) { alert ( "You must select a program." ); valid = false; } if (myformname.prog_opt_days.selectedIndex == 0 && valid == true) { alert ( "You must select your elective day." ); valid = false; } return valid; } function validatephoto( selectedform ) { myformname = document.getElementById(selectedform); valid = true; if (myformname.photo_category.selectedIndex == 0) { alert ( "You must select an album." ); valid = false; } return valid; } function validatemember( selectedform ) { myformname = document.getElementById(selectedform); valid = true; if ( myformname.family_email.value === "" ) { alert ( "You must enter an email address." ); valid = false; } if ( (myformname.family_pass1.value === "" || myformname.family_pass2.value === "") && valid == true ) { alert ( "You must enter a password in both password fields." ); valid = false; } if ( (myformname.family_pass1.value !== myformname.family_pass2.value) && valid == true ) { alert ( "Both password fields must match." ); valid = false; } if ( myformname.family_firstname.value === "" && valid == true ) { alert ( "You must enter your first name." ); valid = false; } if ( myformname.family_name.value === "" && valid == true ) { alert ( "You must enter your last name / family name." ); valid = false; } if ( myformname.family_address1.value === "" && valid == true ) { alert ( "You must enter your address." ); valid = false; } if ( myformname.family_city.value === "" && valid == true ) { alert ( "You must enter your city." ); valid = false; } if ( myformname.family_province.value === "" && valid == true ) { alert ( "You must enter your province." ); valid = false; } if ( myformname.family_postal.value === "" && valid == true ) { alert ( "You must enter your postal code." ); valid = false; } if ( myformname.family_country.value === "" && valid == true ) { alert ( "You must enter your country." ); valid = false; } if ( myformname.family_phone1.value === "" && valid == true ) { alert ( "You must enter your phone number." ); valid = false; } return valid; } function validateoldmember( selectedform ) { myformname = document.getElementById(selectedform); valid = true; if ( myformname.family_email.value === "" ) { alert ( "You must enter an email address." ); valid = false; } if ( myformname.family_pass1.value !== "" && (myformname.family_pass1.value !== myformname.family_pass2.value) && valid == true ) { alert ( "Both password fields must match." ); valid = false; } if ( myformname.family_firstname.value === "" && valid == true ) { alert ( "You must enter your first name." ); valid = false; } if ( myformname.family_name.value === "" && valid == true ) { alert ( "You must enter your last name / family name." ); valid = false; } if ( myformname.family_address1.value === "" && valid == true ) { alert ( "You must enter your address." ); valid = false; } if ( myformname.family_city.value === "" && valid == true ) { alert ( "You must enter your city." ); valid = false; } if ( myformname.family_province.value === "" && valid == true ) { alert ( "You must enter your province." ); valid = false; } if ( myformname.family_postal.value === "" && valid == true ) { alert ( "You must enter your postal code." ); valid = false; } if ( myformname.family_country.value === "" && valid == true ) { alert ( "You must enter your country." ); valid = false; } if ( myformname.family_phone1.value === "" && valid == true ) { alert ( "You must enter your phone number." ); valid = false; } return valid; } function validateindiv( selectedform ) { myformname = document.getElementById(selectedform); regtype = myformname.member_reg_type; voltype = myformname.volunteer; valid = true; if ( (myformname.member_gender[0].checked == false) && (myformname.member_gender[1].checked == false) ) { alert ( "You must select a gender." ); valid = false; } if ( myformname.member_firstname.value === "" && valid == true ) { alert ( "You must enter a first name." ); valid = false; } if ( myformname.member_lastname.value === "" && valid == true ) { alert ( "You must enter a last name." ); valid = false; } if ( (myformname.year.selectedIndex == 0 || myformname.month.selectedIndex == 0 || myformname.day.selectedIndex == 0) && valid == true ) { alert ( "You must select valid date of birth." ); valid = false; } if ( myformname.member_volunteer.selectedIndex == 0 && valid == true ) { alert ( "You must select a volunteer category or select N/A if you are exempt (Racers Only)." ); valid = false; } if ( myformname.member_emergency_name.value === "" && valid == true ) { alert ( "You must enter an emergency contact name." ); valid = false; } if ( myformname.member_emergency_phone.value === "" && valid == true ) { alert ( "You must enter an emergency contact phone number." ); valid = false; } if ( myformname.member_healthcard.value === "" && valid == true ) { alert ( "You must enter your provincial health card number." ); valid = false; } if ( myformname.member_reg_type.selectedIndex == -1 && valid == true ) { alert ( "You must select at least one membership category."); valid = false; } return valid; } function HideContent(d) { document.getElementById(d).style.display = "none"; } function ShowContent(d) { document.getElementById(d).style.display = "block"; } function ReverseDisplay(d) { if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; } else { document.getElementById(d).style.display = "none"; } } /* Calendar Functions */ var enableCache = false; var jsCache = new Array(); var AjaxObjects = new Array(); function ShowContent_UpdateMiniCal2(divId,ajaxIndex,url) { document.getElementById(divId).innerHTML = AjaxObjects[ajaxIndex].response; if(enableCache){ jsCache[url] = AjaxObjects[ajaxIndex].response; } AjaxObjects[ajaxIndex] = false; } function Ajax_UpdateMiniCal(divId,url) { if(enableCache && jsCache[url]){ document.getElementById(divId).innerHTML = jsCache[url]; return; } var ajaxIndex = AjaxObjects.length; document.getElementById(divId).innerHTML = ''; AjaxObjects[ajaxIndex] = new sack(); AjaxObjects[ajaxIndex].requestFile = url; AjaxObjects[ajaxIndex].onCompletion = function(){ ShowContent_UpdateMiniCal2(divId,ajaxIndex,url); }; AjaxObjects[ajaxIndex].runAJAX(); } function HL_On(id, upto) { var i=0 for (i=0;i<=upto;i++) { var x = id + '_' + i css_color_change(x,'FFFF99'); } } function HL_Off(id, upto) { var i=0 for (i=0;i<=upto;i++) { var x = id + '_' + i css_color_change(x,'ffffff'); } } function css_color_change(id, val) { var e = document.getElementById(id); if(!(e)) { // alert("This change is not possible! [" + id + "]"); return(false); } e.style.backgroundColor = "#"+val; return(true); } /* */