Event.observe(window, 'load', function(e) {
    $$("a[rel='Player']").invoke('observe', 'click', function(e) {
        var href = this.readAttribute('href');
        if (href != null) {
            OpenPlayer(href);
        }
        e.stop();
    });
});

function OpenCenteredWindow(url, id) {
    var w = 1024, h = 768;
    if (document.all || document.layers) {
        w = screen.availWidth;
        h = screen.availHeight;
    }
    var popW = 265, popH = 50;
    var leftPos = (w - popW) / 2, topPos = (h - popH) / 2;

    window.open(url, id, 'status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=0,width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);
}
function OpenPlayer(href) {
    OpenCenteredWindow(href);
}
