// create the HelloWorld application (single instance)
var HelloWorld = 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('n170');
             // attach to click event
     //        showBtn.on('click', this.showDialog, this);
            if(!dialog){ // lazy initialize the dialog and only create it once
                dialog = new Ext.BasicDialog("hello-dlg", { 
                        autoTabs:false,
                        width:480,
                        height:300,
                        shadow:true,
                        minWidth:300,
                        minHeight:240,
                        proxyDrag: true
                });
                dialog.addKeyListener(27, dialog.hide, dialog);
                dialog.addButton('关闭', dialog.hide, dialog);
            }
        },
       
        showDialog : function(title){
		   dialog.setTitle(title);
   //         dialog.show(showBtn.dom);
            dialog.show();
        }
    };
}();

// 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(HelloWorld.init, HelloWorld, true);
function shownews(id,title){
//HelloWorld.showBtn = Ext.get('n170');

var msg = Ext.get("livemsg");
msg.load({
			url: '/forex/news', 
			params: "nid=" + id,
			text: "Updating..."
		});

 HelloWorld.showDialog(title);
}