var isInited = false;

//document.oncontextmenu = new Function("return false");

function init()
{
    isInited = true;
}

function showLrs2(sId1, sId2)
{
    showLr(sId1);
    showLr(sId2);
}

function showLrs3(sId1, sId2, sId3)
{
    showLr(sId1);
    showLr(sId2);
    showLr(sId3);
}

function switchLr(sIdOff, sIdOn)
{
    hideLr(sIdOff);
    showLr(sIdOn);
    parent.focus(); //Resolves an pixel error in firefox
}

function showLr(lrName)
{
    if (document.getElementById)
    {
        var elem;
        elem = document.getElementById(lrName);
        if (elem)
        {
            elem.style.display = "block";
        }
        else
        {
            // alert("ID \"" + lrName + "\" not found.");
        }
    }
}

function hideLr(lrName)
{
    if (document.getElementById)
    {
        var elem;
        elem = document.getElementById(lrName);
        if (elem)
        {
            elem.style.display = "none";
        }
        else
        {
            // alert("ID \"" + lrName + "\" not found.");
        }
    }
}

function lrPos(lrName, x, y)
{
    if (document.getElementById)
    {
        var elem;
        elem = document.getElementById(lrName);
        if (elem)
        {
            elem.style.left = x +  "px";
            elem.style.top = y + "px";
        }
        else
        {
            // alert("ID \"" + lrName + "\" not found.");
        }
    }
}

function lrPosX(lrName, x)
{
    if (document.getElementById)
    {
        var elem;
        elem = document.getElementById(lrName);
        if (elem)
        {
            elem.style.left = x +  "px";
        }
        else
        {
            // alert("ID \"" + lrName + "\" not found.");
        }
    }
}

function lrPosY(lrName, y)
{
    if (document.getElementById)
    {
        var elem;
        elem = document.getElementById(lrName);
        if (elem)
        {
            elem.style.top = y +  "px";
        }
        else
        {
            // alert("ID \"" + lrName + "\" not found.");
        }
    }
}

function openWin(sUrl, sWidth, sHeight)
{
    sWidth += 20;
    sHeight += 25;
    newWin = window.open(sUrl, "newWin" + getRandomInt(10000), "width=" + sWidth + ",height=" + sHeight + ",left=40,top=40,dependent=yes,location=no,resizable=no,scrollbars=no,status=no");
}

function getRandomInt(max)
{
    return Math.round( Math.random() * (max-1) );
}

function openLeanWin(sUrl, sWidth, sHeight)
{
    sWidth += 20;
    sHeight += 25;
    newWin = window.open(sUrl, "newWin" + getRandomInt(10000), "width=" + sWidth + ",height=" + sHeight + ",left=140,top=140,dependent=yes,location=no,resizable=no,scrollbars=no,status=no,menubar=no,toolbar=no");
}

function doPrintWindow()
{
    if (document.getElementById)
    {
        window.print();
    }
}

function makeVisibleLr(lrName)
{
    if (document.getElementById)
    {
        var elem;
        elem = document.getElementById(lrName);
        if (elem)
        {
            elem.style.visibility = "visible";
        }
    }
}

function makeInvisibleLr(lrName)
{
    if (document.getElementById)
    {
        var elem;
        elem = document.getElementById(lrName);
        if (elem)
        {
            elem.style.visibility = "hidden";
        }
    }
}

function doPrint()
{
    if ( document.getElementById && (is_ie6up || is_opera7 || is_moz || is_gecko || is_nav) )
    {
        window.print();
    }
}
