var product=["Keyboard (only)" , "Keyboard (with pointer)" , "Mouse Pointer" , "USB FlightStick" , "Analog Joystick - \"F\" series" , "Motion Controller" , "Compumotor Motion Controller" , "Trackball"]


var c=[["NEMA 4 (IP66), OEM" , "NEMA 4 (IP66), Desktop, Aluminum Enclosure" , "NEMA 4X (IP66), Desktop, Stainless Steel Enclosure" , "Custom/Other (Please Specify)",""] , 
	   ["NEMA 4 (IP66), OEM w/ ArrowMouse" , "NEMA 4 (IP66), OEM w/ OrbitalMouse&reg;" , "NEMA 4X (IP66), Panel Mount w/ Industrial Mouse&trade;" , "NEMA 4 (IP66), Desktop, Aluminum Enclosure w/ ArrowMouse" , "NEMA 4X (IP66), Desktop, Stainless Steel Enclosure w/ ArrowMouse" , "NEMA 4 (IP66), Desktop, Aluminum Enclosure w/ Industrial Mouse&trade;" , "NEMA 4X (IP66), Desktop, Stainless Steel Enclosure w/ Industrial Mouse&trade;" , "NEMA 4 (IP66), Desktop, Aluminum Enclosure w/ OrbitalMouse&reg;" , "NEMA 4X (IP66), Desktop, Stainless Steel Enclosure w/ OrbitalMouse&reg;" , "NEMA 12 (IP54), Desktop, Aluminum Enclosure w/ Trackball Mouse" , "NEMA 12 (IP54), Desktop, Stainless Steel Enclosure w/ Trackball Mouse" , "NEMA 4 (IP66), RackMount, Aluminum Enclosure w/ ArrowMouse" , "NEMA 4 (IP66), RackMount, Aluminum Enclosure w/ Industrial Mouse&trade;" , "NEMA 4 (IP66), RackMount, Aluminum Enclosure w/ OrbitalMouse&reg;" , "NEMA 4 (IP66), RackMount, Aluminum Enclosure w/ Trackball Mouse" , "Custom/Other (Please Specify)",""],
	   ["OEM - Industrial Mouse&trade; (No Switchpad)" , "OEM - Industrial Mouse&trade; (3 Buttons)" , "OEM - OrbitalMouse&reg; (No Buttons)" , "OEM - OrbitalMouse&reg; (3 Buttons Integrated)" , "OEM - OrbitalMouse&reg; (w/ 3 Button Switchpad)" , "OEM - ArrowMouse" , "Panel Mount - Industrial Mouse&trade; (1 Button)" , "Panel Mount - Industrial Mouse&trade; (3 Buttons)" , "Handheld - Industrial Mouse&trade; (1 Button)" , "Handheld - Industrial Mouse&trade; (3 Buttons)" , "Handheld - OrbitalMouse&reg;" , "Desktop - Industrial Mouse&trade;" , "Desktop - OrbitalMouse&reg;" , "Desktop - Trackball" , "Custom/Other (Please Specify)",""],
	   ["NEMA 4 (IP66), OEM - USB FlightStick (No Switchpad)" , "NEMA 4 (IP66), OEM - USB FlightStick (3 Buttons)" , "NEMA 4 (IP66), Panel Mount - USB FlightStick (1 Button)" , "NEMA 4 (IP66), Panel Mount - USB FlightStick (3 Buttons)" , "NEMA 4 (IP66), Handheld - USB FlightStick (1 Button)" , "NEMA 4 (IP66), Handheld - USB FlightStick (3 Buttons)" , "NEMA 4 (IP66), Desktop - USB FlightStick" , "Custom/Other (Please Specify)",""],
	   ["NEMA 4 (IP66), OEM Industrial Joystick" , "Custom/Other (Please Specify)",""],
	   ["NEMA 4 (IP66), Hand Held - Industrial Analog Joystick" , ""],
	   ["NEMA 4 (IP66), Hand Held - Industrial Analog Joystick" , "Custom/Other (Please Specify)" , ""],
	   ["OEM" , "Panel Mount  (No Switches)" , "Panel Mount  (3 Switches)" , "Desktop (3 Switches)" , "Custom/Other (Please Specify)" , ""]
	  ]

