var minJavaVer="1.5";var minJavaVersion=minJavaVer+"+";var fullscreenMode=false;var browserName;var isFirefox=false;var isDevMode="";version=navigator.appVersion;browserName=navigator.appName;function Joyplay(){this.notLoggedInExceptionHandler=function(){alert("Not Logged in - refresh page")};this.initThirdParty=function(a,b){warn("Joyplay.initThirdParty() - This should be overriden!");b(true)};this.getFriends=function(a){a(new Array())};this.sendRequest=function(a){showWarning("This is not available in the guest version")};this.getFirstname=function(a){a("guest");return"guest"};this.inviteFriends=function(){showWarning("This is only available in the Facebook version")};this.postToFeed=function(){showWarning("This is only available in the Facebook version")};this.postToFeedOrInvite=function(){showWarning("This is only available in the Facebook version")};this.redeem=function(){showWarning("This is not available in the guest version")};this.likes=function(c,b){b(false)};this.getPermissions=function(a){a(new Object())};this.postScore=function(a){};this.autoPostToFeed=function(){};this.setStatus=function(){};this.fanPage=function(){};this.refreshBalance=function(a){};this.showFullProfile=function(a){};this.setDocumentSize=function(a){};this.logout=function(){};this.getAppUrl=function(){return serverUrl}}var Joyplay=new Joyplay();if(navigator.userAgent.indexOf("Firefox")!=-1){browserName="Firefox";isFirefox=true}else{if(navigator.userAgent.indexOf("MSIE")!=-1){browserName="Explorer"}}function Dim(){this.width=0;this.height=0}function jadeInstallJava(){if(deployJava.installLatestJRE()){alert("Ok great, Java is updated. Press enter to join the fun")}else{alert("Java update was canceled. No problem, it will install automatically later when you enter the rooms, make sure you click accept when prompted")}}function giveUp(){window.onbeforeunload=null;var a=unescape("givenUp.jsp");window.location.replace(a)}function refreshPage(){window.onbeforeunload=null;var a=unescape(window.location.pathname);window.location.replace(a)}function refreshPage(){window.onbeforeunload=null;window.location.reload(true)}function refresh(){window.scroll(0,0)}function openGame(a){myOpenWindow(a)}function goToGamemoviePage(c,a){var b=unescape(window.location.pathname);b+="?quick=true&gamename="+c+"&moviename="+a;window.location.replace(b)}var targetRoomId;function getTargetRoomId(){if(targetRoomId!=null){return targetRoomId}return getRoomIdFromUrl()}function getRoomIdFromUrl(){var b=getUrlParameter("roomId");if(b==""){try{var c=document.location.pathname.split("/");b=c[c.length-1];if(b.charAt(0)!="@"){b=""}}catch(a){}}return b}function openLobbyHelp(){tUrl="help.jsp";myOpenWindow(tUrl)}function openGameHelp(a){myOpenWindow(tUrl)}function openGetPoints(){tUrl="../../games/user/u?page=deposit";myOpenWindow(tUrl)}function openUserProfile(a){tUrl="../../games/user/u?page=xxx";myOpenWindow(tUrl)}function openUsersGameStats(b,a){tUrl="../../games/user/u?page=xxx";myOpenWindow(tUrl)}function openMyResources(){openInMainWindow("/games/user/myresources")}function openMyAccountPage(){openInMainWindow("/games/user/u?page=myaccount")}function openInvitePage(){openInMainWindow("/games/user/u?page=refer")}function goToSubscribePage(){openInMainWindow("/games/user/subscribe_page")}function openInMainWindow(b){var a=window.parent.opener;a.location.href=b;a.focus();if(isFirefox){a.alert("Press OK to continue")}}function openMyProfile(){openMyAccountPage()}function myOpenWindow(b){var a="width=840,height=700,left=25,top=20,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0";openURLAndDisplayDivIfBlocked(b,"",a)}function writeBrowser(){document.write("
Browser: "+browserName)}function isFirefoxBrowser(){browserName=navigator.appName;if(navigator.userAgent.indexOf("Firefox")!=-1){return true}return false}function checkVersion(b){var a="application/x-java-applet;version=";for(var c=0;c-1){if(pluginType.indexOf(a+""+b)>-1){return true}}}return false}function openURL(c,e,b){try{var a=window.open(c,e,b);if(a==null){return false}if(window.opera){if(!a.opera){return false}}}catch(d){return false}return true}var urlBackup;function openURLAndDisplayDivIfBlocked(b,c,a){if(openURL(b,c,a)==false){urlBackup=b;$("#popupBlockedDiv").show();$("#appletComponent").css("width","1px");$("#appletComponent").css("height","1px")}}function hidePopupBlockedDiv(){$("#popupBlockedDiv").style.display="none";$("#appletComponent").css("width","100%");$("#appletComponent").css("height","100%")}function arePopupsAllowed(a){return(getUrlParameter("continue")!="")||openURL(a+"/popupCheck.jsp","_blank","width=50,height=50,left=25,top=20,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0")}function openPopup(a){return openPopup(a,"popup")}function openPopup(a,b){return openURL(a,b,"width=900,height=680,resizable=yes,scrollbars=no,toolbar=no,menubar=no,location=no,status=no,directories=no")}function justOpenPopup(a){openPopup(a)}function justOpenPopup(a,b){openPopup(a,b)}function getUrlParameter(b){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var a="[\\?&]"+b+"=([^&#]*)";var d=new RegExp(a);var c=d.exec(window.location.href);if(c==null){return""}else{return c[1]}}function copyToClipboard(a){if(window.clipboardData&&clipboardData.setData){clipboardData.setData("Text",a)}}function goToSignUpPage(){window.onbeforeunload=null;window.parent.location.href="/signup_page"}function openfortunecity(c){var d=800,f=800;if(parseInt(navigator.appVersion)>3){d=screen.width;f=screen.height}else{if(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==3&&navigator.javaEnabled()){var e=java.awt.Toolkit.getDefaultToolkit();var b=e.getScreenSize();d=b.width;f=b.height}}var a="width="+(d-40)+",height="+(f-70)+",left=10,top=10,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=1";window.location.href=c}function writeAppletForSafari(a,c){var b=getObjectTag(a,c);document.write(b)}function getObjectTag(a,e){var b=''}b+="";return b}function getAsEmbedTag(a,d){var b="=700)){b+="/styles/medium/.css"}else{b+="/styles/small/.css"}$("link[rel=stylesheet].mainSizeStyle").attr("href",b)}function customLog(a,b){return(Math.log(a))/(Math.log(b))}function initReverseAjax(){if(dwr.engine._scriptSessionId==null){setTimeout("initReverseAjax()",2000)}else{dwr.engine.setActiveReverseAjax(true)}}function dummyCallback(a){}var scrollEventHandler=function(a){window.setTimeout(function(){window.scrollTo(0,1)},500);a.stopPropagation();a.preventDefault()};function getDocumentDimension(){var a=new Dim();a.width=$("body").width();a.height=$("body").height();return a}function isPortrait(){try{if(window.orientation==0||window.orientation==180){return true}else{return false}}catch(a){return false}}function getScreenSize(a){var b=new Dim();if(a==null){a=window.orientation}if(isIDevice()&&(a==90||a==270)){b.width=screen.height;b.height=screen.width}else{b.width=screen.width;b.height=screen.height}return b}function getAvailableScreenSize(a){if(isDesktop){var b=getContainerDimension();return b}else{if(withinIFrame){var b=getScreenSize(a);if(isIPad()){b.height-=80}else{if(isIPod()||isIPhone()){b.height-=30}}return b}else{var b=getContainerDimension();return b}}}function getContainerDimension(){var b=new Dim();if(typeof window.innerWidth!="undefined"){b.width=window.innerWidth;b.height=window.innerHeight}else{if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){b.width=document.documentElement.clientWidth;b.height=document.documentElement.clientHeight}else{b.width=document.getElementsByTagName("body")[0].clientWidth;b.height=document.getElementsByTagName("body")[0].clientHeight}}if(isIDevice()&&(window.orientation==90||window.orientation==270)){var a=b.width;b.width=b.height;b.height=a}return b}function setBodyHeightToFillWindow(){var a=getAvailableScreenSize();$("body").css("height",a.height+"px")}function isTouch(){return $.support.touch?true:false}function isLandscapeView(){var a=getDocumentDimension();return a.width>=a.height}function displayRotateScreenIfLandscape(){$(".rotateScreen").remove();if(!isDesktop&&isLandscapeView()){if(!ignoreRotation){displayRotateScreen();return true}}}function displayRotateScreenIfPortrait(){$(".rotateScreen").remove();if(!isDesktop&&isPortraitView()){if(!ignoreRotation){displayRotateScreen();return true}}}function displayRotateScreen(){if($(".rotateScreen").length==0){$("body").append("
Please rotate your device
[ignore]
");$(".rotateScreen").bind(tapEventName,function(){ignoreRotation=true;$(".rotateScreen").remove()})}}var prevW=0;var prevH=0;var prevDimH=0;var prevDimW=0;function clearPrevSizes(){prevW=0;prevH=0;prevDimH=0;prevDimW=0}function hasSizeChanged(){var a=$("body").css("width");var b=$("body").css("height");var c=getDocumentDimension();if(a==prevW&&b==prevH&&c.width==prevDimW&&c.height==prevDimH){return false}else{prevW=a;prevH=b;prevDimW=c.width;prevDimH=c.height;return true}}function setFullScreenMode(){try{log("setFullScreenMode called");fullscreenMode=true;setBodyHeightToFillWindow();window.scrollTo(0,1);$(document).unbind("scroll",scrollEventHandler);$(document).bind("scroll",scrollEventHandler)}catch(a){showWarning(a)}}function showWarning(b,c,a){warn(b);if(displayErrorMessage){if(c==null){c=3000}var e=$('
'+b+"
");e.addClass(a);$("body").prepend(e);e.show();setTimeout(function(){e.remove()},c)}}function Rectangle(b,d,c,a){this.x=b;this.y=d;this.width=c;this.height=a;this.intersects=function(e){if(e.y>=this.y&&e.y<=this.y+this.height||e.y+e.height>=this.y&&e.y+e.height<=this.y+this.height){return true}return false}}function openMiniBrowser(b,a){var c=$("