
  var theIP = null;
  var http_request = false;
  function fromServer()
  { if( http_request.readyState==4 )
    { if( http_request.status==200 )
      { theIP = http_request.responseText;
      }
      else
      { // uncomment next line if you want to show any error messages
        //alert('error: ' + http_request.responseText);
      }
    }
  }

  function makeSynchronousRequest(url, parameters) 
  {
    http_request = false;
    if( window.XMLHttpRequest ) 
    { // Mozilla, Safari,...
      http_request = new XMLHttpRequest();
      http_request.multipart = false;
      http_request.open('GET', url + parameters, false);
      http_request.onload = fromServer;
    } 
    else if (window.ActiveXObject) 
    { // IE
      try 
      { http_request = new ActiveXObject("Msxml2.XMLHTTP");
      } 
      catch (e) 
      { try
        { http_request = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {}
      }
      http_request.open('GET', url + parameters, false);
      http_request.onreadystatechange = fromServer;
    }
    if (!http_request) 
    { // uncomment next line if you want to show any error messages
      //alert('Cannot create XMLHTTP instance');
      return false;
    }
    http_request.send(null);
  }

  function getIP()
  {

    makeSynchronousRequest('get_ip_address.php','');
    return theIP;
  }

