/*
 * Ext JS Library 2.0.1
 * Copyright(c) 2006-2008, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */

function Test()
{
} 
 
 
Ext.onReady(function(){
    var btnKamasutra = Ext.get('btnKamasutra');	
	var btnOldStyle = Ext.get('btnOldStyle');
	var btnFashion =  Ext.get('btnFashion');
	var btnClassic =  Ext.get('btnClassic');
	var btnGalery =  Ext.get('btnGalery');
	var winKamasutra;
	var winOldStyle;
	var winFashion;
	var winClassic;
	var winGalery;

    btnKamasutra.on('click', function(){
        // create the window on the first click and reuse on subsequent clicks
		if (!winKamasutra)
		{
				winKamasutra = new Ext.Window({
                el:'apartmentKamasutra-win',
                layout:'border',
                width:600,
                height:400,
                closeAction:'hide',
                plain: true,
                
                items: new Ext.TabPanel({
				
					region: 'center',
					defaults:{autoScroll:true},
                    el: 'apartmentKamasutra-tabs',
                    autoTabs:true,
                    activeTab:0,
                    deferredRender:false,
                    border: true
                }),

                buttons: [{
                    text: 'Zamknij',
                    handler: function(){
                        winKamasutra.hide();					
                    }
                }]
            });        
		}
			winKamasutra.show(this);
    });
	
	btnOldStyle.on('click', function(){
        // create the window on the first click and reuse on subsequent clicks        
		if (!winOldStyle)
		{
			winOldStyle = new Ext.Window({
                el:'apartmentOldStyle-win',
                layout:'border',
                width:600,
                height:400,
                closeAction:'hide',
                plain: true,
                
                items: new Ext.TabPanel({
				
					region: 'center',
					defaults:{autoScroll:true},
                    el: 'apartmentOldStyle-tabs',
                    autoTabs:true,
                    activeTab:0,
                    deferredRender:false,
                    border: true
                }),

                buttons: [{
                    text: 'Zamknij',
                    handler: function(){
                        winOldStyle.hide();
                    }
                }]
            });        
		}
		winOldStyle.show(this);
    });
	
	btnFashion.on('click', function(){
        // create the window on the first click and reuse on subsequent clicks        
		if (!winFashion)
		{
			winFashion = new Ext.Window({
                el:'apartmentFashion-win',
                layout:'border',
                width:600,
                height:400,
                closeAction:'hide',
                plain: true,
                
                items: new Ext.TabPanel({
				
					region: 'center',
					defaults:{autoScroll:true},
                    el: 'apartmentFashion-tabs',
                    autoTabs:true,
                    activeTab:0,
                    deferredRender:false,
                    border: true
                }),

                buttons: [{
                    text: 'Zamknij',
                    handler: function(){
                        winFashion.hide();
                    }
                }]
            });        
		}
		winFashion.show(this);
    });
	
	
	btnClassic.on('click', function(){
        // create the window on the first click and reuse on subsequent clicks        
		if (!winClassic)
		{
			winClassic = new Ext.Window({
                el:'apartmentClassic-win',
                layout:'border',
                width:600,
                height:400,
                closeAction:'hide',
                plain: true,
                
                items: new Ext.TabPanel({
				
					region: 'center',
					defaults:{autoScroll:true},
                    el: 'apartmentClassic-tabs',
                    autoTabs:true,
                    activeTab:0,
                    deferredRender:false,
                    border: true
                }),

                buttons: [{
                    text: 'Zamknij',
                    handler: function(){
                        winClassic.hide();
                    }
                }]
            });        
		}
		winClassic.show(this);
    });
	
	
	btnGalery.on('click', function(){
        // create the window on the first click and reuse on subsequent clicks
		if (!winGalery)
		{
				winGalery = new Ext.Window({
                el:'Galery_JS-win',
                layout:'border',
                width:600,
                height:400,
                closeAction:'hide',
                plain: true,
                
                items: new Ext.TabPanel({
				
					region: 'center',
					defaults:{autoScroll:true},
                    el: 'Galery_JS-tabs',
                    autoTabs:true,
                    activeTab:0,
                    deferredRender:false,
                    border: true
                }),

                buttons: [{
                    text: 'Zamknij',
                    handler: function(){
                        winGalery.hide();					
                    }
                }]
            });        
		}
			winGalery.show(this);
    });
});
