/*
var welcometools = {
  regionTitle: 'Homepage Tools',
  defaults: {autoHeight: true, cls: 'toolbox'},
  items:[{
    title: 'Print Options',
    items: [
      {
        xtype: 'link',
        iconCls: 'print',
        text: 'Print Something'
      }
    ]
  }]
};
*/
var welcome = {
    id: 'welcome-panel',	
    layout:'fit',
    title:"Welcome to School Dynamics",
    border: true,
    items: [
        {
            xtype: 'container',
            id: 'welcomecontent',
            items: [
                {
                    xtype: 'dataview',
                    itemSelector: 'div',
                    store: siteinfo,
                    tpl: '<tpl for="."><div><h3>Welcome, <em>{username}</em>. Your life is about to get easier.</h3><p>You can use the navigation on the left or make a selection below to get started.</p></div></tpl>',
                    id: 'welcomemsg'
                },
                {
                    xtype: 'container',
                    layout: 'hbox',
                    height: 210,
                    width: 505,
                    items: [
                        {
                            xtype: 'container',
                            flex: 1,
                            layout: 'form',
                            height: 210,
                            margins: '0 20 0 0',
                            id: 'welcomeButtons',
                            defaults: { xtype: 'button', flex: 1, height: 40, width: 200, cls: 'welcomeSelection' },
                            items: [
                                {
                                    text: 'Attendance',
                                    iconCls: 'bell',
                                    handler: function() {
                                        Ext.getCmp('tree-panel').fireEvent('click', Ext.getCmp('tree-panel').getNodeById('attendance'));
                                    }
                                },
                                {
                                    xtype: 'spacer',
                                    height: 18
                                },
                                {
                                    text: 'Gradebook',
                                    iconCls: 'chart_pie',
                                    handler: function() {
                                        Ext.getCmp('tree-panel').fireEvent('click', Ext.getCmp('tree-panel').getNodeById('gradebook'));
                                    }
                                },
                                {
                                    xtype: 'spacer',
                                    height: 18
                                },
                                {
                                    text: 'Lesson Plan',
                                    iconCls: 'layout_edit',
                                    handler: function() {
                                        Ext.getCmp('tree-panel').fireEvent('click', Ext.getCmp('tree-panel').getNodeById('lessonplans'));
                                    }
                                },
                                {
                                    xtype: 'spacer',
                                    height: 18
                                },
                                {
                                    xtype: 'checkbox',
                                    boxLabel: 'Don\'t show this message again',
                                    anchor: '100%',
                                    hideLabel: true
                                }
                            ]
                        },
                        {
                            xtype: 'panel',
                            title: 'New to School Dynamics?',
                            id: 'new_to_SD',
                            flex: 1,
                            height: 210,
                            width: 265,
                            frame: true,
                            padding: 6,
                            items: [
                                {
                                    html:'<p class="welcomeintro homemonitor">School Dynamics is powerful school administrative software that is designed to reduce repetitive tasks so you can focus on what you do best.</p>' + '<p class="welcomeintro homegears">You can configure your preferences to match your needs.  Enjoy!</p>'
                                },
                                {
                                    xtype: 'container',
                                    layout: 'hbox',
                                    style: 'margin-left: 65px;',
                                    defaults: { xtype: 'button', flex: 1 },
                                    items: [
                                        {
                                            text: 'Preferences',
                                            margins: '0 5 0 0',
                                            handler: function() {
                                                preferencepopup.show();
                                            }
                                        },
                                        {
                                            text: 'What\'s new?',
                                            margins: '0 0 0 5',
                                            handler: function() {
                                                helppopup.loadHelpFile("New in School Dynamics", 600, 500);
                                            }
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    listeners: {
        render: function(panel) {
        //   document.getElementById('welcomeuser').innerHTML = siteinfo.username;
        },
        afterrender: function(panel) {
        //  document.getElementById('welcomeuser').innerHTML = siteinfo.data.items[0].data.username;
        }
    }                                                            
};
