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 "5-WHITE": ao(s, "YXS-27\" INSEAM - $11.99","YXS-27\" INSEAM", x++); ao(s, "YS-27\" INSEAM - $11.99","YS-27\" INSEAM", x++); ao(s, "YM-27\" INSEAM - $11.99","YM-27\" INSEAM", x++); ao(s, "YL-27\" INSEAM - $11.99","YL-27\" INSEAM", x++); ao(s, "YXL-27\" INSEAM - $11.99","YXL-27\" INSEAM", x++); ao(s, "AS-31\" INSEAM - $13.59","AS-31\" INSEAM", x++); ao(s, "AM-31\" INSEAM - $13.59","AM-31\" INSEAM", x++); ao(s, "AL-31\" INSEAM - $13.59","AL-31\" INSEAM", x++); ao(s, "AXL-31\" INSEAM - $13.59","AXL-31\" INSEAM", x++); ao(s, "AXXL-31\" INSEAM - $13.59","AXXL-31\" INSEAM", x++); ao(s, "AXXXL-31\" INSEAM - $13.59","AXXXL-31\" INSEAM", x++); break; case "33-SILVER": ao(s, "YXS-27\" INSEAM - $11.99","YXS-27\" INSEAM", x++); ao(s, "YS-27\" INSEAM - $11.99","YS-27\" INSEAM", x++); ao(s, "YM-27\" INSEAM - $11.99","YM-27\" INSEAM", x++); ao(s, "YL-27\" INSEAM - $11.99","YL-27\" INSEAM", x++); ao(s, "YXL-27\" INSEAM - $11.99","YXL-27\" INSEAM", x++); ao(s, "AS-31\" INSEAM - $13.59","AS-31\" INSEAM", x++); ao(s, "AM-31\" INSEAM - $13.59","AM-31\" INSEAM", x++); ao(s, "AL-31\" INSEAM - $13.59","AL-31\" INSEAM", x++); ao(s, "AXL-31\" INSEAM - $13.59","AXL-31\" INSEAM", x++); ao(s, "AXXL-31\" INSEAM - $13.59","AXXL-31\" INSEAM", x++); ao(s, "AXXXL-31\" INSEAM - $13.59","AXXXL-31\" INSEAM", 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;