//
// For a good site about this, see: http://jibbering.com/2002/4/httprequest.html
//

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) {
    try {
        xmlhttp = new XMLHttpRequest();
    } catch (e) {
        xmlhttp = false;
    }
}

var XML_HTTP_LAST_STATUS;

//
// logClientEvent(url): call this from client to log a non-server based event
//      (such as an agent invocation).   This disregards the actual return 
//      document, and also fails silently.  
//
function logClientEvent (url) {
    if (xmlhttp == null || !xmlhttp)
        return;
    xmlhttp.open("HEAD", url, true);
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4) {
            XML_HTTP_LAST_STATUS = xmlhttp.status;
        }
    }
    xmlhttp.send(null);
}

