function removeAllOptions(selectbox) { var i; for(i=selectbox.options.length-1;i>=0;i--) { selectbox.remove(i); } } function addOption(selectbox, value, text) { var optn = document.createElement("OPTION"); optn.text = text; optn.value = value; selectbox.options.add(optn); } function Finish() { } function showSubmit() { document.getElementById('addtocart').style.display = 'inline'; } function hideSubmit() { document.getElementById('addtocart').style.display = 'none'; } function fillHardwares() { removeAllOptions(document.product_select.Hardwares); addOption(document.product_select.Hardwares, '', '-- Select Hardware --', ''); addOption(document.product_select.Hardwares, 'F', 'Freshwater'); addOption(document.product_select.Hardwares, 'S', 'Saltwater'); ClearColors(); } function fillColors() { fillHardwares(); document.getElementById('Colors').style.display = 'inline'; } function fillSizes() { fillColors(); document.getElementById('Sizes').style.display = 'inline'; } function fillMaterials() { fillSizes(); document.getElementById('Materials').style.display = 'inline'; } function fillBodies() { fillMaterials(); document.getElementById('Bodies').style.display = 'inline'; } function fillOptions() { fillBodies(); document.getElementById('Options').style.display = 'inline'; } function ClearColors(){ removeAllOptions(document.product_select.Colors); addOption(document.product_select.Colors, '', '-- Select Color --', ''); document.getElementById('Colors').style.display = 'none'; ClearSizes(); } function ClearSizes(){ removeAllOptions(document.product_select.Sizes); addOption(document.product_select.Sizes, '', '-- Select Size --', ''); document.getElementById('Sizes').style.display = 'none'; ClearMaterials(); } function ClearMaterials(){ removeAllOptions(document.product_select.Materials); addOption(document.product_select.Materials, '', '-- Select Material --', ''); document.getElementById('Materials').style.display = 'none'; ClearBodies(); } function ClearBodies(){ removeAllOptions(document.product_select.Bodies); addOption(document.product_select.Bodies, '', '-- Select Body --', ''); document.getElementById('Bodies').style.display = 'none'; ClearOptions(); } function ClearOptions(){ removeAllOptions(document.product_select.Options); addOption(document.product_select.Options, '', '-- Select Option --', ''); document.getElementById('Options').style.display = 'none'; document.getElementById('addtocart').style.display = 'none'; } fillHardwares();