/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  February 10th 2010 3:12:55 AM PST                            */
/*      Machine:  10.16.139.106                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/developers/editapp.js h:9gfw4tip                          */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/developers/editapp.js                                     */

if (window.CavalryLogger) { CavalryLogger.start_js(["js\/developers\/editapp.js"]); }

function ShowCompanyOptions(){show(getParentRow('creator_name'));show(getParentRow('creator_url'));show(getParentRow('company_blurb'));hide(getParentRow('developers'));hide(getParentRow('developer_blurb'));}function ShowDeveloperOptions(){show(getParentRow('developers'));hide(getParentRow('creator_name'));hide(getParentRow('creator_url'));hide(getParentRow('company_blurb'));show(getParentRow('developer_blurb'));}function checkappform(_L0){if(!_L0.agree_tos.checked){aiert(_tx("You must check the Terms of Use agreement before continuing."));return false;}return true;}function check_editabout_form(_L0){return checkdesc(_L0,2000);}function checkdesc(_L0,_L1){if(_L0.detailed_description.value.length>_L1){num_chars_over=_L0.detailed_description.value.length-_L1;aiert(_tx("Please note that the limit on the description field is {max_chars} characters. Your input is {num_chars} characters over the limit.",{'max_chars':_L1,'num_chars':num_chars_over}));return false;}return true;}var canvas_box_searched_text=null;var canvas_box_ajax_pending=false;function canvas_box_onkeypress(obj,_L1){setTimeout(function(){if(obj.value==''||obj.value.length<7){CSS.setClass($('canvas_availability'),'');return;}if(canvas_box_searched_text!=obj.value&&!canvas_box_ajax_pending){canvas_box_searched_text=obj.value;canvas_box_ajax_pending=true;var _L2={action:'check_canvas',appname:obj.value};if(typeof _L1!='undefined')_L2['appid']=_L1;new AsyncRequest().setMethod('GET').setReadOnly(true).setHandler(canvas_box_ajax_done.bind(obj)).setData(_L2).setURI('/developers/editapp_ajax.php').send();}},0);}function canvas_box_ajax_done(_L0){var _L1=_L0.getPayload();CSS.setClass($('canvas_availability'),(_L1=='0'?'canvas_available':'canvas_not_available'));canvas_box_ajax_pending=false;canvas_box_onkeypress(this);}function render_blocked_sentence(){return _tx("Your application's notifications have been marked as spam by our users, meaning people who haven't added your application can't see its notifications.");}function render_spam_tip(){return '<p>'+_tx("To reduce your spam level, we recommend only sending notifications to users when a friend explicitly takes an action that directly affects that specific user - for example, our applications have notifications like \"[name] tagged you in a photo.\" or \"[name] wrote on your Wall.\"")+'</p>';}function show_unblock_dialog(_L0){var msg=render_blocked_sentence();msg+='  '+_tx("You can request to unblock it, but keep in mind your ability to do so will be on a sliding scale.")+'  ';msg+='<p>'+_tx("Specifically, the first time you can unblock your application immediately, but every consecutive time you will be forced to wait an additional 30 days longer than you waited for the previous unblock.  So please make sure that it is no longer as spammy <b>before<\/b> requesting to unblock it.")+'</p>';msg+=render_spam_tip();msg+='<p>'+_tx("Remember, if your application is blocked again, you will have to wait for a longer period of time, so please be careful!")+'</p>';msg+='<input type="hidden" name="unblock_app" value="'+_L0+'"/>';new Dialog().setTitle(_tx("Unblock Application?")).setBody(msg).setButtons([Dialog.newButton('yes-unblock',_tx("Yes, unblock it")),Dialog.CANCEL]).setPostURI('/developers/unblockapp.php',false).show();return false;}function show_blocked_dialog(_L0){var msg=render_blocked_sentence();msg+='  '+_tx("Please return here in approximately {days-left} days, and you will be allowed to unblock your application.  Please email developers-help@facebook.com if you have any further questions.",{'days-left':_L0});new Dialog().setTitle(_tx("Your application has been blocked")).setBody(msg).setButtons([Dialog.OK]).show();return false;}function show_spam_tip(){new Dialog().setTitle(_tx("What is \"spamminess\"?")).setBody(_tx("The spamminess score reflects our users' reactions to your application's notifications (sent via notifications.send).  If your score goes above a certain limit, users who have not added your application will not be able to see its notifications.")+render_spam_tip()).setButtons([Dialog.OK]).show();return false;}function remove_app_from_directory(_L0){var _L1=function(){var _L3=$('app_id_'+_L0+'_submit');new AsyncRequest().setURI('/ajax/developers/remove_app.php').setData({app_id:_L0}).setHandler(bind(this,function(_L5){DOM.setContent(_L3,HTML(_L5.getPayload()));var _L2=Dialog.getCurrent();if(_L2)_L2.hide();})).setErrorHandler(bind(this,function(_L5){ErrorDialog.showAsyncError(_L5);var _L2=Dialog.getCurrent();if(_L2)_L2.hide();})).send();var _L4=$N('img',{src:'/images/loaders/indicator_blue_small.gif'});CSS.addClass(_L4,'loading_indicator');DOM.setContent(_L3,_L4);};var _L2=new Dialog().setTitle(_tx("Remove App from Directory?")).setBody(_tx("If you proceed, your app will no longer be listed in the application directory or search results. To list it again in the directory, you will need to get it re-approved.")).setButtons([{'name':'remove','label':_tx("Remove App from Directory")},Dialog.CANCEL]).setHandler(_L1).show();return false;}

if (window.Bootloader) { Bootloader.done(["js\/developers\/editapp.js"]); }