YAHOO.namespace("salesreport.container");
var Dom = YAHOO.util.Dom;

if(typeof interface == "undefined" || !interface){
  var interface = {};
}

/* define constants used in the application */
interface.old_password_match = 'Old password is incorrect';
interface.new_password_missing = 'New password is invalid';
interface.new_password_match = 'New passwords do not match';

if(typeof interface.widget == "undefined" || !interface.widget){
  interface.widget = {};
}

interface.widget.workingPanel = function(){
  var _instance = null;
  return {
    getInstance : function(){
      if(_instance === null){
        _instance = new function() {
          var panel = null;


          /**
           * Private method that provides lazy initialization of YUI resources.  Called the first time
           * that the show() method is invoked.
           *
           * @author Sean Kennelly
           */
          var construct = function() {
            panel = new YAHOO.widget.Panel("WorkingPanel",
            {
              width: "240px",
              fixedcenter: true,
              close: false,
              draggable: false,
              zindex:4,
              modal: true,
              visible: false
            }
            );
            panel.setHeader("Working, please wait...");
            panel.setBody("<img src=\"/images/rel_interstitial_loading.gif\"/>");
            panel.render(document.body);
          };


          /**
           * Shows the save dialog
           *
           * @author Sean Kennelly
           */
          this.show = function() {
            if(!panel) {
              construct.call(this);
            }

            panel.show();
          };


          /**
           * Hides the save dialog
           *
           * @author Sean Kennelly
           */
          this.hide = function() {
            if(panel) {
              panel.hide();
            }
          };
        };
      }
      return _instance;
    }
  };
}();