intro = function() {
	var versionStr = '10.0.0';
	var siteWrapper = '#site-wrapper';
	
	function init() {
		// do I even have flash?
		if (!swfobject.hasFlashPlayerVersion(versionStr)) {
			$sho('#alternateContent').remove();
			return;
		}
		
		// should I play the intro
		//var doPlay = ($sho.cookie("noIntro")) ? false : true;
				
		// if you don't want the intro to ever play
		doPlay = false;
		
		if ( doPlay ) { // show the intro
			// set a cookie til next sunday if they've already seen it
			var nextSunday = Date.today().next().sunday().at({hour:21, minute:30});
			$sho.cookie("noIntro", true, { path: '/', expires: nextSunday });
			
			// hide the site content
			if (jQuery.support.opacity) {
				$sho(siteWrapper).animate({
					opacity: 0
				}, 0).hide();
			} else {
				$sho(siteWrapper).hide();
			}
			
			// embed the swf
			var flashvars = {};
			var params = {
				wmode:"transparent",
				allowScriptAccess: "always",
				base:"flash/home/"
			};
			var attributes = {
				id:'flashContent'
			};
			swfobject.embedSWF("flash/home/dexterintro.swf", "alternateContent", "970", "608", versionStr, "lib/expressInstall.swf", flashvars, params, attributes);
		}
		else { // don't show the intro .. just hide the alternate content
			$sho('#alternateContent').remove();
		}
		
		// delete the cookie for testing
		//$sho.cookie("noIntro", null, { path: '/'});
	};
	function killFlash() {
		$sho('#flashContent').remove();
		
		if (jQuery.support.opacity) {
			$sho(siteWrapper).show().animate({
				opacity:1
			}, 1000);
		} else {
			$sho(siteWrapper).show();
		}
	};	
	return {
		init:init,
		killFlash:killFlash
	};
}();
var $sho = jQuery.noConflict(); // remap jquery to sho namespace
$sho(document).ready(function() {
	intro.init();
});
