/* 
Compiled  : 09.12.2009 15:14:10
Author    : Marc Janin (iguana.lu)
Copyright : www.iguana.lu
Contact   : For any questions, contact me by iguana.lu!
 */
function Popup() {this.init();return this;};Popup.insertRequires = function() {dojo.require("dijit.Dialog");};Popup.prototype.init = function() {var dialog = dojo.query('.dijitDialog');if (typeof dialog != 'undefined' && dialog.length > 0) {console.log('dialog already exits!');return;};    this.popup = new dijit.Dialog({        title: 'Title is undefined!',        content: 'Content is undefined!'    });    this.popup.startup();};Popup.prototype.setTitle = function(str) {this.popup.attr('title', str);return this;};Popup.prototype.setContent = function(str) {this.popup.attr('content', str);return this;};Popup.prototype.appendContent = function(str) {var contentPanel = dojo.query('.dijitDialogPaneContent');contentPanel = contentPanel && contentPanel.length > 0 ? contentPanel[0] : contentPanel;if (typeof contentPanel != 'undefined') {contentPanel.appendChild(str);};return this;};Popup.prototype.show = function() {this.popup.show();this.enableEvents();return this;};Popup.prototype.hide = function() {this.popup.hide();this.popup.destroyRecursive(false);this.init();return this;};Popup.prototype.enableEvents = function() {var instance = this;var bg = dojo.query('.dijitDialogUnderlay');bg = bg && bg.length > 0 ? bg[0] : bg;if (typeof bg != 'undefined') {bg.onclick = function() {instance.hide();};};var closeIco = dojo.query('.dijitDialogCloseIcon');closeIco = closeIco && closeIco.length > 0 ? closeIco[0] : closeIco;if (typeof closeIco != 'undefined') {closeIco.onclick = function() {instance.hide();};};var btnClose = dojo.byId('btnClose');if (btnClose != null) {btnClose.onclick = function() {instance.hide();};};};var popup = null;dojo.addOnLoad(window, function() {Popup.insertRequires();popup = new Popup();});
