/*    HTTP Host:  b.static.ak.fbcdn.net                                        */
/*    Generated:  May 12th 2009 1:59:36 PM PDT                                 */
/*      Machine:  10.16.140.109                                                */
/*       Source:  Local Cache                                                  */
/*     Location:  rsrc:8bgwprj3:nu_ll:/html/js/9el8d38p6mg400gc.pkg.js:141     */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/9el8d38p6mg400gc.pkg.js                                   */


function ToolTips(){copy_properties(this,{tipBox:$N('div'),tipInner:$N('div'),_showTimer:null});CSS.addClass(this.tipBox,'tooltip');CSS.addClass(this.tipInner,'tooltip_inner');this.tipBox.appendChild(this.tipInner);DOM.getRootElement().appendChild(this.tipBox);};ToolTips.TOP_CENTER={orientClassName:'tooltip_top_center'};ToolTips.RIGHT_CENTER={orientClassName:'tooltip_right_center'};ToolTips.BOTTOM_CENTER={orientClassName:'tooltip_bottom_center'}
ToolTips.LEFT_CENTER={orientClassName:'tooltip_left_center'}
ToolTips.DEFAULT=ToolTips.TOP_CENTER;copy_properties(ToolTips.prototype,{show:function(event){var target=$E(event).getTarget();var delay=DataStore.get(target,'tooltip',{}).delay||0;if(!delay){this._show(target);}else if(!this._showTimer){this._showTimer=this._show.bind(this,target).defer(delay);}},_show:function(target){var data=DataStore.get(target,'tooltip');if(data){this.tipInner.setContent(HTML(data.tip));CSS.setClass(this.tipBox,'tooltip');if(data.className){this.tipBox.addClass(data.className);}
this.tipBox.style.display='block';this.tipBox.style.visibility='hidden';orientation=data.orientation||ToolTips.DEFAULT;var vector;var elem_dimensions=Vector2.getElementDimensions(this.tipBox);switch(orientation){case ToolTips.RIGHT_CENTER:vector=Vector2.getElementCompassPoint(target,Vector2.compass.southeast).add(3,-(Vector2.getElementDimensions(target).y+
elem_dimensions.y)/2);break;case ToolTips.TOP_CENTER:vector=Vector2.getElementCompassPoint(target,Vector2.compass.north).add(-elem_dimensions.x/2,-elem_dimensions.y-3);break;case ToolTips.LEFT_CENTER:vector=Vector2.getElementCompassPoint(target,Vector2.compass.southwest).add(-elem_dimensions.x-7,-(Vector2.getElementDimensions(target).y+
elem_dimensions.y)/2);break;case ToolTips.BOTTOM_CENTER:vector=Vector2.getElementCompassPoint(target,Vector2.compass.south).add(-elem_dimensions.x/2,3);break;default:throw new Error(sprintf('Unknown tooltip orientation: %s.',orientation));}
CSS.addClass(this.tipBox,orientation.orientClassName);this.tipBox.style.visibility='visible';if(data.offset){vector=vector.sub(data.offset);}
vector.setElementPosition(this.tipBox);(function(){Rect.getElementBounds(this.tipBox).boundWithin(Rect.getViewportBounds()).getPositionVector().setElementPosition(this.tipBox);}).bind(this).defer();}else{this.hide();}
return this;},hide:function(event){if(this._showTimer){clearTimeout(this._showTimer);this._showTimer=null;}
this.tipBox.style.display='';return this;}});copy_properties(ToolTips,{instance:null,getInstance:function(){return ToolTips.instance||(ToolTips.instance=new ToolTips());},setTips:function(tips,orientation,delay,offset){for(var k in tips){ToolTips.setTip(k,tips[k],orientation,delay,offset);}
return ToolTips;},setTip:function(element,toolTip,orientation,delay,offset){el=ge(element);if(el){var instance=ToolTips.getInstance();var show=instance.show.bind(instance);var hide=instance.hide.bind(instance);DataStore.set(el,'tooltip',{tip:toolTip,orientation:orientation,delay:delay,offset:offset});el.listen('mouseover',show);el.listen('mouseout',hide);}
return ToolTips;},configureTip:function(element,property,value){switch(property){case'orientation':case'delay':case'tip':case'className':element=$(element);var data=DataStore.get(element,'tooltip');data[property]=value;DataStore.set(element,'tooltip',data);return ToolTips;break;}
throw new TypeError('Invalid property, consult documentation.');}});
Arbiter.inform("template\/registerTemplate", {"name":"\/templates\/UIObjectListing.tmpl","template":"\n\n<div bindPoint=\"root\" class=\"UIObjectListing clearfix\">\n    <div class=\"UIObjectListing_Pic\">\n      <a href=\"${href}\">\n        <span class=\"UIObjectListing_PicRounded\"><\/span>\n        <img bindPoint=\"pic\" \/>\n      <\/a>\n    <\/div>\n    <div class=\"UIObjectListing_MetaData\">\n      <a bindPoint=\"title\" class=\"UIObjectListing_Title\" href=\"${href}\"\/>\n      <div class=\"UIObjectListing_MetaDataSecondary\">\n        <span bindPoint=\"subtitle\" class=\"UIObjectListing_Subtitle\"\/>\n        <span bindPoint=\"subtext\" class=\"UIObjectListing_Subtext\"\/>\n      <\/div>\n    <\/div>\n    <div class=\"UIObjectListing_RightContent\" bindPoint=\"rightContent\">\n      <div class=\"UIObjectListing_RemoveContainer hidden_elem\" bindPoint=\"removeContainer\">\n        <a class=\"UIObjectListing_RemoveLink\" bindPoint=\"removeLink\" href=\"#\">&nbsp;<\/a>\n      <\/div>\n      <div class=\"UIObjectListing_ActionContainer hidden_elem\" bindPoint=\"actionContainer\">\n      <\/div>\n    <\/div>\n<\/div>\n"}, Arbiter.BEHAVIOR_PERSISTENT);
Arbiter.inform("template\/registerTemplate", {"name":"\/templates\/UIActionButton.tmpl","template":"\n<a class=\"UIActionButton\" bindPoint=\"root\" href=\"#\">\n  <span class=\"UIActionButton_Link\" bindPoint=\"main\">\n    <span class=\"UIActionButton_Icon\" bindPoint=\"icon\"><\/span>\n    <span class=\"UIActionButton_Text\" bindPoint=\"text\"><\/span>\n  <\/span>\n<\/a>\n"}, Arbiter.BEHAVIOR_PERSISTENT);

