// Handle several common Flash callbacks used by all Affiliate sites.

function fromFlash_getIsAnonymousPlayer () 
{
   var isAnonymousPlayer = false;

   if ( m_isAnon == 1 ) 
   {
     isAnonymousPlayer = true;
   } 
   return isAnonymousPlayer;
}


/**
 * <<< START of cookie stuff to handle the "play games" page remembering the selected hit game group. >>>
 */
var HIT_GAME_GROUP_COOKIE_NAME = "hitGameGroupId"; 
function fromFlash_getHitGameGroupIdFromCookie () 
{
    var hitGameGroupId = getCookie ( HIT_GAME_GROUP_COOKIE_NAME );
    return hitGameGroupId;
}

function fromFlash_setHitGameGroupIdInCookie ( hitGameGroupId ) 
{
   setCookie ( HIT_GAME_GROUP_COOKIE_NAME, hitGameGroupId );
}
/**
 * <<< END!!! of cookie stuff to handle the "play games" page remembering the selected hit game group. >>>
 */

function getWholeCookie ( offset ) 
{
  var endstr = document.cookie.indexOf ( ";", offset );
  if ( endstr == -1 ) 
  {
  endstr = document.cookie.length;
  }
  return unescape(document.cookie.substring(offset, endstr));
}

function getCookie ( cookieName ) 
{
  var arg = cookieName + "=";
  var argLength = arg.length;
  var cookieLength = document.cookie.length;
  var i = 0;
  while ( i < cookieLength ) 
  {
    var j = i + argLength;
    if ( document.cookie.substring(i,j) == arg ) {
       return getWholeCookie(j);
    }
    i = document.cookie.indexOf ( " ", i) + 1;
    if ( i == 0 ) {
      break;
    }
  }
  return null;
}

function setCookie ( name, value ) 
{
  document.cookie = name + "=" + escape(value);
}

var m_pjuid = getCookie ( "pjuid" );

function fromFlash_getPopjaxUserId () 
{
   return m_pjuid; //54; //m_pjuid; //54; // m_pjuid;
}

function fromFlash_getHitGameGroupIdFromParm () 
{
   return m_passedInHitGameGroupId;
}

function fromFlash_getSortOrderFromParm () 
{
   return m_passedInSortOrder;
}

function fromFlash_getCategoryToSelect ( gotDataYet ) 
{
   return null; //m_categoryToSelect;
}

