function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.state, "1", "Andhra Pradesh", "");
//addOption(document.drop_list.state, "Tamil Nadu", "30", "");
//addOption(document.drop_list.state, "Maharashtra", "20", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.city);

if(document.drop_list.state.value == '1'){
addOption(document.drop_list.city,"1","Adilabad");
addOption(document.drop_list.city,"2","Anantapur");
addOption(document.drop_list.city,"3","Chittoor");
addOption(document.drop_list.city,"4","Eluru");
addOption(document.drop_list.city,"5","Kadapa");
addOption(document.drop_list.city,"6","Kakinada");
addOption(document.drop_list.city,"7","Guntur");
addOption(document.drop_list.city,"8","Hyderabad");
addOption(document.drop_list.city,"9","Karimnagar");
addOption(document.drop_list.city,"10","Khammam");
addOption(document.drop_list.city,"11","Machilipatnam");
addOption(document.drop_list.city,"12","Kurnool");
addOption(document.drop_list.city,"13","Mahbubnagar");
addOption(document.drop_list.city,"14","Medak");
addOption(document.drop_list.city,"15","Nalgonda");
addOption(document.drop_list.city,"16","Nellore");
addOption(document.drop_list.city,"17","Nizamabad");
addOption(document.drop_list.city,"18","Prakasam");
addOption(document.drop_list.city,"19","Rajahmundry");
addOption(document.drop_list.city,"20","Rangareddy");
addOption(document.drop_list.city,"21","Srikakulam");
addOption(document.drop_list.city,"26","Vijayawada");
addOption(document.drop_list.city,"22","Visakhapatnam");
addOption(document.drop_list.city,"23","Vizianagaram");
addOption(document.drop_list.city,"24","Warangal");

}


//if(document.drop_list.Category.value == 'Games'){
//addOption(document.drop_list.SubCat,"Cricket", "Cricket");
//addOption(document.drop_list.SubCat,"Football", "Football");
//addOption(document.drop_list.SubCat,"Polo", "Polo", "");
//}
//if(document.drop_list.Category.value == 'Scripts'){
//addOption(document.drop_list.SubCat,"PHP", "PHP");
//addOption(document.drop_list.SubCat,"ASP", "ASP");
//addOption(document.drop_list.SubCat,"Perl", "Perl");
//}

}
////////////////// 

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);
}
