/**
 * @author tahmed
 */

function submitContForm(){
    Ext.Ajax.request({
	url:'join_us.php', 
    params: {nametxt: Ext.getCmp('nameTxt').getRawValue(), 
    		emailtxt: Ext.getCmp('emailTxt').getRawValue(), 
    		phonetxt: Ext.getCmp('phoneTxt').getRawValue(),
    		citytxt: Ext.getCmp('cityTxt').getRawValue(),
    		statetxt: Ext.getCmp('stateTxt').getRawValue(),
    		msgtxt: Ext.getCmp('msgTxt').getRawValue()
    		},
	success: function ( result, request ) { 
			Ext.Msg.alert('Contact WBCC', result.responseText + "\n");
			Ext.getCmp('contactWin').close();
            },
	failure: function ( result, request) { 
            Ext.Msg.alert('Contact WBCC', result.responseText + "\n"); 
            } 
        });
    }
 
function contactForm(){
var contatForm = new Ext.form.FormPanel({
        baseCls: 'x-plain',
        labelWidth: 55,
        url:'join_us.php',
        defaultType: 'textfield',
        items: [{
            fieldLabel: 'Name',
            id: 'nameTxt',
            name: 'nameTxt',
            allowBlank:false,
            anchor:'100%'  // anchor width by percentage
        },{
            fieldLabel: 'E-Mail',
            id: 'emailTxt',
            name: 'emailTxt',
            vtype:'email',
            allowBlank:false,
            anchor: '100%'  // anchor width by percentage
        },{
            fieldLabel: 'Phone',
            xtype:'numberfield',
            id: 'phoneTxt',
            name: 'phoneTxt',
            allowBlank:false,
            anchor: '100%'  // anchor width by percentage
        },{
            fieldLabel: 'City',
            id: 'cityTxt',
            name: 'cityTxt',
            allowBlank:false,
            anchor: '50%'  // anchor width by percentage
        },{
            fieldLabel: 'State',
            id: 'stateTxt',
            name: 'stateTxt',
            allowBlank:false,
            anchor: '50%'  // anchor width by percentage
        },{
            xtype: 'textarea',
            hideLabel: true,
            allowBlank:false,
            id: 'msgTxt',
            name: 'msgTxt',
            anchor: '100% -53'  // anchor width by percentage and height by raw adjustment
        }]
    });

    var contactWin = new Ext.Window({
        title: 'Contact the Washington Bengals',
        width: 500,
        height:400,
        resizable:false,
        minWidth: 300,
        modal:true,
        id:'contactWin',
        minHeight: 200,
        layout: 'fit',
        plain:true,
        bodyStyle:'padding:5px;',
        buttonAlign:'center',
        items: contatForm,

        buttons: [{
            text: 'Send',
            handler:submitContForm
        },{
            text: 'Cancel',
            handler:function(){contactWin.close();},
            id:'cancelBtn',
            name: 'cancelBtn'
        }]
    });

    contactWin.show();
    }
 
