
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");
addOption(document.drop_list.Category,"Colorado", "Colorado");
addOption(document.drop_list.Category,"Texas", "Texas");
addOption(document.drop_list.Category,"Utah", "Utah");
}

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", "Scottsdale");
}

if(document.drop_list.Category.value == 'California'){
addOption(document.drop_list.SubCat3,"2", "Beverly Hills");
addOption(document.drop_list.SubCat3,"3", "San Diego");
addOption(document.drop_list.SubCat3,"4", "Dana Point");
}

if(document.drop_list.Category.value == 'Colorado'){
addOption(document.drop_list.SubCat3,"5", "Aspen");
}

if(document.drop_list.Category.value == 'Texas'){
addOption(document.drop_list.SubCat3,"6", "Dallas");
addOption(document.drop_list.SubCat3,"7", "Houston");
}

if(document.drop_list.Category.value == 'Utah'){
addOption(document.drop_list.SubCat3,"8", "Park City");
}

//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);
}

