/////////////////////////////////////////////////////////////////////////////
// All Javascript Code
// (c) Copyright 2006 Rob Tietje
// All Rights Reserved.
//
// Proverbs 3:5-6
//
function Firefox()  { return navigator.userAgent.toLowerCase().indexOf('firefox') != -1; }
function IE()       { return navigator.userAgent.toLowerCase().indexOf('msie') != -1; }
function Opera()    { return navigator.userAgent.toLowerCase().indexOf('opera') != -1; }
function Netscape() { return navigator.userAgent.toLowerCase().indexOf('netscape') != -1; }
function Safari()   { return navigator.userAgent.toLowerCase().indexOf('safari') != -1; }
function Mac()      { return navigator.userAgent.toLowerCase().indexOf('macintosh') != -1; }
function Windows()  { return navigator.userAgent.toLowerCase().indexOf('windows') != -1; }

function PopupStr(popupWidth, popupHeight)
{
    var adjWidth = 6;
    var adjHeight = 54;
    if (Windows())
    {
        if (IE())
        {
            adjWidth = 10;
            adjHeight = 79;
        }
        else if (Opera())
        {
            adjWidth = 10;
            adjHeight = 49;
        }
        else if (Netscape())
            adjHeight = 34;
    }
    else
    {
        adjWidth = 0;

        if (Firefox())
            adjHeight = 31;
        else if (Safari())
            adjHeight = 22;
    }

    var leftVal = parseInt((screen.width - (popupWidth + adjWidth)) / 2);
    var topVal = parseInt((screen.height - (popupHeight + adjHeight)) / 2);

    var str = "titlebar=0,toolbar=0,scrolladjHeight=0,location=0,status=0,menubar=0,resizable=0,width=";

    str += popupWidth;
    str += ",height=";
    str += popupHeight;
    str += ",left=";
    str += leftVal;
    str += ",top=";
    str += topVal;

    return str;
}

function Popup(args)
{
    var str = PopupStr(1000, 660);

    var popup = window.open('browser.php?' + args, 'browser', str);
    popup.focus();
}