function UIActionButton(title,iconClass){copy_properties(this,{_dirty:true,_title:title,root:null,main:null,text:null});this.parent.construct(this,URI('/templates/UIActionButton.tmpl'));this.setIcon(iconClass);this._clickHandler=bagofholding;Event.listen(this.root,'click',this._click.bind(this));}
UIActionButton.extend('TemplateObject');copy_properties(UIActionButton,{Icon:{PLUS:'UIActionButton_IconPlus',CONNECT:'UIActionButton_IconConnect',CONNECT_FRIEND:'UIActionButton_IconConnectFriend',CONNECT_FAN:'UIActionButton_IconConnectFan'},TextColor:{BLACK:1,BLUE:2}});UIActionButton.prototype.setClickHandler=function(fn){this._clickHandler=fn;return this;}
UIActionButton.prototype._click=function(){if(!this.getDisabled()){return this._clickHandler();}else{return false;}}
UIActionButton.prototype.setIcon=function(icon){for(var name in UIActionButton.Icon){CSS.removeClass(this.root,UIActionButton.Icon[name]);}
if(icon){CSS.addClass(this.root,icon);CSS.addClass(this.root,'UIActionButton_HasIcon');}else{CSS.removeClass(this.root,'UIActionButton_HasIcon');}
return this;}
UIActionButton.prototype.setTextColor=function(color){this.textColor=color;CSS.conditionClass(this.root,'UIActionButton_BlueText',this.textColor==UIActionButton.TextColor.BLUE);return this;}
UIActionButton.prototype.setSuppressBasePadding=function(suppress){CSS.conditionClass(this.root,'UIActionButton_SuppressBasePadding',suppress);return this;}
UIActionButton.prototype.setDisabled=function(disabled){CSS.conditionClass(this.root,'UIActionButton_Disabled',disabled);this.root.disabled=disabled;return this;}
UIActionButton.prototype.getDisabled=function(){return CSS.hasClass(this.root,'UIActionButton_Disabled');}
UIActionButton.prototype.setGrayBackground=function(gray_background){CSS.conditionClass(this.root,'UIActionButton_GrayBG',gray_background);return this;}
UIActionButton.prototype.getNodes=function(){DOM.setContent(this.text,this._title);this._dirty=false;return[this.root];}