var b=[   [["Mini KI6800 Series" , "Mini KI6800 Backlit Series", "Mid-Size KI8800 Series", "Full-Size KI9800 Series", ""] , ["Mini KI6000 Series" , "Mini KI6000 Backlit Series", "Full-Size KI9500 Series", ""] , ["Mini KI6600 Series", "Mini KI6600 Backlit Series", "Mid-Size KI8000 Series", "Full-Size KI9000 Series", ""] , ["Miniature" , "Mid-Size" , "Full-Size", "Other (Please Specify)", ""]],
		  [["Mini KIA6800 Series", "Mini KIA6800 Backlit Series", "Full-Size KIA9800 Series",""] , ["Mini KIO6800 Series" , "Mini KIO6800 Backlit Series", "Mid-Size KIO7800 Series", "Mid-Size KIO7800 Backlit Series",""] , ["Mid-Size KIF8900 Series" , "Full-Size KIF9900 Series",""] , ["Mini KIA6000 Series, Beige Enclosure", "Mini KIA6000 Series, Black Enclosure","Mini KIA6000 Backlit Series, Beige Enclosure", "Mini KIA6000 Backlit Series, Black Enclosure",""] , ["Mini KIA6600 Series","Mini KIA6000 Backlit Series", ""] , ["Mid-Size KIF8000 Series, Black Enclosure","Mid-Size KIF8000 Series, Beige Enclosure",""] , ["Mid-Size KIF8000 Series", "Full-Size KIF9000 Series",""] , ["Mini KIO6000 Series, Beige Enclosure", "Mini KIO6000 Series, Black Enclosure", "Mid-Size KIO7000 Series, Black Enclosure" , "Mid-Size KIO7000 Series, Beige Enclosure", "Mid-Size KIO8000 Series, Black Enclosure", "Mid-Size KIO8000 Series, Beige Enclosure", "Mid-Size KIO8000 Series, Black Enclosure", "Mid-Size KIO8000 Series, Beige Enclosure",""] , ["Mini KIO6600 Series", "Mid-Size KIO7000 Series", "Mid-Size KIO7000 Backlit Series", "Mid-Size KIO8000 Series",""] , ["Mid-Size KIT2x00 Series, Black Enclosure" , "Mid-Size KIT2x00 Series, Beige Enclosure", "Mini KIT6000 Series, Beige Enclosure", "Mini KIT6000 Series, Black Enclosure",""] , ["Mini KIT6600 Series",""] , ["Full-Size KIA3700 Series",""] , ["Mid-Size KIF3000 Series",""] , ["Full-Size KIO3700 Series, Beige Enclosure",""] , ["Mini KIO3700 Series, Beige Enclosure", "Mini KIO3700 Series, Black Enclosure",""] ,["Custom/Other - Please Fill Out Comment Section",""]],
		  [["Standard Joystick" , "Joystick w/ Push Button Switch" , "3 Axis Joystick",""] , ["Standard",""] , ["2.0\" Diameter Only",""] , ["Standard Joystick" , "Joystick w/ Push Button Switch" , "3 Axis Joystick",""] , ["1.5\" Diameter " , "2.0\" Diameter" , "3.0\" Diameter",""] , ["Standard Joystick" , "Joystick w/ Push Button Switch" , "3 Axis Joystick",""] , ["Standard",""] , ["Standard Joystick" , "Joystick w/ Push Button Switch" , "3 Axis Joystick",""] , ["Standard",""] , ["Standard",""] , ["Custom - Fill Out Comment Section",""]],
		  [["N2" , "N5" , "N24" , "N54",""] , ["N3 - Push Button Switch" , "N33 - Push Button Switch" , "N34 - 2 Push Button Switches" , "N63 - Push Button",""] , ["1850 - 3 Axis",""] , ["Custom - Fill Out Comment Section",""]],
		  [["N0" , "N04",""] , ["N32 - Push Button" , "N42 - Push Button" , "N62 - Push Button",""] , ["0800 - 3 Axis",""]],
		  [["2.0\" Diameter Only",""] , ["1.3\" Diameter" , "1.5\" Diameter" , "2.0\" Diameter" , "3.0\" Diameter",""] , ["1.3\" Diameter" , "1.5\" Diameter" , "2.0\" Diameter",""] , ["Custom - Fill Out Comment Section",""]]
		 ]

