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";
        }
    }
}

window.onload = externalLinks;

function image_open(img_url, width, height, extra)
{
    var win_w = width;
    var win_h = height;
    var img_url = img_url.replace('&', '%26');
    var left = Math.floor((screen.width - win_w) / 2);
    var top = Math.floor((screen.height - win_h) / 2);
    var params = 'top=' + top + ', left=' + left + ', height=' + win_h + ', width=' + win_w;

    win = window.open('', '', params + ', directories=0, location=0, menubar=0, resizable=0, scrollbars=0, status=0, toolbar=0');
    win.document.open();
    win.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
    win.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml">');
    win.document.writeln('<head>');
    win.document.writeln('<title>Associazione Culturale La Conchiglia :: Zoom Image</title>');
    win.document.writeln('</head>');
    win.document.writeln('<body style="margin:0;padding:0;" scroll="no">');
    win.document.writeln('<a href="javascript:window.close();"><img alt="Associazione Culturale La Conchiglia" src="' + img_url + '" width="' + width  + '" height="' + height + '" style="display:block;border:0;" /></a>');
    win.document.writeln('</body>');
    win.document.writeln('</html>');
    win.document.close();
    win.focus();
}