function UIObjectListing(data){copy_properties(this,{_data:data,_dirty:true,root:null,pic:null,actionContainer:null,removeContainer:null,removeLink:null,rightContent:null,subtext:null});this._removeLinkHandler=bagofholding;this._control=false;var uri=URI('/templates/UIObjectListing.tmpl');this.parent.construct(this,uri,this._data);}
UIObjectListing.extend('TemplateObject');UIObjectListing.prototype.setBoldTitle=function(bold_title){CSS.conditionClass(this.root,'UIObjectListing_TitleNormal',!bold_title);}
UIObjectListing.prototype.setPicPadding=function(pic_padding){CSS.conditionClass(this.root,'UIObjectListing_PicPadding',pic_padding);}
UIObjectListing.prototype.getId=function(){return this._data.id;}
UIObjectListing.prototype.setSubtext=function(subtext){DOM.setContent(this.subtext,subtext);return this;}
UIObjectListing.prototype.setActionControl=function(control){this._control=control;DOM.setContent(this.actionContainer,control.getNodes());CSS.removeClass(this.actionContainer,'hidden_elem');return this;}
UIObjectListing.prototype.getActionControl=function(){return this._control;}
UIObjectListing.prototype.setRemoveControl=function(enabled,handler,tooltip_text){CSS.conditionClass(this.removeContainer,'hidden_elem',!enabled);CSS.conditionClass(this.root,'UIObjectListing_HasRemoveControl',enabled);if(enabled){if(handler){this._removeLinkHandler=handler;}
if(tooltip_text){ToolTips.setTip(this.removeLink,tooltip_text,ToolTips.TOP_CENTER,0,new Vector2(0,5));}}}
UIObjectListing.prototype.setRightContent=function(content){DOM.setContent(this.rightContent,content);return this;}
UIObjectListing.prototype._removeLinkClick=function(e){this._removeLinkHandler();return false;}
UIObjectListing.prototype.paint=function(){this.pic.src=this._data.pic;if(this._data.removeable){CSS.removeClass(this.removeContainer,'hidden_elem');}
DOM.setContent(this.title,this._data.title);if(this._data.subtitle){DOM.setContent(this.subtitle,this._data.subtitle);}
if(this._data.subtext){this.setSubtext(this._data.subtext);}
Event.listen(this.removeLink,'click',this._removeLinkClick.bind(this));if(!this._data.href){DOM.replace(this.title,$N('span',{className:this.title.className},DOM.getText(this.title)));}
this._dirty=false;}

