JPC = {};
JPC.Layout = function(config) {
	this.view = new Ext.Panel({
		layout: 'border',
		renderTo: document.body,
		floating: true,
		shadow: false,
		x: 100,
		y: 10,
		height: 910,
		width: 955,
		items: [{
			region: 'north',
			border: false,
			bodyStyle: 'background-color:#FDF8FF;',
			html: '<img src="/i/sunlogo.png" style="float:left;margin-left:5px;margin-top:5px" /><div style="width:820px;color:#8B008B;float:left;text-shadow: 2px 2px 3px #999;"><span style="font-size:25pt;font-family:sans-serif;font-weight:bold;text-shadow:0 0 3px black, 0 0 2px black, 1px 1px 2px gray;">Jordan Psychological Assessment Center</span><br /><span style="font-size:15pt;float:left;font-family:sans-serif">Karen M. Jordan, Ph.D., Licensed Psychologist</span><span style="font-size:15pt;float:right;text-align:right;font-family:sans-serif;padding-left:10px;border-left:1px solid #8B008B;">7381 W. 133rd St., Suite 260<br />Overland Park, KS  66213<br />(913) 647-7990</span></div>',
			height: 120
		},{
			region: 'center',
			autoHeight: true,
			border: false,
			items: [{
				xtype: 'tabpanel',
				autoScroll: true,
				border: false,
				layoutOnTabChange: true,
				deferredRender: false,
				activeTab: 0,
				id: this.bottomPanel=Ext.id(),
				items: [{
					xtype: 'panel',
					title: 'Home',
					autoScroll: true,
                    autoHeight: true,
					autoLoad: {
						url: 'main.html'
					}
				},{
					xtype: 'panel',
					title: 'Services',
					autoScroll: true,
					autoLoad: {
						url: 'services.html'
					}
				},{
					xtype: 'panel',
					title: 'Cogmed',
					autoScroll: true,
					autoLoad: {
						url: 'cogmed.html'
					}
				},{
					xtype: 'panel',
					title: 'Location and Hours',
					autoLoad: {
						url: 'location.html'
					}
				},{
					xtype: 'panel',
					title: 'FAQ',
					autoScroll: true,
					autoLoad: {
						url: 'faq.html'
					}
				},{
					xtype: 'panel',
					title: 'Links',
					autoLoad: {
						url: 'links.html'
					}
				},{
					xtype: 'panel',
					title: 'Classes and Presentations',
					autoLoad: {
						url: 'classes.html'
					}
				},{
					xtype: 'panel',
					title: 'Resources',
					autoLoad: {
						url: 'books.html'
					}
				},{
					xtype: 'panel',
					title: 'About',
					autoScroll: true,
					autoLoad: {
						url: 'aboutdrjordan.html'
					}
				},{
					xtype: 'panel',
					title: 'Contact',
					autoScroll: true,
					autoLoad: {
						url: 'contact.html'
					}
				}]
            }]
		},{
            region: 'south',
            height: 90,
            html: '<!--Professional verification provided by therapists.psychologytoday.com --><a href="http://therapists.psychologytoday.com/rms/verification.php?profid=50288" target="_blank"><img src="http://therapists.psychologytoday.com/rms/external-verification.php?profid=50288" alt="verified by Psychology Today" border=0></a><!--End Verification --><a href="http://cogmedqualifiedpractices.com"><img src="http://cogmed.com/shields/practice/jordan_psychological_assessment_center.png" alt="Cogmed Qualified Practice" width="360" height="81" border="0" /></a>'
        }]
	});
	this.adjustMiddle(Ext.getBody().getWidth(),Ext.getBody().getHeight());
	Ext.EventManager.onWindowResize(this.adjustMiddle,this)
};

Ext.extend(JPC.Layout,Ext.util.Observable,{
	adjustMiddle: function(width,height) {
		var size = this.view.getSize();
		var pos = (width-size.width)/2;
		if (pos < 0) {
			pos = 0;
		}
		this.view.setPosition(pos,10);
	}
});

var layout = null;
Ext.onReady(function() {
	layout = new JPC.Layout();
});
