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 "VEGAS GOLD": ao(s, "L (7 1/4 - 7 3/8)","L (7 1/4 - 7 3/8)", x++); ao(s, "M (7 - 7 1/8)","M (7 - 7 1/8)", x++); ao(s, "ONE SIZE FITS MOST (6 1/2 - 7 1/2)","ONE SIZE FITS MOST (6 1/2 - 7 1/2)", x++); ao(s, "S (6 3/4 - 6 7/8)","S (6 3/4 - 6 7/8)", x++); ao(s, "XL (7 1/2- 7 3/4)","XL (7 1/2- 7 3/4)", x++); break; case "SCARLET": ao(s, "L (7 1/4 - 7 3/8)","L (7 1/4 - 7 3/8)", x++); ao(s, "M (7 - 7 1/8)","M (7 - 7 1/8)", x++); ao(s, "ONE SIZE FITS MOST (6 1/2 - 7 1/2)","ONE SIZE FITS MOST (6 1/2 - 7 1/2)", x++); ao(s, "S (6 3/4 - 6 7/8)","S (6 3/4 - 6 7/8)", x++); ao(s, "XL (7 1/2- 7 3/4)","XL (7 1/2- 7 3/4)", x++); break; case "ORANGE": ao(s, "L (7 1/4 - 7 3/8)","L (7 1/4 - 7 3/8)", x++); ao(s, "M (7 - 7 1/8)","M (7 - 7 1/8)", x++); ao(s, "ONE SIZE FITS MOST (6 1/2 - 7 1/2)","ONE SIZE FITS MOST (6 1/2 - 7 1/2)", x++); ao(s, "S (6 3/4 - 6 7/8)","S (6 3/4 - 6 7/8)", x++); ao(s, "XL (7 1/2- 7 3/4)","XL (7 1/2- 7 3/4)", x++); break; case "ROYAL": ao(s, "L (7 1/4 - 7 3/8)","L (7 1/4 - 7 3/8)", x++); ao(s, "M (7 - 7 1/8)","M (7 - 7 1/8)", x++); ao(s, "ONE SIZE FITS MOST (6 1/2 - 7 1/2)","ONE SIZE FITS MOST (6 1/2 - 7 1/2)", x++); ao(s, "S (6 3/4 - 6 7/8)","S (6 3/4 - 6 7/8)", x++); ao(s, "XL (7 1/2- 7 3/4)","XL (7 1/2- 7 3/4)", x++); break; case "PURPLE": ao(s, "L (7 1/4 - 7 3/8)","L (7 1/4 - 7 3/8)", x++); ao(s, "M (7 - 7 1/8)","M (7 - 7 1/8)", x++); ao(s, "ONE SIZE FITS MOST (6 1/2 - 7 1/2)","ONE SIZE FITS MOST (6 1/2 - 7 1/2)", x++); ao(s, "S (6 3/4 - 6 7/8)","S (6 3/4 - 6 7/8)", x++); ao(s, "XL (7 1/2- 7 3/4)","XL (7 1/2- 7 3/4)", x++); break; case "NAVY": ao(s, "L (7 1/4 - 7 3/8)","L (7 1/4 - 7 3/8)", x++); ao(s, "M (7 - 7 1/8)","M (7 - 7 1/8)", x++); ao(s, "ONE SIZE FITS MOST (6 1/2 - 7 1/2)","ONE SIZE FITS MOST (6 1/2 - 7 1/2)", x++); ao(s, "S (6 3/4 - 6 7/8)","S (6 3/4 - 6 7/8)", x++); ao(s, "XL (7 1/2- 7 3/4)","XL (7 1/2- 7 3/4)", x++); break; case "BLACK": ao(s, "L (7 1/4 - 7 3/8)","L (7 1/4 - 7 3/8)", x++); ao(s, "M (7 - 7 1/8)","M (7 - 7 1/8)", x++); ao(s, "ONE SIZE FITS MOST (6 1/2 - 7 1/2)","ONE SIZE FITS MOST (6 1/2 - 7 1/2)", x++); ao(s, "S (6 3/4 - 6 7/8)","S (6 3/4 - 6 7/8)", x++); ao(s, "XL (7 1/2- 7 3/4)","XL (7 1/2- 7 3/4)", x++); break; case "DARK GREEN": ao(s, "S (6 3/4 - 6 7/8)","S (6 3/4 - 6 7/8)", 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;