/*
 * GAddress
 * This hack was written by
 *   John Resig <jeresig@gmail.com>
 * More info can be found here:
 *   http://ejohn.org/projects/gaddress/
 */

function GAddress( a, c ) {
  var xmlhttp = false;
  try {
   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   try {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (E) {
    xmlhttp = false;
   }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }

  var l = new Array();
  xmlhttp.open("GET", "gaddress.cgi?a=" + escape(a), true);
  xmlhttp.onreadystatechange=function() {
   if (xmlhttp.readyState==4) {
    l = xmlhttp.responseText.split(',');
    if ( l[0] == '' )
      c( null, a );
    else
      c( new GPoint( l[0] - 0, l[1] - 0 ), a );
   }
  }
  xmlhttp.send(null)
}