var a=[		   [[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""],["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""],["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""],["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""],["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""],["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""],["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""],["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""],["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""],["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""],["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""],["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Other (Please Specify)", ""]]],
			   [[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""] , ["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""] , ["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""],["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""] , ["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""] , ["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]],
				[["USB, 9.5 ft. Cable" , "USB, No Cable" , "PS/2, 9.5 ft. Cable" , "PS/2, No Cable" , "AT (5 Pin-Din), 6.0 ft. Cable" , "AT (5 Pin-Din), No Cable", "Don't Know - Help Me!", ""]]],
			   [[["PS/2" , "USB (mouse)" , "USB (flight stick)" , "AT" , "RS232" ,"Don't know",""] , ["PS/2" , "USB (mouse)" , "USB (flight stick)" , "AT" , "RS232" ,"Don't know",""] , ["PS/2" , "USB (mouse)" , "USB (flight stick)" , "AT" , "RS232" ,"Don't know",""]],
				[["PS/2" , "USB" ,"Don't know",""]],
				[["PS/2" , "USB" ,"Don't know",""]],
				[["PS/2" , "USB (mouse)" , "USB (flight stick)" , "RS232" ,"Don't know",""] , ["PS/2" , "USB (mouse)" , "USB (flight stick)" , "RS232" ,"Don't know",""] , ["PS/2" , "USB (mouse)" , "USB (flight stick)" , "RS232" ,"Don't know",""]],
				[["PS/2" , "USB" , "RS232" ,"Don't know",""] ,["PS/2" , "USB" , "RS232" ,"Don't know",""] ,["PS/2" , "USB" , "RS232" ,"Don't know",""]],
				[["PS/2" , "USB (mouse)" , "USB (flight stick)" , "RS232" ,"Don't know",""] , ["PS/2" , "USB (mouse)" , "USB (flight stick)" , "RS232" ,"Don't know",""] , ["PS/2" , "USB (mouse)" , "USB (flight stick)" , "RS232" ,"Don't know",""]],
				[["PS/2" , "USB" ,"Don't know",""]],
				[["PS/2" , "USB (mouse)" , "USB (flight stick)" , "RS232" ,"Don't know",""] , ["PS/2" , "USB (mouse)" , "USB (flight stick)" , "RS232" ,"Don't know",""] , ["PS/2" , "USB (mouse)" , "USB (flight stick)" , "RS232" ,"Don't know",""]],
				[["PS/2" , "USB" , "RS232" , "Don't know",""]],
				[["PS/2" , "USB" ,  "Don't know",""]],
				[["PS/2" , "USB (mouse)" , "USB (flight stick)" , "RS232" ,"Don't know",""]]],
			   [[["Voltage Input = +12" , "Voltage Input = +5" , "Voltage Input = +/-5" , "Voltage Input = +/-12" , "Don't Know",""] , ["Voltage Input = +12" , "Voltage Input = +5" , "Voltage Input = +/-5" , "Voltage Input = +/-12" , "Don't Know",""] ,["Voltage Input = +12" , "Voltage Input = +5" , "Voltage Input = +/-5" , "Voltage Input = +/-12" , "Don't Know",""] , ["Voltage Input = +12" , "Voltage Input = +5" , "Voltage Input = +/-5" , "Voltage Input = +/-12" , "Don't Know",""]],
				[["Voltage Input = +12" , "Voltage Input = +5" , "Voltage Input = +/-5" , "Voltage Input = +/-12" , "Don't Know",""] , ["Voltage Input = +12" , "Voltage Input = +5" , "Voltage Input = +/-5" , "Voltage Input = +/-12" , "Don't Know",""] ,["Voltage Input = +12" , "Voltage Input = +5" , "Voltage Input = +/-5" , "Voltage Input = +/-12" , "Don't Know",""] , ["Voltage Input = +12" , "Voltage Input = +5" , "Voltage Input = +/-5" , "Voltage Input = +/-12" , "Don't Know",""]],
				[["Voltage Input = +/-5" , "Voltage Input = +5" , "Don't Know",""]],
				[["Custom - Fill Out Comment Section",""]]],
			   [[["Voltage Input = +12" , "Voltage Input = +/-12" , "Voltage Input = +24" , "Voltage Input = +/-15" , "Voltage Input = +10" , "Voltage Input = +/-10" , "Don't Know",""] , ["Voltage Input = +12" , "Voltage Input = +/-12" , "Voltage Input = +24" , "Voltage Input = +/-15" , "Voltage Input = +10" , "Voltage Input = +/-10" , "Don't Know" ,""]],
				[["Voltage Input = +12" , "Voltage Input = +/-12" , "Voltage Input = +24" , "Voltage Input = +/-15" , "Voltage Input = +10" , "Voltage Input = +/-10" , "Don't Know",""] , ["Voltage Input = +12" , "Voltage Input = +/-12" , "Voltage Input = +24" , "Voltage Input = +/-15" , "Voltage Input = +10" , "Voltage Input = +/-10" , "Don't Know",""] , ["Voltage Input = +12" , "Voltage Input = +/-12" , "Voltage Input = +24" , "Voltage Input = +/-15" , "Voltage Input = +10" , "Voltage Input = +/-10" , "Don't Know",""]],
				[["Voltage Input = +12" , "Voltage Input = +/-12" , "Voltage Input = +24" , "Voltage Input = +/-15" , "Voltage Input = +10" , "Voltage Input = +/-10" , "Don't Know",""]]],
			   [[["PS/2" , "USB" , "RS232" , "Don't Know",""]],
				[["PS/2" , "USB" , "RS232" , "Quadrature Ribbon - Wire Output" , "Don't Know",""] , ["PS/2" , "USB" , "RS232" , "Quadrature Ribbon - Wire Output" , "Don't Know",""] , ["PS/2" , "USB" , "RS232" , "Quadrature Ribbon - Wire Output" , "Don't Know",""] , ["PS/2" , "USB" , "RS232" , "Quadrature Ribbon - Wire Output" , "Don't Know",""]],
				[["Quadrature Ribbon - Wire Output",""] , ["Quadrature Ribbon - Wire Output",""] , ["Quadrature Ribbon - Wire Output",""]],
				[["Custom - Fill Out Comment Section",""]]]
			  ]


