T=Array("EP", "MD", "MH", "MP"); P=Array("QUAD", "TWIN", "1", "2", "3"); A=Array("15", "15/40/40/15", "15/50/50/15", "15/15", "15/20", "15/15/15/15", "15/20/20/15", "15/30/30/15", "20", "20/40/40/20", "20/50/50/20", "20/20", "20/30", "20/20/20/20", "20/30/30/20", "25", "30/30/30/30", "30", "30/50/50/30", "30/30", "30/20/20/30", "35", "40/30/30/40", "40/40/40/40", "40", "40/20/20/40", "45", "50", "60", "70", "80", "90", "100", "110", "125", "150", "175", "200", "225"); V=Array("120/240", "120", "240"); prods=Array(Array(0,4,34,2), Array(0,4,34,2), Array(0,4,35,2), Array(0,4,35,2), Array(0,4,36,2), Array(0,4,36,2), Array(0,4,37,2), Array(0,4,37,2), Array(0,4,38,2), Array(0,4,38,2), Array(3,2,0,0), Array(3,2,0,1), Array(3,2,0,0), Array(3,2,8,0), Array(3,2,8,1), Array(3,2,8,0), Array(3,2,15,0), Array(3,2,17,0), Array(3,2,17,1), Array(3,2,17,0), Array(3,2,24,0), Array(3,2,24,0), Array(3,2,27,0), Array(3,2,27,0), Array(2,1,3,0), Array(2,1,3,0), Array(2,1,4,0), Array(2,1,11,0), Array(2,1,11,0), Array(2,1,12,0), Array(3,3,32,0), Array(3,3,32,0), Array(3,3,33,0), Array(3,3,34,0), Array(3,3,34,0), Array(3,3,0,0), Array(2,0,5,0), Array(2,0,5,0), Array(3,3,0,0), Array(3,3,0,0), Array(3,3,8,0), Array(2,0,6,0), Array(2,0,13,0), Array(2,0,13,0), Array(2,0,20,0), Array(2,0,25,0), Array(3,3,8,0), Array(3,3,8,0), Array(3,3,15,0), Array(3,3,17,0), Array(2,0,7,0), Array(2,0,14,0), Array(2,0,16,0), Array(2,0,22,0), Array(3,3,17,0), Array(3,3,17,0), Array(3,3,21,0), Array(3,3,24,0), Array(2,0,1,0), Array(2,0,9,0), Array(2,0,23,0), Array(3,3,24,0), Array(3,3,24,0), Array(3,3,26,0), Array(3,3,27,0), Array(2,0,2,0), Array(2,0,10,0), Array(2,0,18,0), Array(3,3,27,0), Array(3,3,27,0), Array(3,3,28,0), Array(3,3,28,0), Array(3,3,28,0), Array(3,3,29,0), Array(3,3,29,0), Array(3,3,30,0), Array(3,3,30,0), Array(3,3,31,0), Array(3,3,31,0), Array(2,1,19,0), Array(3,4,32,2), Array(3,4,32,2), Array(3,4,0,2), Array(3,4,0,2), Array(3,4,8,2), Array(3,4,8,2), Array(3,4,17,2), Array(3,4,17,2), Array(3,4,24,2), Array(3,4,24,2), Array(3,4,27,2), Array(3,4,27,2), Array(3,4,28,2), Array(3,4,28,2), Array(3,4,29,2), Array(3,4,29,2), Array(3,4,30,2), Array(3,4,31,2), Array(1,3,35,0), Array(1,3,35,0), Array(1,3,36,0), Array(1,3,36,0), Array(1,3,37,0), Array(1,3,37,0), Array(3,3,8,2), Array(3,3,17,2), Array(3,3,28,2), Array(3,3,29,2), Array(3,3,35,0), Array(3,3,36,0), Array(3,3,37,0), Array(2,2,0,0), Array(2,2,8,0), Array(2,2,17,0), Array(2,2,24,0), Array(2,2,27,0), Array(2,3,0,0), Array(2,3,8,0), Array(2,3,17,0), Array(2,3,24,0), Array(2,3,27,0)); function defselect(sbox, string) { var si = sbox.selectedIndex; for (var i = sbox.options.length - 1; i >= 0; i--) { sbox.options[i] = null; sbox.options[0] = new Option(string, 0); } sbox.options[0].selected = true; } function getSelection(sbox) { var a = Array(); var j = 0; if (sbox.options[0].selected) return a; for (i = 1; i < sbox.options.length; i++) { if (sbox.options[i].selected) { a[j++] = sbox.options[i].value; } } return a; } // a contains the ID, d contains the descriptions, E is the index function contains(a, d, is_array, e) { if (a.length == 0) return true; if (is_array) { for(j=0;j= 0; i--) sbox.options[i] = null; sbox.options[0] = new Option("All " + name + " ------", 0); sbox.options[1] = new Option("Don't Know", -1); if (orig.length == 0 || orig[0] == 0) sbox.options[0].selected = true; if (orig.length == 1 && orig[0] == -1) sbox.options[1].selected = true; for (j = 0; j < opts.length; j++) { var value = ""; sbox.options[j+2] = new Option(describe[opts[j]], describe[opts[j]]); value = describe[opts[j]]; for (x = 0; x < orig.length; x++) { if (value == orig[x]) break; } if (x != orig.length) { sbox.options[j+2].selected = true; } } } function propagate(src) { var types = document.forms["srch"].types; var poles = document.forms["srch"].poles; var amps = document.forms["srch"].amperages; var volts = document.forms["srch"].voltages; if (src == "") { types.selectedIndex = poles.selectedIndex = amps.selectedIndex = volts.selectedIndex = 0; setSelection(types, "Types", T, 0, Array(), Array(), Array(), Array(), 0); setSelection(poles, "Poles", P, 1, Array(), Array(), Array(), Array(), 0); setSelection(amps, "Amperages", A, 2, Array(), Array(), Array(), Array(), 0); setSelection(volts, "Voltages", V, 3, Array(), Array(), Array(), Array(), 0); /* setSelection(types, "Types", T, 0, Array(), Array(), Array()); defselect(poles, "All Poles ------"); defselect(amps, "All Amperages ------"); defselect(volts, "All Voltages ------"); */ } else { var sel1 = getSelection(types); var sel2 = getSelection(poles); var sel3 = getSelection(amps); var sel4 = getSelection(volts); if ((sel1.length == 1 && sel1[0] <= 0)||(sel1.length==2&&sel1[0]<=0&&sel1[1]<=0)) sel1 = Array(); if ((sel2.length == 1 && sel2[0] <= 0)||(sel2.length==2&&sel2[0]<=0&&sel2[1]<=0)) sel2 = Array(); if ((sel3.length == 1 && sel3[0] <= 0)||(sel3.length==2&&sel3[0]<=0&&sel3[1]<=0)) sel3 = Array(); if ((sel4.length == 1 && sel4[0] <= 0)||(sel4.length==2&&sel4[0]<=0&&sel4[1]<=0)) sel4 = Array(); setSelection(types, "Types", T, 0, sel1, sel2, sel3, sel4, src=="types"); setSelection(poles, "Poles", P, 1, sel1, sel2, sel3, sel4, src=="poles"); setSelection(amps, "Amperages", A, 2, sel1, sel2, sel3, sel4, src=="amperages"); setSelection(volts, "Voltages", V, 3, sel1, sel2, sel3, sel4, src=="voltages"); } } function resetsearch() { var types = document.forms["srch"].types; var poles = document.forms["srch"].poles; var amps = document.forms["srch"].amperages; var volts = document.forms["srch"].voltages; // types.selectedIndex = poles.selectedIndex = // amps.selectedIndex = volts.selectedIndex = 0; }