// ------- Private vars -------
var jsReady = false;
var swfReady = false;
var swfName = "dssb";
AC_FL_RunContent = 0;

// -------- Functions --------

function setCookie(cookieName, cookieExp, inCookieValue) {
	// alert("Setting cookie " + cookieName + " to " + inCookieValue + " to expire in " + cookieExp + " days");
	$.cookie(cookieName, inCookieValue, { expires: cookieExp, path: '/'});
	
	if ($.cookie(cookieName) == inCookieValue) {
		// alert("Cookie set");
		return true;
	} else {
		// alert("Could not set cookie");
		return false;
	}
}

function getCookie(cookieName) {
	// alert("Getting cookie " + cookieName + ".  Returning " + $.cookie(cookieName));
	return $.cookie(cookieName);
}

function cookieExists(cookieName) {
	if ($.cookie(cookieName)) {
		// alert("Cookie Exists");
		return true;
	} else {
		// alert("Cookie not found");
		return false;
	}	
}

// ------- functions called by ActionScript -------
// called to check if the page has initialized and JavaScript is available
function isReady()
{
	// alert("Check if page is ready");
    return jsReady;
}

// called by the onload event of the <body> tag
function pageInit()
{
    // Record that JavaScript is ready to go.
	jsReady = true;
	// alert("Page is ready");
	
}

function setSWFIsReady()
{
	swfReady = true;
	// alert("SWF is ready");
}

function getSWF(movieName)
{
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        return window[movieName];
    }
    else
    {
        return document[movieName];
    }
}


