// New window method courtesy of:
// [ http://www.sitepoint.com/article/standards-compliant-world ]

function setExternalLinks()
{
    if (!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");

    for (var i=0; i<anchors.length; i++)
    {
        var anchor = anchors[i];

        if (anchor.getAttribute("href") &&
            anchor.getAttribute("rel") == "external")
        {
            anchor.target = "_blank";
        }
    }
}

addEvent(window, "load", setExternalLinks);

// window.onload = setExternalLinks;

var apWindow;

function openNewWindow(url, name, width, height)
{
    if (width > 0 && height > 0)
    {
        apWindow = window.open(url, name, ("height=" + (height+20) + ",width=" + (width+20)));
    }
    else
    {
        apWindow = window.open(url, name);
    }

    if (window.focus)
    {
        apWindow.focus()
    }
}
