function PopulateSubs() { var colList = document.prodForm.col; // Clear out the list of teams ClearOptions(document.prodForm.size); if (colList[colList.selectedIndex].value=="Cream") { AddToOptionList(document.prodForm.size, "SS09-1716", "Large"); AddToOptionList(document.prodForm.size, "SS09-1717", "Small"); AddToOptionList(document.prodForm.size, "SS09-1715", "Medium"); } if (colList[colList.selectedIndex].value=="Chocolate") { AddToOptionList(document.prodForm.size, "SS09-1713", "Large"); AddToOptionList(document.prodForm.size, "SS09-1714", "Small"); AddToOptionList(document.prodForm.size, "SS09-1712", "Medium"); } if (colList[colList.selectedIndex].value=="Fuchsia") { AddToOptionList(document.prodForm.size, "SS09-1720", "Small"); AddToOptionList(document.prodForm.size, "SS09-1719", "Large"); AddToOptionList(document.prodForm.size, "SS09-1718", "Medium"); } } 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); }