	$j(function() {
		
		// load cookie
		if(!cookieExists('beenHome')) {
			document.cookie = 'beenHome=true;';
			initFlashTimer();
		} else {
			$j('DIV.home-banners').show();
			showBanners();
		}
	});
	
	function initFlashTimer()
	{
		$j('DIV.home-flash').show();
		setTimeout("setupBanners()", 11000);
	}
	
	function setupBanners()
	{
		// Fade out the flash movie
		$j('DIV.home-flash').fadeOut(1000);
		
		// Fade in the banners
		$j('DIV.home-banners').fadeIn(1000);
		
		// Make the banners do their thing
		showBanners();
	}
	
	function showBanners()
	{
		$j('#home-banners') 
		.before('<div id="banner-pager">') 
		.cycle({ 
			fx:     'fade', 
			speed:  1000, 
			timeout: 5000, 
			pager:  '#banner-pager' 
		});
	
		$j('a.pause ').toggle(function() {
			$j('#home-banners').cycle('pause');
			$j(this).text('resume');
			return false;
		}, function() {
			$j('#home-banners').cycle('resume');
			$j(this).text('pause');
		});
	}
	
	function cookieExists(c_name)
	{
		if (document.cookie.length>0) {
			c_start=document.cookie.indexOf(c_name + "=");
			if (c_start!=-1) {
				c_start=c_start + c_name.length+1;
				c_end=document.cookie.indexOf(";",c_start);
				if (c_end==-1) c_end=document.cookie.length;
				return unescape(document.cookie.substring(c_start,c_end));
			}
		}

		return false;
	}
