//-----------------------------------------------------------------------------
// Define and initialize an HttpRequest object for posting data.
//-----------------------------------------------------------------------------
  var HTTPREQUEST_COMPLETED   = 4;
  var HTTPREQUEST_SUCCESS			= 200;
	var _return = '';
  var Request = (window.XMLHttpRequest)? new XMLHttpRequest(): new ActiveXObject("MSXML2.XMLHTTP");

  function LogVisit(){
    Request.abort();
    Request.onreadystatechange = StateChangeHandler;
    var data = '';
    Request.open("post", "http://" + location.host + "/php/logvisit.php", true);
    Request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
    data = "host=" + encodeURIComponent(location.host)
    + "&referrer=" + encodeURIComponent(document.referrer)
    + "&page=" + encodeURIComponent(location.pathname) 
    + "&platform=" + encodeURIComponent(navigator.platform) 
    + "&browser=" + encodeURIComponent(navigator.userAgent) 
    + "&b_name=" + encodeURIComponent(navigator.appName) 
    + "&b_ver=" + encodeURIComponent(navigator.appVersion) 
    + "&b_lang=" + encodeURIComponent(navigator.browserLanguage) 
    + "&u_lang=" + encodeURIComponent(navigator.systemLanguage) 
    + "&s_width=" + screen.width 
    + "&s_height=" + screen.height
    + "&a_width=" + screen.availWidth
    + "&a_height=" + screen.availHeight
    + "&c_width=" + document.body.clientWidth 
    + "&c_height=" + document.body.clientHeight
    + "&color=" + screen.colorDepth
    + "&cookies=" + navigator.cookieEnabled
    + "&java=" + navigator.javaEnabled()
    + "&path=" + encodeURIComponent(location.pathname);
    Request.send(data);
  } // function LogVisit()
   
/*
  function LogExit(){
    Request.abort();
    Request.onreadystatechange = function(){return;};
    Request.open("post", "http://" + location.host + "/php/logexit.php", true);
    Request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
    Request.send('key='+_return);
  } // function LogExit()
*/
   
   function StateChangeHandler(){
     if (HTTPREQUEST_COMPLETED == Request.readyState){
       if (HTTPREQUEST_SUCCESS == Request.status){
				 _return = Request.responseText;
       }	// if (HTTPREQUEST_SUCCESS == Request.status)
       else{
          alert("Error: HTTP "
           + Request.status
           + " "
           + Request.statusText
           + " Please contact our WebMaster from the link on our Contact Us page explaining the error you received.  Thank you.");
       }	// ekse [if (HTTPREQUEST_SUCCESS == Request.status)]
     }	// if (HTTPREQUEST_COMPLETED == Request.readyState)
   }	// function myReadyStateChangeHandler()

