var attApiBasePath ="/att"



/**
 * @class KitchenSink.application
 * Registers the KitchenSink application and dispatches to the index controller.
 *
 *  Creates the Sencha.Provider instance and assigns the object to 
 *  KitchenSink.provider
 *
 */
Ext.regApplication({
    name: "KitchenSink",

    launch: function() {
        Ext.dispatch({
            controller: 'index',
            action    : 'index'
        });

        // Initialize the Provider component.
        this.provider = new Sencha.Provider();
        
        
        
        this.resultOverlayTitle = new Ext.Toolbar({
                    dock: 'top'
        });
        
        this.resultOverlay = new Ext.Panel({
              floating: true,
              modal: true,
              centered: true,
              width: Ext.is.Phone ? 320 : 500,
              height: Ext.is.Phone ? 320 : 500,
              styleHtmlContent: true,
              dockedItems: this.resultOverlayTitle,
              scroll: "both",
              cls: 'htmlcontent'
          });

        
    },
    /**
    * Display a formatted JSON object in a floating dialog.
    * Used by each of the API calls to display the results of the call.
    *
    * @param results {Object} JSON object to display
    * @param label {String} Title of the panel
    *
    */
    showResults: function(results, label) {
       this.resultOverlay.update( JSON.stringify(results, null, '\t'));
       this.resultOverlayTitle.setTitle(label || "Results");
      this.resultOverlay.show();
      
    }
    
});

