function GoToAdultLink(whichSelect) { var baseURL = "https://thriva.activenetwork.com/ThrivaRegister/Registration.aspx?"; var mySel = document.getElementById(whichSelect); var URLAdd = mySel.options[mySel.selectedIndex].value; if ((URLAdd)&&(URLAdd!='')) { var fullURL = baseURL + URLAdd; window.location = "/myaccount/?destpg=" + escape(fullURL); } } ////////////////////////////////////////////////// // Hide/show stuff for radio buttons and the adult course search. SrcSel343Adult == the id of the select for boston. ////////////////////////////////////////////////////// function showValidAdultLevels(theobj) { bostonLevelssubmit=document.getElementById('submitSrcSel343Adult') bostonLevels=document.getElementById('SrcSel343Adult'); newtonLevelssubmit=document.getElementById('submitnewtonAdultLevels'); newtonLevels=document.getElementById('newtonAdultLevels'); if ((theobj.checked==true) && (theobj.value=='Boston')) { newtonLevelssubmit.className='none'; newtonLevels.className='none'; bostonLevels.className='notNone'; bostonLevelssubmit.className='regSubmit'; } if ((theobj.checked==true) && (theobj.value=='Newton')) { bostonLevelssubmit.className='none'; bostonLevels.className='none'; newtonLevels.className='notNone'; newtonLevelssubmit.className='regSubmit'; } } var ErrorClass = 'hasError bunda'; var NoErrorClass = 'bunda'; // //////////////////////////////////////////////////// function MyChildrenCoursesObj(IsFSL, AgeGroup, Location, URLAdd) { this.IsFSL = IsFSL; this.AgeGroup = AgeGroup; this.Location = Location; this.URLAdd = URLAdd; } function MyChildrenCurrChoices() { this.IsFSL = null; this.Location = ''; this.AgeGroup = ''; } // //////////////////////////////////////////////////// var MyChildrenCoursesArr = new Array(); var i=0; // Below are EVERY possibility of classes for the two main categories: french spoken at home, and english spoken at home. a function is called in the html which then hides the "wrong" choices based on the default values set in the html code. // English at home (my child speaks French as second language) MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( true, 'Babies and Toddlers', 'Boston', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181077,+1702157682+1702181254&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( true, '3-4', 'Boston', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181631,+1702157682+1702181254&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( true, '3-4', 'Newton', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181631,+1702157682+1702181255&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( true, '4-6', 'Boston', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181258,+1702157682+1702181254&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( true, '4-6', 'Newton', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181258,+1702157682+1702181255&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( true, '6-8', 'Boston', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181259,+1702157682+1702181254&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( true, '6-8', 'Newton', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181259,+1702157682+1702181255&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( true, '8-10', 'Boston', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181260,+1702157682+1702181254&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( true, '8-10', 'Newton', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181260,+1702157682+1702181255&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( true, '10-13', 'Boston', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181632,+1702157682+1702181254&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( true, '10-13', 'Newton', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181632,+1702157682+1702181255&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( true, '13 and up', 'Boston', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181262,+1702157682+1702181254&RHL=-1'); i++; // Native speaker / bilingual / french-at-home courses. set first val, isFSL, to FALSE. MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( false, 'Babies and Toddlers', 'Boston', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181077,+1702157682+1702181254&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( false, '4-7', 'Boston', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181633,+1702157682+1702181254&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( false, '4-7', 'Newton', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181633,+1702157682+1702181255&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( false, '7-9', 'Boston', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181634,+1702157682+1702181254&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( false, '7-9', 'Newton', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181634,+1702157682+1702181255&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( false, '9-11', 'Boston', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181635,+1702157682+1702181254&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( false, '11-13', 'Boston', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181636,+1702157682+1702181254&RHL=-1'); i++; MyChildrenCoursesArr[i] = new MyChildrenCoursesObj( false, '13 and up', 'Boston', 'IDTD=2057567&IDRPH=2159141&COID=1702157645+1702181637,+1702157682+1702181254&RHL=-1'); i++; // //////////////////////////////////////////////////// function MyChildrenCoursesResetErrors() { document.getElementById('IsFSLCont').className= NoErrorClass; document.getElementById('LocationCont').className= NoErrorClass; document.getElementById('AgeGroupCont').className= NoErrorClass; document.getElementById('chilerrmsg').innerHTML=''; document.getElementById('chilerrmsg').className= 'hide'; } function MyChildrenCoursesAddError(ErrStr) { if (document.getElementById('chilerrmsg').innerHTML == '') { document.getElementById('chilerrmsg').innerHTML = ''; } else { document.getElementById('chilerrmsg').innerHTML += '
  • '+ErrStr+'
  • '; } document.getElementById('chilerrmsg').className='myaccterror'; } // //////////////////////////////////////////////////// function MyChildrenCoursesGetCurrChoices() { var FormId = "f_childCourses"; var OutObj = new MyChildrenCurrChoices(); // I. FSL // Define IsFSL as yes or no var IsFSLStr = ""; if (document.getElementById(FormId).elements['IsFSL'][0].checked==true) IsFSLStr = document.getElementById(FormId).elements['IsFSL'][0].value; if (document.getElementById(FormId).elements['IsFSL'][1].checked==true) IsFSLStr = document.getElementById(FormId).elements['IsFSL'][1].value; if (IsFSLStr == "yes") { OutObj.IsFSL=true; } else if (IsFSLStr == "no") { OutObj.IsFSL=false; } // II. LOCATION var LocationSel = document.getElementById(FormId).elements['Location']; // Get Current Location and remove existing options CurrLocation = LocationSel.options[LocationSel.selectedIndex].value; LocationSel.options.length=0; // Add new options and, if possible, pre-select to CurrLocation var k = 0; if (OutObj.IsFSL != null) { for (var j=0; j0) { for (var i=0; i0) OutObj.Location = LocationSel.options[LocationSel.selectedIndex].value; // III. AGE GROUP var AgeGroupSel = document.getElementById(FormId).elements['AgeGroup']; // Get Current AgeGroup and remove existing options var CurrAgeGroup = ""; CurrAgeGroup = AgeGroupSel.options[AgeGroupSel.selectedIndex].value; AgeGroupSel.options.length = 0; // Add new options and, if possible, pre-select to CurrAgeGroup var k = 0; if (OutObj.IsFSL != null) { for (var j=0; j0) { for (var i=0; i0) OutObj.AgeGroup = AgeGroupSel.options[AgeGroupSel.selectedIndex].value; return(OutObj); } function GoToChildrenLink() { // Reset error messages MyChildrenCoursesResetErrors(); var FoundError = false; // Our form by id var FormId = 'f_childCourses'; // base url for thriva var baseURL = "/myaccount?destpg=" + escape("https://thriva.activenetwork.com/ThrivaRegister/Registration.aspx?"); // Get current selections var MyObj = MyChildrenCoursesGetCurrChoices(); // Make sure use chose FSL or not if (MyObj.IsFSL == null) { document.getElementById('IsFSLCont').className= ErrorClass; MyChildrenCoursesAddError('Select native or not'); FoundError = true; } // Make sure a location was selected if (MyObj.Location=='') { document.getElementById('LocationCont').className= ErrorClass; MyChildrenCoursesAddError('Select a Location'); FoundError = true; } // Make sure an age group was selected if (MyObj.AgeGroup=='') { document.getElementById('AgeGroupCont').className= ErrorClass; MyChildrenCoursesAddError('Select an age group'); FoundError = true; } if (FoundError) { return; } // Define the correct URL var URLAdd = ""; for (var i=0; i