addLoadEvent(externalLinks);

function addLoadEvent(func)
{
    var oldonload = window.onload;

    if (typeof window.onload != "function")
    {
        window.onload = func;
    }
    else
    {
        window.onload = function(){oldonload(); func();}
    }
}

function externalLinks()
{
    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";
        }
    }
}

strURL = 'informacio_legal.php';
strName = '';
intWidth = parseInt('400');
intHeight = parseInt('300');
strLocationBar = (false) ? 'yes' : 'no';
strMenuBar = (false) ? 'yes' : 'no';
strStatusBar = (false) ? 'yes' : 'no';
strToolBar = (false) ? 'yes' : 'no';
strResizeable = (false) ? 'yes' : 'no';
strScrollBars = (false) ? 'yes' : 'no';

function openPopupWindow() {
    if (typeof(intWidth) == 'number' || typeof(intHeight) == 'number') {
        window.open(strURL,'popup','height=' + intHeight + ',width=' + intWidth + ',location=' + strLocationBar + ',menubar=' + strMenuBar + ',resizable=' + strResizeable + ',scrollbars=' + strScrollBars + ',status=' + strStatusBar + ',toolbar=' + strToolBar);
    } else {
        window.open(strURL,'popup','location=' + strLocationBar + ',menubar=' + strMenuBar + ',resizable=' + strResizeable + ',scrollbars=' + strScrollBars + ',status=' + strStatusBar + ',toolbar=' + strToolBar);
    }
}