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 "BLACK SOCK-FLUORESCENT GREEN/PINK STRIPES": ao(s, "9-11 - $4.59","9-11", x++); break; case "WHITE/FLUORESCENT PINK-PALE PINK": ao(s, "9-11 - $4.59","9-11", x++); break; case "WHITE/FLUORESCENT GREEN/BLACK": ao(s, "9-11 - $4.59","9-11", x++); ao(s, "9-11 - $4.59","9-11", x++); break; case "WHITE/ROYAL/BLACK": ao(s, "10-13 - $4.59","10-13", x++); ao(s, "9-11 - $5.09","9-11", x++); break; case "WHITE/PALE PINK-BLACK": ao(s, "9-11 - $4.59","9-11", x++); break; case "WHITE/GOLD-ROYAL": ao(s, "10-13 - $4.59","10-13", x++); break; case "WHITE/ORANGE-BLACK": ao(s, "10-13 - $4.59","10-13", x++); ao(s, "9-11 - $4.59","9-11", x++); break; case "WHITE/RED-RED": ao(s, "9-11 - $4.59","9-11", x++); break; case "WHITE/FLUORESCENT GREEN-PALE PINK": ao(s, "9-11 - $4.59","9-11", x++); break; case "WHITE/LT. BLUE-BLACK": ao(s, "9-11 - $4.59","9-11", x++); break; case "WHITE/ROYAL/ROYAL": ao(s, "9-11 - $4.59","9-11", x++); break; case "WHITE/RED-BLACK": ao(s, "10-13 - $4.59","10-13", x++); ao(s, "9-11 - $4.59","9-11", x++); break; case "WHITE/GOLD-BLACK": ao(s, "10-13 - $4.59","10-13", x++); ao(s, "9-11 - $4.59","9-11", x++); break; case "WHITE/BLACK-BLACK": ao(s, "9-11 - $4.59","9-11", x++); break; case "WHITE/DARK GREEN/BLACK": ao(s, "10-13 - $4.59","10-13", 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;