/**
* ExtJs Master App - loads in ViewPort and relevant Modules for the requested page.
*
* @author	sbrooks
* @version	$Id:
*
*/

Ext.namespace('Smart.Login.App');

Smart.Login.App = function () {
 
	return {
        init: function () {

			/**
			* Declare Viewport
			*/
            var adStats = new Ext.Viewport({
            	
            	layout:		'border',
                id:			'AdvertiserStats.Main',
                autoHeight:	true, 
 //               autoWidth:	true,
                items: [
					
					// Header
					new Smart.Header(),

					// Main central section
		            new Ext.Panel({
		            	region: 'center',
		                id: 'SmartMain',
		                height: window.height,
		                frame: true,
						autoScroll: true,
		                activeTab: 0,
						bodyStyle  : 'position: relative; left:35%; top: 150;',
						
						items: [
							
							new Ext.Panel({
								title: 'SMART Login',
								height: 130,
								width: 350,
								bodyStyle:  'padding: 5px; border: 1px solid #aaa; vertical-alignment: middle; background: #fff; text-align: center;',
								items:[
									{html: "<br>"},
									new Ext.Button({
										id:'advertiser_login', 
										width: 200,
										text: 'Login as an advertiser',
										handler: function(){
											window.location = 'advertiser/index.php';
										}
									}),
									{html: "<br>"},
									new Ext.Button({
										id:'publisher_login', 
										width: 200,
										text: 'Login as a publisher',
										handler: function(){
											window.location = 'publisher/index.php';
										}
									})	
								]
								
							})
		                ]
		            }), // End of TabPanel							
					
					// Footer
					new Smart.Footer()

		         ]
		      });

			// render layout to page
            adStats.render('container');
            adStats.doLayout();
        }
    };
}();

Ext.onReady(Smart.Login.App.init, Smart.Login.App);
   
