
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "gtools", "General Hand Tools", "");
addOption(document.drop_list.Category, "ptools", "Power Tools", "");
addOption(document.drop_list.Category, "cequip", "Cutting & Welding Equipment", "");
addOption(document.drop_list.Category, "safety", "Safety & Fire Fighting Products ", "");
addOption(document.drop_list.Category, "lequip", "Lifting Equipment ", "");
addOption(document.drop_list.Category, "imp", "Industrial Maintenance Products", "");
addOption(document.drop_list.Category, "bm", "Building Materials ", "");
addOption(document.drop_list.Category, "wms", "Waste Management Systems ", "");

}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "Brands", "");

if(document.drop_list.Category.value == 'gtools'){
addOption(document.drop_list.SubCat,"general_htools.asp?command=view&id=11", "Unior");
addOption(document.drop_list.SubCat,"general_htools.asp?command=view&id=6", "Rothenberger");
addOption(document.drop_list.SubCat,"general_htools.asp?command=view&id=10", "Groz");
addOption(document.drop_list.SubCat,"general_htools.asp?command=view&id=7", "Freemans");
addOption(document.drop_list.SubCat,"general_htools.asp?command=view&id=9", "Irwin");
}
if(document.drop_list.Category.value == 'ptools'){
addOption(document.drop_list.SubCat,"power_tools.asp?command=view&id=2", "Powerbor");
addOption(document.drop_list.SubCat,"power_tools.asp?command=view&id=1", "Bosch");
addOption(document.drop_list.SubCat,"power_tools.asp?command=view&id=3", "Partner", "");
addOption(document.drop_list.SubCat,"power_tools.asp?command=view&id=4", "Rottluff", "");
addOption(document.drop_list.SubCat,"power_tools.asp?command=view&id=5", "Osborn", "");

}
if(document.drop_list.Category.value == 'cequip'){
addOption(document.drop_list.SubCat,"cutting_welding.asp?command=view&id=12", "Deca");
addOption(document.drop_list.SubCat,"cutting_welding.asp?command=view&id=13", "Uniweld");
addOption(document.drop_list.SubCat,"cutting_welding.asp?command=view&id=14", "Welspring Universal");
addOption(document.drop_list.SubCat,"cutting_welding.asp?command=view&id=15", "GekaTek");
}

if(document.drop_list.Category.value == 'safety'){
addOption(document.drop_list.SubCat,"safety_fire.asp?command=view&id=30", "Explosion Proof");
addOption(document.drop_list.SubCat,"safety_fire.asp?command=view&id=44", "Road Safety");
addOption(document.drop_list.SubCat,"safety_fire.asp?command=view&id=20", "Spill Tech");
addOption(document.drop_list.SubCat,"safety_fire.asp?command=view&id=21", "Helmet");
addOption(document.drop_list.SubCat,"safety_fire.asp?command=view&id=22", "Head Protection");
addOption(document.drop_list.SubCat,"safety_fire.asp?command=view&id=24", "Eye Protection");
addOption(document.drop_list.SubCat,"safety_fire.asp?command=view&id=25", "Hearing Protection");
addOption(document.drop_list.SubCat,"safety_fire.asp?command=view&id=26", "Respiratory Protection");
addOption(document.drop_list.SubCat,"safety_fire.asp?command=view&id=27", "Fall Protection");
addOption(document.drop_list.SubCat,"safety_fire.asp?command=view&id=28", "Hand Protection");
addOption(document.drop_list.SubCat,"safety_fire.asp?command=view&id=29", "Protective Clothing");
}

if(document.drop_list.Category.value == 'lequip'){
addOption(document.drop_list.SubCat,"lift_equip.asp?command=view&id=16", "Yale");
addOption(document.drop_list.SubCat,"lift_equip.asp?command=view&id=17", "George Taylor");
addOption(document.drop_list.SubCat,"lift_equip.asp?command=view&id=43", "Lifting Slings");
}

if(document.drop_list.Category.value == 'imp'){
addOption(document.drop_list.SubCat,"indus_maintenance.asp?command=view&id=18", "Devacon");

}

if(document.drop_list.Category.value == 'bm'){
addOption(document.drop_list.SubCat,"building_materials.asp?command=view&id=32", "General");
}

if(document.drop_list.Category.value == 'wms'){
addOption(document.drop_list.SubCat,"waste_management.asp?command=view&id=19", "Outdoor/Indoor Furnishing");
addOption(document.drop_list.SubCat,"waste_management.asp?command=view&id=19", "Steel Combi Containers");
addOption(document.drop_list.SubCat,"waste_management.asp?command=view&id=19", "Waste Containers");
addOption(document.drop_list.SubCat,"waste_management.asp?command=view&id=19", "Bio-medical Waste Contain:");
}

}
////////////////// 

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);
}
