var ref = document.referrer;
var xmlHttpObject = false;
if (typeof XMLHttpRequest != 'undefined') 
{
    xmlHttpObject = new XMLHttpRequest();
}
if (!xmlHttpObject) 
{
    try 
    {
        xmlHttpObject = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e) 
    {
        try 
        {
            xmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(e) 
        {
            xmlHttpObject = null;
        }
    }
}
function loadContent()
{
    xmlHttpObject.open('get','counter.php?ref='+ref);
    xmlHttpObject.onreadystatechange = handleContent;
    xmlHttpObject.send(null);
    return false;
}
function handleContent()
{
    if (xmlHttpObject.readyState == 4)
    {
        document.getElementById('counter').innerHTML = xmlHttpObject.responseText;
    }
}
