	var exit = "";
	function getCounties(){
		state = document.getElementById("state").value;
		ajax=ajaxInit();
		if (ajax) {
			ajax.open("GET", "http://www.freeforeclosuressale.com/js/counties.php?st="+state, true);
			ajax.onreadystatechange = function (){
				if (ajax.readyState == 4) {
					if (ajax.status == 200) {
						exit=ajax.responseText;
						select_innerHTML(document.getElementById("county"),exit); 
						select_innerHTML(document.getElementById("city")," ");     
					}
					else {
						alert(ajax.statusText);
					}
				}
			}
			ajax.send(null);
		}
	}
	
	
	var exit2;
	function getCities(){
		state = document.getElementById("state").value;
		county = document.getElementById("county").value;
		ajax=ajaxInit();
		if (ajax) {
			ajax.open("GET", ("http://www.freeforeclosuressale.com/js/cities.php?cn="+county+"&amp;st="+state).replace(/&amp;/g, '&'), true);
			ajax.onreadystatechange = function (){
				if (ajax.readyState == 4) {
					if (ajax.status == 200) {
						exit2=ajax.responseText;
						select_innerHTML(document.getElementById("city"),exit2);      
					}
					else {
						alert(ajax.statusText);
					}
				}
			}
			ajax.send(null);
		}
	}
	function goHomes(){
		state       = document.getElementById("state").value;
		county      = document.getElementById("county").value;
                county2     = county.replace(/-/, ' ');
                county3     = county2.toLowerCase().substr(0,1).toUpperCase()+county2.toLowerCase().substr(1);
                county4     = county.replace(/ /, '-');
		city        = document.getElementById("city").value;
                city2       = city.replace(/-/, ' ');
                city3       = city2.toLowerCase().substr(0,1).toUpperCase()+city2.toLowerCase().substr(1);
                city4       = city3.replace(/ /, '-');
		location.href=("http://www.freeforeclosuressale.com/homes.php?st="+state+"&amp;cn="+county4+"&amp;city="+city4).replace(/&amp;/g, '&');
	}

	function addOpenSearch(name,ext,meth){
		if ((typeof window.external == "object") && ((typeof window.external.AddSearchProvider == "unknown") || (typeof window.external.AddSearchProvider == "function"))){
			if ((typeof window.external.AddSearchProvider == "unknown") && meth == "p"){
				alert("This plugin uses POST which is not currently supported by Internet Explorer's implementation of OpenSearch.");
			}else{
				window.external.AddSearchProvider("http://www.freeforeclosuressale.com/search.xml");
			}
		}else{
			alert("You will need a browser which supports OpenSearch to install this plugin.");
		}
	}
