$( document ).ready(function() {
	$('#splash-embed').flash({
    swf: "flash/intro_v3.swf",
    width: 400,
    height: 490,
		allowScriptAccess: 'always'
  });

	$('#close-splash').click(function(e) {		
		splashEnd();
		return false;
	});
	
	//window.console && console.log(['referrer', document.referrer]);
	
	// Turned off at Pete's request on 1/12/11
	// if($.cookie('showsplash') == 'false') {
	// 		$('header, article, footer').css('visibility', 'visible');
	// 		$('#splash').hide();
	// 	} else {		
	// 		$.cookie('showsplash', 'false', { expires: 7 });
	// 	}
	
	if( /stirstuff.com/.test(document.referrer) ) {
		$('header, article, footer').css('visibility', 'visible');
		$('#splash').hide();
	}
	
});

function closeSplash() {
	window.setTimeout(splashEnd, 9999);
}

function splashEnd() {
	$('header, article, footer').css('visibility', 'visible');
	$('#splash').fadeOut(1200);
}

