
function fillMaterial(){ 
 // this function is used to fill the Material list on load
addOption(document.drop_list.Material, "Metal", "Metal", "");
addOption(document.drop_list.Material, "Plastic", "Plastic", "");

}

function SelectProduct(){
// ON selection of Material this function will work

removeAllOptions(document.drop_list.Product);
addOption(document.drop_list.Product, "Products:", "Product", "");

if(document.drop_list.Material.value == 'Metal'){
addOption(document.drop_list.Product,"Insert Check Valves","ICV");
addOption(document.drop_list.Product,"Insert Relief Valves","IRV");
addOption(document.drop_list.Product,"Insert Orifices","IO");
addOption(document.drop_list.Product,"Insert Restrictor Check Valves","IRCV");
addOption(document.drop_list.Product,"Insert Flow Controls","IFC");
addOption(document.drop_list.Product,"Insert Shuttle Valves","ISV");
addOption(document.drop_list.Product,"Insert Safety Screens","ISS");
addOption(document.drop_list.Product,"Lee BetaPlugs","LB");
}
if(document.drop_list.Material.value == 'Plastic'){
addOption(document.drop_list.Product,"Check Valves","CV");
addOption(document.drop_list.Product,"Relieft Valves","RV");
addOption(document.drop_list.Product,"Orifices","O");
addOption(document.drop_list.Product,"Flow Controls","FC");
addOption(document.drop_list.Product,"Restrictor Check Valves","RCV");
addOption(document.drop_list.Product,"Safety Screens","SC");
addOption(document.drop_list.Product,"Products in Plastic Fittings","PIPF");
}


}

/////OK to here

function SelectSize(){
// ON selection of Material this function will work

removeAllOptions(document.drop_list.Size);
addOption(document.drop_list.Size, "Sizes:", "Size", "");

if(document.drop_list.Product.value == 'ICV'){
addOption(document.drop_list.Size,"5.5mm Check Valves","55CV");
addOption(document.drop_list.Size,"8.0mm Check Valves","80CV");
addOption(document.drop_list.Size,"Show All","ICV-All");
}

if(document.drop_list.Product.value == 'IRV'){
addOption(document.drop_list.Size,"5.5mm Relief Valves","55RV");
addOption(document.drop_list.Size,"8.0mm Relief Valves","80RV");
}

if(document.drop_list.Product.value == 'IO'){
addOption(document.drop_list.Size,"2.5mm Orifices for Liquids","25OL");
addOption(document.drop_list.Size,"2.5mm Orifices for Gases","25OG");
addOption(document.drop_list.Size,"5.5mm Orifices for Liquids","55OL");
addOption(document.drop_list.Size,"5.5mm Orifices for Gases","55OG");
addOption(document.drop_list.Size,"8.0mm Orifices for Liquids","80OL");
addOption(document.drop_list.Size,"8.0mm Orifices for Gases","80OG");
}

if(document.drop_list.Product.value == 'IRCV'){
addOption(document.drop_list.Size,"5.5mm Restrictor Checks","55RC");
}

if(document.drop_list.Product.value == 'IFC'){
addOption(document.drop_list.Size,"5.5mm Flow Controls","55FC");
addOption(document.drop_list.Size,"8.0mm Flow Controls","85FC");
}

if(document.drop_list.Product.value == 'ISV'){
addOption(document.drop_list.Size,"5.5mm Shuttle Valve","55SV");
addOption(document.drop_list.Size,"8.0mm Shuttle Valve","85SV");
}

if(document.drop_list.Product.value == 'ISS'){
addOption(document.drop_list.Size,"5.5mm Insert Screen","55IS");
addOption(document.drop_list.Size,"8.0mm Insert Screen","80IS");
addOption(document.drop_list.Size,"10.0mm Insert Screen","100IS");
addOption(document.drop_list.Size,"12.0mm Insert Screen","120IS");
addOption(document.drop_list.Size,"5.5mm High Pressure Cartridge Screen","55HPCS");
addOption(document.drop_list.Size,"5.5mm Insert Retainer","55IR");
addOption(document.drop_list.Size,"8.0mm High Pressure Cartridge Screen","80HPCS");
addOption(document.drop_list.Size,"8.0mm Insert Retainer","80IR");
addOption(document.drop_list.Size,"10.0mm High Pressure Cartridge Screen","100HPCS");
addOption(document.drop_list.Size,"12.0mm Insert Retainer","120IR");
}


}

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

function SelectModel(){
// ON selection of Material this function will work

removeAllOptions(document.drop_list.Model);
addOption(document.drop_list.Model, "Models:", "Model", "");

if(document.drop_list.Size.value == '55CV'){
addOption(document.drop_list.Model,"558 Reverse","558R.htm");
addOption(document.drop_list.Model,"558 Forward","558F.htm");
addOption(document.drop_list.Model,"558 Screened Reverse","558SR.htm");
addOption(document.drop_list.Model,"558 Screened Forward","558SF.htm");
addOption(document.drop_list.Model,"558 Ceramic Ball Reverse","558CBR.htm");
addOption(document.drop_list.Model,"558 Ceramic Ball Forward","558CBF.htm");
}

if(document.drop_list.Size.value == '80CV'){
addOption(document.drop_list.Model,"855 Reverse","1");
addOption(document.drop_list.Model,"855 Forward","2");
addOption(document.drop_list.Model,"855 Screened Reverse","3");
addOption(document.drop_list.Model,"855 Screened Forward","4");
addOption(document.drop_list.Model,"832 Reserve Side Exit","5");
addOption(document.drop_list.Model,"832 Forward Side Exit","6");
}

if(document.drop_list.Size.value == 'ICV-All'){
addOption(document.drop_list.Model,"All Check Valves","ICV-All-Show");
}

}


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


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

// Show All interrupts go here

if(value=="ICV-All-Show"){
document.location.href="ICV-All-Show.htm";
}


// Or go to the end

	selectbox.options.add(optn);
}

