jQuery.fn.popup = function(w, h)
{
	if(w !== undefined) jQuery(this).attr('w', w);
	if(h !== undefined) jQuery(this).attr('h', h);
    jQuery(this).click(function(e)
    {
		var w = $(this).attr('w');
		var h = $(this).attr('h');
		var width = w == undefined || false ? screen.width : w;
		var height = h == undefined || false ? screen.height : h;
        var params = 'menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=no, status=no';
        /*
        if (par != undefined) 
        {
            for (prop in par) 
                params += prop + '=' + par[prop] + ',';
        }
        */
        var left = (screen.width - width) / 2;
		var top = (screen.height - height) / 2 - 20;
        params += ',height=' + height + 'px';
        params += ',width=' + width + 'px';
        params += ',top=' + top + 'px';
        params += ',left=' + left + 'px';
        win = window.open($(this).attr('href'), '', params);
        win.window.focus();
        return false;
    });
}
