
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "a", "North", "");
addOption(document.drop_list.Category, "e", "East", "");
addOption(document.drop_list.Category, "c", "Central", "");
addOption(document.drop_list.Category, "d", "West", "");
addOption(document.drop_list.Category, "b", "South", "");

}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "first.htm", "Select City");

if(document.drop_list.Category.value == 'a'){
addOption(document.drop_list.SubCat,"agra.html", "Agra");	
addOption(document.drop_list.SubCat,"ambala.html", "Ambala");
addOption(document.drop_list.SubCat,"chandigarh.html", "Chandigarh");
addOption(document.drop_list.SubCat,"dehradun.html", "Dehradun");
addOption(document.drop_list.SubCat,"delhi.html", "Delhi");
addOption(document.drop_list.SubCat,"ghaziabad.html", "Ghaziabad");
addOption(document.drop_list.SubCat,"gurgoan.html", "Gurgaon");
addOption(document.drop_list.SubCat,"jaipur.html", "Jaipur");
addOption(document.drop_list.SubCat,"jammu.html", "Jammu");
addOption(document.drop_list.SubCat,"lucknow.html", "Lucknow");
}

if(document.drop_list.Category.value == 'b'){
addOption(document.drop_list.SubCat,"bangalore.html", "Bangalore");
addOption(document.drop_list.SubCat,"chennai.html", "Chennai");
addOption(document.drop_list.SubCat,"palakkad.html", "Palakkad", "");
addOption(document.drop_list.SubCat,"secunderabad.html", "Secunderabad", "");
}

if(document.drop_list.Category.value == 'c'){
addOption(document.drop_list.SubCat,"indore.html", "Indore");
addOption(document.drop_list.SubCat,"nagpur.html", "Nagpur");

}
if(document.drop_list.Category.value == 'd'){
addOption(document.drop_list.SubCat,"ahmedabad.html", "Ahmedabad");
addOption(document.drop_list.SubCat,"mumbai.html", "Mumbai");
addOption(document.drop_list.SubCat,"pune.html", "Pune");
}

if(document.drop_list.Category.value == 'e'){
addOption(document.drop_list.SubCat,"bhubaneshwar.html", "Bhubaneshwar");
addOption(document.drop_list.SubCat,"guwahati.html", "Guwahati");
addOption(document.drop_list.SubCat,"jamshedpur.html", "Jamshedpur");
addOption(document.drop_list.SubCat,"kolkata.html", "Kolkata");
}

}
////////////////// 

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);
}
