/********************************************************************************************************************************
JQUERY HOMEPAGE INITIALIZATION 
@author = Keegan Watkins October 2008
********************************************************************************************************************************/

// Initialize homepage, fired on DOM ready
$(function(){
	// Begin setup: 
	HPNormalizer.initializeUI(); 
	// Call WebTrends with page and open tab info
	//dcsMultiTrack("DCSext.tabcontent_page","Homepage","DCSext.tabcontent_link", "NONE", "DCSext.tabcontent_tab",$(".tabs li.ui-tabs-selected span").text());
});

// To avoid global collisions with other objects/methods, all functionality here is wrapped in the HPNormalizer 
// Object. After the initializeUI() method is called above, all needed normalization for the HomePage will execute.
// Visual changes need to occur first; once complete all page event listeners are added. 
var HPNormalizer = new function() {
	
//--METHOD--//------------------------------------------------------------------------------------------------------------------------------->
	
	// Group all visual changes together to limit flickering/jiggling/motion on page load. There are several
	// tasks to accomplish on page load, these however are the most noticable to the user. 
	this.initializeUI = function() {
			// Tab-bify the tabs
			$("ul.tabs").tabs();
			//Force Firefox to reserve space for the vertical scrollbar, keeps from horizontal "jiggling" when all panels are closed
			if ($.browser.mozilla) {  $("body").css("overflow-y", "scroll"); }
			// Setup hover behavior for the tabs
			$("#nav ul li").hover( function(){$(this).addClass("hover")}  ,  function(){$(this).removeClass("hover")});
			// After all visual manipulation to DOM is complete, attach all event handlers
			this.bindPageEventHandlers();
	},
		
//--METHOD--//------------------------------------------------------------------------------------------------------------------------------->
	
	// Attach all page events		
	this.bindPageEventHandlers =  function() {
	
	}
}; //Closes HPNormalizer

/* Preloader */
jQuery.preloadImages=function(){
	for(var A=0;A<arguments.length;A++){
		jQuery("<img>").attr("src",arguments[A])
	}
};