Ext.onReady(function(){
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());

//////////// 2007 schedule ////////////

	var regsch07store = new Ext.data.Store({
        url: '2007schedule.xml',
        reader: new Ext.data.XmlReader({
               record: 'regsch'
           }, [
               'Date','Time','Opposition','Ground', 'HomeAway', 'Trophy','Result','Highlights'
           ])
    });
    
    var scheduleCM = new Ext.grid.ColumnModel([
            {header: "Date", width: 45, sortable: true, dataIndex: 'Date'},
            {header: "Time", width: 25, sortable: false, dataIndex: 'Time'},
            {header: "Opposition", width: 35, sortable: true, dataIndex: 'Opposition'},
            {header: "Ground", width: 35, sortable: true, dataIndex: 'Ground'},
            {header: "Home/Away", width: 35, sortable: true, dataIndex: 'HomeAway'},
            {header: "Trophy", width: 60, sortable: true, dataIndex: 'Trophy'},
            {header: "Result", width: 60, sortable: false, dataIndex: 'Result'},
            {header: "Highlights", width: 120, sortable: false, dataIndex: 'Highlights'}
        ]
    )
    
    var regsch07grid = new Ext.grid.GridPanel({
        store: regsch07store,
        cm: scheduleCM,
        stripeRows: true,
        //autoExpandColumn: 'company',
        //cm: battingColModel,
        header:false,
        //style :'margin-top:2px', 
        //height:450,
        width:950,
        layout: 'fit',
        draggable: false,
        enableHdMenu: false,
        viewConfig: {forceFit: true},
        //sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
        title:'Regular Season Schedule',
        height:200
    });
    regsch07store.load();
    
    var playoffsch07store = new Ext.data.Store({
        url: '2007schedule.xml',
        reader: new Ext.data.XmlReader({
               record: 'playoffsch'
           }, [
               'Date','Time','Opposition','Ground', 'HomeAway', 'Trophy','Result','Highlights'
           ])
    });
    
    var playoffsch07grid = new Ext.grid.GridPanel({
        store: playoffsch07store,
        cm:scheduleCM,
        stripeRows: true,
        //autoExpandColumn: 'company',
        //cm: battingColModel,
        header:false,
        //height:450,
        width:950,
        layout: 'fit',
        draggable: false,
        enableHdMenu: false,
        viewConfig: {forceFit: true},
        //sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
        title:'Playoffs Schedule',
        height:200
    });
    playoffsch07store.load();
    
    //// START of 2008 Schedule grids for both teams ////
    
    	/// Bengals-1 Schedule ///
    var B1regsch08store = new Ext.data.Store({
        url: '2008schedule.xml',
        reader: new Ext.data.XmlReader({
               record: 'regschB1'
           }, [
               'Date','Time','Opposition','Ground', 'HomeAway', 'Trophy','Result','Highlights'
           ])
    });
    
    var B1regsch08grid = new Ext.grid.GridPanel({
        store: B1regsch08store,
        cm: scheduleCM,
        stripeRows: true,
        //autoExpandColumn: 'company',
        //cm: battingColModel,
        header:false,
        //style :'margin-top:2px', 
        //height:450,
        width:950,
        layout: 'fit',
        draggable: false,
        enableHdMenu: false,
        viewConfig: {forceFit: true},
        //sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
        title:'Bengals-1',
        height:200
    });
    B1regsch08store.load();
    
    	/// Bengals-2 Schedule ///
    var B2regsch08store = new Ext.data.Store({
        url: '2008schedule.xml',
        reader: new Ext.data.XmlReader({
               record: 'regschB2'
           }, [
               'Date','Time','Opposition','Ground', 'HomeAway', 'Trophy','Result','Highlights'
           ])
    });
    
    var B2regsch08grid = new Ext.grid.GridPanel({
        store: B2regsch08store,
        cm: scheduleCM,
        stripeRows: true,
        //autoExpandColumn: 'company',
        //cm: battingColModel,
        header:false,
        //style :'margin-top:2px', 
        //height:450,
        width:950,
        layout: 'fit',
        draggable: false,
        enableHdMenu: false,
        viewConfig: {forceFit: true},
        //sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
        title:'Bengals-2',
        height:200
    });
    B2regsch08store.load();
    
    
    /// END of 2008 schedule grids ////

    /// START of 2007 Bowling Stat Grid ////

	var bowlstatfields = Ext.data.Record.create([
       {name: 'lastName', mapping: 'Name > lastName'},
       {name: 'firstName', mapping: 'Name > firstName'},
       {name: 'Matches', mapping: 'Matches',type:'float'},
       {name: 'Overs', mapping: 'Overs',type:'float'},
       {name: 'Runs', mapping: 'Runs',type:'float'},
       {name: 'Wickets', mapping: 'Wickets',type:'float'},
       {name: 'Average', mapping: 'Average',type:'float'},
       {name: 'EconomyRate', mapping: 'EconomyRate',type:'float'}
    ]);
    
    var bowlStatReader = new Ext.data.XmlReader({
    record: "bowlingstat",
    id: "ID"
    }, bowlstatfields);
    
    var bowlstore = new Ext.data.Store({
        // load using HTTP
        url: 'bowling_stat.xml',
        // the return will be XML, so lets set up a reader
        reader: bowlStatReader
    });
    
    var bowlStatCM = new Ext.grid.ColumnModel([
            {header: "First Name", width: 120, sortable: true, dataIndex: 'firstName'},
            {header: "Last Name", width: 120, sortable: true, dataIndex: 'lastName'},
            {header: "Matches", width: 45, sortable: true, dataIndex: 'Matches'},
            {header: "Overs", width: 45, sortable: true, dataIndex: 'Overs'},
            {header: "Runs", width: 45, sortable: true, dataIndex: 'Runs'},
            {header: "Wickets", width: 45, sortable: true, dataIndex: 'Wickets'},
            {header: "Average", width: 45, sortable: true, dataIndex: 'Average'},
            {header: "EconomyRate", width: 95, sortable: true, dataIndex: 'EconomyRate'}
        ]
    ) 

    // create the grid
    var bowlstat07grid = new Ext.grid.GridPanel({
        store: bowlstore,
        cm: bowlStatCM,
        stripeRows: true,
        header:false,
        //height:450,
        width:740,
        layout: 'fit',
        draggable: false,
        enableHdMenu: false,
        viewConfig: {forceFit: true},
        title:'Bowling Statistics',
        height:200
    });

    bowlstore.load();
    
    /// END of 2007 Bowling Stat Grid ////
    
    /// START of 2009 Bowling Stat Grid ////
    
    /////////////////Bengals-1////////////////////
    var B1_08_bowlStatReader = new Ext.data.XmlReader({
    record: "B1bowlingstat",
    id: "ID"
    }, bowlstatfields);
    
    var B1_08_bowlstore = new Ext.data.Store({
        // load using HTTP
        url: 'b1bowlingstat.xml',
        // the return will be XML, so lets set up a reader
        reader: B1_08_bowlStatReader
    });
    var B1_08_bowlstatgrid = new Ext.grid.GridPanel({
        store: B1_08_bowlstore,
        cm: bowlStatCM,
        stripeRows: true,
        header:false,
        //height:450,
        width:740,
        layout: 'fit',
        draggable: false,
        enableHdMenu: false,
        viewConfig: {forceFit: true},
        title:'Bowling Statistics',
        height:200
    });
    B1_08_bowlstore.load();
    
    /////////////////Bengals-2////////////////////
    var B2_08_bowlStatReader = new Ext.data.XmlReader({
    record: "b2bowlingstat",
    id: "ID"
    }, bowlstatfields);
    
    var B2_08_bowlstore = new Ext.data.Store({
        // load using HTTP
        url: 'b2bowlingstat.xml',
        // the return will be XML, so lets set up a reader
        reader: B2_08_bowlStatReader
    });
    var B2_08_bowlstatgrid = new Ext.grid.GridPanel({
        store: B2_08_bowlstore,
        cm: bowlStatCM,
        stripeRows: true,
        header:false,
        //height:450,
        width:740,
        layout: 'fit',
        draggable: false,
        enableHdMenu: false,
        viewConfig: {forceFit: true},
        title:'Bowling Statistics',
        height:200
    });
    B2_08_bowlstore.load();
    
    /// END of 2009 Bowling Stat Grid ////

   /// START of 2007 Batting Stats ////
    
    var batstatfields = Ext.data.Record.create([
       {name: 'lastName', mapping: 'Name > lastName'},
       {name: 'firstName', mapping: 'Name > firstName'},
       {name: 'Matches', mapping: 'Matches',type:'float'},
       {name: 'NotOut', mapping: 'NotOut',type:'float'},
       {name: 'Centuries', mapping: 'Centuries',type:'float'},
       {name: 'Fifties', mapping: 'Fifties',type:'float'},
       {name: 'Runs', mapping: 'Runs',type:'float'},
       {name: 'Average', mapping: 'Average',type:'float'}
    ]);
    
    var batStatReader = new Ext.data.XmlReader({
        record: "battingstat",
        id: "ID"
        }, batstatfields);
    
    var batstore = new Ext.data.Store({
        url: 'batting_stat.xml',
        reader: batStatReader
    });
    
    var batStatCM = new Ext.grid.ColumnModel([
            {header: "First Name", width: 120, sortable: true, dataIndex: 'firstName'},
            {header: "Last Name", width: 120, sortable: true, dataIndex: 'lastName'},
            {header: "Matches", width: 45, sortable: true, dataIndex: 'Matches'},
            {header: "Not Out", width: 45, sortable: true, dataIndex: 'NotOut'},
            {header: "100s", width: 45, sortable: true, dataIndex: 'Centuries'},
            {header: "50s", width: 45, sortable: true, dataIndex: 'Fifties'},
            {header: "Runs", width: 45, sortable: true, dataIndex: 'Runs'},
            {header: "Average", width: 95, sortable: true, dataIndex: 'Average'}
        ]
    ) 

    // create the grid
    var batstat07grid = new Ext.grid.GridPanel({
        store: batstore,
        cm: batStatCM,
        stripeRows: true,
        //autoExpandColumn: 'company',
        //cm: battingColModel,
        header:false,
        //height:450,
        width:740,
        layout: 'fit',
        draggable: false,
        enableHdMenu: false,
        viewConfig: {forceFit: true},
        //sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
        title:'Batting Statistics',
        height:200
    });

    batstore.load();
   
    /// END of 2007 Batting Stats ////
    
    /// START of 2009 Batting Stats ////
    
    ///////////////// Bengals-1//////////////////////////
    var B1_08_batStatReader = new Ext.data.XmlReader({
        record: "b1battingstat",
        id: "ID"
        }, batstatfields);
    
    var B1_08_batStore = new Ext.data.Store({
        url: 'B1battingstat.xml',
        reader: B1_08_batStatReader
    });
    var B1_08_batStatGrid = new Ext.grid.GridPanel({
        store: B1_08_batStore,
        cm: batStatCM,
        stripeRows: true,
        //autoExpandColumn: 'company',
        //cm: battingColModel,
        header:false,
        //height:450,
        width:740,
        layout: 'fit',
        draggable: false,
        enableHdMenu: false,
        viewConfig: {forceFit: true},
        //sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
        title:'Batting Statistics',
        height:200
    });
    B1_08_batStore.load();
    
    
    ///////////////// Bengals-2//////////////////////////
    var B2_08_batStatReader = new Ext.data.XmlReader({
        record: "b2battingstat",
        id: "ID"
        }, batstatfields);
    
    var B2_08_batStore = new Ext.data.Store({
        url: 'b2battingstat.xml',
        reader: B2_08_batStatReader
    });
    var B2_08_batStatGrid = new Ext.grid.GridPanel({
        store: B2_08_batStore,
        cm: batStatCM,
        stripeRows: true,
        //autoExpandColumn: 'company',
        //cm: battingColModel,
        header:false,
        //height:450,
        width:740,
        layout: 'fit',
        draggable: false,
        enableHdMenu: false,
        viewConfig: {forceFit: true},
        //sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
        title:'Batting Statistics',
        height:200
    });
    B2_08_batStore.load();
    /// END of 2009 Batting Stats ////
    
  //////////////// START of Roster Grids /////////////////////
    
    var rosterFields = Ext.data.Record.create([
       {name: 'lastName', mapping: 'Name > lastName'},
       {name: 'firstName', mapping: 'Name > firstName'},
       {name: 'Batting', mapping: 'Batting'},
       {name: 'Bowling', mapping: 'Bowling'}
    ]);
    
    var B1rosterReader = new Ext.data.XmlReader({
        record: "Bengals1",
        id: "ID"
        }, rosterFields);
        
    var B1rosterStore = new Ext.data.Store({
        url: 'BengalsRoster.xml',
        reader: B1rosterReader
    });
    
    var rosterCM = new Ext.grid.ColumnModel([
            {header: "First Name", width: 120, sortable: true, dataIndex: 'firstName'},
            {header: "Last Name", width: 120, sortable: true, dataIndex: 'lastName'},
            {header: "Batting Style", width: 95, sortable: true, dataIndex: 'Batting'},
            {header: "Bowling Style", width: 95, sortable: true, dataIndex: 'Bowling'}
        ]
    ) 
    
    // create the grid
    var B1RosterGrid = new Ext.grid.GridPanel({
        store: B1rosterStore,
        cm: rosterCM,
        stripeRows: true,
        //autoExpandColumn: 'company',
        //cm: battingColModel,
        header:false,
        //height:450,
        width:740,
        layout: 'fit',
        draggable: false,
        enableHdMenu: false,
        viewConfig: {forceFit: true},
        //sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
        title:'Bengals-1',
        height:200
    });
    B1rosterStore.load();
    
    var B2rosterReader = new Ext.data.XmlReader({
        record: "Bengals2",
        id: "ID"
        }, rosterFields);
    
    var B2rosterStore = new Ext.data.Store({
        url: 'BengalsRoster.xml',
        reader: B2rosterReader
    });
        
    var B2RosterGrid = new Ext.grid.GridPanel({
        store: B2rosterStore,
        cm: rosterCM,
        stripeRows: true,
        //autoExpandColumn: 'company',
        //cm: battingColModel,
        header:false,
        //height:450,
        width:740,
        layout: 'fit',
        draggable: false,
        enableHdMenu: false,
        viewConfig: {forceFit: true},
        //sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
        title:'Bengals-2',
        height:200
    });
    B2rosterStore.load();
    
    ///// END of roster grids ////////////////
    
       var viewport = new Ext.Viewport({
            layout:'border',
            items:[
                {xtype: 'box',
				region: 'north',
				id:"northpanel",
				applyTo: 'topofpage',
				height: 130
			},/*{
                region: 'south',
                id:"southpanel",
		        //title: ' ',
		        //collapsible: true,
		        //html: 'Information goes here',
		        //split: true,
		        //autoScroll: true,
		        height: 10
                },*/{
                    //xtype:'panel',
                    region:'east',
                    //title: 'East Side',
                    //collapsible: true,
                    id:"eastpanel",
                    //split:true,
                    width: 195,
                    minSize: 200,
                    maxSize: 200,
                    border:false,
                    layout:'column',
                    margins:'0 0 0 3',
                    //contentEl: 'eastpanelcontent'
                    items:[{
	                    columnWidth:1,
	                    baseCls:'x-plain',
	                    bodyStyle:'padding:0px 0 5px 0px',
	                    items:[{
	                        //title: 'Important Cricket Links',
	                        border:true,
	                        bodyStyle:'padding:0px 0 0px 0px',
	                        contentEl: 'implinks'
	                    },{
	                        title: 'Cricket Links',
	                        border:true,
	                        bodyStyle:'padding:0px 0 0px 0px',
	                        contentEl: 'cricketlinks'
	                    },{
	                        title: 'Cricket Shop Links',
	                        bodyStyle:'padding:0px 0 0px 0px',
	                        border:true,
	                        contentEl: 'shoplinks'
	                    },{
	                        bodyStyle:'padding:5px 0 0px 10px',
	                        border:false,
	                        contentEl: 'letterLogo'
	                    },{
	                        bodyStyle:'padding:15px 0 0px 0px',
	                        border:false,
	                        contentEl: 'disclaimer'
	                    }]
	                }]
                    
                 },{
                    region:'west',
                    id:'westpanel',
                    title:'Latest News',
                    //split:true,
                    width: 195,
                    minSize: 200,
                    maxSize: 200,
                    margins:'0 3 0 0',
                    border:true,
                    layout:'accordion',
                    defaults: {bodyStyle: 'padding:5px'},  // applied to each contained panel
				    //fill:false,
                    
                    layoutConfig: {
				        titleCollapse: true,
				        hideCollapseTool:true,
				        animate: true
				    },
                    items: [/*{
                        contentEl: 'impNews',
                        title:'Imporant News',
                        //iconCls:'nav',
                        border:false
                    },*/{
                        title:'07/14/08 to 07/20/08',
                        contentEl: 'weekend0720',
                        border:false
                    },{
                        title:'07/07/08 to 07/13/08',
                        contentEl: 'weekend0713',
                        border:false
                    },{
                        title:'06/30/08 to 07/06/08',
                        contentEl: 'weekend0706',
                        border:false
                    },{
                        title:'06/23/08 to 06/29/08',
                        contentEl: 'weekend0629',
                        border:false
                    },{
                        title:'06/16/08 to 06/22/08',
                        contentEl: 'weekend0622',
                        border:false
                    },{
                        title:'06/09/08 to 06/15/08',
                        contentEl: 'weekend0615',
                        border:false
                    },{
                        title:'06/02/08 to 06/08/08',
                        contentEl: 'weekend0608',
                        border:false
                    },{
                        title:'05/26/08 to 06/01/08',
                        contentEl: 'weekend0601',
                        border:false
                    },{
                        title:'05/19/08 to 05/25/08',
                        contentEl: 'weekend0525',
                        border:false
                    },{
                        title:'05/12/08 to 05/18/08',
                        contentEl: 'weekend0518',
                        border:false
                    },{
                        title:'05/05/08 to 05/11/08',
                        contentEl: 'weekend0511',
                        border:false
                    },{
                        title:'04/28/08 to 05/04/08',
                        contentEl: 'weekend0504',
                        border:false
                    },{
                        title:'04/21/08 to 04/27/08',
                        contentEl: 'weekend0427',
                        border:false
                    }]
                },
                new Ext.TabPanel({
                    region:'center',
                    id:'centerpanel',
                    resizeTabs:true,
                    tabWidth:300,
                    width:500,
                    minSize: 500,
                    maxSize: 800,
                    deferredRender:false,
                    border:true,
                    activeTab:0,
                    items:[{
                        contentEl:'welcome',
                        title: 'Home of The Bengals',
                        autoScroll:true
                    },{
                    	xtype:"tabpanel",
                        title: 'About Us',
                        activeTab:0,
                        border:false,
                        tabWidth:500,
                        //resizeTabs:true,
                        closable:false,
                        margins:'20 20 20 20',
                        autoScroll:true,
                        items:[{
								xtype:'panel',
								autoScroll:true,
								border:false,
							    title: 'History of the Bengals',
							    contentEl: 'hist'
							},{
							    xtype:'panel',
							    autoScroll:true,	
							    title: 'Organization',
							    id: 'orgtab',
							    contentEl:'org'
							},{
							    xtype:"tabpanel",
		                        title: 'Players',
		                        activeTab:0,
		                        border:false,
		                        tabWidth:500,
		                        //resizeTabs:true,
		                        closable:false,
		                        margins:'20 20 20 20',
		                        autoScroll:true,
		                        items:[B1RosterGrid,B2RosterGrid]
							    
							},{
							    xtype:'panel',
							    autoScroll:true,	
							    title: 'Accomplishments',
							    id: 'accomplish',
							    contentEl: 'accomplishments'
						}]
                    },{
                        xtype:'tabpanel',
                        //contentEl:'schedule',
                        activeTab:0,
                        border:false,
                        resizeTabs:true,
                        title: 'Schedule',
                        autoScroll:true,
                        items:[{
							    xtype:'tabpanel',
							    autoScroll:true,	
							    title: '2008 Schedule',
							    //resizeTabs:true,
							    activeTab:0,
							    id: 'schedule08',
							    items:[B1regsch08grid,B2regsch08grid]
							},{
							    xtype:'tabpanel',
							    autoScroll:true,	
							    title: '2007 Schedule',
							    activeTab:0,
							    id: 'schedule07',
							    items:[regsch07grid,playoffsch07grid]
						}]
                        
                    },{
                        xtype:'tabpanel',
                        id:'stattab',
                        activeTab:0,
                        title: 'Statistics',
                        resizeTabs:true,
                        autoScroll:true,
                        items:[{
							    xtype:'tabpanel',
							    autoScroll:true,
							    resizeTabs:true,
							    activeTab:0,
							    title: '2009 Statistics',
							    id: '2009stats',
							    items:[{
									    xtype:'tabpanel',
									    autoScroll:true,	
									    title: 'Bengals-1',
									    resizeTabs:true,
									    activeTab:0,
									    id: 'b108stat',
									    items:[B1_08_batStatGrid,B1_08_bowlstatgrid]
									},{
									    xtype:'tabpanel',
									    autoScroll:true,	
									    resizeTabs:true,
									    title: 'Bengals-2',
									    activeTab:0,
									    id: 'b208stat',
									    items:[B2_08_batStatGrid,B2_08_bowlstatgrid]
								}]
							},{
							    xtype:'tabpanel',
							    autoScroll:true,	
							    resizeTabs:true,
							    activeTab:0,
							    title: '2007 Statistics',
							    id: 'stat07',
							    items:[batstat07grid,bowlstat07grid]
							}]
                    },{
                        xtype:'tabpanel',
                    	//contentEl:'grounds',
                        title: 'Members Corner',
                        resizeTabs:true,
                        activeTab:0,
                        autoScroll:true,
                        items:[{
                        	xtype:'panel',
	                        title: 'Member Duties',
	                        contentEl:'memberduties',
	                        autoScroll:true
                        },{
                        	xtype:'tabpanel',
	                        title: 'Grounds',
	                        resizeTabs:true,
	                        activeTab:0,
	                        autoScroll:true,
	                        items:[{
								    xtype:'panel',
								    autoScroll:true,	
								    title: 'Practice',
								    id: 'practicefield',
								    contentEl: 'practice'
								},{
								    xtype:'panel',
								    autoScroll:true,	
								    title: 'Bucklodge',
								    id: 'buckfield',
								    contentEl: 'bucklodge'
								},{
								    xtype:'panel',
								    autoScroll:true,	
								    title: 'Cherry Hill',
								    id: 'cherryhillfield',
								    contentEl: 'cherryhill'
								},{
									xtype:'panel',
									autoScroll:true,
									border:false,
									id: 'damascusfield',
								    title: 'Damuscus',
								    contentEl: 'damascus'
								},{
									xtype:'panel',
									autoScroll:true,
									border:false,
									id: 'fairfaxfield',
								    title: 'Lake Fairfax',
								    contentEl: 'fairfax'
								},{
								    xtype:'panel',
								    autoScroll:true,	
								    title: 'Galway',
								    id: 'galwayfield',
								    contentEl: 'galway'
								},{
									xtype:'panel',
									autoScroll:true,
									border:false,
									id: 'hyattsvillefield',
								    title: 'Hyattsville',
								    contentEl: 'hyattsville'
								},{
									xtype:'panel',
									autoScroll:true,
									border:false,
									id: 'jeffersonfield',
								    title: 'Jefferson',
								    contentEl: 'jefferson'
								},{
									xtype:'panel',
									autoScroll:true,
									border:false,
									id: 'metrofield',
								    title: 'Metro',
								    contentEl: 'metro'
								},{
								    xtype:'panel',
								    autoScroll:true,	
								    title: 'Woodmoor',
								    id: 'woodmoorfield',
								    contentEl: 'woodmoor'
							}]
                        }/*,{
                        	xtype:'panel',
	                        title: 'Forum',
	                        listeners: {activate: getForum},
	                        autoScroll:true
                        },{
                        	xtype:'panel',
	                        title: 'Email Login',
	                        listeners: {activate: getEmail},
	                        autoScroll:true
                        }*/
                        ] 
                    }/*,{
                        //xtype:"panel",
                        title: 'Contact Us',
                        autoScroll:true,
                        contentEl:'joinus'
                    }*/]
                })
             ]
        });
        /*Ext.get("hideit").on('click', function() {
           var w = Ext.getCmp('west-panel');
           w.collapsed ? w.expand() : w.collapse(); 
        });*/
        
            ///////// link to forum ////////////////
    var forum = function (x){
        location.href = 'http://www.washingtonbengals.org/forum/';
        }
    Ext.get('forum').on('click', forum); 

    ///////// link to email ////////////////
    var email = function (x){
        location.href = 'http://www.washingtonbengals.org/webmail/';
        }
    Ext.get('email').on('click', email); 

    ///////// link to image ////////////////
    var image = function (x){
        location.href = 'http://www.washingtonbengals.org/imggallery/';
        }
    Ext.get('image').on('click', image); 
    
    ///////// link to contact form ////////////////
    Ext.get('contactfrm').on('click', contactForm); 
    
 });