function updateCities(whichForm, rtype, cityValue) {
	var searchForm = 'searchform' + whichForm;
	var cityFrame = 'cityframe' + whichForm;
	var stateList = document.forms[searchForm].search_state;
	var selectedState = stateList.selectedIndex;
	if (selectedState <= 51) {
		var stateValue = stateList.options[selectedState].value;
		parent.frames[cityFrame].location.href = 'citymenu.php?search_state=' + stateValue + '&rtype=' + rtype + '&search_city=' + cityValue;
	} else {
		parent.frames[cityFrame].location.href = 'citymenu.php';
	}
}

function checkCityField(whichForm) {
	var cityFrame = 'cityframe' + whichForm;
	var searchForm = 'searchform' + whichForm;
	//alert(cityFrame);
	var selectedCity = parent.frames[cityFrame].document.cityform.search_city.selectedIndex;
	//alert(selectedCity);
	if (selectedCity != 0) {
		document.forms[searchForm].search_city.value = parent.frames[cityFrame].document.cityform.search_city.options[selectedCity].value;
	}
}

// if the selected state is a city-searchable state, display city search; otherwise hide it
function turnonLayer(whichLayer, selectedState) {
	var layerOn = (selectedState <= 51) ? 'block' : 'none';
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = layerOn;
	} else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = layerOn;
	} else if (document.layers) {
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = layerOn;
	}
}
	
