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 "Galv. Steel Under/Anodized Alum. Planks": ao(s, "NB0515GPRF-15' LONG (50 SEATS) - $2304.49","NB0515GPRF-15' LONG (50 SEATS)", x++); ao(s, "NB0515GSTD-15' LONG (50 SEATS) - $2177.99","NB0515GSTD-15' LONG (50 SEATS)", x++); ao(s, "NB0521GPRF-21' LONG (70 SEATS) - $2975.49","NB0521GPRF-21' LONG (70 SEATS)", x++); ao(s, "NB0521GSTD-21' LONG (70 SEATS) - $2799.49","NB0521GSTD-21' LONG (70 SEATS)", x++); ao(s, "NB0524GPRF-24'LONG(80 SEATS) - $3404.49","NB0524GPRF-24'LONG(80 SEATS)", x++); ao(s, "NB0524GSTD-24' LONG (80 SEATS) - $3200.99","NB0524GSTD-24' LONG (80 SEATS)", x++); ao(s, "NB0527GPRF-27'LONG(90 SEATS) - $3701.49","NB0527GPRF-27'LONG(90 SEATS)", x++); ao(s, "NB0527GSTD-27' LONG (90 SEATS) - $3464.99","NB0527GSTD-27' LONG (90 SEATS)", 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;