///////////////////////////////////////////////////////////////////////////// function onSelectClass(classlistid, timelistid1, timelistid2, timelistid1value, timelistid2value) { var classlist = document.getElementById(classlistid); var timelist1 = document.getElementById(timelistid1); var timelist2 = document.getElementById(timelistid2); timelist1.options.length = 0; timelist2.options.length = 0; timelist1.options[0] = new Option('--select time--', ''); timelist2.options[0] = new Option('--select time--', ''); if (classlist.selectedIndex == 0) { timelist1.disabled = true; timelist2.disabled = true; } else { var classtimes = 'classTimes' + (classlist.selectedIndex - 1).toString(); var timearray = eval(classtimes); timelist1.disabled = false; timelist2.disabled = true; if (timearray.length > 1) { timelist2.disabled = false; } var x = 0; for (x = 0; x != timearray.length; x++) { timelist1.options[x+1] = new Option(timearray[x], timearray[x]); timelist2.options[x+1] = new Option(timearray[x], timearray[x]); } } updateTimeHiddenValues(timelistid1, timelistid2, timelistid1value, timelistid2value); } ///////////////////////////////////////////////////////////////////////////// function onSelectTime(classlistid, timelistid1, timelistid2, timelistid1value, timelistid2value) { var classlist = document.getElementById(classlistid); var timelist1 = document.getElementById(timelistid1); var timelist2 = document.getElementById(timelistid2); var index = timelist1.selectedIndex; timelist2.options.length = 0; timelist2.options[0] = new Option('--select time--', ''); var classtimes = 'classTimes' + (classlist.selectedIndex - 1).toString(); var timearray = eval(classtimes); var x = 0; var c = 1; for (x = 0; x != timearray.length; x++) { if (x+1 != index) { timelist2.options[c] = new Option(timearray[x], timearray[x]); c++; } } updateTimeHiddenValues(timelistid1, timelistid2, timelistid1value, timelistid2value); } ///////////////////////////////////////////////////////////////////////////// function onSelectTimeAlt(classlistid, timelistid1, timelistid2, timelistid1value, timelistid2value) { updateTimeHiddenValues(timelistid1, timelistid2, timelistid1value, timelistid2value); } ///////////////////////////////////////////////////////////////////////////// function updateTimeHiddenValues(timelistid1, timelistid2, timelistid1value, timelistid2value) { var timelist1 = document.getElementById(timelistid1); var timelist2 = document.getElementById(timelistid2); var timelist1value = document.getElementById(timelistid1value); var timelist2value = document.getElementById(timelistid2value); timelist1value.value = timelist1.options[timelist1.selectedIndex].text; timelist2value.value = timelist2.options[timelist2.selectedIndex].text; if (timelist1value.value == '--select time--') { timelist1value.value = ''; } if (timelist2value.value == '--select time--') { timelist2value.value = ''; } } /////////////////////////////////////////////////////////////////////////////