// Sample desktop configuration
MyDesktop = new Ext.app.App({
	init :function(){
		Ext.QuickTips.init();
	},

	getModules : function(){
		return [
			new MyDesktop.GridWindow(),
			new MyDesktop.TabWindow2(),            
            new MyDesktop.AccordionWindow(),
            //new MyDesktop.BogusMenuModule(),
			new MyDesktop.TabWindow(),
            new MyDesktop.BogusModule()
		];
	},

    // config for the start menu
    getStartConfig : function(){
        return {
            title: 'Club Pcs',
            iconCls: 'user'/*,
            toolItems: [{
                text:'Settings',
                iconCls:'settings',
                scope:this
            },'-',{
                text:'Login',
                iconCls:'logout',				
                scope:this
            }]	*/		
        };
    }
});


MyDesktop.GridWindow = Ext.extend(Ext.app.Module, {
    id:'grid-win',
    init : function(){
        this.launcher = {
            text: 'Pcs Member',
            iconCls:'icon-grid',
            handler : this.createWindow,
            scope: this
        }
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('grid-win');
        if(!win){
            win = desktop.createWindow({
                id: 'grid-win',
                title:'Pcs Member',
                width:440,
                height:580,
                iconCls: 'icon-grid',
                shim:false,
                animCollapse:false,
                constrainHeader:true,

                layout: 'fit',
                items:
                    new Ext.grid.GridPanel({
                        border:false,
                        ds: new Ext.data.Store({
                            reader: new Ext.data.ArrayReader({}, [
                               {name: 'Number', type: 'int'},
                               {name: 'Name'},
                               {name: 'Initial'},
                               {name: 'Position'}
                            ]),
                            data: Ext.grid.dummyData
                        }),
                        cm: new Ext.grid.ColumnModel([
                            //new Ext.grid.RowNumberer(),
                            {id:'Number',header: "Number", width: 50, sortable: true, dataIndex: 'Number'},
                            {header: "Name", width: 70, sortable: true, dataIndex: 'Name'} ,
                            {header: "Initial", width: 70, sortable: true, dataIndex: 'Initial'} ,
                            {header: "Position", width: 70, sortable: true, dataIndex: 'Position'}
                        ]),

                        viewConfig: {
                            forceFit:true
                        }
                    })
            });
        }
        win.show();
    }
});



MyDesktop.TabWindow2 = Ext.extend(Ext.app.Module, {
	id:'pcs-win',
    init : function(){
        this.launcher = {
            text: 'Club Pcs',
            iconCls:'tabs',
            handler : this.createWindow,
            scope: this
        }
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('tab-win2');
        if(!win){
            win = desktop.createWindow({
                id: 'tab-win2',
                title:'Club Pcs Window',
                width:740,
                height:650,
                iconCls: 'tabs',
                shim:false,
                animCollapse:false,
                border:false,
                constrainHeader:true,

                layout: 'fit',
                items:
                    new Ext.TabPanel({
                        activeTab:1,
                        items: [{
                            title: 'About Club Pcs',
                            header:false,							
                            html : '<iframe src="/comuser/pcs/about_pcs.asp" frameborder="0" width="100%" height="100%"></iframe>',
                            border:false
                        },{
                            title: 'Club Pcs History',
                            header:false,							
                            html : '<iframe src="/comuser/pcs/club_history.asp" frameborder="0" width="100%" height="100%"></iframe>',
                            border:false
                        },{
                            title: 'Photo',
                            header:false,
                            html : '<iframe src="/comuser/pcs/photo_pcs.asp" frameborder="0" width="100%" height="100%"></iframe>',
                            border:false
                        },{
                            title: 'Contact Pcs',
                            header:false,
                            html : '<iframe src="/comuser/pcs/contact_pcs.asp" frameborder="0" width="100%" height="100%"></iframe>',							
                            border:false
                        }]
                    })
            });
        }
        win.show();
    }
});



MyDesktop.TabWindow = Ext.extend(Ext.app.Module, {
	id:'acc-win',
    init : function(){
        this.launcher = {
            text: 'Featur',
            iconCls:'tabs',
            handler : this.createWindow,
            scope: this
        }
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('tab-win');
        if(!win){
            win = desktop.createWindow({
                id: 'tab-win',
                title:'About Featur Window',
                width:740,
                height:740,
                x:40,
                y:0,
                iconCls: 'tabs',
                shim:false,
                animCollapse:false,
                border:false,
                constrainHeader:true,

                layout: 'fit',
                items:
                    new Ext.TabPanel({
                        activeTab:1,

                        items: [{
                            title: 'Portfolio',
                            header:false,
                            html : '<iframe src="/comuser/featur/portfolio.asp" frameborder="0" width="100%" height="100%"></iframe>',
                            border:false
                        },{
                            title: 'About Featur',
                            header:false,
                            html : '<iframe src="/comuser/featur/about.asp" frameborder="0" width="100%" height="100%"></iframe>',
                            border:false
                        },{
                            title: 'Photo',
                            header:false,
                            html : '<iframe src="/comuser/pcs/photo_pcs.asp" frameborder="0" width="100%" height="100%"></iframe>',
							//html : '<iframe src="/comuser/featur/photo.asp" frameborder="0" width="100%" height="100%"></iframe>',
                            border:false
                        }]
                    })
            });
        }
        win.show();
    }
});






