function ao(c,txt,val,idx){ c.options[idx] = new Option(txt,val); } function setSizes(c, s){ var id; var x=0; var opt; if (!s || !c) return; if (c.selectedIndex < 1){ clearSizes(); return; } id = c.options[c.selectedIndex].value; s.options.length = 0; opt = new Option('Please select a size', ''); s.options[x++] = opt; switch(id){ case "4-BLACK": ao(s, "AXS-LOW RISE","AXS-LOW RISE", x++); ao(s, "AXS-STANDARD CUT","AXS-STANDARD CUT", x++); ao(s, "AS-LOW RISE","AS-LOW RISE", x++); ao(s, "AS-STANDARD CUT","AS-STANDARD CUT", x++); ao(s, "AM-LOW RISE","AM-LOW RISE", x++); ao(s, "AM-STANDARD CUT","AM-STANDARD CUT", x++); ao(s, "AL-LOW RISE","AL-LOW RISE", x++); ao(s, "AL-STANDARD CUT","AL-STANDARD CUT", x++); ao(s, "AXL-LOW RISE","AXL-LOW RISE", x++); ao(s, "AXL-STANDARD CUT","AXL-STANDARD CUT", x++); break; case "7-NAVY": ao(s, "AXS-LOW RISE","AXS-LOW RISE", x++); ao(s, "AXS-STANDARD CUT","AXS-STANDARD CUT", x++); ao(s, "AS-LOW RISE","AS-LOW RISE", x++); ao(s, "AS-STANDARD CUT","AS-STANDARD CUT", x++); ao(s, "AM-LOW RISE","AM-LOW RISE", x++); ao(s, "AM-STANDARD CUT","AM-STANDARD CUT", x++); ao(s, "AL-LOW RISE","AL-LOW RISE", x++); ao(s, "AL-STANDARD CUT","AL-STANDARD CUT", x++); ao(s, "AXL-LOW RISE","AXL-LOW RISE", x++); ao(s, "AXL-STANDARD CUT","AXL-STANDARD CUT", x++); break; case "1-ROYAL": ao(s, "AXS-LOW RISE","AXS-LOW RISE", x++); ao(s, "AXS-STANDARD CUT","AXS-STANDARD CUT", x++); ao(s, "AS-LOW RISE","AS-LOW RISE", x++); ao(s, "AS-STANDARD CUT","AS-STANDARD CUT", x++); ao(s, "AM-LOW RISE","AM-LOW RISE", x++); ao(s, "AM-STANDARD CUT","AM-STANDARD CUT", x++); ao(s, "AL-LOW RISE","AL-LOW RISE", x++); ao(s, "AL-STANDARD CUT","AL-STANDARD CUT", x++); ao(s, "AXL-LOW RISE","AXL-LOW RISE", x++); ao(s, "AXL-STANDARD CUT","AXL-STANDARD CUT", x++); break; case "2-SCARLET": ao(s, "AXS-LOW RISE","AXS-LOW RISE", x++); ao(s, "AXS-STANDARD CUT","AXS-STANDARD CUT", x++); ao(s, "AS-LOW RISE","AS-LOW RISE", x++); ao(s, "AS-STANDARD CUT","AS-STANDARD CUT", x++); ao(s, "AM-LOW RISE","AM-LOW RISE", x++); ao(s, "AM-STANDARD CUT","AM-STANDARD CUT", x++); ao(s, "AL-LOW RISE","AL-LOW RISE", x++); ao(s, "AL-STANDARD CUT","AL-STANDARD CUT", x++); ao(s, "AXL-LOW RISE","AXL-LOW RISE", x++); ao(s, "AXL-STANDARD CUT","AXL-STANDARD CUT", x++); break; } } function initSizes (){ var s, c, f=document.frmOrder; if ( !f ) return; s = f.sizes; c = f.colors; if (!c || !s) return; if (c.selectedIndex > 0){ setSizes(c, s); } else { s.options.length = 0; var opt = new Option('Please select a color first', ''); s.options[0] = opt; } } function clearSizes (){ var s, c, f=document.frmOrder; if ( !f ) return; s = f.sizes; c = f.colors; if (!c || !s) return; if (c.selectedIndex > 0) return; s.options.length = 0; var opt = new Option('Please select a color first', ''); s.options[0] = opt; } window.onload = initSizes;