});
};
})(jQuery);
+
+function Popup(title, width, height, body) {
+ return this.initialize(title, width, height, body);
+}
+
+Popup.prototype = {
+ initialize: function(title, width, height, body)
+ {
+ this.createPopup(width, height);
+ if (title) this.setTitle(title);
+ if (body) this.setBody(body);
+ return this;
+ },
+
+ createPopup: function(width, height)
+ {
+ this.popup = $('<div class="popup">');
+ this.popup.css('width', width ? width : 'auto');
+ this.popup.css('height', height ? height : 'auto');
+ this.popup.hide().css('z-index', '1000');
+ var titlediv = $('<div class="popup_title" style="position:relative;">');
+ titlediv.append($('<p class="popup_title"></p>'));
+
+ var closeimg = $('<img src="/pix/close.gif" title="Close">');
+ titlediv.append(closeimg);
+
+ this.popup.append(titlediv);
+
+ this.popup.append($('<div class="popup_body" style="clear:both;">'));
+ $('body').append(this.popup);
+
+ this.popup.udraggable({'handle': 'div.popup_title'});
+ this.popup.find('div.popup_title img').bind('click', this.closePopup.bind(this));
+ },
+
+ openPopup: function()
+ {
+ this.popup.show();
+ },
+
+ centerPopup: function()
+ {
+ this.popup.center().show();
+ },
+
+ closePopup: function()
+ {
+ this.popup.hide();
+ },
+
+ setTitle: function(title)
+ {
+ this.popup.find('div.popup_title p.popup_title').html(title);
+ },
+
+ setBody: function(body)
+ {
+ this.popup.find('div.popup_body').html(body);
+ }
+}