var myTimer_adoption;
function disableEnterKey_adoption(e)
{
     var key_adoption;

     if(window.event)
          key_adoption = window.event.keyCode;     //IE
     else
          key_adoption = e.which;     //firefox

     if(key_adoption == 13)
          return false;
     else
		startTimer_adoption();
}
function startTimer_adoption() {
		clearTimeout(myTimer_adoption);								// Remove old timer
		myTimer_adoption = setTimeout('kbTimeout_adoption()',750);	
}
function kbTimeout_adoption() {
		updateCityState_adoption();
	}
var url_adoption = "/search_results.cfm?noscript=1&listing_type=8&requesttimeout=500&param="; // The server-side script
function handleHttpResponse_adoption() {
  if (http.readyState == 4) {
    // Split the comma delimited response into an array
    results = http.responseText.split(",");
	{
		var str = '';
		var elem = results;
		for(var i = 0; i < elem.length; i++)
	{
		str += "<a href=\"JavaScript:void(0)\" onClick=\"document.getElementById('adoption').value='" + elem[i] + "'\">" + elem[i] + "</a>";		
		str += "&nbsp;<span class=\"lighter\">&bull;</span>&nbsp;";
	}	
	document.getElementById('div_adoption').innerHTML = str;
	}
  }
}
function updateCityState_adoption() {
  var zipValue_adoption = document.getElementById("adoption").value;
  http.open("GET", url_adoption + escape(zipValue_adoption), true);
  http.onreadystatechange = handleHttpResponse_adoption;
  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