var SocialGraphManager=function(){var _initialized=false;var _classType=-1;var _nodeID=-1;var _dialog=null;var _prepareAsyncData=function(data){if(!_initialized){return null;}
var required_data={'class':_classType,'node_id':_nodeID};copy_properties(data,required_data);return data;};var _send=function(uri,data,handler){new AsyncRequest().setURI(uri).setData(_prepareAsyncData(data)).setHandler(handler?handler:bagofholding).send();return false;};var _showDialog=function(uri,data){if(!(data=_prepareAsyncData(data))){return;}
var async=new AsyncRequest().setMethod('POST').setURI(uri).setData(data);_dialog=new Dialog().setAsync(async).show();return false;};return{init:function(classType,nodeID){_initialized=true;_classType=classType;_nodeID=nodeID;return this;},getCurrentNodeID:function(){return _nodeID;},showInviteDialog:function(){_showDialog('/ajax/social_graph/invite_dialog.php',{});},showAddAdminDialog:function(){_showDialog('/ajax/social_graph/add_admin_dialog.php',{});},showBrowseDialog:function(args){_showDialog('/ajax/social_graph/dialog/browse.php',args||{});},submitDialog:function(formID,target){if(_dialog){var data=serialize_form($(formID));_dialog.hide();if(data['ids']||data['email_addresses']){_showDialog(target,data);}}},cancelDialog:function(){if(_dialog){_dialog.hide();}},fetch:function(edge_type,meta,page,limit,handler){var uri='/ajax/social_graph/fetch.php';var data={'edge_type':edge_type,'page':page,'limit':limit};if(meta){copy_properties(data,meta);}
return _send(uri,data,handler);},search:function(query,meta,handler){var uri='/ajax/social_graph/search.php';var data={'query':query};if(meta){copy_properties(data,meta);}
return _send(uri,data,handler);},add:function(fbids,edge_type,meta,app_id,message,handler){var uri='/ajax/social_graph/add.php';var data={'fbids':fbids,'edge_type':edge_type,'app_id':app_id,'message':message};if(meta){copy_properties(data,meta);}
return _send(uri,data,handler);},remove:function(fbid,edge_type,ban,meta,message,handler){var uri='/ajax/social_graph/remove.php';var data={'fbid':fbid,'edge_type':edge_type,'ban':ban,'message':message};if(meta){copy_properties(data,meta);}
return _send(uri,data,handler);}};}();

