
<!--

var newwin;
function launchwin(winurl,winname,winfeatures)
{
//This launches a new window and then
//focuses it if window.focus() is supported.
newwin = window.open(winurl,winname,winfeatures);
var javascript_version = navigator.appVersion;
if(javascript_version > 1.0)
{
//delay a bit here because IE4 encounters errors
//when trying to focus a recently opened window
setTimeout('newwin.focus();',250);
}
}
function refreshGame()
{
history.go();
}
 
 document.cookie = "test=ok";
 var mbCookiesEnabled = ( document.cookie) ? true : false;
 
 var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
 // Handle all the the FSCommand messages in a Flash movie
 function RootMovie_DoFSCommand( inZoneCommand, inCustomXml)
 {
 if ( inZoneCommand != "CustomEvent")
 {
 return ;
 }
 
 var oTokenArray = inCustomXml.split( "~");
 var command = oTokenArray[ 0];
 var args = oTokenArray[ 1];
 
 var RootMovieObj = InternetExplorer ? RootMovie : document.RootMovie;
 // <------------------------------------------------------------------------------- place code here
 if( command == "REFRESH")
 {
 alert( "REFRESH");
 }
 else if( command == "SetPrefs")
 {
 document.cookie = "Prefs=" + args + "; expires=Fri, 31 Dec 2010 23:59:59 GMT";
 }
 else if( command == "SetAvatar")
 {
 document.cookie = "Avatar=" + args + "; expires=Fri, 31 Dec 2010 23:59:59 GMT";
 }
 else if( command == "SetName")
 {
 document.cookie = "Name=" + args + "; expires=Fri, 31 Dec 2010 23:59:59 GMT";
 }
 else if( command == "GetPrefs")
 {
 if ( mbCookiesEnabled == false)
 {
 document.RootMovie.SetVariable( "/cConnection:mbNoCookies", "1");
 document.RootMovie.TCallLabel( "/cConnection", "lFsGetPrefs");
 return ;
 }
 
 // get the Prefs portion of the cookie
 var oCookies = document.cookie;
 var oCookiesArray = oCookies.split( ";");
 
 // get the cookies that starts with "Prefs = "
 var oIndex = 0;
 while ( oIndex < oCookiesArray.length)
 {
 var oCookie = oCookiesArray[ oIndex];
 if ( oCookie.charAt( 0) == " ")
 {
 // get rid of the leading space
 oCookie = oCookie.substr( 1);
 }
 
 if ( oCookie.indexOf( "Prefs=") == 0)
 {
 document.RootMovie.SetVariable( "/cConnection:mGamesPlayedPref", oCookie.substr( 6));
 }
 else if ( oCookie.indexOf( "Avatar=") == 0)
 {
 document.RootMovie.SetVariable( "/cConnection:mAvatarPref", oCookie.substr( 7));
 }
 else if ( oCookie.indexOf( "Name=") == 0)
 {
 document.RootMovie.SetVariable( "/cConnection:mNamePref", oCookie.substr( 5));
 }
 oIndex ++;
 }
 
 document.RootMovie.TCallLabel( "/cConnection", "lFsGetPrefs");
 }
 }
 
 // Hook for Internet Explorer
 if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
 navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
 document.write('<SCRIPT LANGUAGE=VBScript\> \n');
 document.write('on error resume next \n');
 document.write('Sub RootMovie_FSCommand(ByVal command, ByVal args)\n');
 document.write(' call RootMovie_DoFSCommand(command, args)\n');
 document.write('end sub\n');
 document.write('</SCRIPT> \n');
}

 //-->

