off the screen as we can. } var daysLeft; function showTrialBanner(daysRemaining) { daysLeft = daysRemaining; $('#TrialBannerContainer').load('trialbanner.htm',"",setTrialBanner); } function setTrialBanner(responseText, textStatus, XMLHttpRequest) { $('#affiliateheaderforcp').height(28); $('#club_penguin').height('95%'); $('#hdrWrap').attr("style", "height:28px !important"); if(daysLeft > 1) { var countDown = $('#TrialText').html().replace('%CountDown', daysLeft); $('#TrialText').html(countDown); $('#TrialText2').remove(); } else { $('#TrialText').remove(); } if ($.browser.msie && parseInt($.browser.version, 10) === 7) { $('#TrialBannerContainer').height(28); } else { $('#TrialBannerContainer').animate({height:'+28'}, 1000); } } function biAbout() { window.metrics.log('game_action', {'context':'membership_trial', 'action':'about_banner'}); } function selectLang() { var addsmallscreen = "" if (window.location.href.search(/smallscreen/) >= 0 ) { addsmallscreen = "#/smallscreen"; } location.href=document.selectlang.go2.options[document.selectlang.go2.selectedIndex].value+addsmallscreen; } function send(f) { var addsmallscreen = "" if (window.location.href.search(/#smallscreen/) >= 0 ) { addsmallscreen = "#/smallscreen"; } var chosen; chosen=f.go2.options[f.go2.selectedIndex].value; self.location=chosen+addsmallscreen; return false; } function embedCallback() { if (document.getElementById('upgrade')) { if (swfobject.hasFlashPlayerVersion("1")) { document.getElementById('upgrade').style.display = 'block'; document.getElementById('installText').style.display = 'none'; window.metrics.logError({ "reason" : "Flash not installed", "context" : "launch_clubpenguin" }); } else { document.getElementById('upgrade').style.display = 'block'; document.getElementById('upgradeText').style.display = 'none'; document.getElementById('upgradeButton').style.display = 'none'; window.metrics.logError({ "reason" : "Flash version too low", "context" : "launch_clubpenguin" }); } } } function initHWAccel() { setCookie("hwaccel", "1", 8); if (swfobject.hasFlashPlayerVersion("11.1")) { var sUrl = "http://media1.clubpenguin.com/play/pt/swf/hwaccel.swf"; var sID = "hwaccel"; var sWidth = "1"; var sHeight = "1"; var sVersion = "11.1"; var params = { menu : "false", quality : "high", allowscriptaccess : "always", wmode : "direct" }; var attributes = { "id" : "hwaccel", "name" : "hwaccel", "class" : "hwaccel" }; swfobject.embedSWF(sUrl, sID, sWidth, sHeight, sVersion, null, null, params, attributes); } else { flashVersion = swfobject.ua.pv[0] + "," + swfobject.ua.pv[1]+ "," + swfobject.ua.pv[2]; if (swfobject.ua.win) { flashVersion = "WIN " + flashVersion; } if (swfobject.ua.mac) { flashVersion = "MAC " + flashVersion; } window.metrics.log('flash_profile', {"hw_accelStatus":"unavailable", "hw_browser":navigator.userAgent, "hw_driverInfo":"unknown", "hw_playerType":"unknown", "hw_os":navigator.platform, "hw_version":flashVersion}); initGameLoad(); } } function unloadHWAccel() { swfobject.removeSWF('hwaccel'); $('#hwaccel').remove(); } function initAffiliateMenu() { var swfUrl = "http://media1.clubpenguin.com/play/pt/swf/affiliate-menu.swf"; var swfID = "flashNavigation"; var swfWidth = "665"; var swfHeight = "64"; var swfVersion = "9.0.28.0"; var allowExpressInstall = false; var flashVars = { xmlurl : "http://media1.clubpenguin.com/play/pt/xml/affiliate-menu.xml", language : encodeURIComponent(window.location.search) }; var params = { menu : "false", quality : "high", wmode : "transparent", allowscriptaccess : "always" }; var attributes = { id :"flashNavigation", name :"flashNavigation" }; swfobject.embedSWF(swfUrl, swfID, swfWidth, swfHeight, swfVersion, allowExpressInstall, flashVars, params, attributes); } function initClubPenguin() { var swfUrl = "http://media1.clubpenguin.com/play/v2/client/club_penguin.swf?cacheVersion=1370465700"; var swfID = "club_penguin"; var swfWidth = "100%"; var swfHeight = "100%"; var swfVersion = "10.1"; if ("pt" == "en") { var allowExpressInstall = "http://media1.clubpenguin.com/play/pt/upgrade/swf/expressInstall.swf"; } else { var allowExpressInstall = "http://media1.clubpenguin.com/play/pt/" + "pt" + "/upgrade/swf/expressInstall.swf"; } var flashVars = { play : "http://media1.clubpenguin.com/play/", client : "http://media1.clubpenguin.com/play/v2/client/", content : "http://media1.clubpenguin.com/play/v2/content/", games : "http://media1.clubpenguin.com/play/v2/games/", connectionID : "cp22042", lang : "pt", a : "0", p: "1", nau : '', nal : '', nas : '', nad : '', phrasechat : 'https://api.disney.com/social/autocomplete/v2/search/', isAS3WebServicesOn : true, cacheVersion : '1370465700', tid : window.metrics.getTRANSID(), bid : window.metrics.options.BROWSERID }; var params = { menu : "false", quality : "high", allowscriptaccess : "always", wmode : "opaque" }; var attributes = { "id" : "club_penguin", "name" : "club_penguin", "class" : "disney_land_clubpenguin_player" }; swfobject.embedSWF(swfUrl, swfID, swfWidth, swfHeight, swfVersion, allowExpressInstall, flashVars, params, attributes, embedCallback); }; function initGameLoad() { unloadHWAccel(); initAffiliateMenu(); initClubPenguin(); } jQuery(document).ready(function() { if(getCookie("hwaccel")) { initGameLoad(); } else { initHWAccel(); }; }); function