/*
HTTP Host: static.ak.fbcdn.net
Generated: March 22nd 2010 6:34:21 AM PDT
Machine: 10.16.139.102
Locale: nu_ll
Path: js/devsite/setup.js
*/

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

function connect_setup_form_submit_basic_info(a){var b=a.form;CSS.addClass(ge('reg_error'),'hidden_elem');var c={step:b.step.value,app_id:b.app_id?b.app_id.value:'',website_name:b.website_name.value,website_url:b.website_url.value,i18n_custom:b.i18n_custom.value};connect_setup_ensure_controller();window.connect_setup_controller.sendFormPost(a,c);}function connect_setup_form_submit_upload_icons(a,c){var b=a.form;if(!b.agree.value||(!b.fileicon.value&&!b.filelogo.value)){CSS.removeClass(ge('reg_error'),'hidden_elem');return false;}else CSS.addClass(ge('reg_error'),'hidden_elem');connect_setup_ensure_controller();return window.connect_setup_controller.waitFormPost(c);}function connect_setup_test_setup(e,f,d){connect_setup_ensure_controller();if(!f){var a='<a target="_blank" href="http://wiki.developers.facebook.com/'+'index.php/Cross_Domain_Communication_Channel">'+_tx("here")+'</a>';var c={documentation_link:a};var b=HTML(_tx("Uploading this file is important for performance for those users with older browsers. For more details, you can read the wiki {documentation_link}.",c));var g=HTML(_tx("Upload xd_receiver.htm later?"));new Dialog().setTitle(g).setBody(b).setModal(true).setButtons([Dialog.OK,Dialog.CANCEL]).setHandler(function(){this.hide();window.connect_setup_controller.sendSetupTest(e,'false',d);return false;}).show();}else window.connect_setup_controller.sendSetupTest(e,'true',d);}function connect_setup_ensure_controller(){if(!window.connect_setup_controller)window.connect_setup_controller=new ConnectSetupController();}function ConnectSetupController(){}ConnectSetupController._waiting_for_ajax=false;ConnectSetupController.prototype.sendFormPost=function(a,c){if(!this._waiting_for_ajax){var b=a.form;new AsyncRequest().setMethod('POST').setReadOnly(true).setURI(new URI(b.action)).setData(c).setHandler(function(f){var d=null;var e=f.getPayload();window.location=e.next_step_url;}.bind(this)).setErrorHandler(function(f){var d=ge('reg_error');var e=ge('reg_error_inner');set_inner_html(e,f.getErrorSummary());CSS.removeClass(ge('reg_error'),'hidden_elem');}.bind(this)).setTransportErrorHandler(function(d){CSS.removeClass(ge('reg_error'),'hidden_elem');}.bind(this)).setFinallyHandler(function(d){this._waiting_for_ajax=false;}.bind(this)).send();this._waiting_for_ajax=true;}};ConnectSetupController.prototype.sendSetupTest=function(c,d,a){if(!this._waiting_for_ajax){var b={step:c,test:d};if(this.app_id)b.app_id=this.app_id;new AsyncRequest().setMethod('POST').setReadOnly(true).setURI(new URI('/ajax/setup.php')).setData(b).setHandler(function(f){var e=f.getPayload();if(e&&e.app_id)this.app_id=e.app_id;if(this.app_id)a+='&app_id='+this.app_id;window.location=a;}.bind(this)).setErrorHandler(function(h){var g=h.getPayload();if(g&&g.app_id)this.app_id=g.app_id;var e=ge('reg_error');var f=ge('reg_error_inner');set_inner_html(f,h.getErrorSummary());CSS.removeClass(ge('reg_error'),'hidden_elem');}.bind(this)).setTransportErrorHandler(function(e){CSS.removeClass(ge('reg_error'),'hidden_elem');}.bind(this)).setFinallyHandler(function(e){this._waiting_for_ajax=false;}.bind(this)).send();this._waiting_for_ajax=true;}};

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