
//**SHOW/HIDE widget**
//List the IDS for the elements you want to hide and show
var ids=new Array('commercial','residential','lotsAndLand');


function showThisElement(id){	
	hideAll();
	showSelected(id);
}

function hideAll(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showSelected(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

//**Filter function** - removes non-number characters from MLS number...
function stringFilter (input) {
      s = input.value;
      filteredValues = "LlRrCc";     // Characters stripped out
      var i;
      var returnString = "";
      for (i = 0; i < s.length; i++) {  // Search through string and append to unfiltered values to returnString.
            var c = s.charAt(i);
            if (filteredValues.indexOf(c) == -1) returnString += c;
      }
      input.value = returnString;
}