function fillCategory(){ 
 // this function is used to fill the category list on load
 for(i=0;i<8;i++){addOption(document.getElementById('Category'),i, product[i])}
 for(i=0;i<8;i++){addOption(document.getElementById('Category2'),i, product[i])}
 for(i=0;i<8;i++){addOption(document.getElementById('Category3'),i, product[i])}
 }

function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}


function SelectSubCat(a){
// ON selection of category this function will work
switch(a){
case 1:  
	     document.getElementById('Category2').disabled=true;
		 removeAllOptions(document.drop_list.SubCat1);
		 removeAllOptions(document.drop_list.SubCat2);
		 removeAllOptions(document.drop_list.SubCat3);
         addOption(document.drop_list.SubCat1, "", "Select Style", "");
		 addOption(document.drop_list.SubCat2, "", "Select Size", "");
		 addOption(document.drop_list.SubCat3, "", "Select Interface", "");
		 var pr=document.drop_list.Category.value;
		 fillStyle(pr,a);
		 break;
case 2:
		document.getElementById('Category3').disabled=true;
		removeAllOptions(document.drop_list.SubCat12);
		removeAllOptions(document.drop_list.SubCat22);
		removeAllOptions(document.drop_list.SubCat32);
		addOption(document.drop_list.SubCat12, "", "Select Style", "");
		addOption(document.drop_list.SubCat22, "", "Select Size", "");
		addOption(document.drop_list.SubCat32, "", "Select Interface", "");
		var pr=document.drop_list.Category2.value;
		fillStyle(pr,a);
		break;
case 3:
		removeAllOptions(document.drop_list.SubCat13);
		removeAllOptions(document.drop_list.SubCat23);
		removeAllOptions(document.drop_list.SubCat33);
		addOption(document.drop_list.SubCat13, "", "Select Style", "");
		addOption(document.drop_list.SubCat23, "", "Select Size", "");
		addOption(document.drop_list.SubCat33, "", "Select Interface", "");
		var pr=document.drop_list.Category3.value;
		fillStyle(pr,a);
		break;
		}
}

