
Ext.onReady(function() {
    Ext.QuickTips.init();
    // turn on validation errors beside the field globally
    Ext.form.Field.prototype.msgTarget = 'side';

	// create some portlet tools using built in Ext tool ids
	/*var tools = [{
		id:'gear',
		handler: function() {
			Ext.Msg.alert('Message', 'The Settings tool was clicked.');
		}
	},{
		id:'close',
		handler: function(e, target, panel){
			panel.ownerCt.remove(panel, true);
		}
	}];*/

	var viewport = new Ext.Viewport({
		layout:'border',
		items:[{
			// main toolbar
			id: 'application_bar',
			region: 'north',
			xtype: 'toolbar',
			height: 27,
			items: []//ToolbarConfig
		},{
			// status bar
			region: 'south',
            id: 'taskbar',
			xtype: 'panel',
			bodyCssClass: 'x-toolbar',
			bodyStyle: "border-width:1px 0px 0px 0px",
			border: true,
			height: 27,
            layout: 'hbox',
            layoutConfig: {
                align:'stretch'
            },
            defaults:{margins:'0 5 0 0'},
			items: [{
				xtype: 'tbtext',
				text: 'You are not logged in',
				id: 'statusBar',
                width: 150
			}]
		},/*{
			region:'west',
			id:'west-panel',
			title:'West',
			split:true,
			width: 200,
			minSize: 175,
			maxSize: 400,
			collapsible: true,
			//margins:'35 0 5 5',
			//cmargins:'35 5 5 5',
			layout:'accordion',
			layoutConfig:{
				animate:true
			},
			items: [{
				html: Ext.example.shortBogusMarkup,
				title:'Navigation',
				autoScroll:true,
				border:false,
				iconCls:'nav'
			},{
				title:'Settings',
				html: Ext.example.shortBogusMarkup,
				border:false,
				autoScroll:true,
				iconCls:'settings'
			}]
		},*/{
			// application area
			id: 'portal',
			xtype:'portal',
			bodyStyle: 'background: none;',
			region:'center',
			border: false,
			items:[{
				columnWidth:.333333,
				style:'padding:10px 0 10px 10px'
			},{
				columnWidth:.333333,
				style:'padding:10px 0 10px 10px'
			},{
				columnWidth:.333333,
				style:'padding:10px'
			}],
			
			listeners: {
				'drop': function(e){
					//Ext.Msg.alert('Portlet Dropped', e.panel.title + '<br />Column: ' + e.columnIndex + '<br />Position: ' + e.position);
				}
			}
		}]
	});

	application = new Application(window.location.href);
});

