
function fillCategory(){ 
 // this function is used to fill the category list on load
	addOption(document.drop_list.Category, "Ready Meals", "Ready Meals", "");
	addOption(document.drop_list.Category, "Canned Meats", "Canned Meats", "");
	addOption(document.drop_list.Category, "Meat Products", "Meat Products", "");
	addOption(document.drop_list.Category, "Seafood Products", "Seafood Products", "");
	addOption(document.drop_list.Category, "Sauces", "Sauces", "");
	addOption(document.drop_list.Category, "Spices Perfection", "Spices Perfection", "");
	document.drop_list.SubCat.disabled = true;
	document.drop_list.Prod.disabled = true;
}

function SelectSubCat(){
//ON selection of category this function will work
document.drop_list.SubCat.disabled = false;
removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "Select", "");

if(document.drop_list.Category.value == 'Ready Meals'){
	addOption(document.drop_list.SubCat,"Vegetarian", "Vegetarian");
	addOption(document.drop_list.SubCat,"Meat", "Meat");
	addOption(document.drop_list.SubCat,"Rices", "Rices");
	
}

if(document.drop_list.Category.value == 'Canned Meats'){
	addOption(document.drop_list.SubCat,"Corned Beef", "Corned Beef");
	addOption(document.drop_list.SubCat,"Corned Mutton", "Corned Mutton");
	addOption(document.drop_list.SubCat,"Chicken Products", "Chicken Products");
	
}

if(document.drop_list.Category.value == 'Meat Products'){
	addOption(document.drop_list.SubCat,"Sausages", "Sausages");
	addOption(document.drop_list.SubCat,"Meatballs", "Meatballs");
}

if(document.drop_list.Category.value == 'Seafood Products'){
	addOption(document.drop_list.SubCat,"Tuna Product", "Tuna Product");
}

if(document.drop_list.Category.value == 'Sauces'){
	addOption(document.drop_list.SubCat,"Indian/Curries", "Indian/Curries");
	addOption(document.drop_list.SubCat,"Tomato Sauces", "Tomato Sauces");
}

if(document.drop_list.Category.value == 'Spices Perfection'){
	addOption(document.drop_list.SubCat,"Spice Perfection Brand", "Spice Perfection Brand");
	
}

}////////////////// 


function SelectProduct(){
//PRODUCT SELECT
document.drop_list.Prod.disabled = false;
removeAllOptions(document.drop_list.Prod);
addOption(document.drop_list.Prod, "", "Select", "");

if(document.drop_list.SubCat.value == 'Vegetarian'){
	addOption(document.drop_list.Prod,"../tasteofindia/vegetarian_collection.html", "Taste of India Vegetarian Collection 400g");
	addOption(document.drop_list.Prod,"../tasteofindia/dhal_collection.html", "Taste of India Dhal Collection 400g");
	addOption(document.drop_list.Prod,"../tasteofindia", "Taste of India Dhal Soup (Can)");
	addOption(document.drop_list.Prod,"../tasteofindia", "Taste of India Bombay Dhal (Can)");
}

if(document.drop_list.SubCat.value == 'Meat'){
	addOption(document.drop_list.Prod,"../tasteofindia/meat_curry_collection.html", "Taste of India Meat Collection 400g");
	addOption(document.drop_list.Prod,"../tasteofindia/meat_curry_collection.html", "Taste of India Meat Curries (Catering)");
}

if(document.drop_list.SubCat.value == 'Rices'){
	addOption(document.drop_list.Prod,"../tasteofrice", "Taste of Rice Brand");
}



if(document.drop_list.SubCat.value == 'Corned Beef'){
	addOption(document.drop_list.Prod,"../goldencountry", "Golden Country Brand");
	addOption(document.drop_list.Prod,"../oxandford", "Ox&ford Brand");
	addOption(document.drop_list.Prod,"../ikuna", "Ikuna Brand");
	addOption(document.drop_list.Prod,"../islands", "Islands Brand");
	addOption(document.drop_list.Prod,"../oxford", "Oxford Brand");
}

if(document.drop_list.SubCat.value == 'Corned Mutton'){
	addOption(document.drop_list.Prod,"../goldencountry", "Golden Country Brand");
	addOption(document.drop_list.Prod,"../canterbury", "Canterbury Brand");
}

if(document.drop_list.SubCat.value == 'Chicken Products'){
	addOption(document.drop_list.Prod,"../tiffinluncheon", "Tiffin Chicken");
	addOption(document.drop_list.Prod,"../tiffinluncheon", "Tiffin Sandwich Fillers (In Production)");
	addOption(document.drop_list.Prod,"../firstchoice", "First Choice Chicken Curry");
}

if(document.drop_list.SubCat.value == 'Sausages'){
	addOption(document.drop_list.Prod,"../toptaste", "Top Taste Pre-cooked Lamb");
	addOption(document.drop_list.Prod,"../toptaste", "Top Taste Premium");
	addOption(document.drop_list.Prod,"../firstchoice", "First Choice Frankfurters");
	addOption(document.drop_list.Prod,"../farmers", "Farmers BBQ Lamb");
}

if(document.drop_list.SubCat.value == 'Meatballs'){
	addOption(document.drop_list.Prod,"../firstchoice", "First Choice Lamb");
	addOption(document.drop_list.Prod,"../firstchoice", "First Choice Lamb Cherios");
	addOption(document.drop_list.Prod,"../firstchoice", "First Choice Chicken Cherios");
}

if(document.drop_list.SubCat.value == 'Tuna Product'){
	addOption(document.drop_list.Prod,"../tiffin", "Tiffin Tuna Meals (In Production)");
	addOption(document.drop_list.Prod,"../tiffin", "Tiffin Slice (In Production)");
}

if(document.drop_list.SubCat.value == 'Indian/Curries'){
	addOption(document.drop_list.Prod,"../tasteofindia/simmer_sauces_collection.html", "Taste of India Simmer Sauces (Catering)");
	addOption(document.drop_list.Prod,"../tasteofindia/simmer_sauces_collection.html", "Taste of India Curry Sauce (Can)");
}

if(document.drop_list.SubCat.value == 'Tomato Sauces'){
	addOption(document.drop_list.Prod,"../redtop", "Red Top Brand");
	addOption(document.drop_list.Prod,"../redtop", "Red Top Pizza Sauce");
}

if(document.drop_list.SubCat.value == 'Spice Perfection Brand'){
	addOption(document.drop_list.Prod,"../spiceperfection", "Spice Perfection Brand");
	
}

}///////////////////




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);
}




