var InternetExplorer=navigator.appName.indexOf("Microsoft")!=-1;function domainconnect_send(msg){var flash;if((window.ActiveXObject)&&(navigator.userAgent.indexOf("MSIE")!=-1)&&(navigator.userAgent.indexOf("Windows")!=-1)){flash=document.getElementById("hiddenConn")}else{flash=document.hiddenConn}flash.SetVariable("sendname",sDomainFlashID);flash.SetVariable("msg",msg);flash.TCallFrame("/",2)}function hiddenConn_DoFSCommand(command,args){if(command=="domainConnect"){var aArgs=args.split('|');if(aArgs.length>1){if(aArgs[0]=='refresh')document.location.href=aArgs[1]}else{launchGame(args)}}else if(command=="getURL"){var temp=new Array();temp=args.split('<separator>');var winwidth=0;var winheight=0;var wtimeout=0;var screenheight=screen.height;var screenwidth=screen.width;temp[1]=temp[1]?temp[1]:'ThisIsATestWindow';windowsi++;if(temp[3]){var size=temp[3].split('X');if(size[0]&&size[1]){winwidth=size[0];winheight=size[1]}}if(temp[2]){wtimeout=parseInt(temp[2])*1000}for(var i in windows){if(i==temp[1]&&temp[1]!='cashier'){windows[i].close();break}}if(temp[1]=='cashier'&&windows['cashier']&&!windows['cashier'].closed){windows['cashier'].focus()}else{var win=new Object();win['content']='<div id="HTMLLayoutFormPlace" style="display: none">'+temp[0]+'</div>';win['focus']=true;win['name']=temp[1];win['winwidth']=winwidth?winwidth:800;win['winheight']=winheight?winheight:600;newwin=newWindowObject(win);postParams(newwin)}}else if(command=="close"){self.close()}else if(command=="closeWindows"){closeWindows()}}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('Sub hiddenConn_FSCommand(ByVal command, ByVal args)\n');document.write('Call hiddenConn_DoFSCommand(command, args)\n');document.write('End Sub\n');document.write('</script\>\n')}var bFlashConnected=false;function Casino_DoFSCommand(command,args){var CasinoObj=InternetExplorer?Casino:document.Casino;if(command=="alert"){alert(args)}else if(command=="opensat"){if(window.frames["betfredsat"]&&!window.frames["betfredsat"].closed&&window.frames["betfredsat"].location.href.indexOf("offline")>0)betfredsat=window.open(sFullPathForGames+"sections/common/flashgame.asp","betfredsat","width=800,height=600,toolbar=no,menubar=no,scrollbars=no,resizable=no,top="+((screen.height/2)-(300))+",left="+((screen.width/2)-(400)));if(window.frames["betfredsat"]&&!window.frames["betfredsat"].closed){window.frames["betfredsat"].focus()}else{betfredsat=window.open(sFullPathForGames+"sections/common/flashgame.asp?game="+CasinoObj.GetVariable("newgame"),"betfredsat","width=800,height=600,toolbar=no,menubar=no,scrollbars=no,resizable=no,top="+((screen.height/2)-(300))+",left="+((screen.width/2)-(400)));betfredsat.focus()}}else if(command=="refreshsat"){if(window.frames["betfredsat"]&&!window.frames["betfredsat"].closed)window.frames["betfredsat"].location.reload()}else if(command=="closesat"){if(window.frames["betfredsat"]&&!window.frames["betfredsat"].closed)window.frames["betfredsat"].close()}else if(command=="gotoCashier"){parent.frames['mainFrame'].location=sAccDomainUrl;parent.frames['mainFrame'].focus()}else if(command=="writeCookie"){howlong=new Date();howlong.setTime(howlong.getTime()+100000000000);document.cookie=args+';expires='+howlong.toGMTString()}else if(command=="connection"){if(args==2){bFlashConnected=true}}else if(command=="getURL"){var temp=new Array();temp=args.split('<separator>');var winwidth=0;var winheight=0;var wtimeout=0;var screenheight=screen.height;var screenwidth=screen.width;temp[1]=temp[1]?temp[1]:'ThisIsATestWindow';windowsi++;if(temp[3]){var size=temp[3].split('X');if(size[0]&&size[1]){winwidth=size[0];winheight=size[1]}}if(temp[2]){wtimeout=parseInt(temp[2])*1000}for(var i in windows){if(i==temp[1]&&temp[1]!='cashier'){windows[i].close();break}}if(temp[1]=='cashier'&&windows['cashier']&&!windows['cashier'].closed){windows['cashier'].focus()}else{var win=new Object();win['content']='<div id="HTMLLayoutFormPlace" style="display: none">'+temp[0]+'</div>';win['focus']=true;win['name']=temp[1];win['winwidth']=winwidth?winwidth:800;win['winheight']=winheight?winheight:600;newwin=newWindowObject(win);postParams(newwin)}}else if(command=="close"){self.close()}else if(command=="closeWindows"){closeWindows()}}function postParams(form){var elForm=form.document.getElementById('SubmitCashierData');if(elForm==null){return false}else{elForm.submit();return true}}function newWindowObject(p){p.resizable=p.resizable?'yes':'no';p.top=p.top?p.top:'';p.left=p.left?p.left:'';p.url=p.url?p.url:'';p.winwidth=p.winwidth?p.winwidth:800;p.winheight=p.winheight?p.winheight:600;var win=window.open(p.url,p.name,"width="+p.winwidth+",height="+p.winheight+",toolbar=no,menubar=no,scrollbars=yes,resizable="+p.resizable+",top="+p.top+",left="+p.left);windows[p.name]=win;if(p.content.length>0&&p.url==''){win.document.open();win.document.write(p.content);win.document.close()}if(p.setoncontextmenu){win.document.getElementsByTagName('body')[0].oncontextmenu=function(){return false}}if(p.winclosetimeout>0){win.setTimeout(function(){win.close()},p.winclosetimeout)}if(p.winfocus){win.focus()}return win}function closeWindows(){for(var i in windows){if(windows[i]){windows[i].close()}}}function playRealOffline(arg){var flash;if((window.ActiveXObject)&&(navigator.userAgent.indexOf("MSIE")!=-1)&&(navigator.userAgent.indexOf("Windows")!=-1)){flash=document.getElementById("Casino")}else{flash=document.Casino}try{flash.SetVariable("newgame",arg);flash.TGotoLabel("clip","openFrame");flash.TPlay("clip");betfredsat=window.open(SiteLocation()+CommonServerUrl+"/satgame.aspx?gameMode=fun","betfredsat","width=800,height=600,toolbar=no,menubar=no,scrollbars=no,resizable=yes,top="+((screen.height/2)-(300))+",left="+((screen.width/2)-(400)));betfredsat.focus()}catch(e){alert(sPleaseEnableFlash)}}function playRealFun(arg){alert(sPleaseLogin);document.cookie="gamename="+escape(arg)+";";window.frames["betfredsat"].close()}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 Casino_FSCommand(ByVal command, ByVal args)\n');document.write('  call Casino_DoFSCommand(command, args)\n');document.write('end sub\n');document.write('</SCRIPT\> \n')}function isGameOpen(){if(window.frames["betfredsat"]==null)return false;if(!window.frames["betfredsat"].closed)return true;else return false}function confirmClose(){if(isGameOpen()){var res=confirm(sCasinoWindowToClose);if(!res)return false;if(window.frames["betfredsat"]!=null){launchGame('logoutgame');window.frames["betfredsat"].close()}return void(0)}launchGame('logoutgame');return void(0)}function launchGame(game){if(sCryptedUserData==''){betfredsat=window.open(sFullPathForGames+"sections/common/offlineflashgame.asp?game="+game,"betfredsat","width=800,height=600,toolbar=no,menubar=no,scrollbars=no,resizable=no,top="+((screen.height/2)-(300))+",left="+((screen.width/2)-(400)));betfredsat.focus();return}var flash;flash=document.getElementById("Casino");if(flash){launchGameDirectly(game)}else{document.location.href=document.location.href+'?'+'game='+game;return}}var nSecsToWait=20;var nSecsWaiting=0;function launchGameDirectly(game){if(flashinstalled==1){alert(sPleaseEnableFlash);return}if(!bFlashConnected){if(nSecsWaiting==nSecsToWait){return}nSecsWaiting++;setTimeout('launchGameDirectly("'+game+'")',1000);return}nSecsWaiting=0;var flash;if((window.ActiveXObject)&&(navigator.userAgent.indexOf("MSIE")!=-1)&&(navigator.userAgent.indexOf("Windows")!=-1)){flash=document.getElementById("Casino")}else{flash=document.Casino}try{flash.SetVariable("newgame",game);flash.SetVariable("user_id",sCryptedUserData);flash.TGotoLabel("clip","openFrame");flash.TPlay("clip")}catch(e){alert('Error running the game')}}var flashinstalled=0;var flashversion=0;MSDetect="false";if(navigator.plugins&&navigator.plugins.length){x=navigator.plugins["Shockwave Flash"];if(x){flashinstalled=2;if(x.description){y=x.description;flashversion=y.charAt(y.indexOf('.')-1)}}else flashinstalled=1;if(navigator.plugins["Shockwave Flash 2.0"]){flashinstalled=2;flashversion=2}}else if(navigator.mimeTypes&&navigator.mimeTypes.length){x=navigator.mimeTypes['application/x-shockwave-flash'];if(x&&x.enabledPlugin)flashinstalled=2;else flashinstalled=1}else MSDetect="true";