
var expdate = new Date ();
// Set expiration date for Total Rewards cookie = 365 days ahead
expdate.setTime (expdate.getTime() + (1000 * 60 * 60 * 24 * 730));
//begin sound prefs cookie
var _soundFlag = getCookie("FlashSound");

var _currentCasino = document.location.pathname

var _urlArray = new Array();
_urlArray = _currentCasino.split('/');




var propCode = _urlArray[2];


var _skipFlag = getCookie(propCode + "_FlashSkip");


function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}


function readSound()
{
	if (_soundFlag != null)
	{
		var flashMovie=getFlashMovieObject("heroFlash");
		flashMovie.SetVariable("/:soundPrefs", _soundFlag);
	}else{
		setCookie("FlashSound","off",expdate);
		var flashMovie=getFlashMovieObject("heroFlash");
		flashMovie.SetVariable("/:soundPrefs", "off");
	}
}
function setSound(args) 
{
	setCookie("FlashSound",args,expdate);
	var flashMovie=getFlashMovieObject("heroFlash");
	flashMovie.SetVariable("/:soundPrefs", args);
}



function readSkip()
{

	if (_skipFlag != null)
	{
		if (_skipFlag == "yes") {
			var flashMovie=getFlashMovieObject("heroFlash");
			flashMovie.SetVariable("/:skipPrefs", _skipFlag);
			//flashMovie.Play();
		}
		var flashMovie=getFlashMovieObject("heroFlash");
		flashMovie.SetVariable("/:skipPrefs", _skipFlag);
	}else{
		
		setCookie(propCode + "_FlashSkip","no",expdate);
	}
}

function setSkip(args) {
	var flashMovie=getFlashMovieObject("heroFlash");
	flashMovie.SetVariable("/:skipPrefs", args);
	
	setCookie(propCode + "_FlashSkip",args,expdate);
}






// -------- Set and get cookie functions
function getCookie(name)
{
    var cname = name + "=";
    var dc = document.cookie;
    if (dc.length > 0) 
    {
        begin = dc.indexOf(cname);
        if (begin != -1) 
	{
            begin += cname.length;
            end = dc.indexOf(";", begin);
            if (end == -1) end = dc.length;
            return unescape(dc.substring(begin, end));
        }
    }
	return null;
}
// Use this function to save a cookie.
function setCookie(name, value, expires) 
{
    document.cookie = name + "=" + escape(value) + "; path=/" +
    ((expires == null) ? "" : "; expires=" + expires.toGMTString());
}
