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-1691", "3"); AddToOptionList(document.prodForm.size, "SS09-1692", "4"); AddToOptionList(document.prodForm.size, "SS09-1693", "5"); AddToOptionList(document.prodForm.size, "SS09-1694", "6"); AddToOptionList(document.prodForm.size, "SS09-1695", "7"); AddToOptionList(document.prodForm.size, "SS09-1696", "8"); } if (colList[colList.selectedIndex].value=="Cream") { AddToOptionList(document.prodForm.size, "SS09-1685", "3"); AddToOptionList(document.prodForm.size, "SS09-1686", "4"); AddToOptionList(document.prodForm.size, "SS09-1687", "5"); AddToOptionList(document.prodForm.size, "SS09-1688", "6"); AddToOptionList(document.prodForm.size, "SS09-1689", "7"); AddToOptionList(document.prodForm.size, "SS09-1690", "8"); } } 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); }