function SelectSize(a){
// ON selection of category this function will work
switch(a){
case 1:
		 removeAllOptions(document.drop_list.SubCat2);
		 removeAllOptions(document.drop_list.SubCat3);
		 addOption(document.drop_list.SubCat2, "", "Select Size", "");
		 addOption(document.drop_list.SubCat3, "", "Select Interface", "");
		 var pr=document.drop_list.Category.value;
		 var st=document.drop_list.SubCat1.value;
		 fillSize(pr,st,a);
		 break;		 
case 2:
		removeAllOptions(document.drop_list.SubCat22);
		removeAllOptions(document.drop_list.SubCat32);
		addOption(document.drop_list.SubCat22, "", "Select Size", "");
		addOption(document.drop_list.SubCat32, "", "Select Interface", "");
		var pr=document.drop_list.Category2.value;
		var st=document.drop_list.SubCat12.value;
		fillSize(pr,st,a);
		break;
case 3:
		removeAllOptions(document.drop_list.SubCat23);
		removeAllOptions(document.drop_list.SubCat33);
		addOption(document.drop_list.SubCat23, "", "Select Size", "");
		addOption(document.drop_list.SubCat33, "", "Select Interface", "");
		var pr=document.drop_list.Category3.value;
		var st=document.drop_list.SubCat13.value;
		fillSize(pr,st,a);
		break;
		}
}

function SelectInterface(a){
// ON selection of category this function will work
switch(a){
case 1:
		removeAllOptions(document.drop_list.SubCat3);
		addOption(document.drop_list.SubCat3, "", "Select Interface", "");
		var pr=document.drop_list.Category.value;
		var st=document.drop_list.SubCat1.value;
		var sz=document.drop_list.SubCat2.value;
		fillInterface(pr,st,sz,1);
		break;		 
case 2:
		removeAllOptions(document.drop_list.SubCat32);
		addOption(document.drop_list.SubCat32, "", "Select Interface", "");
		var pr=document.drop_list.Category2.value;
		var st=document.drop_list.SubCat12.value;
		var sz=document.drop_list.SubCat22.value;
		fillInterface(pr,st,sz,a);
		document.getElementById('Category3').disabled=false;
		break;
case 3:
		removeAllOptions(document.drop_list.SubCat33);
		addOption(document.drop_list.SubCat33, "", "Select Interface", "");
		var pr=document.drop_list.Category3.value;
		var st=document.drop_list.SubCat13.value;
		var sz=document.drop_list.SubCat23.value;
		fillInterface(pr,st,sz,a);
		break;
		}
}

////////////////// 

////////////////////////////////////////

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}

function fillStyle(productCatagory,a){
	if(productCatagory !=""){
	switch(a){
		case 1:	i=parseInt(productCatagory);
		        j=0
					do{
						addOption(document.drop_list.SubCat1,j, c[i][j]);
						j++
					}while (c[i][j] !='')
				break;
		case 2:
				i=parseInt(productCatagory);
		        j=0
					do{
						addOption(document.drop_list.SubCat12,j, c[i][j]);
						j++
					}while (c[i][j] !='')
				break;
		case 3:
				i=parseInt(productCatagory);
				j=0
					do{
						addOption(document.drop_list.SubCat13,j, c[i][j]);
						j++
					}while (c[i][j] !='')
				break;
			}
	}
}

