
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category,"COLORADO", "COLORADO");
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 == 'COLORADO'){
addOption(document.drop_list.SubCat3,"1", "ASPEN");
addOption(document.drop_list.SubCat3,"2", "BEAVER CREEK");
addOption(document.drop_list.SubCat3,"3", "DENVER");
//addOption(document.drop_list.SubCat3,"4", "STEAMBOAT SPRINGS");
}

if(document.drop_list.Category.value == 'UTAH'){
addOption(document.drop_list.SubCat3,"5", "PARK CITY");
addOption(document.drop_list.SubCat3,"6", "SALT LAKE 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);
}

