/*
 * Ext JS Library 1.1 RC 1
 * Copyright(c) 2006-2007, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://www.extjs.com/license
 */

// create the HelloWorld 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 ultimas = function(){
    // everything in this space is private and only accessible in the HelloWorld block
    
    // define some private variables
    var dialog, showBtn;
    
    // return a public interface
    return {
        init : function(){
             showBtn = Ext.get('show-ultimas_noticias-btn');
             // attach to click event
             showBtn.on('click', this.showDialog, this);
        },
       
        showDialog : function(){
            if(!dialog){ // lazy initialize the dialog and only create it once
                dialog3 = new Ext.BasicDialog("ultimas_noticias", { 
                        autoTabs:true,
                        width:'90%',
                        height:'90%',
                        shadow:true,
                        minWidth:300,
                        minHeight:250,
                        proxyDrag: true
                });
                dialog3.addKeyListener(27, dialog3.hide, dialog3);// 27 es la tecla ESC
                //dialog.addButton('Submit', dialog.hide, dialog).disable();no tiene sentido aquí
                dialog3.addButton('Cerrar', dialog3.hide, dialog3);
            }
            dialog3.show(showBtn.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(ultimas.init, ultimas, true);