var browser = new getBrowser();

//------------------------------------------------
// Get client's browser
//------------------------------------------------

function getBrowser()
{
    var ua, s, i;

    this.IE    = false;  // Internet Explorer
    this.OP    = false;  // Opera
    this.NS    = false;  // Netscape
    this.version = null;

    ua = navigator.userAgent;

    s = "MSIE";
    if ((i = ua.indexOf(s)) >= 0)
    {
        this.IE = true;
        this.version = parseFloat(ua.substr(i + s.length));
        return;
    }

    s = "Opera";
    if ((i = ua.indexOf(s)) >= 0)
    {
        this.OP = true;
        this.version = parseFloat(ua.substr(i + s.length));
        return;
    }

    s = "Netscape6/";
    if ((i = ua.indexOf(s)) >= 0)
    {
        this.NS = true;
        this.version = parseFloat(ua.substr(i + s.length));
        return;
    }

    s = "Gecko";
    if ((i = ua.indexOf(s)) >= 0)
    {
        this.NS = true;
        this.version = 6.1;
        return;
    }
}
// end function



//------------------------------------------------
// Find object position
//------------------------------------------------

function findPosX(obj)
{
    var curleft = 0;
    if (obj.offsetParent)
    {
        while (obj.offsetParent)
        {
            curleft += obj.offsetLeft
            obj = obj.offsetParent;
        }
    }
    else if (obj.x)
        curleft += obj.x;

    return curleft;
}

function findPosY(obj)
{
    var curtop = 0;
    if (obj.offsetParent)
    {
        while (obj.offsetParent)
        {
            curtop += obj.offsetTop
            obj = obj.offsetParent;
        }
    }
    else if (obj.y)
        curtop += obj.y;
    return curtop;
}
// end functions

