function HomeController(obj) {
	//Common.tracer(obj);

	/*
	Class: HomeController
	Controller class for the home screen view. Handles user interaction and scrolling.
			 
	Package: Controllers
	*/
	
	// ------------------------------------------------------------------------------------------
	// DEFINE PROPERTIES
	// ------------------------------------------------------------------------------------------
	this._tabControllerCls;
	
	// ------------------------------------------------------------------------------------------
	// INTIALIZATION
	// ------------------------------------------------------------------------------------------
	
	/*
	Function: init
	Calls primary initialization methods.
	*/
	this.init = function(obj) {
		Common.tracer("HomeController.init");
		this.setupListeners(obj);
		this.setupProps(obj);
	};
	
	/*
	Function: setupProps
	Assigns all primary properties. 
	*/
	this.setupProps = function(obj) {
		//Common.tracer("HomeController.setupProps");
	
		var self = this;
		$(document).ready(function() {
			  // Handler for .ready() called.
			self.generate();
		});
	};
	
	/*
	Function: setupListeners
	Assigns all primary listeners. 
	*/
	this.setupListeners = function(obj) {
		Common.tracer("HomeController.setupListeners");
		Common.addEventListener({_idStr: "click", _targetStr: '.ev_navButton', _weakBln: false, _eventObj: {_context: this, _fn: this.navClicked} } ); //_weakBln: false
		Common.addEventListener({_idStr: "K_HomeController.generateTabs", _eventObj: {_context: this, _fn: this.generateTabs} } ); //_weakBln: false
	};
	
	/*
	Function: removeListeners
	Assigns all primary listeners to be removed by destroy. 
	*/
	this.removeListeners = function() {
		//Common.tracer("HomeController.REMOVE LISTENERS");
		//Common.removeEventListener({_idStr: "change", _targetStr: '.ev_winnower_criteriaType_'+this._idStr } ); //_weakBln: false
	};
	
	// ------------------------------------------------------------------------------------------
	// GENERATION
	// ------------------------------------------------------------------------------------------
	
	/*
	Function: generate
	Calls all primary generation methods.
	*/
	this.generate = function(obj) {
		//Common.tracer("HomeController.generate");

		$('.home-rotator').cycle({
			fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		});
		
		/*
		var defaults = {
  			containerID: 'moccaUItoTop', // fading element id
			containerHoverClass: 'moccaUIhover', // fading element hover class
			scrollSpeed: 1200,
			easingType: 'linear' 
 		};
		*/
		
		$().UItoTop({easingType: 'linear', scrollSpeed: 400 });		
		
		this.generateTabs();
		
		this.generateForm();
		
	};
	

	this.generateTabs = function(obj) {
		Common.tracer("HomeController.generateTabs");

	    var obj={
        	_selectedIdStr: 'brokers-button-overview',
    		_idStr: "tab1", 
    		_buttonIdArr: ["brokers-button-overview", "brokers-button-agent", "brokers-button-proagent", "brokers-button-brokers", "brokers-button-designer"],
    		_contentIdArr:["tabs_tab1_tabContent", "tabs_tab2_tabContent", "tabs_tab3_tabContent", "tabs_tab4_tabContent", "tabs_tab5_tabContent"],
    		_activeStyleStr:'active',
    		_noStartingStateBln: false,
    		_hideContentBln: true
    		
    	};		
	   this._tabControllerCls = new TabController(obj);
	
	}
	
	
	this.generateForm = function(obj) {
		
		this._formCls = new ContactUsForm();
	}
	// ------------------------------------------------------------------------------------------
	// EVENT METHODS
	// ------------------------------------------------------------------------------------------
	

	this.navClicked = function(obj) {
		Common.tracer("HomeController.navClicked");
		var sectionStr = $(obj._eventObj.currentTarget).data("section");
		
		this.gotoSection(sectionStr);
	}
	
	this.gotoSection = function(sectionStr) {
		
		//remove active from the top nav
		$(".nav-button").removeClass("active");
		
		$("#topnav-"+sectionStr).addClass("active");
		
		
		$('html, body').animate({
	         scrollTop: $("#"+sectionStr).offset().top
	     }, 400);		
		
	}

	
	// ------------------------------------------------------------------------------------------
	// CALL TO CONSTRUCTOR - MUST BE AT THE END
	// ------------------------------------------------------------------------------------------
	this.init();
}

HomeController = new HomeController();

