/*
HTTP Host: static.ak.fbcdn.net
Generated: March 19th 2010 5:30:09 PM PDT
Machine: 10.16.140.102
Locale: nu_ll
Path: js/ailxchlgkgg880ck.pkg.js
*/

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

function fbpage_set_fan_status(c,f,a,h,g,d,e){g=g?g:function(j){_fbpage_show_change_status_feedback(c,j.getPayload());};var b={fbpage_id:f,add:a,reload:h};if(e!=null)copy_properties(b,e);var i=new AsyncRequest().setURI('/ajax/pages/fan_status.php').setData(b).setHandler(g);if(d)i.setErrorHandler(d);i.send();return false;}function fbpage_set_favorite_status(d,e,a){var f=function(){_fbpage_show_change_status_feedback(d,this.getUserData());};var c={fbpage_id:e,add:a};var b=new AsyncRequest().setMethod('POST').setURI('/ajax/pages/favorite_status.php').setData(c);new Dialog().setAsync(b).setCloseHandler(f).show();return false;}function _fbpage_show_change_status_feedback(b,a){if(!a||!b)return;if(a.reload){fbpage_reload_on_fan_status_changed(a.preserve_tab);}else fbpage_redraw_on_fan_status_changed(a.feedback);}function fbpage_reload_on_fan_status_changed(a){var b=URI.getRequestURI();if(a)if(!b.getQueryData().v&&window.profile_tab_controller)b.addQueryData({v:window.profile_tab_controller.currentView});goURI(b,true);}function fbpage_redraw_on_fan_status_changed(a){if(!a)return;var c=document.createElement('span');c.innerHTML=a;CSS.setClass(c,'fan_status_inactive');elem.parentNode.replaceChild(c,elem);var b=function(){if(data.can_repeat_action)c.parentNode.replaceChild(elem,c);};animation(c).duration(3000).checkpoint().to('backgroundColor','#FFFFFF').duration(1000).ondone(b).go();}
function ConnectWidget(f,d,a){copy_properties(this,{button:$(a),profile_id:d,viewer_id:f,status:null,popup:null,busy:false,new_fan:null});this.popup_uri=new URI('/login.php');this.popup_uri.addQueryData({connect_id:this.profile_id,popup:true});this.button=$(a);this.button.listen('click',this.connectClickHandler.bind(this));this.fan_hidden=[];this.fan_shown=[];var b=DOM.scry(document,'div.connections');if(b.length>0){b=b[0];this.new_fan=DOM.find(b,'div.grid_item_plus');this.fan_shown.push(this.new_fan);this.fan_shown.push(DOM.find(b,'span.total_plus'));var e=DOM.scry(b,'span.total');var c=DOM.scry(b,'div.grid_item');if(c.length>1)this.fan_hidden.push(c[1]);this.fan_hidden.push(e[e.length-1]);}ConnectWidget.instances[a]=this;}ConnectWidget.instances={};ConnectWidget.prototype.setLoggedIn=function(a){this.viewer_id=a;return this;};ConnectWidget.prototype.connectClickHandler=function(a){a.kill();if(this.viewer_id!=0){this.connect();}else this.popUpLogin();};ConnectWidget.prototype.connect=function(){if(!this.busy){this.busy=true;fbpage_set_fan_status(this.button,this.profile_id,true,false,this.connectDoneHandler.bind(this),this.connectErrorHandler.bind(this),this.getAsyncData());}};ConnectWidget.prototype.disconnect=function(){if(!this.busy){this.busy=true;fbpage_set_fan_status(this.button,this.profile_id,false,false,this.connectUndoneHandler.bind(this),function(){},this.getAsyncData());}};ConnectWidget.prototype.getAsyncData=function(){var a={source:'connect'};if(ge('post_form_id'))a.post_form_id=$('post_form_id').value;if(ge('fb_dtsg'))a.fb_dtsg=$('fb_dtsg').value;return a;};ConnectWidget.prototype.popUpLogin=function(){window.open(this.popup_uri.toString(),'_blank','toolbar=0,status=0,width=626,height=400');};ConnectWidget.prototype.connectErrorHandler=function(b){if(b.error==kError_Async_NotLoggedIn){this.viewer_id=0;this.popUpLogin();}else if(b.error==kError_Async_PopUpCaptchaRequired){hide(this.button);var a=$N('a',{href:DOM.find(document,'div.name_block a').href,target:'_blank'},_tx("Verification is needed to connect."));this.status=$N('span',{className:'connect_span'},a);DOM.insertAfter(this.button,this.status);}else{hide(this.button);if(b.error==kError_ProfileConnect_AlreadyConnected){this.status=$N('span',{className:'connect_span'},_tx("\u0986\u09aa\u09a8\u09bf \u098f\u0995\u099c\u09a8 \u09ad\u0995\u09cd\u09a4"));}else this.status=$N('span',{className:'connect_span'},b.getErrorSummary()+': '+b.getErrorDescription());animation(this.status).from('opacity',0).to('opacity',1).go();DOM.insertAfter(this.button,this.status);}this.busy=false;};ConnectWidget.prototype.connectDoneHandler=function(c){var b=c.getPayload();if(!b||!b.feedback)return;this.status=$N('span',{className:'connect_span'},HTML(b.feedback));var d=$N('a',{className:'undo'},_tx("Undo"));d.listen('click',function(e){e.kill();this.disconnect();}.bind(this));DOM.appendContent(this.status,d);animation(this.status).from('opacity',0).to('opacity',1).go();DOM.insertAfter(this.button,this.status);hide(this.button);if(this.new_fan!=null&&b.connect_fan_div){var a=$N('div',{},HTML(b.connect_fan_div));DOM.setContent(this.new_fan,DOM.find(a,'a'));}this.fan_shown.forEach(function(e){animation(e).from('opacity',0).to('opacity',1).go();CSS.removeClass(e,'hidden');});this.fan_hidden.forEach(function(e){CSS.addClass(e,'hidden');});this.busy=false;};ConnectWidget.prototype.connectUndoneHandler=function(b){var a=b.getPayload();DOM.remove(this.status);animation(this.button).from('opacity',0).to('opacity',1).go();show(this.button);this.fan_shown.forEach(function(c){CSS.addClass(c,'hidden');});this.fan_hidden.forEach(function(c){CSS.removeClass(c,'hidden');});this.busy=false;};ConnectWidget.loadStream=function(b,a){new AsyncRequest().setMethod('GET').setURI('/ajax/connect/connect_widget.php').setData({id:b}).setReadOnly(true).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(c){payload=c.getPayload();DOM.setContent($(a),HTML(payload.stream_markup));}.bind(this)).send();};ConnectWidget.loggedIn=function(c,a){if(ge('post_form_id')){DOM.replace($('post_form_id'),HTML(a));}else DOM.appendContent(DOM.find(document,'body'),HTML(a));for(var b in ConnectWidget.instances){ConnectWidget.instances[b].setLoggedIn(c);ConnectWidget.instances[b].connect();}};
function invitetool_dialog_helper(k,l,a,j,m,i,f,g,b,d){var h='';var c=d[a];switch(a){case 'make_admin':dialog_info=invitetool_make_admin_msg(m,j,i,g);break;case 'remove_admin':dialog_info=invitetool_remove_admin_msg(m,j,i,g);break;case 'remove_member':dialog_info=invitetool_remove_msg(m,j,i,f,g);if(b)h='<input type="checkbox" id="ban_user" name="ban_user" value="1" />'+_tx("Ban Permanently");break;case 'unban_member':dialog_info=invitetool_unban_msg(m,j);break;case 'remove_fbpage_admin':dialog_info=invitetool_fbpage_admin_msg(m,j,i);break;default:return false;}var e=new Dialog().setTitle(dialog_info.label).setBody(dialog_info.msg).setButtons([Dialog.newButton('invitetool_dialog',dialog_info.label,'',function(){c();e.hide();}),Dialog.CANCEL]).setButtonsMessage(h).show();return false;}function invitetool_unban_msg(a,b){text=' '+_tx("Are you sure you want to remove the ban on {user-name}?",{'user-name':a});return {msg:text,label:_tx("Remove Ban")};}function invitetool_remove_msg(d,e,c,a,b){var f='';if(c){if(a)if(b)switch(e){case 'Group':f+=' '+_tx("You are attempting to remove yourself from a Group for which you are the only administrator.");f+=' '+_tx("Since you are the last administrator, the administrator position will be offered to other people in this Group.");break;case 'Event':f+=' '+_tx("You are attempting to remove yourself from an Event for which you are the only administrator.");f+=' '+_tx("Since you are the last administrator, removing yourself will cause this Event to be deleted.");break;case 'Page':f+=' '+_tx("You are attempting to remove yourself from a Page for which you are the only administrator.");f+=' '+_tx("Since you are the last administrator, removing yourself will cause this Page to be deleted.");break;}switch(e){case 'Group':f+=' '+_tx("Are you sure you want to remove yourself from this Group?");break;case 'Event':f+=' '+_tx("Are you sure you want to remove yourself from this Event?");break;case 'Page':f+=' '+_tx("Are you sure you want to remove yourself from this Page?");break;}}else{switch(e){case 'Group':f+=' '+_tx("You are attempting to remove {user-name} from this Group.",{'user-name':d});break;case 'Event':f+=' '+_tx("You are attempting to remove {user-name} from this Event.",{'user-name':d});break;case 'Page':f+=' '+_tx("You are attempting to remove {user-name} from this Page.",{'user-name':d});break;}f+=' '+_tx("Are you sure you want to remove {user-name}?",{'user-name':d});}return {msg:f,label:_tx("Remove")};}function invitetool_remove_admin_msg(c,d,b,a){var e='';if(b){e+=' '+_tx("You are attempting to remove yourself as an administrator.");if(a)switch(d){case 'Group':e+=' '+_tx("Since you are the last administrator, the administrator position will be offered to other people in this Group.");break;case 'Event':e+=' '+_tx("Since you are the last administrator, removing yourself will cause this Event to be deleted.");break;case 'Page':e+=' '+_tx("Since you are the last administrator, removing yourself will cause this Page to be deleted.");break;}e+=' '+_tx("Are you sure you want to remove yourself as an administrator?");}else{e+=' '+_tx("You are attempting to remove {user-name} as an administrator.",{'user-name':c});e+=' '+_tx("Are you sure you want to remove {user-name} as an administrator?",{'user-name':c});}return {msg:e,label:_tx("Remove Admin")};}function invitetool_fbpage_admin_msg(b,c,a){var d='';if(a){d+=' '+_tx("You are attempting to remove yourself as an administrator.")+' '+_tx("You will not be able to get these privileges back without invitation.");}else d+=' '+_tx("You are attempting to remove {user-name} as an administrator.",{'user-name':b});return {msg:d,label:_tx("Remove Admin")};}function invitetool_make_admin_msg(b,c){var a;switch(c){case 'Group':a=_tx("Are you sure you want to make {user-name} an admin? This will let {user-name} have the same control that you do over your Group.",{'user-name':b});break;case 'Event':a=_tx("Are you sure you want to make {user-name} an admin? This will let {user-name} have the same control that you do over your Event.",{'user-name':b});break;case 'Page':a=_tx("Are you sure you want to make {user-name} an admin? This will let {user-name} have the same control that you do over your Page.",{'user-name':b});break;}return {msg:a,label:_tx("Make Admin")};}

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