function PopulateSubs() { var colList = document.prodForm.col; // Clear out the list of teams ClearOptions(document.prodForm.size); if (colList[colList.selectedIndex].value=="Choc") { AddToOptionList(document.prodForm.size, "AW09-1525", "Mens Small"); AddToOptionList(document.prodForm.size, "AW09-1526", "Mens Medium"); AddToOptionList(document.prodForm.size, "AW09-1527", "Mens Large"); } if (colList[colList.selectedIndex].value=="Biscuit") { AddToOptionList(document.prodForm.size, "AW09-1528", "Mens Small"); AddToOptionList(document.prodForm.size, "AW09-1529", "Mens Medium"); AddToOptionList(document.prodForm.size, "AW09-1530", "Mens Large"); } } 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); }