var Common = {

    init: function(){
        Common.doPopups();
    },

    doPopups: function(){
        $("a[rel*='popup']").click(function(){

            re = /popup-size([0-9]{1,4})x([0-9]{1,4})/;
            texto = $(this).attr("rel");
            resultado = re.exec(texto);

            wName = $(this).text();
            wNameRE = new RegExp("[\\s]","g");
            wName = wName.replace(wNameRE, "");

            larg = resultado[1];
            altu = resultado[2];
            window.open($(this).attr("href")+"/popup", wName , "height = "+altu+" , width = "+larg+", scrollbars = 1");
            return false;
        });
    }

}

$(function(){
    Common.init();
});