/*
 * Ext JS Library 1.1 RC 1
 * Copyright(c) 2006-2007, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://www.extjs.com/license
 */

// create the HelloWorld2 application (single instance)
//ES COPIA DE dialog/simpleDialog/simpleDialog.js Uso esta copia para evitar "interferencias" (no se si la puede haber) co simpleDialog
var HelloWorld2 = function(){
    // everything in this space is private and only accessible in the HelloWorld2 block
    
    // define some private variables
    var dialog2, showBtn2;
    
    // return a public interface
    return {
        init : function(){
             showBtn2 = Ext.get('show-dialog-btn2');
             // attach to click event
             showBtn2.on('click', this.showDialog2, this);
        },
       
        showDialog2 : function(){
            if(!dialog2){ // lazy initialize the dialog and only create it once
                dialog2 = new Ext.BasicDialog("hello-dlg2", { 
                        autoTabs:true,
                        width:640,
                        height:480,
                        shadow:true,
                        minWidth:300,
                        minHeight:250,
                        proxyDrag: true
                });
                dialog2.addKeyListener(27, dialog2.hide, dialog2);// 27 es la tecla ESC
                //dialog.addButton('Submit', dialog.hide, dialog).disable();no tiene sentido aquí
                dialog2.addButton('Cerrar', dialog2.hide, dialog2);
            }
            dialog2.show(showBtn2.dom);
        }
    };
}();

// using onDocumentReady instead of window.onload initializes the application
// when the DOM is ready, without waiting for images and other resources to load
Ext.onReady(HelloWorld2.init, HelloWorld2, true);
