function checkCR(evt) {

    var evt  = (evt) ? evt : ((event) ? event : null);

    var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);

    if ((evt.keyCode == 13) && (node.type=="text")) {return false;}

  }

  document.onkeypress = checkCR;
  function disableSubmit(whichButton)
{
    if (document.getElementById)
    {
        // this is the way the standards work
        document.getElementById(whichButton).disabled = true;
		 document.getElementById(whichButton).value = 'Processing...';
    }
    else if (document.all)
    {
        // this is the way old msie versions work
        document.all[whichButton].disabled = true;
		document.all[whichButton].value = 'Processing...';
    }
    else if (document.layers)
    {
        // this is the way nn4 works
        document.layers[whichButton].disabled = true;
		document.layers[whichButton].value = 'Processing...';
    }
}
<!-- Idea by:  Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web URL:  http://fineline.xs.mw -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL,width,height) {
day = new Date();
id = day.getTime();
real_width = width+20;
real_height = height+20;
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+real_width+",height="+real_height+"');");
}
// End -->

var url = "getCityState.php?id="; // The server-side script

function handleStateResponse() {
  if (http.readyState == 4) {
     // Split the comma delimited response into an array
    results = http.responseText.split("@");
	document.getElementById('county').options.length = 0;
	if(results.length == 1){
	document.getElementById('county').options[0] = new Option('All zones','3137');
	}
	for (var i = 0;i+1<results.length;i++){
		var nowresult = results[i].split("/");
		document.getElementById('county').options[i] = new Option(nowresult[0],nowresult[1]);
		}
  }
}
function handleCountryResponse() {
  if (http.readyState == 4) {
    // Split the comma delimited response into an array
    results = http.responseText.split("@");
	document.getElementById('state').options.length = 0;
	for (var i = 0;i<results.length;i++){
		if(i == 0){
			document.getElementById('state').options[i] = new Option('SELECT A STATE','');
		}else{
			var nowresult = results[i-1].split("/");
			document.getElementById('state').options[i] = new Option(nowresult[0],nowresult[1]);
		}
	}
  }
}
function searchhandleStateResponse() {
  if (http.readyState == 4) {
     // Split the comma delimited response into an array
    results = http.responseText.split("@");
	document.getElementById('search_county').options.length = 0;
		for (var i = 0;i<results.length;i++){
		if(i == 0){
			document.getElementById('search_county').options[i] = new Option('All Counties','');
		}else{
			var nowresult = results[i-1].split("/");
			document.getElementById('search_county').options[i] = new Option(nowresult[0],nowresult[1]);
		}
		}
  }
}
function searchhandleCountryResponse() {
  if (http.readyState == 4) {
    // Split the comma delimited response into an array
    results = http.responseText.split("@");
	document.getElementById('search_state').options.length = 0;
	for (var i = 0;i<results.length;i++){
		if(i == 0){
			document.getElementById('search_state').options[i] = new Option('All States','');
		}else{
			var nowresult = results[i-1].split("/");
			document.getElementById('search_state').options[i] = new Option(nowresult[0],nowresult[1]);
		}
	}
  }
}
function updateCityState() {
  var stateValue = document.getElementById("state").value;
  document.getElementById('county').options[0] = new Option('Loading Please Wait','');
  http.open("GET", url + escape(stateValue) + "&type=state&long=1", true);
  http.onreadystatechange = handleStateResponse;
  http.send(null);
}

function updateCountryState() {
  var countryValue = document.getElementById("country").value;
  document.getElementById('state').options[0] = new Option('Loading Please Wait','');
  http.open("GET", url + escape(countryValue) + "&type=country&long=1", true);
  http.onreadystatechange = handleCountryResponse;
  http.send(null);
}
function searchCityState() {
  var stateValue = document.getElementById("search_state").value;
  document.getElementById('search_county').options[0] = new Option('Loading Please Wait','');
  http.open("GET", url + escape(stateValue) + "&type=state", true);
  http.onreadystatechange = searchhandleStateResponse;
  http.send(null);
}

function searchCountryState() {
  var countryValue = document.getElementById("search_country").value;
  document.getElementById('search_state').options[0] = new Option('Loading Please Wait','');
  http.open("GET", url + escape(countryValue) + "&type=country", true);
  http.onreadystatechange = searchhandleCountryResponse;
  http.send(null);
}
function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object
function decision(message, url){
if(confirm(message)) location.href = url;
}