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 "12 OZ. MAROON": ao(s, "12\" - $12.89","12\"", x++); break; case "5 OZ. COLUMBIA BLUE": ao(s, "12\" - $9.49","12\"", x++); break; case "6 OZ. WHITE": ao(s, "12\" - $9.89","12\"", x++); break; case "10 OZ. OLIVE": ao(s, "12\" - $11.69","12\"", x++); break; case "4 OZ. GOLD": ao(s, "12\" - $9.29","12\"", x++); break; case "11 OZ. GREY": ao(s, "12\" - $12.29","12\"", x++); break; case "7 OZ. BRIGHT ORANGE": ao(s, "12\" - $10.29","12\"", x++); break; case "8 OZ. YELLOW": ao(s, "12\" - $10.89","12\"", x++); break; case "9 OZ. RED": ao(s, "12\" - $11.29","12\"", 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;