/*
HTTP Host: b.static.ak.fbcdn.net
Generated: March 19th 2010 3:58:27 AM PDT
Machine: 10.16.139.110
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("\u4f60\u73fe\u5728\u662f\u64c1\u8e89\u4e86\u3002"));}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("\u5fa9\u539f"));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&&!i)h='<input type="checkbox" id="ban_user" name="ban_user" value="1" />'+_tx("\u6c38\u4e45\u7981\u6b62");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("\u60a8\u78ba\u5b9a\u79fb\u9664\u5df2\u88ab\u7981\u6b62\u7684 {user-name}\uff1f",{'user-name':a});return {msg:text,label:_tx("\u79fb\u9664\u5c01\u9396")};}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("\u4f60\u6b63\u5728\u5617\u8a66\u9000\u51fa\u4f60\u4f5c\u70ba\u552f\u4e00\u4e00\u500b\u7ba1\u7406\u54e1\u7684\u6d3b\u52d5\u3002");f+=' '+_tx("\u7531\u65bc\u4f60\u662f\u552f\u4e00\u7684\u7ba1\u7406\u54e1\uff0c\u79fb\u9664\u4f60\u81ea\u5df1\u6703\u5c0e\u81f4\u6b64\u6d3b\u52d5\u88ab\u522a\u9664\u3002");break;case 'Page':f+=' '+_tx("You are attempting to remove yourself from a Page for which you are the only administrator.");f+=' '+_tx("\u7531\u65bc\u4f60\u662f\u6b64\u5c08\u9801\u7684\u552f\u4e00\u7684\u7ba1\u7406\u54e1\uff0c\u79fb\u9664\u4f60\u81ea\u5df1\u6703\u5c0e\u81f4\u6b64\u5c08\u9801\u88ab\u522a\u9664\u3002");break;}switch(e){case 'Group':f+=' '+_tx("\u4f60\u78ba\u5b9a\u8981\u96e2\u958b\u9019\u500b\u7fa4\u7d44\uff1f");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("\u60a8\u78ba\u5b9a\u8981\u79fb\u9664 {user-name} \u55ce\uff1f",{'user-name':d});}return {msg:f,label:_tx("\u79fb\u9664")};}function invitetool_remove_admin_msg(c,d,b,a){var e='';if(b){e+=' '+_tx("\u4f60\u6b63\u5728\u522a\u9664\u4f60\u7684\u7ba1\u7406\u54e1\u6b0a\u9650\u3002");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("\u7531\u65bc\u4f60\u662f\u552f\u4e00\u7684\u7ba1\u7406\u54e1\uff0c\u79fb\u9664\u4f60\u81ea\u5df1\u6703\u5c0e\u81f4\u6b64\u6d3b\u52d5\u88ab\u522a\u9664\u3002");break;case 'Page':e+=' '+_tx("\u7531\u65bc\u4f60\u662f\u6b64\u5c08\u9801\u7684\u552f\u4e00\u7684\u7ba1\u7406\u54e1\uff0c\u79fb\u9664\u4f60\u81ea\u5df1\u6703\u5c0e\u81f4\u6b64\u5c08\u9801\u88ab\u522a\u9664\u3002");break;}e+=' '+_tx("\u4f60\u78ba\u5b9a\u4e0d\u8981\u518d\u64d4\u4efb\u7ba1\u7406\u54e1\uff1f");}else{e+=' '+_tx("\u4f60\u6b63\u8a66\u5716\u4ee5\u7ba1\u7406\u54e1\u8eab\u4efd\u79fb\u9664{user-name}\u3002",{'user-name':c});e+=' '+_tx("\u60a8\u78ba\u5b9a\u79fb\u9664 {user-name} \u70ba\u7ba1\u7406\u54e1\u55ce\uff1f",{'user-name':c});}return {msg:e,label:_tx("\u8fad\u9000\u7ba1\u7406\u54e1")};}function invitetool_fbpage_admin_msg(b,c,a){var d='';if(a){d+=' '+_tx("\u4f60\u6b63\u5728\u522a\u9664\u4f60\u7684\u7ba1\u7406\u54e1\u6b0a\u9650\u3002")+' '+_tx("You will not be able to get these privileges back without invitation.");}else d+=' '+_tx("\u4f60\u6b63\u8a66\u5716\u4ee5\u7ba1\u7406\u54e1\u8eab\u4efd\u79fb\u9664{user-name}\u3002",{'user-name':b});return {msg:d,label:_tx("\u8fad\u9000\u7ba1\u7406\u54e1")};}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("\u4f60\u78ba\u5b9a\u8981\u8a2d\u5b9a{user-name}\u70ba\u7ba1\u7406\u54e1\uff1f\u9019\u6837\u6703\u4ee4{user-name}\u6709\u6b0a\u529b\u7ba1\u7406\u4f60\u7684\u5c08\u9801\uff1f",{'user-name':b});break;}return {msg:a,label:_tx("\u6307\u5b9a\u70ba\u7ba1\u7406\u54e1")};}

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