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-RED": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "WHITE-ORANGE": ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "GOLD- ROYAL": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "WHITE-BLACK": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "GOLD-KELLY": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "WHITE-PURPLE": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "WHITE-DARK GREEN": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "GOLD-BLACK": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "WHITE-MAROON": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "WHITE-KELLY": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "WHITE-ROYAL": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "WHITE-LIGHT BLUE": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "BLACK-ROYAL": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "WHITE-GOLD": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "WHITE-RED": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "BLACK-KELLY": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "GOLD-RED": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", x++); break; case "WHITE-NAVY": ao(s, "SIZE 10-13 - $4.69","SIZE 10-13 ", x++); ao(s, "SIZE 9-11 - $4.59","SIZE 9-11 ", 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;