
function fillSwitch(){ 
 // this function is used to fill the Switch list on load first is value, second is text 
addOption(document.drop_list_powSwitch.Switch, "Floor", "Floor Racks", "");
addOption(document.drop_list_powSwitch.Switch, "Seismic-certified", "Seismic-Certified RacksTM", "");
addOption(document.drop_list_powSwitch.Switch, "Vari-Rack", "Vari-Rack", "");
addOption(document.drop_list_powSwitch.Switch, "Portable", "Portable Racks", "");
addOption(document.drop_list_powSwitch.Switch, "Wall-Mount", "Wall-Mount Racks & Shelves", "");
addOption(document.drop_list_powSwitch.Switch, "Pull", "Pull & Turn Racks", "");
addOption(document.drop_list_powSwitch.Switch, "Credenza", "Credenza Racks", "");
addOption(document.drop_list_powSwitch.Switch, "Laminated", "Laminated Racks", "");
}

function SelectSubCat_powSwitch(){
// ON selection of Switch this function will work

removeAllOptions(document.drop_list_powSwitch.SubCat_powSwitch);
//removeAllOptions(document.drop_list_powSwitch.Tier3_powSwitch);
addOption(document.drop_list_powSwitch.SubCat_powSwitch, "", "Make a Selection", "");

if(document.drop_list_powSwitch.Switch.value == 'switchrackmount'){
addOption(document.drop_list_powSwitch.SubCat_powSwitch,"maintain1", "Maintained");
addOption(document.drop_list_powSwitch.SubCat_powSwitch,"moment1", "Momentary");
}
if(document.drop_list_powSwitch.Switch.value == 'wallplate'){
addOption(document.drop_list_powSwitch.SubCat_powSwitch,"maintain2", "Maintained");
addOption(document.drop_list_powSwitch.SubCat_powSwitch,"moment2", "Momentary");
}
if(document.drop_list_powSwitch.Switch.value == 'replacementswitch'){
addOption(document.drop_list_powSwitch.SubCat_powSwitch,"", "No further options");
}
if(document.drop_list_powSwitch.Switch.value == 'momentaryswitch'){
addOption(document.drop_list_powSwitch.SubCat_powSwitch,"surfacemnt", "Surface-Mount");
}
}
////////////////// 

/////////////////


/////////////////
function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}
