
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category,"Arizona", "Arizona");
//addOption(document.drop_list.Category,"California", "California");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat3);
addOption(document.drop_list.SubCat3, "City", "City", "");
document.drop_list.SubCat3.disabled = false;

if(document.drop_list.Category.value == 'Arizona'){
addOption(document.drop_list.SubCat3,"1", "Phoenix");
addOption(document.drop_list.SubCat3,"2", "Scottsdale");
addOption(document.drop_list.SubCat3,"3", "Tempe");
addOption(document.drop_list.SubCat3,"6", "Chandler");
//addOption(document.drop_list.SubCat3,"4", "Tucson");

}

if(document.drop_list.Category.value == 'California'){
addOption(document.drop_list.SubCat3,"5", "San Diego");
}

//end subcat3
}




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);
}

