
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.form1.Category, "Small", "Small", "");
addOption(document.form1.Category, "Medium", "Medium", "");
addOption(document.form1.Category, "Large", "Large", "");
addOption(document.form1.Category, "Luxury", "Luxury", "");

}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.form1.SubCat);
addOption(document.form1.SubCat, "", "SubCat", "");

if(document.form1.Category.value == 'Small'){
addOption(document.form1.SubCat,"TOYOTA COROLLA(MANUAL)", "TOYOTA COROLLA(MANUAL)");
//addOption(document.form1.SubCat,"TOYOTA AVENSIS", "TOYOTA AVENSIS");
//addOption(document.form1.SubCat,"TOYOTA CAMRY", "TOYOTA CAMRY");
}
if(document.form1.Category.value == 'Medium'){
addOption(document.form1.SubCat,"TOYOTA AVENSIS(MANUAL)", "TOYOTA AVENSIS(MANUAL)");
addOption(document.form1.SubCat,"TOYOTA CAMRY(AUTOMATIC)", "TOYOTA CAMRY(AUTOMATIC)");
//addOption(document.form1.SubCat,"TOYOTA LANDCRUSIER JEEP", "TOYOTA LANDCRUSIER JEEP", "");
}
if(document.form1.Category.value == 'Large'){
addOption(document.form1.SubCat,"TOYOTA HIACE BUS 15 SEATER(MANUAL)", "TOYOTA HIACE BUS 15 SEATER(MANUAL)");
//addOption(document.form1.SubCat,"MERCEDES BENZ E - CLASS", "MERCEDES BENZ E - CLASS");
addOption(document.form1.SubCat,"TOYOTA COASTER BUS 30 SEATER(MANUAL)", "TOYOTA COASTER BUS 30 SEATER(MANUAL)");
addOption(document.form1.SubCat,"TOYOTA HILUX TRUCK 4x2(MANUAL)", "TOYOTA HILUX TRUCK 4x2(MANUAL)");
addOption(document.form1.SubCat,"TOYOTA HILUX TRUCK 4x4(MANUAL))", "TOYOTA HILUX TRUCK 4x4(MANUAL)");
}

if(document.form1.Category.value == 'Luxury'){
addOption(document.form1.SubCat,"MERCEDES BENZ E-240(AUTOMATIC)", "MERCEDES BENZ E-240(AUTOMATIC)");
addOption(document.form1.SubCat,"TOYOTA LAND CRUISER JEEP(AUTOMATIC)", "TOYOTA LAND CRUISER JEEP(AUTOMATIC)");
addOption(document.form1.SubCat,"RANGE ROVER HPS VOGUE(AUTOMATIC)", "RANGE ROVER HPS VOGUE(AUTOMATIC)");
//addOption(document.form1.SubCat,"BMW 5 SERIES(AUTOMATIC)", "BMW 5 SERIES(AUTOMATIC)");
addOption(document.form1.SubCat,"TOYOTA PRADO JEEP(AUTOMATIC)", "TOYOTA PRADO JEEP(AUTOMATIC)");

}



}
////////////////// 

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);
}

