if(top!==self){top.location=location}namespace("MySpace.Games.Canvas",{init:function(){if(MySpaceAppProfileContext.enforceLogin){MySpace.UI.LoginOverlayClient.show()}if(MySpaceAppProfileContext.executeAddApp){ifpc_requestInstall()}jQuery("#apptopnav_appinstall_link").bind("click",function(){ifpc_requestInstall()});jQuery("#apptopnav_appreport_link").bind("click",function(){ifpc_reportProblem()});jQuery("#apptopnav_forum_link a").attr("target","_blank");MySpace.Games.Canvas.setupToken();MySpace.Games.Canvas.checkNewInstall()},checkNewInstall:function(){if(window.location.search.match(/newinstall=1/i)!=null){MySpace.Apps.tryInstallCallback()}},setupToken:function(){var b=document.getElementsByTagName("iframe");if(b.length>0){for(var c=0;c<b.length;c++){var a=b[c].id;if(typeof a==="string"&&a.indexOf("apppanel_")===0){gadgets.rpc.setAuthToken(a,"0")}}}}});jQuery(document).ready(function(){MySpace.Games.Canvas.init()});function ifpc_requestInstall(){MySpace.Games.Modal.invokeAddApp({appid:MySpaceAppProfileContext.appId,redirecturl:location.href})}function ifpc_reportProblem(){MySpace.Games.Modal.invokeReportApp({appid:MySpaceAppProfileContext.appId})}function ifpc_requestPreferences(){headerContent=MySpaceRes.AppManagement.UserAppPref_Heading.replace("{0}",MySpaceAppProfileContext.appDisplayName);MySpace.UI.AppsPopup.ajaxPreferences(MySpaceAppProfileContext.appId,headerContent,function(b,a){})}jQuery(document).ready(function(){if(window._IFPC){_IFPC.registerService("requestInstall",ifpc_requestInstall);_IFPC.registerService("requestPreferences",ifpc_requestPreferences);_IFPC.registerService("reportProblem",ifpc_reportProblem)}});MySpace.UI.PopupV2=function(b){var l=this,i,j,m,d,f,c,e;function h(){j=a("msPopupV2Overlay",document.body);m=a("msPopupV2Wrapper",document.body);d=a("msPopupV2Box",m);f=a("msPopupV2Content",d);c=a("msPopupV2Border",d);e=a("msPopupV2Close",d);$addHandler(e,"click",l.hide);$addHandler(window,"resize",k);l.set(b||{});MySpace.UI.addStyles(".msPopupV2Overlay { position:absolute;top:0;left:0;display:none;z-index:1000200;width:100%;opacity:0.6;filter:alpha(opacity=60);background:#000; }.msPopupV2Wrapper { position:absolute;left:0;display:none;width:100%;z-index:1000201 }.msPopupV2Box { margin:0 auto;padding:10px;position:relative; }.msPopupV2Border { position:absolute;top:0;left:0;background:#000;height:100%;width:100%;opacity:0.33;filter:alpha(opacity=33);-moz-border-radius:10px;-webkit-border-radius:10px;z-index:-1; }.msPopupV2Close { position:absolute;top:-5px;right:-7px;height:15px;width:15px;background:url("+MySpace.StaticContentBase+"/modules/common/static/img/closepopup.png);cursor:pointer; }.msPopupV2Content { height:100%;width:100%;overflow:auto;background:#444; }",false,"MySpace.UI.PopupV2")}function k(){j.style.height=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)+"px"}function a(n,p){var o=document.createElement("div");o.className=n;p.appendChild(o);return o}function g(o){if(jQuery.browser.msie&&parseInt(jQuery.browser.version,10)<=6){var q="iframe,select,embed,object",p=$q(q),n=$q(q,m);Array.forEach(p,function(r){if(Array.indexOf(n,r)==-1){if(o){r.setAttribute("origvis",r.style.visibility)}r.style.visibility=o?"hidden":(r.getAttribute("origvis")||"")}})}}l.show=function(){k();j.style.display="block";m.style.display="block";d.style.height=b.height+"px";d.style.width=b.width+"px";var n=window.innerHeight||document.documentElement.clientHeight,o=document.documentElement.scrollTop||document.body.scrollTop;m.style.top=(o+Math.max(Math.round((n-b.height)/2),50))+"px";c.style.zoom="1";c.style.zoom="";g(true);i=true};l.hide=function(n){j.style.display="";m.style.display="";g(false);i=false};l.set=function(o){for(var n in o){b[n]=o[n]}if(o.content){if(typeof o.content=="string"){f.innerHTML=o.content}else{f.innerHTML="";f.appendChild(o.content)}}if(i){l.show()}};l.getCloseButton=function(){return e};h()};if(!MySpace){MySpace={}}if(!MySpace.UI){MySpace.UI={}}MySpace.UI.LoginOverlayClient=(function(){var h=this,a,d=350,e=550,i=450,g;function f(){return !(MySpace.ClientContext&&MySpace.ClientContext.UserId>0)}function c(){var j;if(document.domain.indexOf("myspace.dev")>=0){document.domain="myspace.dev";j="http://secure.myspace.dev"}else{if(document.domain.indexOf("myspace.com")>=0){document.domain="myspace.com";j="https://secure.myspace.com"}}j+="/index.cfm?fuseaction=login.simpleform&featureName=loginOverlay";if(a.titleClass1&&a.titleKey1){j+="&tc1="+a.titleClass1+"&tk1="+a.titleKey1}if(a.titleClass2&&a.titleKey2){j+="&tc2="+a.titleClass2+"&tk2="+a.titleKey2}return j}function b(){var j=document.createElement("iframe");j.style.height="100%";j.style.width="100%";j.style.border="none";j.scrolling="no";j.frameBorder="0";j.src=c();return j}h.show=function(k){a={};if(k){for(var j in k){a[j]=k[j]}}if(f()){var l={height:d,width:i,content:b()};if(!g){g=new MySpace.UI.PopupV2(l)}else{g.set(l)}g.show();return true}else{if(a.alreadyLoggedInCallback&&typeof(a.alreadyLoggedInCallback)=="function"){a.alreadyLoggedInCallback()}else{h._loggedIn()}}return false},h.hide=function(){if(g){g.hide()}};h._resizeForCaptcha=function(j){if(g){if(j){g.set({height:e})}else{g.set({height:d})}}};h._loggedIn=function(j){h.hide();if(a.loggedInCallback&&typeof a.loggedInCallback=="function"){a.loggedInCallback(j)}else{if(a.redirectUrl&&typeof a.redirectUrl=="string"){window.top.location=a.redirectUrl}else{window.location.reload(true)}}};return h})();
