// MLS Search function... this one displays or hides price criteria on search form
function changeDisplay(theChecked,theWhat) {
	var theNode;
	var theDisplay;
	/* alert("in changeDisplay. theWhat=" + theWhat + " theChecked = " + theChecked);  */
	if (theChecked == true)
		theDisplay = "";
	else
		theDisplay = "none";
	for (var i=1;;i++) {
		// Check if the getElementById method is available
		if (document.getElementById) {
			theNode = document.getElementById(theWhat + i);
			/* alert(theNode); */
			if (theNode == null) {
				return;
			}
		} else if (document.all) {
			// The alert lets me verify that I tested the path.
			alert("Running an older version of IE." + " May not be able to hide rows");
			theNode = document.all[theWhat + i];
			if (theNode == null){
				return;
			}
		} else {
			alert("Cannot change visibility of the display element." + " Was " + theWhat);
			return;
		}
		theNode.style.display = theDisplay;
	}
}
function hidePriceRangeRes(all) {
	var all = ["priceRangeRes"];
	for (var i = 0; i < all.length; i++) {
		changeDisplay(false, all[i]);
	}
}
function hidePriceRangeRnt(all) {
	var all = ["priceRangeRnt"];
	for (var i = 0; i < all.length; i++) {
		changeDisplay(false, all[i]);
	}
}
function priceRangeSelect() {
	formStr = document.searchForm.propType;
	formSelInd = formStr.selectedIndex;
	propTypeVal = formStr.options[formSelInd].value;
	// alert("Selected: " + propTypeVal);
	if (propTypeVal == "RNT") {
		show = ["priceRangeRnt"];
		hide = ["priceRangeRes"];
	} else {
		show = ["priceRangeRes"];
		hide = ["priceRangeRnt"];
	}
	for (var i = 0; i < show.length; i++) {
		changeDisplay(true, show[i]);
	}
	for (var i = 0; i < hide.length; i++) {
		changeDisplay(false, hide[i]);
	}
}