function fillSize(productCatagory,style,a){
    if(productCatagory !="" && style !=""){
	switch(a){
		case 1:
				 i=parseInt(productCatagory);
				 j=parseInt(style);
				 k=0
					do{
						addOption(document.drop_list.SubCat2,k, b[i][j][k]);
						k++
					}while (b[i][j][k] !='')
				break;
		case 2:
				 i=parseInt(productCatagory);
				 j=parseInt(style);
				 k=0
					do{
						addOption(document.drop_list.SubCat22,k, b[i][j][k]);
						k++
					}while (b[i][j][k] !='')
				break;
		case 3:
				 i=parseInt(productCatagory);
				 j=parseInt(style);
				 k=0
					do{
						addOption(document.drop_list.SubCat23,k, b[i][j][k]);
						k++
					}while (b[i][j][k] !='')
				break;
			}
	}
   }


function fillInterface(productCatagory,style,Interface,h){
		if(productCatagory != "" && style != "" && Interface != ""){
		switch(h){
		case 1:  i=parseInt(productCatagory);
		         j=parseInt(style);
	             k=parseInt(Interface);
				 l=0;
				 	do{
						addOption(document.drop_list.SubCat3,l, a[i][j][k][l]);
						l++
					}while (a[i][j][k][l] !='')
				break;
		case 2:
				 i=parseInt(productCatagory);
				 j=parseInt(style);
	             k=parseInt(Interface);
				 l=0
					do{
						addOption(document.drop_list.SubCat32,l, a[i][j][k][l]);
						l++
					}while (a[i][j][k][l] !='')
				break;
		case 3:
				i=parseInt(productCatagory);
				 j=parseInt(style);
	             k=parseInt(Interface);
				 l=0
					do{
						addOption(document.drop_list.SubCat33,l, a[i][j][k][l]);
						l++
					}while (a[i][j][k][l] !='')
				break;
			}	
		}
}

///  Enabling the other 2 category drop downs

function EnableCatagory(e){
	switch(e){
		case 1:	if (document.drop_list.SubCat3.value !=""){document.getElementById('Category2').disabled=false;}
		        break;
		case 2: if (document.drop_list.SubCat32.value !=""){document.getElementById('Category3').disabled=false;}
		        break;
	}
}

function DisableCatagory(e){
	switch(e){
		case 1:	if (!document.getElementById('Category2').disabled){
							document.getElementById('Category2').disabled=true;
							removeAllOptions(document.drop_list.SubCat12);
							removeAllOptions(document.drop_list.SubCat22);
							removeAllOptions(document.drop_list.SubCat32);
							addOption(document.drop_list.SubCat12, "", "Select Style", "");
							addOption(document.drop_list.SubCat22, "", "Select Size", "");
							addOption(document.drop_list.SubCat32, "", "Select Interface", "");
		            }
		        if (!document.getElementById('Category3').disabled){
							document.getElementById('Category3').disabled=true;
							removeAllOptions(document.drop_list.SubCat13);
							removeAllOptions(document.drop_list.SubCat23);
							removeAllOptions(document.drop_list.SubCat33);
							addOption(document.drop_list.SubCat13, "", "Select Style", "");
							addOption(document.drop_list.SubCat23, "", "Select Size", "");
							addOption(document.drop_list.SubCat33, "", "Select Interface", "");
					}
		        break;
		case 2: if (!document.getElementById('Category3').disabled){
							document.getElementById('Category3').disabled=true;
							removeAllOptions(document.drop_list.SubCat13);
							removeAllOptions(document.drop_list.SubCat23);
							removeAllOptions(document.drop_list.SubCat33);
							addOption(document.drop_list.SubCat13, "", "Select Style", "");
							addOption(document.drop_list.SubCat23, "", "Select Size", "");
							addOption(document.drop_list.SubCat33, "", "Select Interface", "");
					}
		        break;
	}
}

