new BannerUtils();   // This is needed to declare the static variables
function BannerUtils()
{
	//-----------------------------------------------------------------------------------------------------------
	// Static functions
	//-----------------------------------------------------------------------------------------------------------

	BannerUtils.initBanners = initBanners;
	
	//-----------------------------------------------------------------------------------------------------------
	// Functions
	//-----------------------------------------------------------------------------------------------------------
	
	function initBanners()
	{
		// Set delay to prevent all banners refreshing at once, we increment per banner container load
		var initialDelay = 0;
		
		$('.banner_wrapper').each(function(i)
		{
			var pagingDiv = '#' + this.id + ' > .banner_paging';
			var bannersDiv = '#' + this.id + ' > .banners';
			
			$(bannersDiv).cycle
			({
				fx: 'fade',
				pause: true,
				speed:500,
				timeout: 6000,
				delay: initialDelay,
				pager: pagingDiv 
			});
			
			initialDelay += 800;
			
			// Shows and hides navigation based on hovering over the banners
			$(bannersDiv).hover
			(
				function(){$(this).next().css('display', 'block');},
				function(){$(this).next().css('display', 'none');}
			);
			
			$(pagingDiv).hover
			(
				function(){$(this).css('display', 'block');}
			);
		});
	}
}
