
function fillSurge(){ 
 // this function is used to fill the Surge list on load first is value, second is text 
addOption(document.drop_list_powSurge.Surge, "Floor", "Floor Racks", "");
addOption(document.drop_list_powSurge.Surge, "Seismic-certified", "Seismic-Certified RacksTM", "");
addOption(document.drop_list_powSurge.Surge, "Vari-Rack", "Vari-Rack", "");
addOption(document.drop_list_powSurge.Surge, "Portable", "Portable Racks", "");
addOption(document.drop_list_powSurge.Surge, "Wall-Mount", "Wall-Mount Racks & Shelves", "");
addOption(document.drop_list_powSurge.Surge, "Pull", "Pull & Turn Racks", "");
addOption(document.drop_list_powSurge.Surge, "Credenza", "Credenza Racks", "");
addOption(document.drop_list_powSurge.Surge, "Laminated", "Laminated Racks", "");
}

function SelectSubCat_powSurge(){
// ON selection of Surge this function will work

removeAllOptions(document.drop_list_powSurge.SubCat_powSurge);
removeAllOptions(document.drop_list_powSurge.Tier3_powSurge);
addOption(document.drop_list_powSurge.SubCat_powSurge, "", "Make a Selection", "");

if(document.drop_list_powSurge.Surge.value == 'rackmountlink'){
addOption(document.drop_list_powSurge.SubCat_powSurge,"", "No options");
}
if(document.drop_list_powSurge.Surge.value == 'compac'){
addOption(document.drop_list_powSurge.SubCat_powSurge,"ftaCorded8", "15A Corded");
addOption(document.drop_list_powSurge.SubCat_powSurge,"twaCorded8", "20A Corded");
}
if(document.drop_list_powSurge.Surge.value == 'compacstic'){
addOption(document.drop_list_powSurge.SubCat_powSurge,"ftaCorded9", "15A Corded");
}
if(document.drop_list_powSurge.Surge.value == 'gtf'){
addOption(document.drop_list_powSurge.SubCat_powSurge,"twaHard10", "20A Hardwired");
}
if(document.drop_list_powSurge.Surge.value == 'standalonehard'){
addOption(document.drop_list_powSurge.SubCat_powSurge,"twaSingle11", "20A Single-Circuit");
addOption(document.drop_list_powSurge.SubCat_powSurge,"twaMulti11", "20A Multi-Circuit");
}
}
////////////////// 
function SelectTier3_powSurge(){
removeAllOptions(document.drop_list_powSurge.Tier3_powSurge);
addOption(document.drop_list_powSurge.Tier3_powSurge, "", "Make a Selection", "");

if(document.drop_list_powSurge.SubCat_powSurge.value == 'ftaCorded8'){
addOption(document.drop_list_powSurge.Tier3_powSurge,"overunder17", "Over/Under Voltage Protection");
addOption(document.drop_list_powSurge.Tier3_powSurge,"rpc17", "Remote Power Control");
}
if(document.drop_list_powSurge.SubCat_powSurge.value == 'twaCorded8'){
addOption(document.drop_list_powSurge.Tier3_powSurge,"overunder18", "Over/Under Voltage Protection");
addOption(document.drop_list_powSurge.Tier3_powSurge,"rpc18", "Remote Power Control");
}
if(document.drop_list_powSurge.SubCat_powSurge.value == 'ftaCorded9'){
addOption(document.drop_list_powSurge.Tier3_powSurge,"", "No further options");
}
if(document.drop_list_powSurge.SubCat_powSurge.value == 'twaHard10'){
addOption(document.drop_list_powSurge.Tier3_powSurge,"", "No further options");
}
if(document.drop_list_powSurge.SubCat_powSurge.value == 'twaSingle11'){
addOption(document.drop_list_powSurge.Tier3_powSurge,"Standard19", "Standard");
addOption(document.drop_list_powSurge.Tier3_powSurge,"Isolated19", "Isolated Ground");
addOption(document.drop_list_powSurge.Tier3_powSurge,"IsolatedGTF19", "Isolated Ground with GTF");
}

if(document.drop_list_powSurge.SubCat_powSurge.value == 'twaMulti11'){
addOption(document.drop_list_powSurge.Tier3_powSurge,"Standard20", "Standard");
addOption(document.drop_list_powSurge.Tier3_powSurge,"IsolatedGTF20", "Isolated Ground with GTF");
addOption(document.drop_list_powSurge.Tier3_powSurge,"xsurge20", "Extra Surge Card");
addOption(document.drop_list_powSurge.Tier3_powSurge,"xsurgegtf20", "Extra Surge Card &amp; GTF");
}
}
/////////////////


/////////////////
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);
}
