/*
HTTP Host: static.ak.fbcdn.net
Generated: March 15th 2010 1:50:01 AM PDT
Machine: 10.16.139.106
Locale: nu_ll
Path: js/profile/prototypes.js
*/

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

var PrototypeActivationController=function(a,b){this.controller=$('confirm_button');this.prototypeID=a;this.userID=b;this.buttonLink=DOM.find(this.controller,'a.UIActionButton');this.buttonText=DOM.find(this.controller,'span.UIButton_Text');this.buttonEnabled=true;this.buttonLink.listen('click',this.toggleActivationStatus.bind(this));};copy_properties(PrototypeActivationController.prototype,{toggleActivationStatus:function(){if(!this.buttonEnabled)return false;this.buttonEnabled=false;this.insertProgressImage();data={prototype_id:this.prototypeID};new AsyncRequest().setURI('/ajax/profile/togglePrototypeActivation.php').setData(data).setHandler(function(c){var b=c.getPayload();DOM.remove(this.buttonLink.previousSibling,false);DOM.remove(this.buttonLink.nextSibling,false);DOM.empty(this.buttonText);DOM.setText(this.buttonText,b.new_button_text);CSS.removeClass(this.buttonLink,'UIButton_Disabled');CSS.addClass(this.buttonLink,'UIButton_Blue');var a=new Dialog().setTitle(b.dialog_title).setBody(HTML(b.dialog_body)).setModal(true).setAutohide(5000).setButtons(Dialog.OK).show();this.buttonEnabled=true;}.bind(this)).send();return false;},insertProgressImage:function(){var a=$N('span',{className:'progress_image_span'},HTML('&nbsp'));var b=$N('span',{className:'progress_image_span progress_image'},HTML('&nbsp'));DOM.insertBefore(a,this.buttonLink);DOM.insertAfter(this.buttonLink,b);CSS.removeClass(this.buttonLink,'UIButton_Blue');CSS.addClass(this.buttonLink,'UIButton_Disabled');},createSuccessDiv:function(a){return $N('div',{className:'success_toggle_notification'},a);}});

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