
	function afterLoginCallback ( _pjuid ) 
	{		
       if ( _pjuid == null || _pjuid == "null" ) {
		    window.location.href="/videocube/index.htm"; 
	   }
	   
       var registrationRequiredLink = document.getElementById ( "registrationRequiredLink" );
	   if ( registrationRequiredLink != null )
         registrationRequiredLink.style.display = "none";

       m_pjuid = _pjuid;
	   
       var topNavRegisterLink = document.getElementById ( "topNavRegisterLink" );
       var topNavMemberLink   = document.getElementById ( "topNavMemberLink" );
	   topNavMemberLink.style.display = "block";
	   topNavRegisterLink.style.display = "none";
	   
	   var mainFlashContent = document.getElementById ( "mainFlashContent" );
	   mainFlashContent.refreshData ();
	}
	
	function afterRegistrationCallback ( _pjuid ) 
	{
	   m_pjuid = _pjuid;

       var topNavRegisterLink = document.getElementById ( "topNavRegisterLink" );
       var topNavMemberLink   = document.getElementById ( "topNavMemberLink" );
	   topNavRegisterLink.style.display = "none";
	   topNavMemberLink.style.display   = "block";

       if ( _pjuid == null || _pjuid == "null" ) 
	   {
		  window.location.href = "/videocube/index.htm"; 
	   }

       var registrationRequiredLink = document.getElementById ( "registrationRequiredLink" );
	   if ( registrationRequiredLink != null )
         registrationRequiredLink.style.display = "none";

	   var mainFlashContent = document.getElementById ( "mainFlashContent" );
	   mainFlashContent.refreshData ();  
	}
	function userChangedCallback ( _pjuid, _userName )
	{
       var lgOutForm = getEl("logOutForm2");
	   lgOutForm.style.display = "block";
		
	   var lgInForm = getEl("loginform2");
	   lgInForm.style.display = "none";
		
	   getEl("userNameLoggedIn").innerHTML = _userName;		
	}
	
	
	function afterLogOutCallback () 
	{
	   m_pjuid      = null;
       m_pjuserName = null;
	 
	   var uname = document.getElementById("userNameLoggedIn"); 	
       if ( uname != null )
	     uname.innerHTML = "";
		 
       var topNavRegisterLink = document.getElementById ( "topNavRegisterLink" );
       var topNavMemberLink   = document.getElementById ( "topNavMemberLink" );
	   topNavMemberLink.style.display = "none";
	   topNavRegisterLink.style.display = "block";

       var registrationRequiredLink = document.getElementById ( "registrationRequiredLink" );
	   if ( registrationRequiredLink != null )
         registrationRequiredLink.style.display = "none";
	   
	   // Wait a bit - becuase otherwise this is calling the GAME SERVER at 
	   //  the same time that we are trying to send it a LOGOUT message !
	   setTimeout ( delayedChooserRefresh, 1200 );
	}  
  
    function delayedChooserRefresh ()
	{
	   var mainFlashContent = document.getElementById ( "mainFlashContent" );
	   mainFlashContent.refreshData ();
	}
	
/*******************************************************
* FUNCTIONS CALLED BY THE FLASH CONTENT
********************************************************/

   function startPop4Game ( categoryIdsString ) {
	  
	  var gamePageUrl = "/game/standAloneGame.jsp?game_type=POP4&categories=" + categoryIdsString + "&pjuid=" + m_pjuid + "&pjusername=" + m_pjuserName;
	  window.location.href = gamePageUrl;
	     //"file:///C:/Users/User/Documents/workspace/release/FlashGame/deploy/pop4Game.html";
		 urchinTracker("/playPop4/step1.html")
   } 

   function startPopSpinGame ( categoryIdsString ) {
   
     // setDidNotBounceFromSite ();
	  var gamePageUrl = "/game/standAloneGame.jsp?game_type=POPSPIN&categories=" + categoryIdsString + "&pjuid=" + m_pjuid + "&pjusername=" + m_pjuserName;
	  window.location.href = gamePageUrl;
	     urchinTracker("/playPopSpin/step1.html")
   } 
   
   function startHitGame ( gameId ) {
      
	 // setDidNotBounceFromSite ();
	 
	 var gamePageUrl = "/content/game3/standAloneGame.htm?game_id=" + gameId ; 
	 
// var gamePageUrl = "/game/standAloneGame.jsp?game_type=HIT&game_id=" + gameId + 
//  "&pjuid=" + m_pjuid + "&pjusername=" + m_pjuserName;

	  window.location.href = gamePageUrl;
//	  urchinTracker("/playHitGame/step2.html")
   } 
      