// JavaScript Document
var SplashLoopCount = 3;
//var SplashAnimationFile = "/content/flash/new_players_splash.swf";
var SplashAnimationFile = "/content/flash/registered_players_splash_SEP.swf";
var SplashAnimationFile2 = "/content/flash/registered_players_splash.swf";

//registered_players_splash_SEP.swf

function SplashGetCookie(sName)
{
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0]) 
      return unescape(aCrumb[1]);
  }
  return null;
}

function SplashSetCookie(sName, sValue)
{
  document.cookie = sName + "=" + escape(sValue);
  // Expires the cookie in one month
  var date = new Date();
  date.setMonth(date.getMonth()+1);
  document.cookie += ("; expires=" + date.toUTCString()); 
}

Shadowbox.init({
		overlayColor:		"#000000",
		overlayOpacity:		0.5,
		flashParams:		{bgcolor: "#FFFFFF"},
		flashVars:			{playCount: SplashLoopCount},
		modal:				true,
		displayNav:			false,
		animate: 			false
});

window.onload = function() {
	if (checkSplash())
	{
		// set cookie to SHOWN
		SplashSetCookie("splash02","SHOWN")
		Shadowbox.open({
			content: 			SplashAnimationFile,
			player: 			'swf',
			width:				800,
			height:				400	
		});
	}
	else return;
	// turned off splash screen for july (new splash screens to come)

}

function closeSplash()
{
	Shadowbox.close();	
}

function checkSplash()
{
	if (document.referrer.toString().indexOf("bingohollywood") != -1) return false;
	if (SplashGetCookie("splash02") == "showSplash") return true;
	return false;
}

function checkSplash2()
{
	if (document.referrer.toString().indexOf("bingohollywood") != -1) return false;
	if (SplashGetCookie("splash02") == "showSplash") return true;
	return false;
}


checkSplash()
