
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function movepic(img_name,img_src) {
document[img_name].src=img_src;
}


function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}

var downStrokeField;
function autojump(fieldName,nextFieldName,fakeMaxLength)
{
var myForm=document.forms[document.forms.length - 1];
var myField=myForm.elements[fieldName];
myField.nextField=myForm.elements[nextFieldName];

if (myField.maxLength == null)
   myField.maxLength=fakeMaxLength;

myField.onkeydown=autojump_keyDown;
myField.onkeyup=autojump_keyUp;
}

function autojump_keyDown()
{
this.beforeLength=this.value.length;
downStrokeField=this;
}

function autojump_keyUp()
{
if (
   (this == downStrokeField) && 
   (this.value.length > this.beforeLength) && 
   (this.value.length >= this.maxLength)
   )
   this.nextField.focus();
downStrokeField=null;
}

function pausecomp(millis) 
{
date = new Date();
var curDate = null;

do { var curDate = new Date(); } 
while(curDate-date < millis);
} 
function handleHttpResponse() {

  if (http.readyState == 4) {

    
if (http.responseText.indexOf('invalid') == -1) {


      // Split the comma delimited response into an array

      results = http.responseText.split(",");
	  
	  //document.getElementById('call_status').innerHTML = results[0];
	  pausecomp(3000);
	document.getElementById("call_status_in").style.display = "none";
	document.getElementById("call_status").style.display="inline";
	document.getElementById("pushtalk").style.visibility="hidden";
	
      //document.getElementById('num').innerHTML = results[0] + " matches found";

      //document.getElementById('state').value = results[1];

      
isWorking = false;


    
}


  }

}

var isWorking = false;


function updateResults() {

 
  
if (!isWorking && http) {

	
	
    var areaValue = document.getElementById("area").value;
	var phone_1Value = document.getElementById("phone_1").value;
	var phone_2Value = document.getElementById("phone_2").value;
	var delayValue = document.getElementById("delay").value;
	var mlsValue = document.getElementById("mls").value;
	
	if (areaValue.length == 3 && phone_1Value.length == 3 && phone_2Value.length == 4) {
	document.getElementById("call_status").style.display="none";
	document.getElementById("call_status_in").style.display = "inline";
	
    http.open("GET", "http://www.geniusrealty.com/maps/do_callback.php?area="+areaValue+"&phone_1="+phone_1Value+"&phone_2="+phone_2Value+"&delay="+delayValue+"&mls="+mlsValue+"", true);

    http.onreadystatechange = handleHttpResponse;

    
isWorking = true;


    http.send(null);

  }
  else {
  alert("Please input a valid phone number.");
  }
  
}


}

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(); 
// End -->