/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  February 9th 2010 8:02:52 PM PST                             */
/*      Machine:  10.16.139.103                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/95ljcslrmqkggck0.pkg.js h:th5eo9ua                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/95ljcslrmqkggck0.pkg.js                                   */

if (window.CavalryLogger) { CavalryLogger.start_js(["js\/95ljcslrmqkggck0.pkg.js"]); }

function PlatformCanvasController(_L0,_L1,_L2,_L3,_L4,_L5){this.sessionKey=_L1;this.appName=_L3;this.appId=_L0;this.callback=_L4;this.api_key=_L5;this.isFirstPage=false;this.isIFrame=false;this._movingPage=false;this.sessionRefresh=(_L2*900);if(this.appId&&this.sessionKey&&this.sessionRefresh)setTimeout(this.refreshAppSession.bind(this),this.sessionRefresh);PlatformCanvasController.singleton=this;Arbiter.inform('PLATFORM_HAS_API_KEY',_L5,Arbiter.BEHAVIOR_PERSISTENT);}PlatformCanvasController.AUTO_REFRESH=30000;PlatformCanvasController.prototype.setUpIFrame=function(_L0){PageTransitions.registerHandler(this.handleChange.bind(this));this.isIFrame=true;this.isStatic=_L0;};PlatformCanvasController.prototype.autoRefreshAd=function(){if(this.isIFrame){this.isFirstPage=true;$('app'+this.appId+'_iframe_canvas').onload=this._clickRefresh.bind(this);}this._ignoreNext=true;this._loopRefresh();};PlatformCanvasController.prototype.requireLogin=function(){var _L0=FB.IFrameUtil.CanvasUtilServer.loginResponse;FBML.requireLogin(this.appId,_L0.bind(null,true),_L0.bind(null,false),null,true,true);};PlatformCanvasController.prototype.closeLogin=function(){FBML.closeLoginDialog();};PlatformCanvasController.prototype.showFeedDialog=function(_L0,_L1,_L2,_L3,_L4,_L5){FBML.showFeedDialog(this.appId,_L0,_L1,_L2,_L3,FB.IFrameUtil.CanvasUtilServer.loginResponse.bind(null),_L4,_L5);};PlatformCanvasController.prototype._loopRefresh=function(){if(this._ignoreNext){this._ignoreNext=false;}else this.refreshAd();this._loopRefresh.bind(this).defer(PlatformCanvasController.AUTO_REFRESH);};PlatformCanvasController.prototype._clickRefresh=function(){this.refreshAd();this._ignoreNext=true;};PlatformCanvasController.prototype.refreshAppSession=function(){new AsyncRequest().setURI('/ajax/session.php').setData({'app_id':this.appId,'session_key':this.sessionKey}).setReadOnly(true).setHandler(function(_L0){var _L1=_L0.getPayload();if(_L1['session_end']>0)setTimeout(this.refreshAppSession.bind(this),this.sessionRefresh);}.bind(this)).send();};PlatformCanvasController.prototype.refreshUrl=function(_L0){var _L1=_L0.href;if(_L1.startsWith(this.callback)){var _L2=new URI(_L1.substring(this.callback.length));this.changeUrlSuffix(_L2,true);}return false;};PlatformCanvasController.refreshUrl=function(_L0){if(PlatformCanvasController.singleton)PlatformCanvasController.singleton.refreshUrl(_L0);};PlatformCanvasController.prototype.changeUrlSuffix=function(_L0,_L1){this.currentUri=URI.getRequestURI().getUnqualifiedURI();var _L2=new URI(this.getAppPrefix()+_L0);this.stripFbParams(_L2);var _L3=_L1&&PlatformCanvasController.storesIFrameHistory(this.isStatic);if(this.currentUri.toString()!=_L2.toString()){this.currentUri=_L2;this.refreshAd();PageTransitions.go(_L2.toString(),_L3);}};PlatformCanvasController.prototype.getAppPrefix=function(){return "/"+this.appName+"/";};PlatformCanvasController.prototype.convertFromApps=function(uri){var _L1=this.getAppPrefix();var _L2=uri.getUnqualifiedURI().toString().substring(_L1.length);return new URI(this.callback+_L2);};PlatformCanvasController.prototype.convertToApps=function(uri){var _L1=uri.toString().substring(this.callback.length);return new URI(this.getAppPrefix()+_L1);};PlatformCanvasController.prototype.stripFbParams=function(uri){var _L1=uri.getQueryData();var _L2={};for(key in _L1)if((!key.startsWith("fb_")||key.startsWith("fb_force_mode"))&&!key.startsWith("_fb")&&!key.startsWith("quickling_apps"))_L2[key]=_L1[key];uri.setQueryData(_L2);};PlatformCanvasController.prototype.refreshAd=function(){if(this.isFirstPage){this.isFirstPage=false;}else ads_refresh(this.appName,'/canvas.php');};PlatformCanvasController.prototype.handleChange=function(uri){if(!uri.getPath().startsWith("/"+this.appName)||this._movingPage)return false;var _L1=uri.getUnqualifiedURI();this.stripFbParams(_L1);if(this.currentUri.toString()!=_L1.toString()){FB.IFrameUtil.CanvasUtilServer.loadNewUrl(this.convertFromApps(uri).toString());this.currentUri=_L1;}PageTransitions.transitionComplete();return true;};PlatformCanvasController.prototype.goURI=function(uri){this._movingPage=true;var _L1=new URI(uri);_L1.addQueryData({_fb_q:true});PageTransitions.go(_L1);};PlatformCanvasController.storesIFrameHistory=function(_L0){if(ua.ie()){return true;}else if(ua.firefox()){if(_L0){return true;}else return false;}else if(ua.safari()){return false;}else return false;};var smartIframes=[];function smartSizingFrameAdded(){window.onresize=_resizeSmartFrames;smartIframes=[];var _L0=document.getElementsByTagName('iframe');for(var i=0;i<_L0.length;i++){var _L2=_L0[i];if(_L2.className=='smart_sizing_iframe'){smartIframes.push(_L2);_L2.style.width=_L2.parentNode.scrollWidth-2+"px";}}_resizeSmartFrames();}if(window.innerHeight){var windowHeight=function(){return window.innerHeight;};}else if(document.documentElement&&document.documentElement.clientHeight){var windowHeight=function(){return document.documentElement.clientHeight;};}else var windowHeight=function(){return DOMScroll.getScrollRoot().clientHeight;};function _resizeSmartFrames(){var _L0=windowHeight();for(var i=0;i<smartIframes.length;i++){var _L2=smartIframes[i];var _L3=_L0-elementY(_L2)-61;_L2.style.height=_L3/(smartIframes.length-i)+'px';}}
function GamePlayTracker(_L0){copy_properties(this,{_app:_L0});}copy_properties(GamePlayTracker.prototype,{ping:function(){new AsyncRequest('/ajax/games/play_update.php').setMethod('POST').setData({app:this._app}).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).send();}});
var details_shown=false;function toggle_stored_cc(obj){if(obj.checked==true){show('cvv2_div');hide_new_cc();}else{hide('cvv2_div');show_new_cc();}}function hide_cc_payment(){hide('card_payment');hide('cvv2_div');hide_new_cc();var _L0=ge('cc_id');if(_L0)_L0.checked=false;}function show_cc_payment(){show('card_payment');}function hide_new_cc(){hide('cc_input');hide('enter_new_card');}function show_new_cc(){show('cc_input');show('enter_new_card');if(details_shown)toggleStoredCreditCardDetails();}function toggleStoredCreditCardDetails(){var _L0=ge('toggle_stored_credit_card_details_link');if(!details_shown){show('stored_credit_card_details');_L0.innerHTML=_tx("\u8a73\u7d30\u3092\u96a0\u3059");details_shown=true;}else{hide('stored_credit_card_details');_L0.innerHTML=_tx("\u8a73\u7d30\u3092\u8868\u793a\u3059\u308b");details_shown=false;}}function show_csc_info(_L0){var _L1=_tx("\u30ab\u30fc\u30c9\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b3\u30fc\u30c9 (CSC) \u306f\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u8a50\u6b3a\u9632\u6b62\u306e\u305f\u3081\u306e\u30af\u30ec\u30b8\u30c3\u30c8\u304a\u3088\u3073\u30c7\u30d3\u30c3\u30c8\u30ab\u30fc\u30c9\u306e\u6a5f\u80fd\u3067\u3059\u3002CSC \u30b3\u30fc\u30c9\u306e\u4f4d\u7f6e\u306f\u4ee5\u4e0b\u306e\u56f3\u306e\u901a\u308a\u3067\u3059\u3002");var _L2='float: left;';var _L3='text-align: center; margin: 5px 0;';var _L4='';_L4+='<div style="'+_L2+'">';_L4+='<img src="/images/cvv2_types/amex_csc.gif" alt="" />';_L4+='<p style="'+_L3+'">'+_tx("American Express")+'</p>';_L4+='</div>';var _L5='';_L5+='<div style="margin-right: 8px;'+_L2+'">';_L5+='<img src="/images/cvv2_types/backofcard.gif" alt="" />';_L5+='<p style="'+_L3+'">'+_tx("Visa, Mastercard, JCB")+'</p>';_L5+='</div>';var _L6='';_L6+='<div class="clearfix">';_L6+='<p>'+_L1+'</p>';if(_L0==null){_L6+=_L5;_L6+=_L4;}else if(_L0==65){_L6+=_L4;}else _L6+=_L5;_L6+='</div>';new Dialog().setClassName('csc_type').setTitle(_tx("What's a CSC?")).setBody(_L6).setButtons([Dialog.OK]).show();}function show_csc_validation_info(){var _L0='';_L0+='<div class="clearfix">';_L0+='<div style="float: left">';_L0+='<p style="text-align: left; margin: 5px 0;">';_L0+=_tx("\u8a50\u6b3a\u9632\u6b62\u306e\u305f\u3081\u3001\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u3067\u304a\u652f\u6255\u3044\u306e\u5834\u5408\u306f CSC \u30b3\u30fc\u30c9\u78ba\u8a8d\u3092\u884c\u3063\u3066\u304a\u308a\u307e\u3059\u3002\u767b\u9332\u6e08\u307f\u306e\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u306b\u3082 CSC \u30b3\u30fc\u30c9\u8a8d\u8a3c\u304c\u5fc5\u8981\u3068\u306a\u308a\u307e\u3059\u3002\u8a8d\u8a3c\u5b8c\u4e86\u5f8c\u306f\u3001\u8a8d\u8a3c\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3002");_L0+='</p>';_L0+='</div>';_L0+='</div>';new Dialog().setClassName('validation').setTitle(_tx("\u306a\u305c CSC \u306e\u78ba\u8a8d\u304c\u5fc5\u8981\u306a\u306e\u3067\u3059\u304b\uff1f")).setBody(_L0).setButtons([Dialog.OK]).show();}function get_selected_cc_type(_L0,_L1){if(_L1){cc_type=get_form_select_value(get_dialog_pro_elem(_L0));}else cc_type=get_form_select_value(ge(_L0));return cc_type;}function validate_csc(_L0,_L1){if(_L1){var _L2=get_dialog_pro_elem('cc_cvv2');}else var _L2=ge('cc_cvv2');var _L3=get_selected_cc_type(_L0,_L1);if(_L3==65){if(_L2.value.length!=4){_L2.style.border="1px solid red;";}else _L2.style.border="";}else if(_L2.value.length!=3){_L2.style.border="1px solid red;";}else _L2.style.border="";}function get_dialog_pro_elem(_L0){var _L1=document.getElementsByName(_L0);var i;var _L3=null;for(i=0;i<_L1.length;i++){var _L4=_L1[i];if(DOM.contains('pop_content',_L4))_L3=_L4;}return _L3;}

if (window.Bootloader) { Bootloader.done(["js\/95ljcslrmqkggck0.pkg.js"]); }