
// ************************************
// Main Application file
// ************************************

var PromotionWindowConfig = {
	id: "PromotionWindow",
	xtype: "Window",
	modal: "true",
	width: 400,
	height: 250,
	closeAction: 'close',
	border: false,
	draggable: false,
	title: "Camden Body is on Facebook!",
	bodyStyle: 'background-color:lightgrey; color:black; font-weight:bold; padding:20px; padding-top: 35px',
	html: "'Like' us on Facebook, and receive 10% off your next Mechanical Repair or Service.<br/><br/><br/><a href='http://www.facebook.com/camdenbody' target='_blank'><img width='175' height='40' src='/images/fb_joinus.png' /><img width='100' height='40' style='padding-left:10px' src='/images/headerlogo.png' /><a/>"
};

function AfterRenderDelayed()
{
	var win = new Ext.Window(PromotionWindowConfig);
	win.show('headerlogo');
}

var AppPaneConfig = {
	id: "AppPane",
	region: "center",
    xtype: 'tabpanel',
    activeTab: 0,
    width: 310,
    height: 150,
    enableTabScroll: true,
    deferredRender: true,
    defaults: {
        bodyStyle: 'padding:10px;background-color:lightgrey;color:black'
    },
    items: [{
        title: 'Home',
        contentEl: 'homeContent',
        preventBodyReset: true,
        listeners: {
        	afterrender: function() {
        		setTimeout("AfterRenderDelayed();", 8*1000); // 8 seconds
        	}
        }
    },{
        title: 'Services',
        contentEl: 'servicesContent',
        preventBodyReset: true, // preventBodyReset is to needed to render ul/li properly
        listeners: {
        	afterrender: function() {
			    new Ext.ToolTip({
			    	anchor: 'right',
			        target: 'estimateTip',
			        bodyStyle: 'color: white',
			        html: 'We use the CCC One Estimating & Workflow Solution to write estimates and manage your repair. This computerized system is linked to hundreds of parts suppliers across the nation. This guarantees you&#39;ll get the latest parts for the best prices!'
			    });
			
			    new Ext.ToolTip({
			    	anchor: 'right',
			        target: 'insuranceTip',
			        bodyStyle: 'color: white',
			        html: 'We work with all insurance companies, whether it&#39;s helping you with a rental car, scheduling work, or answering your questions. We&#39;ll work directly with your agent or claim representative to speed your repair needs.'
			    });
        	}
        }
    },{
    	id: 'locations_tab',
        title: 'Locations',
        layout: 'fit',
	    defaults: {
	        bodyStyle: 'background-color:lightgrey'
	    },
        items: [locationsContent]
    },{
        title: 'Guestbook',
        layout: 'fit',
	    defaults: {
	        bodyStyle: 'background-color:lightgrey'
	    },
        items: [guestbookContent]
    },{
        title: 'Shop Tour',
        html: shoptourContent,
        listeners: {
        	afterrender: function() {
        		AfterRenderShopTour();
        	}
        }
    },{
    	id: 'scheduler_tab',
        title: 'Scheduler',
        layout: 'fit',
        items: [schedulerContent]
    },{
    	id: 'mystatus_tab',
        title: 'My Status',
        html: mystatusContent
    },{
        title: 'Contact Us',
        html: contactusContent
    }]
};

var AppHeaderConfig = {
    id: "AppHeader",
    region: "north",
    xtype: "toolbar",
    height: 40,
	cls: "appheader",
    style: "border-bottom:none; padding-top: 8px; color: navy",
    items: [{
        xtype: "spacer",
        width: 10
    },{
        xtype: "label",
        html: "<img id='headerlogo' style=\"width:60px;padding-bottom:3px;\" src=\"/images/headerlogo.png\" />"
    },{
        xtype: "spacer",
        width: 15
    },{
        xtype: "label",
        html: "Camden Body & Fender",
        style: 'color:white; font-weight:bold; font-size:24px; font-family:garamond;verdana,sans-serif'
	},{
		xtype: "tbfill"
    }]
};

AppFooterHtml = " \
<div style='height:22px'> \
	<span style='float:left;padding-top:4px;'>&copy; 2011 Camden Body. All rights reserved.</span> \
	<div style='float:left;width:75px'>&nbsp;</div> \
	<div style='float:left;padding-top:4px;'>Follow us on:</div> \
	<div style='float:left;width:10px'>&nbsp;</div> \
	<div style='background: transparent url(/images/facebook.png) no-repeat scroll left center; height:22px; float:left; padding-right:5px;'><a href='http://www.facebook.com/camdenbody' target='_blank' style='padding-left: 25px; padding-top: 4px; height: 18px; float: left;'>Facebook</a></div> \
	<div style='float:left;width:10px'>&nbsp;</div> \
	<div style='background: transparent url(/images/twitter.png) no-repeat scroll left center; height:22px; float:left; padding-right:5px;'><a href='http://www.twitter.com/camdenbody' target='_blank' style='padding-left: 25px; padding-top: 4px; height: 18px; float: left;'>Twitter</a></div> \
</div> \
";

var AppFooterConfig = {
    id: "AppFooter",
    region: "south",
    xtype: "panel",
    height: 25,
    html: AppFooterHtml,
    bodyStyle: "border-top:none;padding-left:10px;font-size:11px;color:white;"
};
