if((typeof Disney)==='undefined'){var Disney={};}Disney.Error={API_APP_NAME:"clubpenguin",USER_ID:"-1",TAG:"error",APP_LOCALE:"en",init:function(){var hostName=window.location.hostname;if(hostName.indexOf("qa04")>=0||hostName.indexOf("stage")>=0){this.API_APP_NAME="qa_"+this.API_APP_NAME;}if(document.documentElement.lang){this.APP_LOCALE=document.documentElement.lang.toLowerCase();}switch(this.APP_LOCALE){case"en":this.APP_LOCALE+="_US";break;case"pt":this.APP_LOCALE+="_BR";break;case"fr":this.APP_LOCALE+="_FR";break;case"es":this.APP_LOCALE+="_ES";break;case"de":this.APP_LOCALE+="_DE";break;}this.data={"tag":this.TAG,"lang":this.APP_LOCALE,"app_locale":this.APP_LOCALE,"network":"c","view_network":"cp","reason":"","context":""};$("#D_ER_ErrorBtn").mousedown(function(event){var error=Disney.Error;error.stopEvent(event);error.onClick(this);});},setUserId:function(userId){if(userId){this.USER_ID=userId;}},onClick:function(){$("#D_ER_ErrorSection").css("display","none");window.location.reload();},centerMessage:function(){var top=$(window).height()/2-110;if(top<0){top=0;}var left=$(window).width()/2-177;if(left<0){left=0;}$("#D_ER_ErrorSection").css("top",top.toString()+"px").css("left",left.toString()+"px");},logEvent:function(data){var pic,url="http://weblogger-dynamic-lb.playdom.com/cp?app="+this.API_APP_NAME+"&user_id="+this.USER_ID;for(key in data){url+="&"+key+"="+data[key];}pic=new Image();pic.src=url;},stopEvent:function(event){if(event.cancelable){event.preventDefault();}event.cancelBubble=true;if(event.stopPropagation){event.stopPropagation();}}};Disney.Error.FlashCrash={IELT8:false,REASON:"Flash crash",CONTEXT:"FLASH_CRASH",init:function(){if($.browser.msie&&parseInt($.browser.version,10)<8){this.IELT8=true;}setTimeout(Disney.Error.FlashCrash.pollFlash,20000);},pollFlash:function(){(function loop(){setTimeout(function(){var error=Disney.Error;var errorFlash=error.FlashCrash;if(errorFlash.isFlashCrashed()){error.centerMessage();$("#D_ER_ErrorSection").show();error.data.reason=errorFlash.REASON;error.data.context=errorFlash.CONTEXT;error.logEvent(error.data);}else{loop();}},10000);})();},isFlashCrashed:function(){var elem,isCrashed=false;try{if(!this.IELT8){elem=$('[type="application/x-shockwave-flash"]')[0];}if(!elem){elem=$('[classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"]')[0];if(elem){elem=elem.object;if(elem){elem.SetVariable("isSwfWorking","true");if(elem.GetVariable("isSwfWorking")!=="true"){isCrashed=true;}}}}else{if(!elem.SetVariable){isCrashed=true;}}}catch(e){isCrashed=true;}return isCrashed;}};$(function(){Disney.Error.init();Disney.Error.FlashCrash.init();});
