function fillMainCat(){ 
 // this function is used to fill the MainCat list on load
addOption(document.drop_list.MainCat, "Trash_items", "Trash_items", "");
addOption(document.drop_list.MainCat, "Garbage_items", "Garbage_items", "");
addOption(document.drop_list.MainCat, "Recycled_items", "Recycled_items", "");
addOption(document.drop_list.MainCat, "Industrial_items", "Industrial_items", "");
}

function SelectCategory1(){
removeAllOptions(document.drop_list.Category1);
addOption(document.drop_list.Category1, "", "SubCat", "");

if(document.drop_list.MainCat.value == 'Trash_items'){
addOption(document.drop_list.Category1,"ROT|Roll Off Temporary", "ROT|Roll Off Temporary");
addOption(document.drop_list.Category1,"ROP|Roll Off Permanent", "ROP|Roll Off Permanent");
addOption(document.drop_list.Category1,"Compactor|Compactor", "Compactor|Compactor");
}
if(document.drop_list.MainCat.value == 'Garbage_items'){
addOption(document.drop_list.Category1,"FEL|Front End Load", "FEL|Front End Load");
addOption(document.drop_list.Category1,"Compactor|Compactor", "Compactor|Compactor");
}
if(document.drop_list.MainCat.value == 'Recycled_items'){
addOption(document.drop_list.Category1,"FEL|Front End Load", "FEL|Front End Load");
addOption(document.drop_list.Category1,"Compactor|Compactor", "Compactor|Compactor");
}
if(document.drop_list.MainCat.value == 'Industrial_items'){
addOption(document.drop_list.Category1,"ROT|Roll Off Temporary", "ROT|Roll Off Temporary");
addOption(document.drop_list.Category1,"ROP|Roll Off Permanent", "ROP|Roll Off Permanent");
addOption(document.drop_list.Category1,"Compactor|Compactor", "Compactor|Compactor");
}
}
////////////////// 


function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "SubCat", "");

if(document.drop_list.Category1.value == 'Compactor|Compactor'){
addOption(document.drop_list.SubCat,"CY40s|40 cubic yard stationary (dry waste)", "CY40s|40 cubic yard stationary (dry waste)");
addOption(document.drop_list.SubCat,"CY34sc|34 cubic yard self contained (wet waste)", "CY34sc|34 cubic yard self contained (wet waste)");
addOption(document.drop_list.SubCat,"CY30sc|30 cubic yard self contained (wet waste)", "CY30sc|30 cubic yard self contained (wet waste)");
}
if(document.drop_list.Category1.value == 'ROT|Roll Off Temporary'){
addOption(document.drop_list.SubCat,"CY20|20 cubic yard", "CY20|20 cubic yard");
addOption(document.drop_list.SubCat,"CY30|30 cubic yard", "CY20|30 cubic yard");
addOption(document.drop_list.SubCat,"CY40|40 cubic yard", "CY20|40 cubic yard");
}
if(document.drop_list.Category1.value == 'ROP|Roll Off Permanent'){
addOption(document.drop_list.SubCat,"CY20|20 cubic yard", "CY20|20 cubic yard");
addOption(document.drop_list.SubCat,"CY30|30 cubic yard", "CY20|30 cubic yard");
addOption(document.drop_list.SubCat,"CY40|40 cubic yard", "CY20|40 cubic yard");
}
if(document.drop_list.Category1.value == 'FEL|Front End Load'){
addOption(document.drop_list.SubCat,"CY2|2 cubic yard", "CY2|2 cubic yard");
addOption(document.drop_list.SubCat,"CY4|4 cubic yard", "CY4|4 cubic yard");
addOption(document.drop_list.SubCat,"CY6|6 cubic yard", "CY6|6 cubic yard");
addOption(document.drop_list.SubCat,"CY8|8 cubic yard", "CY8|8 cubic yard");
}
}
////////////////// 

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;
if(value=="Perl"){
optn.setAttribute("selected","selected");}

	selectbox.options.add(optn);
}
