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 "M130121-BLUE": ao(s, "1-CASE OF 32 ROLLS - $72.29","1-CASE OF 32 ROLLS", x++); ao(s, "1-ROLL - $2.79","1-ROLL", x++); break; case "M130123-SCARLET": ao(s, "1-CASE OF 32 ROLLS - $72.29","1-CASE OF 32 ROLLS", x++); ao(s, "1-ROLL - $2.79","1-ROLL", x++); break; case "M130122-GREEN": ao(s, "1-CASE OF 32 ROLLS - $72.29","1-CASE OF 32 ROLLS", x++); ao(s, "1-ROLL - $2.79","1-ROLL", x++); break; case "M130130-MAROON": ao(s, "1-CASE OF 32 ROLLS - $72.29","1-CASE OF 32 ROLLS", x++); ao(s, "1-ROLL - $2.79","1-ROLL", x++); break; case "M130125-BLACK": ao(s, "1-CASE OF 32 ROLLS - $72.29","1-CASE OF 32 ROLLS", x++); ao(s, "1-ROLL - $2.79","1-ROLL", x++); break; case "M130126-ORANGE": ao(s, "1-CASE OF 32 ROLLS - $72.29","1-CASE OF 32 ROLLS", x++); ao(s, "1-ROLL - $2.79","1-ROLL", x++); break; case "M130132-PINK": ao(s, "1-CASE OF 32 ROLLS - $72.29","1-CASE OF 32 ROLLS", x++); ao(s, "1-ROLL - $2.79","1-ROLL", x++); break; case "M130124-GOLD": ao(s, "1-CASE OF 32 ROLLS - $72.29","1-CASE OF 32 ROLLS", x++); ao(s, "1-ROLL - $2.79","1-ROLL", x++); break; case "M130129-BEIGE": ao(s, "1-CASE OF 32 ROLLS - $72.29","1-CASE OF 32 ROLLS", x++); ao(s, "1-ROLL - $2.79","1-ROLL", x++); break; case "M130128-PURPLE": ao(s, "1-CASE OF 32 ROLLS - $72.29","1-CASE OF 32 ROLLS", x++); ao(s, "1-ROLL - $2.79","1-ROLL", 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;