function ObjectBrowserDataSource(filter,pageSize){this.data=filter.data;this.id=filter.id;this.meta=filter.meta;this.object_id=filter.object_id;this.object_class=filter.object_class;this.count=0;this.currentPage=0;this.pageSize=pageSize;this.pageData=[];if(filter.entities){this.pageData[0]=filter.entities;this.shouldFetch=false;}
this.fetchCompleteListener=null;this.scrollTopPosition=0;}
copy_properties(ObjectBrowserDataSource.prototype,{fetch:function(pageIndex){if(this.pageData[pageIndex]){if(this.pageData[pageIndex].requested){return;}
if(this.fetchCompleteListener){this.fetchCompleteListener(this.id,pageIndex,this.pageData[pageIndex],this.count);}}else{this.pageData[pageIndex]={'requested':true};if(this.object_id){SocialGraphManager.init(this.object_class,this.object_id);}
SocialGraphManager.fetch(this.data,this.meta,pageIndex,this.pageSize,this.onFetchComplete.bind(this));}},search:function(query,meta,callback){SocialGraphManager.search(query,meta,callback);},prefetch:function(){if(!this.shouldFetch){return;}
if(!this.pageData[this.currentPage]){this.fetch(this.currentPage);}else{this.fetch(this.currentPage+1);}},nextPage:function(){this.currentPage++;this.fetch(this.currentPage);},prevPage:function(){if(this.currentPage>0){this.currentPage--;}
this.fetch(this.currentPage);},setFetchCompleteListener:function(callback){this.fetchCompleteListener=callback;},onFetchComplete:function(response){if(!response){return;}
var payload=response.getPayload();if(!payload||payload.page==null){return;}
var page=payload.page;if(!this.pageData[page]||this.pageData[page].requested){if(payload.user_info){this.pageData[page]=payload.user_info;}else{this.pageData[page]={};}}
this.count=payload.count;if(this.fetchCompleteListener){this.fetchCompleteListener(this.id,page,payload.user_info,payload.count);}},removeItem:function(id){if(this.pageData[this.currentPage]&&this.pageData[this.currentPage][id]){delete this.pageData[this.currentPage][id];}}});function ObjectBrowserController(userData,elementID,filter_data,pageSize,objectType){this.filters={};this.currentFilter=null;this.pageSize=pageSize;this.elementID=elementID;this.pageData=null;this.pageDataArray=null;this.objectType=objectType;this.didPrefetchAll=false;this.objects={};this.arbiterTokens=[];this.segments=[];this.itemsPerSegment=10;this.itemHeight=55;this.segmentsFixed=false;this.container=$(elementID+'_object_browser_body');this.contentArea=$(elementID+'_object_browser_content_area');this.headerElement=$(elementID+'_object_browser_header_element');this.tabContainer=$(elementID+'_object_browser_tab_container');this.pagerNext=ge(elementID+'_object_browser_pager_more');this.pagerPrev=ge(elementID+'_object_browser_pager_less');this.searchBox=ge(elementID+'_object_browser_search_box');this.searchHeader=ge(elementID+'_object_browser_search_header');this.noResultsBanner=ge(elementID+'_object_browser_no_results');if(filter_data){var fetchHandler=this.onFilterFetchComplete.bind(this);for(var i=0;i<filter_data.length;i++){var filter=new ObjectBrowserDataSource(filter_data[i],this.pageSize);filter.setFetchCompleteListener(fetchHandler);this.filters[filter_data[i].id]=filter;if(filter_data[i].selected){this.currentFilter=filter;}}}
if(userData){this.renderPage(userData);}
Event.listen(this.container,'scroll',this.onScroll.bind(this));if(this.currentFilter){if(!userData||userData.length==0){this.currentFilter.fetch(0);}}
var lastHeaderNode=this.searchBox;var firstHeaderNode=this.searchBox;var lis=DOM.scry(this.tabContainer,'li');if(lis.length){firstHeaderNode=lis[0];if(!lastHeaderNode){lastHeaderNode=lis[lis.length-1];}}
if(lastHeaderNode){var lastNodeOffset=lastHeaderNode.offsetTop-firstHeaderNode.offsetTop;var headerHeight=lastNodeOffset+lastHeaderNode.offsetHeight+3;CSS.setStyle(this.tabContainer,'height',headerHeight+'px');}
ObjectBrowserController.setController(elementID,this);}
copy_properties(ObjectBrowserController,{controllers:{},getController:function(elementID){return this.controllers[elementID];},setController:function(elementID,controller){var oldController=this.getController(elementID);if(oldController){oldController.cleanup();}
this.controllers[elementID]=controller;}});copy_properties(ObjectBrowserController.prototype,{setupSegments:function(){var numItems=this.pageDataArray.length;var numSegments=Math.ceil(numItems/this.itemsPerSegment);this.segments=[];var segment=null;var loadingIndicator=null;for(var i=0;i<numSegments;i++){var segment=$N('div',{className:'object_browser_segment_div clearfix'});var loadingIndicator=$N('div');CSS.setClass(loadingIndicator,'object_browser_segment_loading');CSS.setStyle(loadingIndicator,'height',(this.itemsPerSegment*this.itemHeight)+'px');segment.appendContent(loadingIndicator);this.segments.push(segment);}
if(loadingIndicator){CSS.setStyle(loadingIndicator,'height',((numItems%this.itemsPerSegment)*this.itemHeight)+'px');}
DOM.empty(this.contentArea);this.contentArea.appendContent(this.segments);},fixupSegments:function(){if(this.segments.length<=1||this.segmentsFixed){return;}
this.segmentsFixed=true;var segmentHeight=this.segments[0].clientHeight;var itemHeight=Math.round(segmentHeight/this.itemsPerSegment);if(itemHeight==this.itemHeight){return;}
this.itemHeight=itemHeight;for(var i=1;i<this.segments.length-1;i++){CSS.setStyle(this.segments[i],'height',segmentHeight+'px');}
CSS.setStyle(this.segments[this.segments.length-1],'height',((this.pageDataArray%this.itemsPerSegment)*itemHeight)+'px');},cleanup:function(){for(var i=0;i<this.arbiterTokens.length;i++){Arbiter.unsubscribe(this.arbiterTokens[i]);}
this.arbiterTokens=[];},setPageData:function(pageData){this.pageData=pageData;this.pageDataArray=[];for(var x in pageData){this.pageDataArray.push(pageData[x]);}},onScroll:function(){if(this.drawOnScrollTimeout){clearTimeout(this.drawOnScrollTimeout);}
this.drawOnScrollTimeout=setTimeout(this.drawOnScroll.bind(this),20);},drawOnScroll:function(){var viewportTop=this.container.scrollTop-this.pagerPrev.clientHeight;;var segmentHeight=this.itemsPerSegment*this.itemHeight;var firstSegment=Math.floor(viewportTop/segmentHeight);var lastSegment=Math.floor((viewportTop+this.container.clientHeight)/segmentHeight);firstSegment--;lastSegment++;for(var i=firstSegment;i<=lastSegment;i++){this.renderSegment(i);}},prefetchAllFilters:function(){if(this.didPrefetchAll){return;}
this.didPrefetchAll=true;for(var filterName in this.filters){this.filters[filterName].prefetch();}},onFilterClick:function(filterID){if(filterID==this.currentFilter.id){return false;}
this.currentFilter.scrollTopPosition=this.container.scrollTop;if(this.searchHeader){CSS.addClass(this.searchHeader,'hidden_elem');}
var filter=this.filters[filterID];if(!filter){Util.error('Filter '+filterID+' not found');return false;}
this.showLoadingUI();this.currentFilter=this.filters[filterID];filter.fetch(filter.currentPage);this.clearSearch();Arbiter.inform('/people_browser/filterclick/',{'id':filterID});return false;},setCurrentFilter:function(filterID){if((filterID==this.currentFilterID)||!this.filters[filterID]){return;}
var tabsetID=this.elementID+'_filter_tabs';var tabset=Tabset.getInstance(tabsetID);if(!tabset){return;}
tabset.selectTab(tabsetID+'_'+filterID);this.currentFilter=this.filters[filterID];},nextPage:function(){this.showLoadingUI();this.currentFilter.nextPage();this.currentFilter.prefetch();},prevPage:function(){this.showLoadingUI();this.currentFilter.prevPage();},search:function(){this.showLoadingUI();this.currentFilter.search(this.searchBox.value,{'wrapper_id':this.elementID},this.onSearchComplete.bind(this));return false;},showLoadingUI:function(){DOM.empty(this.contentArea);CSS.addClass(this.pagerNext,'hidden_elem');CSS.addClass(this.pagerPrev,'hidden_elem');CSS.addClass(this.container,'object_browser_page_loading');},hideLoadingUI:function(){CSS.removeClass(this.container,'object_browser_page_loading');},onSearchComplete:function(response){if(!response){return;}
var payload=response.getPayload();if(!payload){return;}
if(payload.header){CSS.removeClass(this.searchHeader,'hidden_elem');DOM.setContent(this.searchHeader,HTML(payload.header));Event.listen($(this.elementID+'_search_header_cancel_link'),'click',this.onCancelSearch.bind(this));}
CSS.addClass(this.pagerNext,'hidden_elem');CSS.addClass(this.pagerPrev,'hidden_elem');this.container.scrollTop=0;this.renderPage(payload.user_info);Arbiter.inform('/people_browser/search_complete/',{'wrapper_id':this.elementID,'filter':this.currentFilter.id});},onCancelSearch:function(){this.clearSearch();this.currentPage=0;this.currentFilter.fetch(0);return false;},clearSearch:function(){if(!this.searchHeader){return;}
CSS.addClass(this.searchHeader,'hidden_elem');DOM.empty(this.searchHeader);this.searchBox.value="";},onFilterFetchComplete:function(filterID,pageIndex,userData,count){if(this.currentFilter.id!=filterID){return;}
if(this.filters[filterID].currentPage!=pageIndex){return;}
if(!this.container){Util.error('ObjectBrowserController.container not found');return;}
this.renderPage(userData);this.container.scrollTop=this.filters[filterID].scrollTopPosition;var showNext=((pageIndex+1)*this.pageSize)<count;var showPrev=pageIndex>0;CSS.conditionClass(this.pagerPrev,'hidden_elem',!showPrev);CSS.conditionClass(this.pagerNext,'hidden_elem',!showNext);},removeItem:function(id){if(!this.objects[id]){Util.error('item not found in ObjectBrowserController.removeItem');return;}
var element=this.objects[id].root;animation(element).blind().to('height','0').duration(300).hide().go();if(this.currentFilter){this.currentFilter.removeItem(id);}},replaceItem:function(id,data){if(!this.objects[id]){Util.error('item not found in ObjectBrowserController.replaceItem');return;}
var element=this.objects[id].root;var row=this.renderUser(data,true);DOM.replace(element,row.root);},hideActionLink:function(id){if(!this.objects[id]){Util.error('item not found in ObjectBrowserController.hideActionLink');return;}
var element=this.objects[id].root;CSS.addClass(element,'object_browser_hidden_action');},setHeaderContent:function(content){DOM.setContent(this.headerElement,content);},showHeaderContent:function(show){CSS.conditionClass(this.headerElement,'hidden_elem',!show);},onRemoveClick:function(id){var title=this.pageData[id].title
var data={'id':id,'title':title,'element':this.elementID,'obj_label':this.objectType};if(this.pageData[id].removeArgs){copy_properties(data,this.pageData[id].removeArgs);}
Arbiter.inform('/people_browser/remove/',data);return false;},onActionClick:function(id,action){var title=this.pageData[id].title
var data={'id':id,'title':title,'action':action,'element':this.elementID,'obj_label':this.objectType};if(this.pageData[id].actionArgs){copy_properties(data,this.pageData[id].actionArgs);}
Arbiter.inform('/people_browser/action/'+action,data);return false;},addActionHandler:function(action,callback){var wrapped_callback=function(action,data){callback(data);};this.arbiterTokens.push(Arbiter.subscribe('/people_browser/action/'+action,wrapped_callback));},addRemoveHandler:function(callback){var wrapped_callback=function(action,data){callback(data);}
this.arbiterTokens.push(Arbiter.subscribe('/people_browser/remove/',wrapped_callback));},replaceActionButton:function(id,action,actionText){var button=new UIActionButton(actionText).setSuppressBasePadding(true).setClickHandler(this.onActionClick.bind(this,id,action));this.objects[id].setActionControl(button);},renderUser:function(userData,forceRedraw){if(this.objects[userData.uid]&&!forceRedraw){return this.objects[userData.uid];}
var row=new UIObjectListing(userData);row.setPicPadding(true);row.paint();if(userData.removeable){row.setRemoveControl(true,this.onRemoveClick.bind(this,userData.uid));}
if(userData.action){var button=new UIActionButton(userData.actionText);button.setSuppressBasePadding(true);button.setClickHandler(this.onActionClick.bind(this,userData.uid,userData.action));row.setActionControl(button);}
this.objects[userData.uid]=row;return row;},renderPage:function(userData){this.setPageData(userData);this.setupSegments();this.hideLoadingUI();CSS.addClass(this.noResultsBanner,'hidden_elem');this.renderSegment(0);setTimeout(this.renderSegment.bind(this,1),0);setTimeout(this.fixupSegments.bind(this),0);CSS.conditionClass(this.noResultsBanner,'hidden_elem',this.pageDataArray.length!=0);this.prefetchAllFilters();},renderSegment:function(segment){if(segment<0||segment>=this.segments.length){return;}
if(this.segments[segment].rendered){return;}
var first=segment*this.itemsPerSegment;var last=first+this.itemsPerSegment-1;if(segment==this.segments.length-1){last=this.pageDataArray.length-1;}
var rows=[];for(var i=first;i<=last;i++){var row=this.renderUser(this.pageDataArray[i],true);rows.push(row.root);}
DOM.empty(this.segments[segment]);DOM.appendContent(this.segments[segment],rows);this.segments[segment].rendered=true;}});function people_browser_popup_onclick(people,title,width){var async_request=new AsyncRequest().setURI('/ajax/people_browser.php').setData({people:people}).setMethod('GET').setReadOnly(true);var dialog=new Dialog().setModal(true).setFullBleed(true).setAsync(async_request);if(title){dialog.setTitle(title);}
if(width){dialog.setContentWidth(width)}
dialog.show();return false;}

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