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, "LEAW07-22", "Size 3"); AddToOptionList(document.prodForm.size, "LEAW07-23", "Size 4"); AddToOptionList(document.prodForm.size, "LEAW07-24", "Size 5"); AddToOptionList(document.prodForm.size, "LEAW07-25", "Size 6"); AddToOptionList(document.prodForm.size, "LEAW07-26", "Size 7"); AddToOptionList(document.prodForm.size, "LEAW07-27", "Size 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); }