function initStats(base_uri, screen_tested)
{
    for(counter=0; counter<document.getElementsByTagName("a").length; ++counter)
    {
        var link = document.getElementsByTagName("a")[counter];
        if(link.href.indexOf(base_uri) == -1)
            link.onmousedown = externUri;
    }
    if(screen_tested == 0)
        sendScreenDimensions();
}

function getClientWidth()
{
    if (self.innerWidth) // all except Explorer
    {
        return self.innerWidth;
    }
    else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
    {
        return document.documentElement.clientWidth;
    }
    else if (document.body) // other Explorers
    {
        return document.body.clientWidth;
    }
}

function getClientHeight()
{
    if (self.innerHeight) // all except Explorer
    {
        return self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
    {
        return document.documentElement.clientHeight;
    }
    else if (document.body) // other Explorers
    {
        return document.body.clientHeight;
    }
}

function sendScreenDimensions()
{
    var screen_dimension = screen.width + "*" + screen.height;
    var inner_width = getClientWidth();
    var inner_height = getClientHeight();
    var color_depth = screen.colorDepth;
    xajax_stats(screen_dimension, inner_width, inner_height, color_depth);
}
    
function externUri()
{
    xajax_outgoingLinks(""+this.href+"");
}

