/**
 * Copyright(c) 2006-2009, feyaSoft Inc. All Right Reserved.
 */
Ext.ns("feyaSoft.openSource.mySS");

feyaSoft.openSource.mySS.MainPanel = function(config){

    this.activeTabNo = config.activeTabNo;

    this.aboutMySS = new feyaSoft.openSource.AboutMySS();
    this.forum = new feyaSoft.openSource.ForumPanel({type: 'mySSForum'});
    this.forum.loadThread();
    this.detail = new feyaSoft.openSource.DetailPanel({type: 'mySSForum'});

    // create GroupTabs
    this.mainTab = new Ext.ux.GroupTabPanel({
        region: 'center',
        tabWidth: 180,
    	activeGroup: this.activeTabNo,

        items:[{
            mainItem: 0,
            items: [{
                title: 'About MySpreadSheet',
                tabTip: 'About FeyaSoft MySpreadSheet',
                iconCls: 'excel',
                layout:'fit',
                border: false,
                items: this.aboutMySS
            },{
                title: 'Forum',
                iconCls: 'forum',
                autoScroll:true,
                layout:'card',
                activeItem: 0,
                border: false,
                items: [this.forum, this.detail]
            },{
                title: 'Release Notes',
                iconCls: 'zoom',
                autoScroll:true,
                layout:'fit',
                border: false,
                autoLoad: {url: 'html/openSource/mySpreadsheetReleaseNote.html', scripts: true}
            },{
                title: 'MyCalendar',
                iconCls: 'calendar',
                listeners: {activate: this.goToCalendar}
            },{
                title: 'Home',
                iconCls: 'feyasoft_icon',
                listeners: {activate: this.goToHome}
            }]
        }]
    });

    feyaSoft.openSource.mySS.MainPanel.superclass.constructor.call(this, {
        id: 'open_source_panel_page',
        region: 'center',
        layout: 'border',
        border: false,
        items: [this.mainTab]
    });

};

Ext.extend(feyaSoft.openSource.mySS.MainPanel, Ext.Panel, {

    goToCalendar : function() {
        window.location = 'myCalendar';
    },

    goToHome : function() {
        window.location = 'index.gsp';
    }
});