////// validate the form drop_list

//This is the javascript function that validates fields on the form. The form needs to be named 'drop_list'
//Validation happens on the author, title, and username fields. Validation on the Status field works only
//in Internet Explorer.
//The input name=value for fields on the form must match what is used in the javascript code.
function CheckTheForm()
{
if (document.drop_list.Name.value=="")
{
alert("Name is required!")
document.drop_list.Name.focus();return false
}

if (document.drop_list.Address.value=="")
{
alert("Address is required!")
document.drop_list.Address.focus();return false
}
if (document.drop_list.State.value=="")
{
alert("state is required!")
document.drop_list.State.focus();return false
}

if (document.drop_list.Phone.value=="" || !parseInt(document.drop_list.Phone.value))
{
alert("valid Phone Number is required!")
document.drop_list.Phone.focus();return false
}

if (document.drop_list.Title.value=="")
{
alert("Title/Dept is required!")
document.drop_list.Title.focus();return false
}

if (document.drop_list.Zip.value=="")
{
alert("Valid Postal Zip coid is required!")
document.drop_list.Zip.focus();return false
}
if (document.drop_list.Company.value=="")
{
alert("Company is required!")
document.drop_list.Company.focus();return false
}
if (document.drop_list.City.value=="")
{
alert("City is required!")
document.drop_list.City.focus();return false
}

if (document.drop_list.Country.value=="")
{
alert("Country is required!")
document.drop_list.Country.focus();return false
}

//This does validation of a valid email address... it cannot validate that the address works, but that it is 
//formatted like an email address should be (something@something.something)
if (document.drop_list.Email.value != "")
{
	if (document.drop_list.Email.value.indexOf("@") == -1 || document.drop_list.Email.value.length < 7)
		{
		alert("Sorry your Email address is not valid");
		document.drop_list.Email.focus();return false
		}
}

if (document.drop_list.Category.value=="")
{
alert("Product is required!")
document.drop_list.Category.focus();return false;
}
if (document.drop_list.SubCat1.value=="")
{
alert("Style is required!")
document.drop_list.SubCat1.focus();return false
}

if (document.drop_list.SubCat2.value=="")
{
alert("Size is required!")
document.drop_list.SubCat2.focus();return false
}

if (document.drop_list.SubCat3.value=="")
{
alert("Interface is required!")
document.drop_list.SubCat3.focus();return false
}

if (document.drop_list.hear_about.value=="")
{
alert("How did you hear about CTI? is required!")
document.drop_list.hear_about.focus();return false
}

if (document.drop_list.time_frame.value=="")
{
alert("Time Frame is required!")
document.drop_list.time_frame.focus();return false
}

if(!document.getElementById('Category2').disabled && document.getElementById('Category2').value!="" ){
		
			if (document.drop_list.Category2.value=="")
				{
					alert("Product is required!")
					document.drop_list.Category2.focus();return false
				}
			if (document.drop_list.SubCat12.value=="")
				{
					alert("Style is required!")
					document.drop_list.SubCat12.focus();return false
				}

			if (document.drop_list.SubCat22.value=="")
				{
					alert("Size is required!")
					document.drop_list.SubCat22.focus();return false
				}

			if (document.drop_list.SubCat32.value=="")
				{
					alert("Interface is required!")
					document.drop_list.SubCat32.focus();return false
				}
			
			
			if(!document.getElementById('Category3').disabled && document.getElementById('Category3').value!=""){
				if (document.drop_list.Category3.value=="")
				{
					alert("Product is required!")
					document.drop_list.Category3.focus();return false
				}
				if (document.drop_list.SubCat13.value=="")
				{
					alert("Style is required!")
					document.drop_list.SubCat13.focus();return false
				}

				if (document.drop_list.SubCat23.value=="")
				{
					alert("Size is required!")
					document.drop_list.SubCat23.focus();return false
				}

				if (document.drop_list.SubCat33.value=="")
				{
					alert("Interface is required!")
					document.drop_list.SubCat33.focus();return false
				}
			}
	}

}
