/*
 * Ext JS Library 2.0.2
 * Copyright(c) 2006-2008, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */

Ext.onReady(function(){
    var lwin;

    var lbutton = Ext.get('LeadBtn');
    var lbutton2 = Ext.get('LeadBtn1');

    lbutton.on('click', function(){
        // create the window on the first click and reuse on subsequent clicks
        if(!lwin){
            lwin = new Ext.Window({
                el:'ld-dlg',
                layout:'fit',
                width:540,
                height:375,
                closeAction:'hide',
                plain: true,
                
                items: new Ext.TabPanel({
                    el: 'lx-tabs',
                    autoTabs:true,
                    activeTab:0,
                    deferredRender:false,
                    border:false
                }),

                buttons: [{
                    text:'Submit',
                    disabled:true
                },{
                    text: 'Close',
                    handler: function(){
                        lwin.hide();
                    }
                }]
            });
        }
        lwin.show(this);
    });
    
        lbutton2.on('click', function(){
        // create the window on the first click and reuse on subsequent clicks
        if(!lwin){
            lwin = new Ext.Window({
                el:'ld-dlg',
                layout:'fit',
                width:540,
                height:375,
                closeAction:'hide',
                plain: true,
                
                items: new Ext.TabPanel({
                    el: 'lx-tabs',
                    autoTabs:true,
                    activeTab:0,
                    deferredRender:false,
                    border:false
                }),

                buttons: [{
                    text:'Submit',
                    disabled:true
                },{
                    text: 'Close',
                    handler: function(){
                        lwin.hide();
                    }
                }]
            });
        }
        lwin.show(this);
     });
});