function PopulateSubs() { var colList = document.prodForm.col; // Clear out the list of teams ClearOptions(document.prodForm.size); if (colList[colList.selectedIndex].value=="Chocolate") { AddToOptionList(document.prodForm.size, "SS09-1837", "0-6 Months"); AddToOptionList(document.prodForm.size, "SS09-1838", "12-18 Months"); AddToOptionList(document.prodForm.size, "SS09-1839", "6-12 Months"); } if (colList[colList.selectedIndex].value=="Tangerine") { AddToOptionList(document.prodForm.size, "SS09-1840", "0-6 Months"); AddToOptionList(document.prodForm.size, "SS09-1841", "12-18 Months"); AddToOptionList(document.prodForm.size, "SS09-1842", "6-12 Months"); } if (colList[colList.selectedIndex].value=="Pink") { AddToOptionList(document.prodForm.size, "SS09-1843", "0-6 Months"); AddToOptionList(document.prodForm.size, "SS09-1844", "12-18 Months"); AddToOptionList(document.prodForm.size, "SS09-1845", "6-12 Months"); } } 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); }