/*
HTTP Host: b.static.ak.fbcdn.net
Generated: March 14th 2010 3:48:55 PM PDT
Machine: 10.16.139.104
Locale: nu_ll
Path: js/axtigxuwu1sgsg4g.pkg.js
*/

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

function UIPagelet(_L0,src,_L2,_L3){this._id=_L0||null;this._element=ge(_L0||$N('div'));this._src=src||null;this._context_data=_L2||{};this._data=_L3||{};this._handler=bagofholding;this._request=null;return this;}copy_properties(UIPagelet.prototype,{getElement:function(_L0){_L0=_L0||false;if(_L0)this._element=ge(this._id);return this._element;},setHandler:function(_L0){this._handler=_L0;return this;},go:function(src,_L1){if(arguments.length>=2||typeof src=='string'){this._src=src;this._data=_L1||{};}else if(arguments.length==1)this._data=src;this.refresh();return this;},refresh:function(_L0){var _L1=function(_L2){this._request=null;if(_L0&&this._id)this._element=ge(this._id);this._element.setContent(HTML(_L2.getPayload()));this._handler();}.bind(this);this._request=new AsyncRequest().setURI(this._src).setMethod('GET').setData({data:JSON.encode(merge(this._context_data,this._data))}).setReadOnly(true).setHandler(_L1).setOption('bundle',true);this._request.send();return this;},cancel:function(){if(this._request)this._request.abort();}});
function FriendsPage(_L0,_L1,_L2,_L3,_L4,_L5,_L6){this._cache={};this._friendCache={};this._listDownloadComplete=false;this._phonebookDownloadComplete=false;this._RecentlyUpdatedDownloadComplete=false;this._currentView=null;this._pagelet=_L4;this._currentNetworkFilter=false;this._filterKeys=_L6;this._filterKeys.default_view=_L6.all_connections;this._mainNav=_L0;this._listNav=_L1;this._listNav.setCreateLinkHandler(this._showMFS.bind(this,true));this._networkFiltersTypeMap={};this._networkFilters={};this._friendContainer=$('FriendsPage_Container');this._itemsPerPage=50;this._searchResultsPerPage=25;this._offsetMap={};if(this._getNavSelectedItem()){var _L7=this._getNavSelectedItem().data;var _L8=URI().getQueryData();if(_L8.filter_network)_L7.filter_network=_L8.filter_network;}else{var _L7={filter:this._filterKeys.find_friends};var _L8=_L7;}if(!_L8.offset)_L8.offset=0;_L7.offset=_L8.offset;PageTransitions.registerHandler(this._pageTransitionHandler.bind(this));var _L9=function(_La){var uri=URI.getRequestURI();var _L7={filter:this._currentView,offset:_La};if(this._currentNetworkFilter!==false)_L7.filter_network=this._currentNetworkFilter;uri.setQueryData(_L7);uri.go();}.bind(this);this._pagerTop=new UIPager(0,this._itemsPerPage,_L7.offset,_L9);this._pagerBottom=new UIPager(0,this._itemsPerPage,_L7.offset,_L9);this._pagerTop.setSummaryTextHandler(this._getPagerSummaryText.bind(this));this._pagerBottom.setSummaryTextHandler(this._getPagerSummaryText.bind(this));this._toolbarTop=_L2;this._toolbarBottom=_L3;this._createListButton=new UIActionButton(_tx("Create New List"));this._createListButton.setOnclick(this._createListButtonClick.bind(this));this._toolbarTop.addButton(this._createListButton,'left');this._editListButton=new UIActionButton(_tx("Edit List"));this._editListButton.setOnclick(this._editListButtonClick.bind(this));this._toolbarTop.addButton(this._editListButton,'left');this._toolbarTop.addContent(this._pagerTop.getRoot(),'right');this._toolbarBottom.addContent(this._pagerBottom.getRoot(),'right');this._deleteListButton=new UIActionButton(_tx("Delete List"));this._deleteListButton.setOnclick(this._deleteListButtonClick.bind(this));this._toolbarTop.addButton(this._deleteListButton,'left');this._searchInput=$('FriendsPage_Search');this._statusContainer=$('FriendsPage_StatusContainer');this._statusMessage=this._statusContainer.find('h2.FriendsPage_SimpleStatus');this._setNavLoading(true);Arbiter.subscribe(FriendsPage.ARBITER_NETWORK_FILTERS_DONE,this._setShowNetworkFilters.bind(this,true));TemplateRegistry.registerServerSideTemplate('/templates/UIObjectListing.tmpl',null,true,false);new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_search.php?'+_L5).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(_L7,_La){this._setNavLoading(false);this._typeaheadFriends=[];var _Lb=_La.payload.entries;var _Lc={};_Lc[search_friend_source.TYPES.USER]=1;_Lc[search_friend_source.TYPES.PAGE]=1;_Lc[search_friend_source.TYPES.CONNECTION]=1;for(var i=0;i<_Lb.length;i++){if(!_Lc[_Lb[i].ty])continue;this._typeaheadFriends.push(_Lb[i]);var _Le={title:_Lb[i].t,type:_Lb[i].ty,subtitle:_Lb[i].n,id:_Lb[i].i,pic:_Lb[i].it,pending:_Lb[i].pnd};if(_Lb[i].a){_Le.href='/'+escapeURI(_Lb[i].a);}else _Le.href='/profile.php?id='+_Lb[i].i;this._friendCache[_Le.id]=_Le;}this._cache[this._filterKeys.default_view]={};this._cache[this._filterKeys.default_view].members=[];this._cache[this._filterKeys.default_view].filter=this._filterKeys.default_view;this._cache[this._filterKeys.default_view].type=this._filterKeys.default_view;for(var k in this._friendCache)this._cache[this._filterKeys.default_view].members.push(this._friendCache[k].id);this._setupSearch();var item=this._getNavItem(_L7.filter);if(!(item.data&&item.data.is_pagelet))this._getFriends(_L7,false);}.bind(this,_L7)).send();this._getFriendLists();Arbiter.subscribe(Arbiter.LIST_EDITOR_LISTS_CHANGED,this._listEditorSave.bind(this),Arbiter.SUBSCRIBE_NEW);}copy_properties(FriendsPage,{ARBITER_NETWORK_FILTERS_DONE:'FriendsPage/network_filters_done'});FriendsPage.prototype._pageTransitionHandler=function(uri){if(uri.getPath()=='/friends/index.php'||uri.getPath()=='/friends/'||uri.getPath()=='/people/'||uri.getPath()=='/people/index.php'||uri.getPath()=='/friends/new/'||uri.getPath()=='/friends/new/index.php'){var _L1=uri.getQueryData();if(!_L1.offset)_L1.offset=0;this._selectNavItem(_L1.filter);this._getFriends(_L1,true);return true;}return false;};FriendsPage.prototype._getNavItem=function(_L0){var _L1=this._mainNav.getItems().concat(this._listNav.getItems());for(var i=0;i<_L1.length;i++)if(_L1[i].data&&_L0==_L1[i].data.filter)return _L1[i];return false;};FriendsPage.prototype._selectNavItem=function(_L0){var _L1=this._getNavItem(_L0);if(_L1)if(this._mainNav.getItems().contains(_L1)){this._mainNav.selectItem(_L1);this._listNav.deselectAll();}else if(this._listNav.getItems().contains(_L1)){this._listNav.selectItem(_L1);this._mainNav.deselectAll();}};FriendsPage.prototype._getNavSelectedItem=function(){return this._mainNav.getSelectedItem()||this._listNav.getSelectedItem();};FriendsPage.prototype._setNavLoading=function(_L0){this._mainNav.setLoading(_L0);this._listNav.setLoading(_L0);};FriendsPage.prototype._getFriendLists=function(){if(this._listDownloadComplete)return;var _L0=new AsyncRequest().setURI('/friends/ajax/superfriends.php').setReadOnly(true).setOption('retries',0).setMethod('GET').setData({all_lists:true}).setHandler(this._getFriendListsHandler.bind(this)).setFinallyHandler(bagofholding).send();};FriendsPage.prototype._getFriendListsHandler=function(_L0){var _L1=_L0.payload.collections;for(var i=0;i<_L1.length;i++){var _L3=_L1[i].filter;this._cache[_L3]=_L1[i];}this._listDownloadComplete=true;this._updateAllFriendListings();};FriendsPage.prototype._getNetworkFilters=function(){if(this._networkFiltersDownloadComplete||this._networkFiltersLoading)return;this._networkFiltersLoading=true;var _L0=new AsyncRequest().setURI('/friends/ajax/superfriends_filters.php').setReadOnly(true).setOption('retries',0).setMethod('GET').setHandler(this._getNetworkFiltersHandler.bind(this)).send();};FriendsPage.prototype._getNetworkFiltersHandler=function(_L0){var _L1=_L0.payload;this._networkNames=_L1.network_names;this._networkFilters=_L1.networks;this._networkTypes=_L1.network_types;for(var k in this._networkFilters)for(var nk in this._networkFilters[k])this._networkFiltersTypeMap[nk]=k;this._networkFiltersLoading=false;this._networkFiltersDownloadComplete=true;Arbiter.inform(FriendsPage.ARBITER_NETWORK_FILTERS_DONE,{});};FriendsPage.prototype._setShowNetworkFilters=function(_L0){if(!_L0){this._toolbarTop.setShowSecondaryContent(false);return;}if((this._currentView!=this._filterKeys.browse)||!this._networkFiltersDownloadComplete)return;if(!this._toolbarFilters){if(hasArrayNature(this._networkFilters)&&this._networkFilters.length==0)return;this._toolbarFilters=$N('div',{className:'FriendsPage_ToolbarFilters'});var _L1=$N('span',{className:'FriendsPage_ToolbarFiltersLabel'});_L1.setContent(_tx("Browse by:"));this._toolbarFilters.appendContent(_L1);this._primaryNetworkFilterSelect=$N('select',{className:'FriendsPage_ToolbarFiltersPrimarySelect'});this._primaryNetworkFilterSelect.listen('change',function(e){this._setNetworkFilters(get_form_select_value(this._primaryNetworkFilterSelect),false,true);}.bind(this));this._primaryNetworkFilterSelect.options[0]=new Option(_tx("Choose an option..."),'');var i=1;for(var k in this._networkTypes){this._primaryNetworkFilterSelect.options[i]=new Option(this._networkTypes[k],k);i++;}this._secondaryNetworkFilterSelect=$N('select');this._secondaryNetworkFilterSelect.addClass('hidden_elem');this._secondaryNetworkFilterSelect.listen('change',function(e){this._setNetworkFilters(get_form_select_value(this._primaryNetworkFilterSelect),get_form_select_value(this._secondaryNetworkFilterSelect),true);}.bind(this));this._toolbarFilters.appendContent(this._primaryNetworkFilterSelect);this._toolbarFilters.appendContent(this._secondaryNetworkFilterSelect);this._toolbarTop.addSecondaryContent(this._toolbarFilters);}this._toolbarTop.setShowSecondaryContent(true);};FriendsPage.prototype._setNetworkFilters=function(_L0,_L1,_L2){if(!this._toolbarFilters)return;if(!_L0){this._primaryNetworkFilterSelect.selectedIndex=0;this._secondaryNetworkFilterSelect.addClass('hidden_elem');}else{this._secondaryNetworkFilterSelect.removeClass('hidden_elem');set_form_select_value(this._primaryNetworkFilterSelect,_L0);this._secondaryNetworkFilterSelect.options.length=0;this._secondaryNetworkFilterSelect.options[0]=new Option(_tx("Choose an option..."),'');var i=1;for(var k in this._networkFilters[_L0]){this._secondaryNetworkFilterSelect.options[i]=new Option(this._networkNames[k],k);i++;}if(_L1===false){this._secondaryNetworkFilterSelect.selectedIndex=0;}else{set_form_select_value(this._secondaryNetworkFilterSelect,_L1);if(_L2){var uri=URI.getRequestURI();uri.setQueryData({filter:this._filterKeys.browse,filter_network:_L1,offset:0});uri.go();}}}};FriendsPage.prototype._getPhonebook=function(){if(this._phonebookDownloadComplete||this._phonebookLoading)return;this._phonebookLoading=true;this._setNavLoading(true);var _L0=new AsyncRequest().setURI('/friends/ajax/superfriends_phonebook.php').setReadOnly(true).setOption('retries',0).setMethod('GET').setHandler(this._getPhonebookHandler.bind(this)).send();};FriendsPage.prototype._getPhonebookHandler=function(_L0){this._phonebookLoading=false;this._phonebookDownloadComplete=true;var _L1=_L0.payload;var _L2=keys(_L1.phone);this._cache[this._filterKeys.phonebook]={members:_L2,key:this._filterKeys.phonebook,filter:this._filterKeys.phonebook};this._phonebook=_L1.phone;};FriendsPage.prototype._getRecentlyUpdated=function(){if(this._recentlyUpdatedDownloadComplete||this._recentlyUpdatedLoading)return;this._recentlyUpdatedLoading=true;this._setNavLoading(true);var _L0=new AsyncRequest().setURI('/friends/ajax/superfriends_recently_updated.php').setReadOnly(true).setOption('retries',0).setMethod('GET').setHandler(this._getRecentlyUpdatedHandler.bind(this)).send();};FriendsPage.prototype._getRecentlyUpdatedHandler=function(_L0){this._recentlyUpdatedDownloadComplete=true;this._recentlyUpdatedLoading=false;this._cache[this._filterKeys.recently_updated]={members:_L0.payload.members,key:this._filterKeys.recently_updated,filter:this._filterKeys.recently_updated};this._recentlyUpdated=_L0.payload.recently_updated;};FriendsPage.prototype._getFriendListsSorted=function(){var _L0=[];for(var k in this._cache)if(this._cache[k].editable)_L0.push(this._cache[k]);return _L0.sort(function(a,b){return (a.name==b.name)?0:(a.name<b.name?-1:1);});};FriendsPage.prototype._getListsForFriend=function(uid){var _L1={};var _L2=this._getFriendListsSorted();for(var i=0;i<_L2.length;i++)for(var ii=0;ii<_L2[i].members.length;ii++)if(_L2[i].members[ii]==uid){_L1[_L2[i].filter]=true;ii=_L2[i].members.length;}return _L1;};FriendsPage.prototype._setupSearch=function(){this._searchSource=new static_source();this._searchSource.values=this._typeaheadFriends;this._searchSource.build_index();this._searchInput.listen('keyup',function(e){this._currentView=this._filterKeys.default_view;this._nextView=this._currentView;if(!this._searchInput.value||this._searchInput.value.length==0){this._paintFriends(this._cache[this._filterKeys.default_view],false,0);return;}var _L1=this._searchSource.search_value(this._searchInput.value);var _L2=[];for(var i=0;i<_L1.length;i++)_L2.push(_L1[i].i);var _L4={members:_L2,editable:false,filter:this._filterKeys.default_view,search:true};this._paintFriends(_L4,false,0,this._searchInput.value);}.bind(this));};FriendsPage.prototype._editFriendsAsync=function(_L0,_L1,_L2,_L3){var _L4={members:_L0,list_id:_L1,action:_L2,name:_L3};new AsyncRequest().setURI('/friends/ajax/superfriends_add.php').setData(_L4).send();};FriendsPage.prototype._addFriend=function(_L0,_L1){var _L2=[];for(var i=0;i<_L0.length;i++){var _L4=this._existsInList(_L0[i],_L1);if(this._friendCache[_L0[i]]&&!_L4){this._cache[_L1].members.push(_L0[i]);this._updateFriendListing(_L0[i]);_L2.push(_L0[i]);}}if(_L2.length>0)this._editFriendsAsync(_L2,this._cache[_L1].value,'add');};FriendsPage.prototype._removeFriend=function(uid,_L1){if(this._existsInList(uid,_L1)){this._editFriendsAsync([uid],this._cache[_L1].value,'remove');var _L2=this._cache[_L1];for(var i=0;i<_L2.members.length;i++)if(_L2.members[i]==uid){_L2.members.splice(i,1);break;}if(this._displayedObjectsMap[uid]&&this._currentView==_L1){this._displayedObjectsMap[uid].getActionControl().hideMenu();DOM.remove(this._displayedObjectsMap[uid].root);for(var i=0;i<this._displayedObjects.length;i++)if(this._displayedObjects[i].root===this._displayedObjectsMap[uid].root){this._displayedObjects.splice(i,1);break;}delete this._displayedObjectsMap[uid];var _L4=URI().getQueryData();var _L5=_L4.offset?_L4.offset:0;var _L6=this._cache[_L1].members.length;this._pagerTop.resetPager(_L6,this._itemsPerPage,_L5);this._pagerBottom.resetPager(_L6,this._itemsPerPage,_L5);}else this._updateFriendListing(uid);}};FriendsPage.prototype._existsInList=function(uid,_L1){var _L2=false;var _L3=this._cache[_L1].members;for(var i=0;i<_L3.length;i++)if(_L3[i]==uid){_L2=true;break;}return _L2;};FriendsPage.prototype._pageletHandler=function(_L0){$('FriendsPage_ListingViewContainer').addClass('hidden_elem');$('FriendsPage_PageletContainer').removeClass('hidden_elem');this._setNavLoading(false);if(_L0)PageTransitions.transitionComplete();};FriendsPage.prototype._getFriends=function(_L0,_L1){var _L2=_L0.filter;this._hideStatusMessage();var _L3=this._getNavItem(_L2);if(_L3.data.is_pagelet){this._setNavLoading(true);this._pagelet=new UIPagelet('FriendsPage_PageletContainerContent');this._pagelet.setHandler(this._pageletHandler.bind(this,_L1));this._pagelet.go(_L3.data.pagelet_path);return;}if(_L2==this._filterKeys.browse)this._getNetworkFilters();if(_L2==this._filterKeys.phonebook)this._getPhonebook();if(_L2==this._filterKeys.recently_updated)this._getRecentlyUpdated();if(this._cache[_L2]&&!_L0.filter_network){this._currentView=_L2;this._currentNetworkFilter=false;this._nextView=_L2;this._setNavLoading(false);this._paintFriends(this._cache[_L2],_L1,_L0.offset);}else if(_L2==this._filterKeys.browse){if(!this._networkFiltersDownloadComplete){this._setNavLoading(true);setTimeout(this._getFriends.bind(this,_L0,_L1),100);return;}this._setNavLoading(false);this._currentView=_L2;this._nextView=_L2;if(_L0.filter_network){this._currentNetworkFilter=_L0.filter_network;var _L4=this._networkFiltersTypeMap[_L0.filter_network];_L0.members=this._networkFilters[_L4][_L0.filter_network];}else{_L0.members=[];this._setNetworkFilters(false,false);}this._paintFriends(_L0,_L1,_L0.offset);}else{this._nextView=_L2;if((!this._listDownloadComplete&&_L0.type==this._filterKeys.list)||(!this._phonebookDownloadComplete&&_L2==this._filterKeys.phonebook)||(!this._recentlyUpdatedDownloadComplete&&_L2==this._filterKeys.recently_updated)){setTimeout(this._getFriends.bind(this,_L0,_L1),100);return;}this._setNavLoading(true);var _L5=new AsyncRequest().setURI('/friends/ajax/superfriends.php').setReadOnly(true).setOption('retries',0).setMethod('GET').setData(_L0).setHandler(this._getFriendsHandler.bind(this,_L1,_L0.offset)).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding).setFinallyHandler(bagofholding).send();}};FriendsPage.prototype._getFriendsHandler=function(_L0,_L1,_L2){this._setNavLoading(false);var _L3=_L2.payload;var _L4=_L3.collections;for(var i=0;i<_L4.length;i++){var _L6=_L4[i].filter;this._cache[_L6]=_L4[i];for(var id in _L4[i].member_data)this._friendCache[id]=_L4[i].member_data[id];}if(_L3.current_view)if(this._nextView==_L3.current_view){this._currentView=_L3.current_view;this._currentNetworkFilter=false;this._paintFriends(this._cache[_L3.current_view],_L0,_L1);}else ;};FriendsPage.prototype._paintFriends=function(_L0,_L1,_L2,_L3){var max=_L3?this._searchResultsPerPage:this._itemsPerPage;_L2=parseInt(_L2);if(_L0.paginated&&!_L0.start){var _L5=max+_L2;if(_L5>_L0.count)_L5=_L0.count;if(_L5>_L0.members.length){var _L6={'start':this._offsetMap[_L2]||_L2,'limit':max};this._setNavLoading(true);new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/friends/ajax/superfriends.php').setData({'filter':_L0.filter,'value':_L6}).setHandler(function(_L1f){var _L20=_L1f.payload.collections.pop();if(_L20.last_used)this._offsetMap[_L2+max]=_L20.last_used+1;for(var id in _L20.member_data)this._friendCache[id]=_L20.member_data[id];this._paintFriends(_L20,_L1,_L2,_L3);this._setNavLoading(false);}.bind(this)).send();return;}}$('FriendsPage_PageletContainer').addClass('hidden_elem');var _L7=_L0.count;if(_L7===undefined)_L7=_L3?max:_L0.members.length;var _L8=_L3?0:_L7;var _L9=_L3?0:max;CSS.conditionClass($('FriendsPage_BottomToolbar'),'hidden_elem',_L8<=_L9);this._pagerTop.resetPager(_L8,_L9,_L2);this._pagerBottom.resetPager(_L8,_L9,_L2);if(_L0.filter_network){var _La=this._networkFiltersTypeMap[_L0.filter_network];var _Lb=_L0.filter_network;}else{var _La=false;var _Lb=false;}this._setShowNetworkFilters(_L0.filter==this._filterKeys.browse);if(_L0.filter==this._filterKeys.browse)this._setNetworkFilters(_La,_Lb,false);if(_L0.members.length==0){$('FriendsPage_ListingViewContainer').removeClass('hidden_elem');$('FriendsPage_ContentContainer').addClass('hidden_elem');$('FriendsPage_BlankStateContainer').removeClass('hidden_elem');$('FriendsPage_BlankStateContainer').setContent(this._getBlankStateContent(_L0.filter,_L3));}else{$('FriendsPage_BlankStateContainer').addClass('hidden_elem');$('FriendsPage_ContentContainer').removeClass('hidden_elem');$('FriendsPage_ListingViewContainer').removeClass('hidden_elem');var _Lc=_L0.members;var _Ld=[];for(var i=0;i<_Lc.length;i++){if(!this._friendCache[_Lc[i]])continue;var _Lf={};copy_properties(_Lf,this._friendCache[_Lc[i]]);_Ld.push(_Lf);}if(!_L3&&_L0.filter!=this._filterKeys.recently_added&&_L0.filter!=this._filterKeys.incoming_fans&&_L0.filter!=this._filterKeys.recently_updated)_Ld=_Ld.sort(function(a,b){return a.title.toString().localeCompare(b.title.toString());});if(!_L0.start)_Ld=_Ld.slice(_L2,_L2+max);var rows=[];this._displayedObjects=[];this._displayedObjectsMap={};for(var i=0;i<_Ld.length;i++){if(_L3)_Ld[i].title=HTML(typeahead_source.highlight_found(_Ld[i].title,_L3));var _L11=keys(this._getListsForFriend(_Ld[i].id));if(_Ld[i].pending){_Ld[i].subtext=_tx("Friend Request Pending");}else _Ld[i].subtext=this._getListsForFriendSubtext(_L11);var row=new UIObjectListing(_Ld[i]);if(_L3)row.setBoldTitle(false);if((_Ld[i].type==search_friend_source.TYPES.USER)||(_Ld[i].type==search_friend_source.TYPES.CONNECTION)||(_Ld[i].type==search_friend_source.TYPES.PAGE)){if(_L0.filter==this._filterKeys.phonebook){var _L13=null;var _L14=null;var _L15=$N('div',{className:'FriendsPage_PhonebookRight'});if(this._phonebook[_Ld[i].id].cell){var _L14=$N('div',{className:'FriendsPage_PhonebookCell'});var _L16=$N('span',{className:'FriendsPage_PhonebookLabel'},_tx("MOBILE"));_L14.setContent([_L16,this._phonebook[_Ld[i].id].cell]);_L15.appendContent(_L14);}if(this._phonebook[_Ld[i].id].phone){var _L13=$N('div',{className:'FriendsPage_PhonebookLand'});var _L17=$N('span',{className:'FriendsPage_PhonebookLabel'},_tx("LAND"));_L13.setContent([_L17,this._phonebook[_Ld[i].id].phone]);_L15.appendContent(_L13);}if(_L13&&_L14)_L15.addClass('FriendsPage_PhonebookBoth');row.setRightContent(_L15);}else if(_L0.filter==this._filterKeys.recently_updated){var _L18=this._recentlyUpdated[_Ld[i].id];var _L19=$N('div',{className:'FriendsPage_RecentlyUpdated'});var _L1a=$N('div',{className:'FriendsPage_RecentlyUpdatedContent'},HTML(_L18.diff));var _L1b=$N('div',{className:'FriendsPage_RecentlyUpdatedTime'},HTML(_L18.updated_time_relative));_L19.setContent([_L1a,_L1b]);row.setRightContent(_L19);}else{var menu=new UIActionMenu(this._getFriendListMenuTitle(_L11.length));menu.setAlignRight(true);menu.setContentCallback(this._getFriendListMenu.bind(this,_Ld[i].id,menu));menu.setSuppressButton(true);row.setActionControl(menu);if(_L0.search||_L0.filter==this._filterKeys.all_friends||_L0.filter==this._filterKeys.all_connections||_L0.filter==this._filterKeys.outgoing_fans||_L0.filter==this._filterKeys.recently_added){var _L1d=null;var _L1e=null;if(_Ld[i].type==search_friend_source.TYPES.PAGE||_Ld[i].type==search_friend_source.TYPES.CONNECTION||_Ld[i].type==search_friend_source.TYPES.USER){_L1d=_Ld[i].pending?_tx("Remove Request"):_tx("Remove Connection");_L1e=this._showRemoveConnectionDialog.bind(this,_Ld[i].id,_Ld[i].pending);}if(_L1e!=null)row.setRemoveControl(true,_L1e,_L1d);}}}else if(_L0.filter==this._filterKeys.incoming_fans)row.setRemoveControl(true,this._showRemoveConnectionDialog.bind(this,_Ld[i].id,false,true,_Ld[i].title),_tx("Remove Fan"));row.paint();rows.push(row.root);this._displayedObjects.push(row);this._displayedObjectsMap[_Ld[i].id]=row;}delete _Ld;this._friendContainer.setContent(rows);}this._selectNavItem(_L0.filter);this._setEditable(_L0.editable,_L0.deletable);DOMScroll.scrollTo(new Vector2(0,0,'document'),false);if(_L1)PageTransitions.transitionComplete();};FriendsPage.prototype._getListsForFriendSubtext=function(_L0){var _L1=[];for(var ii=0;ii<_L0.length;ii++)if(this._cache[_L0[ii]])_L1.push(this._cache[_L0[ii]].name);return _L1.join(', ');};FriendsPage.prototype._getFriendListMenu=function(uid,_L1){var _L2=this._getFriendListsSorted();var _L3=[];if(_L2.length>0){var _L4=new UISelectList();var _L5=this._getListsForFriend(uid);for(var i=0;i<_L2.length;i++){var _L7=_L5[_L2[i].filter]?true:false;_L4.addItem(_L2[i].name,_L7,_L2[i].filter);}_L4.setCallback(function(uid,_L1,_Lc,_Ld){if(_Lc){this._addFriend([uid],_Ld);}else this._removeFriend(uid,_Ld);_L1.hideMenu();}.bind(this,uid,_L1));_L3.push(_L4.getElement());}else{var _L8=$N('div',{className:'FriendsPage_MenuBlankState'});_L8.setContent(_tx("You have no lists."));_L3.push(_L8);}var _L9=$N('div',{className:'FriendsPage_NewList'});var _La=$N('input',{type:'text',className:'FriendsPage_NewListInput inputtext'});_L9.setContent(_La);_L3.push(_L9);new TextInputControl(_La).setPlaceholderText(_tx("Create New List"));_La.listen('focus',this._genNewListId.bind(this));_La.listen('keypress',function(_L1,_La,uid,e){if(Event.getKeyCode(e)==KEYS.RETURN){var _Ld=_La.getControl().getValue();this._menuCreateList(_L1,_Ld,uid);return false;}}.bind(this,_L1,_La,uid));var _Lb=$N('div',{className:'FriendsPage_MenuContainer'});_Lb.setContent(_L3);return _Lb;};FriendsPage.prototype._menuCreateList=function(_L0,_L1,uid){if(!this._newListId&&this._generatingNewListId){this._setNavLoading(true);setTimeout(this._menuCreateList.bind(this,_L0,_L1,uid),100);}else if(this._newListId&&!this._generatingNewListId){this._setNavLoading(false);this._createNewList(this._newListId,_L1,[uid],false,true);this._newListId=false;_L0.hideMenu();}else ;};FriendsPage.prototype._genNewListId=function(){if(!this._newListId&&!this._generatingNewListId){this._generatingNewListId=true;new AsyncRequest().setURI('/friends/ajax/superfriends_newlist.php').setHandler(function(_L0){this._newListId=_L0.payload.fbid;this._generatingNewListId=false;}.bind(this)).send();}};FriendsPage.prototype._getFriendListMenuTitle=function(_L0){if(_L0<1){return _tx("Add to List");}else if(_L0==1){return _tx("1 List");}else return _tx("{number_of_lists} Lists",{number_of_lists:_L0});};FriendsPage.prototype._updateFriendListing=function(uid){if(this._displayedObjectsMap[uid]){var row=this._displayedObjectsMap[uid];var _L2=row.getActionControl();var _L3=keys(this._getListsForFriend(uid));row.getActionControl().setTitle(this._getFriendListMenuTitle(_L3.length));row.setSubtext(this._getListsForFriendSubtext(_L3));}};FriendsPage.prototype._dirtyAllMenus=function(){if(this._displayedObjectsMap)for(var k in this._displayedObjectsMap){var _L1=this._displayedObjectsMap[k].getActionControl();_L1.setDirty(true);}};FriendsPage.prototype._updateAllFriendListings=function(){if(this._displayedObjectsMap)for(var k in this._displayedObjectsMap)this._updateFriendListing(k);};FriendsPage.prototype._setEditable=function(_L0,_L1){this._editListButton.setDisabled(!_L0);this._deleteListButton.setDisabled(!_L1);};FriendsPage.prototype._showStatusMessage=function(_L0){DOM.setContent(this._statusMessage,_L0);this._statusContainer.removeClass('hidden_elem');};FriendsPage.prototype._hideStatusMessage=function(){this._statusContainer.addClass('hidden_elem');};FriendsPage.prototype._createListButtonClick=function(){if(this._cache[this._filterKeys.default_view].members.length==0){new Dialog().setTitle(_tx("Create New List")).setBody(_tx("Lists help you organize your Facebook friends. Once you find some friends, you can come back here to create a list.")).setButtons(Dialog.CLOSE).show();return false;}this._showMFS(true);return false;};FriendsPage.prototype._getBlankStateContent=function(_L0,_L1){var div=$N('div',{className:'FriendsPage_BlankStateContainer'});var _L3=$N('div',{className:'FriendsPage_BlankStateMessage'});var _L4=$N('a',{className:'FriendsPage_BlankStateLink'});div.setContent([_L3,_L4]);if(this._cache[_L0]){var _L5=this._cache[_L0].type;if(_L5==this._filterKeys.list){_L3.setContent(_tx("You have no friends in this list."));_L4.setContent(_tx("Add friends to list..."));_L4.setAttribute('href','#');_L4.listen('click',function(_L0){this._showMFS(false,_L0);return false;}.bind(this,_L0));}else if(_L5==this._filterKeys.all_friends){_L3.setContent(_tx("You do not have any friends. Once you find some friends, they will appear here."));_L4.setContent(_tx("Find friends..."));var uri=URI.getRequestURI();uri.setQueryData({filter:this._filterKeys.find_friends});_L4.href=uri.toString();}else if(_L5==this._filterKeys.network){var _L7=this._cache[_L0].name;_L3.setContent(_tx("You have no friends in this network. When you add a friend that is in the {name_of_network} network, they will appear in this filter.",{name_of_network:_L7}));_L4.setContent(_tx("Find friends in the {name_of_network} network...",{name_of_network:_L7}));var uri=new URI('/srch.php');uri.setQueryData({n:this._cache[_L0].value});_L4.href=uri.toString();}else if(_L5==this._filterKeys.recently_added){_L3.setContent(_tx("This filter shows people that you have recently added as friends. When you add new friends, they will appear here for two weeks."));_L4.setContent(_tx("Find friends..."));var uri=URI.getRequestURI();uri.setQueryData({filter:this._filterKeys.find_friends});_L4.href=uri.toString();}else if(_L5==this._filterKeys.recently_updated){_L3.setContent(_tx("You have no friends with recently updated profiles."));_L4.setContent(_tx("Find friends..."));var uri=URI.getRequestURI();uri.setQueryData({filter:this._filterKeys.find_friends});_L4.href=uri.toString();}else if(_L5==this._filterKeys.mobile_subscriptions){_L3.setContent(_tx("You are not subscribed to anyone via SMS."));_L4.setContent(_tx("Add friends to list..."));_L4.setAttribute('href','#');_L4.listen('click',function(_L0){this._showMFS(false,_L0);return false;}.bind(this,_L0));}}else if(_L1){_L3.setContent(_tx("You have no friends whose name contains \"{search_term}\".",{search_term:_L1}));_L4.setContent(_tx("Search Facebook for \"{search_term}\"...",{search_term:_L1}));var uri=new URI('/search/');uri.setQueryData({q:_L1});_L4.href=uri.toString();}else if(this._getNavItem(_L0).data.type==this._filterKeys.browse){var _L8=this._cache[this._filterKeys.all_friends];if(_L8&&_L8.members.length==0){_L3.setContent(_tx("You do not have any friends. Once you find some friends, you can return here to browse them by different criteria."));_L4.setContent(_tx("Find friends..."));var uri=URI.getRequestURI();uri.setQueryData({filter:this._filterKeys.find_friends});_L4.href=uri.toString();}else if(this._networkFilters&&hasArrayNature(this._networkFilters)){_L3.setContent(_tx("None of your friends are in any networks."));_L4.addClass('hidden_elem');}else{_L3.setContent(_tx("Use the dropdown menu above to browse your friends by network."));_L4.addClass('hidden_elem');}}return div;};FriendsPage.prototype._getPagerSummaryText=function(_L0,_L1,_L2){if(_L1==0)return '';if(_L1<=_L2){if(_L1==1){return _tx("1 Connection");}else return _tx("{num_connections} Connections",{num_connections:_L1});}else{if(_L0+_L2<_L1){var _L3=((_L0/_L2+1)*_L2);}else var _L3=_L1;var _L4=_tx("{starting_offset}-{ending_offset} of {number_of_friends} connections",{starting_offset:(_L0+1),ending_offset:_L3,number_of_friends:_L1});return _L4;}};FriendsPage.prototype._editListButtonClick=function(){var _L0=this._cache[this._currentView].type;if(_L0==this._filterKeys.list||_L0==this._filterKeys.mobile_subscriptions){this._showMFS(false,this._currentView);}else if(_L0==this._filterKeys.news_feed){var _L1=function(){delete this._cache[this._filterKeys.news_feed];data=URI().getQueryData();if(!data.offset)data.offset=0;this._getFriends(data,false);}.bind(this);NewsFeedEditor.show(this._filterKeys.news_feed,_L1);}return false;};FriendsPage.prototype._deleteListButtonClick=function(){var _L0=Dialog.newButton('delete',_tx("Delete List"));var _L1=new Dialog().setTitle(_tx("Delete List?")).setBody(_tx("Are you sure you want to delete this list? This cannot be undone.")).setButtons([_L0,Dialog.CANCEL]);_L1.setHandler(function(_L2,_L3){var _L4=this._cache[_L2];var _L5=this._getNavItem(_L4.filter);if(_L5){this._listNav.removeItem(_L5);this._editFriendsAsync([],_L4.value,'delete');delete this._cache[_L2];URI.getRequestURI().setQueryData({filter:this._filterKeys.all_friends,offset:0}).go();}}.bind(this,this._currentView));_L1.show();return false;};FriendsPage.prototype._removeConnectionFromUI=function(id,_L1){var _L2=this._cache[_L1].members;for(var i=0;i<_L2.length;i++)if(_L2[i]==id){_L2.splice(i,1);break;}if(this._displayedObjectsMap[id]){var _L4=this._displayedObjectsMap[id].getActionControl();if(_L4)_L4.hideMenu();DOM.remove(this._displayedObjectsMap[id].root);for(var i=0;i<this._displayedObjects.length;i++)if(this._displayedObjects[i].root===this._displayedObjectsMap[id].root){this._displayedObjects.splice(i,1);break;}delete this._displayedObjectsMap[id];}delete this._friendCache[id];if(_L2.length==0)this._paintFriends(this._cache[_L1],false,0);};FriendsPage.prototype._showRemoveConnectionDialog=function(id,_L1,_L2,_L3){var _L4=Dialog.newButton('remove',_tx("Remove"));var _L5=new Dialog().setButtons([_L4,Dialog.CANCEL]);var _L6={profile:_L3||this._friendCache[id].title};if(_L2){_L5.setBody(_tx("Are you sure you want to remove {profile} from your list of fans?",_L6));_L5.setTitle(_tx("Remove {profile} from My Fans?",_L6));}else if(_L1){_L5.setBody(_tx("Are you sure you want to remove your request to connect to {profile}?",_L6));_L5.setTitle(_tx("Remove request to connect to {profile}?",_L6));}else{_L5.setBody(_tx("Are you sure you want to remove your connection to {profile}?",_L6));_L5.setTitle(_tx("Remove connection to {profile}?",_L6));}_L5.setHandler(function(id,_L7){new AsyncRequest().setURI('/friends/ajax/remove_friend.php').setData({friend:id,type:_L2?'fan':'friend'}).send();this._removeConnectionFromUI(id,this._filterKeys.default_view);}.bind(this,id));_L5.show();};FriendsPage.prototype._showMFS=function(_L0,_L1){if(!_L0){var _L2=this._cache[_L1].value;}else var _L2=null;Dialog.bootstrap(DialogBootstrapEndpoints.LIST_EDITOR,{new_list:_L0,list_id:_L2});return false;};FriendsPage.prototype._listEditorSave=function(_L0,_L1){if(_L0==Arbiter.LIST_EDITOR_LISTS_CHANGED)if(_L1.is_new_list){this._createNewList(_L1.list_info.list_id,_L1.list_info.name,_L1.list_info.members,false,false);}else{var _L2=_L1.list_info.list_id;var _L3=this._filterKeys.list+'_'+_L2;if(_L2==this._filterKeys.mobile_list_id){_L3=this._filterKeys.mobile_subscriptions;}else{var _L4=_L1.list_info.name;this._listNav.setItemTitle(this._getNavItem(_L3),_L4);this._cache[_L3].name=_L4;}this._cache[_L3].members=_L1.list_info.members;this._getFriends({filter:_L3,offset:0},false);this._selectNavItem(_L3);}};FriendsPage.prototype._createNewList=function(_L0,_L1,_L2,_L3,_L4){if(_L4)this._editFriendsAsync(_L2,_L0,'create',_L1);var _L5=this._filterKeys.list+'_'+_L0;this._cache[_L5]={members:_L2,value:_L0,type:this._filterKeys.list,editable:true,name:_L1,filter:_L5,deletable:true};var _L6={filter:_L5,type:this._filterKeys.list,value:_L0,editable:true};var _L7=URI.getRequestURI();_L7.setQueryData({filter:_L5});var _L8=this._listNav.getItems();var _L9=1;for(var i=0;i<_L8.length;i++)if(_L8[i].data.type==this._filterKeys.list){_L9=i;break;}this._listNav.addItem(_L1,_L7.toString(),_L9,'/images/friend_lists/friend_list_icon_with_hover.gif',_L6);if(_L3){_L7.go();}else{for(var i=0;i<_L2.length;i++)this._updateFriendListing(_L2[i]);this._dirtyAllMenus();}};
function mobile_activation_show_carriers(){var _L0=$('selected_country').value;var _L1=$('carrier_country').value;if(_L0)hide($(_L0+'_carrier_select'));$('selected_country').value=_L1;$('selected_carrier').value=0;show($(_L1+'_carrier_select'));}function mobile_activation_update_carrier(){var _L0=$('selected_country').value+'_carrier_select';$('selected_carrier').value=$(_L0).value;}function MobileSmsActivationController(id,_L1,_L2){copy_properties(this,{profile_id:id,parent:parent,source:_L1,misc:_L2,carrier:null,AJAX_URI:'/ajax/mobile/activation.php',redirect_uri:null});this.start();MobileSmsActivationController.instance=this;}MobileSmsActivationController.instance={};MobileSmsActivationController.getInstance=function(){return MobileSmsActivationController.instance;};copy_properties(MobileSmsActivationController.prototype,{goStep:function(_L0){if(_L0==2){this.getShortCode();return;}else if(_L0==3){this.getConfirmCode();return;}this.start();},start:function(_L0){new AsyncRequest().setURI(this.AJAX_URI).setData({'profile_id':this.profile_id,'get_carriers':1,'source':this.source,'misc':this.misc,'error':_L0}).setHandler(this.showCarriers.bind(this)).send();},showCarriers:function(_L0){var _L1=_L0.getPayload();new Dialog().setTitle(_L1['title']).setBody(_L1['html']).setHandler(this.getShortCode.bind(this)).setButtons([Dialog.NEXT,Dialog.CANCEL]).show();},getShortCode:function(){if(!this.carrier){this.carrier=parseInt($('selected_carrier').value);if(!this.carrier){this.start(true);return false;}}Dialog.getCurrent().setButtonsMessage('<img src="/images/loaders/indicator_blue_small.gif" />');new AsyncRequest().setURI(this.AJAX_URI).setData({'profile_id':this.profile_id,'get_shortcode':1,'carrier':this.carrier}).setHandler(this.showShortCode.bind(this)).send();return false;},showShortCode:function(_L0){var _L1=_L0.getPayload();new Dialog().setTitle(_L1['title']).setBody(_L1['html']).setHandler(this.getConfirmCode.bind(this)).setButtons([Dialog.NEXT,Dialog.CANCEL]).show();},getConfirmCode:function(foo,_L1){Dialog.getCurrent().setButtonsMessage('<img src="/images/loaders/indicator_blue_small.gif" />');new AsyncRequest().setURI(this.AJAX_URI).setData({'profile_id':this.profile_id,'get_code':1,'error':_L1}).setHandler(this.showConfirmCode.bind(this)).send();return false;},showConfirmCode:function(_L0){var _L1=_L0.getPayload();new Dialog().setTitle(_L1['title']).setBody(_L1['html']).setHandler(this.activate.bind(this)).setButtons([Dialog.CONFIRM,Dialog.CANCEL]).show();},activate:function(){var _L0=$('sms_code').value;var _L1=ge('profile_add');_L1=_L1?_L1.checked:null;if(!_L0){this.getConfirmCode(false,true);return false;}new AsyncRequest().setURI(this.AJAX_URI).setData({'profile_id':this.profile_id,'confirm':1,'code':_L0,'profile_add':_L1,'source':this.source,'misc':this.misc}).setHandler(this.confirmCode.bind(this)).send();},confirmCode:function(_L0){var _L1=_L0.getPayload();if(_L1['success']){if(_L1['redirect_now']){goURI(_L1['redirect']);return;}this.redirect_uri=_L1['redirect'];new Dialog().setTitle(_L1['title']).setBody(_L1['html']).setHandler(this.redirect.bind(this)).setButtons([Dialog.OK]).show();}},redirect:function(){if(this.redirect_uri=='reload'){window.location.reload();}else goURI(this.redirect_uri);}});

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