MyDesktop.AccordionWindow = Ext.extend(Ext.app.Module, {
	id:'Featur-win',
    init : function(){
        this.launcher = {
            text: 'Notice',
            iconCls:'accordion',
            handler : this.createWindow,
            scope: this
        }
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('acc-win');
        if(!win){
            win = desktop.createWindow({
                id: 'acc-win',
                title:'Notice',
                width:470,
                height:450,
                iconCls: 'accordion',
                shim:false,
                animCollapse:false,
                constrainHeader:true,
                layout:'accordion',
                border:false,
                layoutConfig: {
                    animate:false
                },

                items: [{
                        title: 'Club Pcs Notice',
                        html : '<iframe src="/comuser/pcs/notice.asp" frameborder="0" width="100%" height="100%"></iframe>'
                    },{
                        title: '½ÃÇÕ½ÅÃ»',
                        html:'<br/>&nbsp;&nbsp;Club Pcs ¿ÍÀÇ ½ÃÇÕ½ÅÃ»Àº <br/><br/>&nbsp;&nbsp;Contact Pcs ¸¦ ÅëÇØ ±ÛÀ» ³²°Ü ÁÖ½Ã°Å³ª,<br/><br/>&nbsp;&nbsp;<a href="http://pcspcs.cyworld.com" target="_blank">½ÎÀÌ¿ùµå Club</a> ¿¡ °¡ÀÔÇÏ¼Å¼­ ±ÛÀ» ³²°ÜÁÖ½Ã°Å³ª,<br/><br/>&nbsp;&nbsp;[¸Å´ÏÀú] ±è¿ëÈ£ ÇÑÅ× ¿¬¶ôÁÖ¼¼¿ä.<br/>',
                        autoScroll:true
                    },{
                        title: '´ëÇ¥ÀüÈ­',
                        html : '<br/>&nbsp;&nbsp;[ °¨ µ¶ ] °ûÁö¿Ï 011 - 220 - 3033 <br/><br/>&nbsp;&nbsp;[¸Å´ÏÀú] ±è¿ëÈ£ 010 - 6286 - 0579 <br/><br/>&nbsp;&nbsp;[ ÁÖ Àå ] ÀÌÀçÈÆ 011 - 1721 - 1790 <br/><br/>&nbsp;&nbsp;<font color="red">¡Ø Àå³­ÀüÈ­´Â »çÀýÀÔ´Ï´Ù.</font>'
                    }]
            });
        }
        win.show();
    }
});

// for example purposes
var windowIndex = 0;

MyDesktop.BogusModule = Ext.extend(Ext.app.Module, {
	id:'weather-win',
    init : function(){
        this.launcher = {
            text: 'Weather' , // +(++windowIndex),
            iconCls:'bogus',
            handler : this.createWindow,
            scope: this,
            windowId:windowIndex
        }
    },

    createWindow : function(src){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('Weather'+src.windowId);
        if(!win){
            win = desktop.createWindow({
                id: 'Weather'+src.windowId,
                title:src.text,
                width:800,
                height:650,
				x:80,
                y:0,
                html : '<iframe src="/comuser/pcs/weather.asp" frameborder="0" width="100%" height="100%"></iframe>',
                iconCls: 'bogus',
                shim:false,
                animCollapse:false,
                constrainHeader:true
            });
        }
        win.show();
    }
});

/*
MyDesktop.BogusMenuModule = Ext.extend(MyDesktop.BogusModule, {
    init : function(){
        this.launcher = {
            text: 'Bogus Submenu',
            iconCls: 'bogus',
            handler: function() {
				return false;
			},
            menu: {
                items:[{
                    text: 'Bogus Window '+(++windowIndex),
                    iconCls:'bogus',
                    handler : this.createWindow,
                    scope: this,
                    windowId: windowIndex
                    },{
                    text: 'Bogus Window '+(++windowIndex),
                    iconCls:'bogus',
                    handler : this.createWindow,
                    scope: this,
                    windowId: windowIndex
                    },{
                    text: 'Bogus Window '+(++windowIndex),
                    iconCls:'bogus',
                    handler : this.createWindow,
                    scope: this,
                    windowId: windowIndex
                    },{
                    text: 'Bogus Window '+(++windowIndex),
                    iconCls:'bogus',
                    handler : this.createWindow,
                    scope: this,
                    windowId: windowIndex
                    },{
                    text: 'Bogus Window '+(++windowIndex),
                    iconCls:'bogus',
                    handler : this.createWindow,
                    scope: this,
                    windowId: windowIndex
                }]
            }
        }
    }
});

*/