/*
HTTP Host: b.static.ak.fbcdn.net
Generated: March 22nd 2010 7:40:11 AM PDT
Machine: 10.16.139.105
Locale: nu_ll
Path: js/axtigxuwu1sgsg4g.pkg.js
*/

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

function UIPagelet(c,d,a,b){this._id=c||null;this._element=ge(c||$N('div'));this._src=d||null;this._context_data=a||{};this._data=b||{};this._handler=bagofholding;this._request=null;return this;}copy_properties(UIPagelet.prototype,{getElement:function(a){a=a||false;if(a)this._element=ge(this._id);return this._element;},setHandler:function(a){this._handler=a;return this;},go:function(b,a){if(arguments.length>=2||typeof b=='string'){this._src=b;this._data=a||{};}else if(arguments.length==1)this._data=b;this.refresh();return this;},refresh:function(b){var a=function(c){this._request=null;if(b&&this._id)this._element=ge(this._id);this._element.setContent(HTML(c.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(a).setOption('bundle',true);this._request.send();return this;},cancel:function(){if(this._request)this._request.abort();}});
function FriendsPage(e,d,j,i,f,c,b){this._cache={};this._friendCache={};this._listDownloadComplete=false;this._phonebookDownloadComplete=false;this._RecentlyUpdatedDownloadComplete=false;this._currentView=null;this._pagelet=f;this._currentNetworkFilter=false;this._filterKeys=b;this._filterKeys.default_view=b.all_connections;this._mainNav=e;this._listNav=d;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 a=this._getNavSelectedItem().data;var h=URI().getQueryData();if(h.filter_network)a.filter_network=h.filter_network;}else{var a={filter:this._filterKeys.find_friends};var h=a;}if(!h.offset)h.offset=0;a.offset=h.offset;PageTransitions.registerHandler(this._pageTransitionHandler.bind(this));var g=function(l){var m=URI.getRequestURI();var k={filter:this._currentView,offset:l};if(this._currentNetworkFilter!==false)k.filter_network=this._currentNetworkFilter;m.setQueryData(k);m.go();}.bind(this);this._pagerTop=new UIPager(0,this._itemsPerPage,a.offset,g);this._pagerBottom=new UIPager(0,this._itemsPerPage,a.offset,g);this._pagerTop.setSummaryTextHandler(this._getPagerSummaryText.bind(this));this._pagerBottom.setSummaryTextHandler(this._getPagerSummaryText.bind(this));this._toolbarTop=j;this._toolbarBottom=i;this._createListButton=new UIActionButton(_tx("\u65b0\u3057\u3044\u30ea\u30b9\u30c8\u3092\u4f5c\u6210"));this._createListButton.setOnclick(this._createListButtonClick.bind(this));this._toolbarTop.addButton(this._createListButton,'left');this._editListButton=new UIActionButton(_tx("\u30ea\u30b9\u30c8\u3092\u7de8\u96c6"));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("\u30ea\u30b9\u30c8\u3092\u524a\u9664"));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?'+c).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(k,q){this._setNavLoading(false);this._typeaheadFriends=[];var m=q.payload.entries;var r={};r[search_friend_source.TYPES.USER]=1;r[search_friend_source.TYPES.PAGE]=1;r[search_friend_source.TYPES.CONNECTION]=1;for(var n=0;n<m.length;n++){if(!r[m[n].ty])continue;this._typeaheadFriends.push(m[n]);var l={title:m[n].t,type:m[n].ty,subtitle:m[n].n,id:m[n].i,pic:m[n].it,pending:m[n].pnd};if(m[n].a){l.href='/'+escapeURI(m[n].a);}else l.href='/profile.php?id='+m[n].i;this._friendCache[l.id]=l;}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 p in this._friendCache)this._cache[this._filterKeys.default_view].members.push(this._friendCache[p].id);this._setupSearch();var o=this._getNavItem(k.filter);if(!(o.data&&o.data.is_pagelet))this._getFriends(k,false);}.bind(this,a)).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(b){if(b.getPath()=='/friends/index.php'||b.getPath()=='/friends/'||b.getPath()=='/people/'||b.getPath()=='/people/index.php'||b.getPath()=='/friends/new/'||b.getPath()=='/friends/new/index.php'){var a=b.getQueryData();if(!a.offset)a.offset=0;this._selectNavItem(a.filter);this._getFriends(a,true);return true;}return false;};FriendsPage.prototype._getNavItem=function(a){var c=this._mainNav.getItems().concat(this._listNav.getItems());for(var b=0;b<c.length;b++)if(c[b].data&&a==c[b].data.filter)return c[b];return false;};FriendsPage.prototype._selectNavItem=function(a){var b=this._getNavItem(a);if(b)if(this._mainNav.getItems().contains(b)){this._mainNav.selectItem(b);this._listNav.deselectAll();}else if(this._listNav.getItems().contains(b)){this._listNav.selectItem(b);this._mainNav.deselectAll();}};FriendsPage.prototype._getNavSelectedItem=function(){return this._mainNav.getSelectedItem()||this._listNav.getSelectedItem();};FriendsPage.prototype._setNavLoading=function(a){this._mainNav.setLoading(a);this._listNav.setLoading(a);};FriendsPage.prototype._getFriendLists=function(){if(this._listDownloadComplete)return;var a=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(d){var b=d.payload.collections;for(var c=0;c<b.length;c++){var a=b[c].filter;this._cache[a]=b[c];}this._listDownloadComplete=true;this._updateAllFriendListings();};FriendsPage.prototype._getNetworkFilters=function(){if(this._networkFiltersDownloadComplete||this._networkFiltersLoading)return;this._networkFiltersLoading=true;var a=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(d){var c=d.payload;this._networkNames=c.network_names;this._networkFilters=c.networks;this._networkTypes=c.network_types;for(var a in this._networkFilters)for(var b in this._networkFilters[a])this._networkFiltersTypeMap[b]=a;this._networkFiltersLoading=false;this._networkFiltersDownloadComplete=true;Arbiter.inform(FriendsPage.ARBITER_NETWORK_FILTERS_DONE,{});};FriendsPage.prototype._setShowNetworkFilters=function(d){if(!d){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 c=$N('span',{className:'FriendsPage_ToolbarFiltersLabel'});c.setContent(_tx("\u8868\u793a\u30ab\u30c6\u30b4\u30ea:"));this._toolbarFilters.appendContent(c);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("\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u9078\u629e"),'');var a=1;for(var b in this._networkTypes){this._primaryNetworkFilterSelect.options[a]=new Option(this._networkTypes[b],b);a++;}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(c,e,d){if(!this._toolbarFilters)return;if(!c){this._primaryNetworkFilterSelect.selectedIndex=0;this._secondaryNetworkFilterSelect.addClass('hidden_elem');}else{this._secondaryNetworkFilterSelect.removeClass('hidden_elem');set_form_select_value(this._primaryNetworkFilterSelect,c);this._secondaryNetworkFilterSelect.options.length=0;this._secondaryNetworkFilterSelect.options[0]=new Option(_tx("\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u9078\u629e"),'');var a=1;for(var b in this._networkFilters[c]){this._secondaryNetworkFilterSelect.options[a]=new Option(this._networkNames[b],b);a++;}if(e===false){this._secondaryNetworkFilterSelect.selectedIndex=0;}else{set_form_select_value(this._secondaryNetworkFilterSelect,e);if(d){var f=URI.getRequestURI();f.setQueryData({filter:this._filterKeys.browse,filter_network:e,offset:0});f.go();}}}};FriendsPage.prototype._getPhonebook=function(){if(this._phonebookDownloadComplete||this._phonebookLoading)return;this._phonebookLoading=true;this._setNavLoading(true);var a=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(c){this._phonebookLoading=false;this._phonebookDownloadComplete=true;var b=c.payload;var a=keys(b.phone);this._cache[this._filterKeys.phonebook]={members:a,key:this._filterKeys.phonebook,filter:this._filterKeys.phonebook};this._phonebook=b.phone;};FriendsPage.prototype._getRecentlyUpdated=function(){if(this._recentlyUpdatedDownloadComplete||this._recentlyUpdatedLoading)return;this._recentlyUpdatedLoading=true;this._setNavLoading(true);var a=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(a){this._recentlyUpdatedDownloadComplete=true;this._recentlyUpdatedLoading=false;this._cache[this._filterKeys.recently_updated]={members:a.payload.members,key:this._filterKeys.recently_updated,filter:this._filterKeys.recently_updated};this._recentlyUpdated=a.payload.recently_updated;};FriendsPage.prototype._getFriendListsSorted=function(){var a=[];for(var b in this._cache)if(this._cache[b].editable)a.push(this._cache[b]);return a.sort(function(c,d){return (c.name==d.name)?0:(c.name<d.name?-1:1);});};FriendsPage.prototype._getListsForFriend=function(e){var d={};var c=this._getFriendListsSorted();for(var a=0;a<c.length;a++)for(var b=0;b<c[a].members.length;b++)if(c[a].members[b]==e){d[c[a].filter]=true;b=c[a].members.length;}return d;};FriendsPage.prototype._setupSearch=function(){this._searchSource=new static_source();this._searchSource.values=this._typeaheadFriends;this._searchSource.build_index();this._searchInput.listen('keyup',function(b){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 e=this._searchSource.search_value(this._searchInput.value);var d=[];for(var c=0;c<e.length;c++)d.push(e[c].i);var a={members:d,editable:false,filter:this._filterKeys.default_view,search:true};this._paintFriends(a,false,0,this._searchInput.value);}.bind(this));};FriendsPage.prototype._editFriendsAsync=function(e,b,a,c){var d={members:e,list_id:b,action:a,name:c};new AsyncRequest().setURI('/friends/ajax/superfriends_add.php').setData(d).send();};FriendsPage.prototype._addFriend=function(e,c){var d=[];for(var b=0;b<e.length;b++){var a=this._existsInList(e[b],c);if(this._friendCache[e[b]]&&!a){this._cache[c].members.push(e[b]);this._updateFriendListing(e[b]);d.push(e[b]);}}if(d.length>0)this._editFriendsAsync(d,this._cache[c].value,'add');};FriendsPage.prototype._removeFriend=function(g,c){if(this._existsInList(g,c)){this._editFriendsAsync([g],this._cache[c].value,'remove');var b=this._cache[c];for(var a=0;a<b.members.length;a++)if(b.members[a]==g){b.members.splice(a,1);break;}if(this._displayedObjectsMap[g]&&this._currentView==c){this._displayedObjectsMap[g].getActionControl().hideMenu();DOM.remove(this._displayedObjectsMap[g].root);for(var a=0;a<this._displayedObjects.length;a++)if(this._displayedObjects[a].root===this._displayedObjectsMap[g].root){this._displayedObjects.splice(a,1);break;}delete this._displayedObjectsMap[g];var f=URI().getQueryData();var d=f.offset?f.offset:0;var e=this._cache[c].members.length;this._pagerTop.resetPager(e,this._itemsPerPage,d);this._pagerBottom.resetPager(e,this._itemsPerPage,d);}else this._updateFriendListing(g);}};FriendsPage.prototype._existsInList=function(e,d){var a=false;var c=this._cache[d].members;for(var b=0;b<c.length;b++)if(c[b]==e){a=true;break;}return a;};FriendsPage.prototype._pageletHandler=function(a){$('FriendsPage_ListingViewContainer').addClass('hidden_elem');$('FriendsPage_PageletContainer').removeClass('hidden_elem');this._setNavLoading(false);if(a)PageTransitions.transitionComplete();};FriendsPage.prototype._getFriends=function(c,f){var b=c.filter;this._hideStatusMessage();var d=this._getNavItem(b);if(d.data.is_pagelet){this._setNavLoading(true);this._pagelet=new UIPagelet('FriendsPage_PageletContainerContent');this._pagelet.setHandler(this._pageletHandler.bind(this,f));this._pagelet.go(d.data.pagelet_path);return;}if(b==this._filterKeys.browse)this._getNetworkFilters();if(b==this._filterKeys.phonebook)this._getPhonebook();if(b==this._filterKeys.recently_updated)this._getRecentlyUpdated();if(this._cache[b]&&!c.filter_network){this._currentView=b;this._currentNetworkFilter=false;this._nextView=b;this._setNavLoading(false);this._paintFriends(this._cache[b],f,c.offset);}else if(b==this._filterKeys.browse){if(!this._networkFiltersDownloadComplete){this._setNavLoading(true);setTimeout(this._getFriends.bind(this,c,f),100);return;}this._setNavLoading(false);this._currentView=b;this._nextView=b;if(c.filter_network){this._currentNetworkFilter=c.filter_network;var e=this._networkFiltersTypeMap[c.filter_network];c.members=this._networkFilters[e][c.filter_network];}else{c.members=[];this._setNetworkFilters(false,false);}this._paintFriends(c,f,c.offset);}else{this._nextView=b;if((!this._listDownloadComplete&&c.type==this._filterKeys.list)||(!this._phonebookDownloadComplete&&b==this._filterKeys.phonebook)||(!this._recentlyUpdatedDownloadComplete&&b==this._filterKeys.recently_updated)){setTimeout(this._getFriends.bind(this,c,f),100);return;}this._setNavLoading(true);var a=new AsyncRequest().setURI('/friends/ajax/superfriends.php').setReadOnly(true).setOption('retries',0).setMethod('GET').setData(c).setHandler(this._getFriendsHandler.bind(this,f,c.offset)).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding).setFinallyHandler(bagofholding).send();}};FriendsPage.prototype._getFriendsHandler=function(h,e,g){this._setNavLoading(false);var f=g.payload;var b=f.collections;for(var c=0;c<b.length;c++){var a=b[c].filter;this._cache[a]=b[c];for(var d in b[c].member_data)this._friendCache[d]=b[c].member_data[d];}if(f.current_view)if(this._nextView==f.current_view){this._currentView=f.current_view;this._currentNetworkFilter=false;this._paintFriends(this._cache[f.current_view],h,e);}};FriendsPage.prototype._paintFriends=function(n,zd,k,d){var h=d?this._searchResultsPerPage:this._itemsPerPage;k=parseInt(k);if(n.paginated&&!n.start){var f=h+k;if(f>n.count)f=n.count;if(f>n.members.length){var ze={start:this._offsetMap[k]||k,limit:h};this._setNavLoading(true);new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/friends/ajax/superfriends.php').setData({filter:n.filter,value:ze}).setHandler(function(zh){var zf=zh.payload.collections.pop();if(zf.last_used)this._offsetMap[k+h]=zf.last_used+1;for(var zg in zf.member_data)this._friendCache[zg]=zf.member_data[zg];this._paintFriends(zf,zd,k,d);this._setNavLoading(false);}.bind(this)).send();return;}}$('FriendsPage_PageletContainer').addClass('hidden_elem');var zc=n.count;if(zc===undefined)zc=d?h:n.members.length;var m=d?0:zc;var l=d?0:h;CSS.conditionClass($('FriendsPage_BottomToolbar'),'hidden_elem',m<=l);this._pagerTop.resetPager(m,l,k);this._pagerBottom.resetPager(m,l,k);if(n.filter_network){var s=this._networkFiltersTypeMap[n.filter_network];var y=n.filter_network;}else{var s=false;var y=false;}this._setShowNetworkFilters(n.filter==this._filterKeys.browse);if(n.filter==this._filterKeys.browse)this._setNetworkFilters(s,y,false);if(n.members.length==0){$('FriendsPage_ListingViewContainer').removeClass('hidden_elem');$('FriendsPage_ContentContainer').addClass('hidden_elem');$('FriendsPage_BlankStateContainer').removeClass('hidden_elem');$('FriendsPage_BlankStateContainer').setContent(this._getBlankStateContent(n.filter,d));}else{$('FriendsPage_BlankStateContainer').addClass('hidden_elem');$('FriendsPage_ContentContainer').removeClass('hidden_elem');$('FriendsPage_ListingViewContainer').removeClass('hidden_elem');var o=n.members;var za=[];for(var e=0;e<o.length;e++){if(!this._friendCache[o[e]])continue;var j={};copy_properties(j,this._friendCache[o[e]]);za.push(j);}if(!d&&n.filter!=this._filterKeys.recently_added&&n.filter!=this._filterKeys.incoming_fans&&n.filter!=this._filterKeys.recently_updated)za=za.sort(function(zf,zg){return zf.title.toString().localeCompare(zg.title.toString());});if(!n.start)za=za.slice(k,k+h);var x=[];this._displayedObjects=[];this._displayedObjectsMap={};for(var e=0;e<za.length;e++){if(d)za[e].title=HTML(typeahead_source.highlight_found(za[e].title,d));var g=keys(this._getListsForFriend(za[e].id));if(za[e].pending){za[e].subtext=_tx("\u53cb\u9054\u30ea\u30af\u30a8\u30b9\u30c8\u627f\u8a8d\u5f85\u3061");}else za[e].subtext=this._getListsForFriendSubtext(g);var w=new UIObjectListing(za[e]);if(d)w.setBoldTitle(false);if((za[e].type==search_friend_source.TYPES.USER)||(za[e].type==search_friend_source.TYPES.CONNECTION)||(za[e].type==search_friend_source.TYPES.PAGE)){if(n.filter==this._filterKeys.phonebook){var p=null;var a=null;var r=$N('div',{className:'FriendsPage_PhonebookRight'});if(this._phonebook[za[e].id].cell){var a=$N('div',{className:'FriendsPage_PhonebookCell'});var b=$N('span',{className:'FriendsPage_PhonebookLabel'},_tx("\u643a\u5e2f"));a.setContent([b,this._phonebook[za[e].id].cell]);r.appendContent(a);}if(this._phonebook[za[e].id].phone){var p=$N('div',{className:'FriendsPage_PhonebookLand'});var q=$N('span',{className:'FriendsPage_PhonebookLabel'},_tx("\u96fb\u8a71"));p.setContent([q,this._phonebook[za[e].id].phone]);r.appendContent(p);}if(p&&a)r.addClass('FriendsPage_PhonebookBoth');w.setRightContent(r);}else if(n.filter==this._filterKeys.recently_updated){var u=this._recentlyUpdated[za[e].id];var t=$N('div',{className:'FriendsPage_RecentlyUpdated'});var c=$N('div',{className:'FriendsPage_RecentlyUpdatedContent'},HTML(u.diff));var z=$N('div',{className:'FriendsPage_RecentlyUpdatedTime'},HTML(u.updated_time_relative));t.setContent([c,z]);w.setRightContent(t);}else{var i=new UIActionMenu(this._getFriendListMenuTitle(g.length));i.setAlignRight(true);i.setContentCallback(this._getFriendListMenu.bind(this,za[e].id,i));i.setSuppressButton(true);w.setActionControl(i);if(n.search||n.filter==this._filterKeys.all_friends||n.filter==this._filterKeys.all_connections||n.filter==this._filterKeys.outgoing_fans||n.filter==this._filterKeys.recently_added){var zb=null;var v=null;if(za[e].type==search_friend_source.TYPES.PAGE||za[e].type==search_friend_source.TYPES.CONNECTION||za[e].type==search_friend_source.TYPES.USER){zb=za[e].pending?_tx("\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u524a\u9664"):_tx("\u3064\u306a\u304c\u308a\u3092\u524a\u9664");v=this._showRemoveConnectionDialog.bind(this,za[e].id,za[e].pending);}if(v!=null)w.setRemoveControl(true,v,zb);}}}else if(n.filter==this._filterKeys.incoming_fans)w.setRemoveControl(true,this._showRemoveConnectionDialog.bind(this,za[e].id,false,true,za[e].title),_tx("\u30d5\u30a1\u30f3\u3092\u3084\u3081\u308b"));w.paint();x.push(w.root);this._displayedObjects.push(w);this._displayedObjectsMap[za[e].id]=w;}delete za;this._friendContainer.setContent(x);}this._selectNavItem(n.filter);this._setEditable(n.editable,n.deletable);DOMScroll.scrollTo(new Vector2(0,0,'document'),false);if(zd)PageTransitions.transitionComplete();};FriendsPage.prototype._getListsForFriendSubtext=function(c){var b=[];for(var a=0;a<c.length;a++)if(this._cache[c[a]])b.push(this._cache[c[a]].name);return b.join(', ');};FriendsPage.prototype._getFriendListMenu=function(l,h){var g=this._getFriendListsSorted();var i=[];if(g.length>0){var f=new UISelectList();var k=this._getListsForFriend(l);for(var c=0;c<g.length;c++){var j=k[g[c].filter]?true:false;f.addItem(g[c].name,j,g[c].filter);}f.setCallback(function(p,o,m,n){if(m){this._addFriend([p],n);}else this._removeFriend(p,n);o.hideMenu();}.bind(this,l,h));i.push(f.getElement());}else{var a=$N('div',{className:'FriendsPage_MenuBlankState'});a.setContent(_tx("\u30ea\u30b9\u30c8\u304c\u3042\u308a\u307e\u305b\u3093\u3002"));i.push(a);}var e=$N('div',{className:'FriendsPage_NewList'});var d=$N('input',{type:'text',className:'FriendsPage_NewListInput inputtext'});e.setContent(d);i.push(e);new TextInputControl(d).setPlaceholderText(_tx("\u65b0\u3057\u3044\u30ea\u30b9\u30c8\u3092\u4f5c\u6210"));d.listen('focus',this._genNewListId.bind(this));d.listen('keypress',function(o,n,q,m){if(Event.getKeyCode(m)==KEYS.RETURN){var p=n.getControl().getValue();this._menuCreateList(o,p,q);return false;}}.bind(this,h,d,l));var b=$N('div',{className:'FriendsPage_MenuContainer'});b.setContent(i);return b;};FriendsPage.prototype._menuCreateList=function(b,a,c){if(!this._newListId&&this._generatingNewListId){this._setNavLoading(true);setTimeout(this._menuCreateList.bind(this,b,a,c),100);}else if(this._newListId&&!this._generatingNewListId){this._setNavLoading(false);this._createNewList(this._newListId,a,[c],false,true);this._newListId=false;b.hideMenu();}};FriendsPage.prototype._genNewListId=function(){if(!this._newListId&&!this._generatingNewListId){this._generatingNewListId=true;new AsyncRequest().setURI('/friends/ajax/superfriends_newlist.php').setHandler(function(a){this._newListId=a.payload.fbid;this._generatingNewListId=false;}.bind(this)).send();}};FriendsPage.prototype._getFriendListMenuTitle=function(a){if(a<1){return _tx("\u30ea\u30b9\u30c8\u306b\u8ffd\u52a0");}else if(a==1){return _tx("\u30ea\u30b9\u30c81\u4ef6");}else return _tx("\u30ea\u30b9\u30c8{number_of_lists}\u4ef6",{number_of_lists:a});};FriendsPage.prototype._updateFriendListing=function(d){if(this._displayedObjectsMap[d]){var c=this._displayedObjectsMap[d];var b=c.getActionControl();var a=keys(this._getListsForFriend(d));c.getActionControl().setTitle(this._getFriendListMenuTitle(a.length));c.setSubtext(this._getListsForFriendSubtext(a));}};FriendsPage.prototype._dirtyAllMenus=function(){if(this._displayedObjectsMap)for(var a in this._displayedObjectsMap){var b=this._displayedObjectsMap[a].getActionControl();b.setDirty(true);}};FriendsPage.prototype._updateAllFriendListings=function(){if(this._displayedObjectsMap)for(var a in this._displayedObjectsMap)this._updateFriendListing(a);};FriendsPage.prototype._setEditable=function(b,a){this._editListButton.setDisabled(!b);this._deleteListButton.setDisabled(!a);};FriendsPage.prototype._showStatusMessage=function(a){DOM.setContent(this._statusMessage,a);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("\u65b0\u3057\u3044\u30ea\u30b9\u30c8\u3092\u4f5c\u6210")).setBody(_tx("\u53cb\u9054\u30ea\u30b9\u30c8\u3092\u4f5c\u6210\u3059\u308c\u3070\u3001Facebook\u306e\u53cb\u9054\u3092\u30ab\u30c6\u30b4\u30ea\u5225\u306b\u898b\u3084\u3059\u304f\u6574\u7406\u3067\u304d\u307e\u3059\u3002\u53cb\u9054\u3092\u8ffd\u52a0\u3057\u305f\u3089\u3001\u3053\u306e\u30da\u30fc\u30b8\u3067\u53cb\u9054\u30ea\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\u3002")).setButtons(Dialog.CLOSE).show();return false;}this._showMFS(true);return false;};FriendsPage.prototype._getBlankStateContent=function(b,g){var c=$N('div',{className:'FriendsPage_BlankStateContainer'});var e=$N('div',{className:'FriendsPage_BlankStateMessage'});var d=$N('a',{className:'FriendsPage_BlankStateLink'});c.setContent([e,d]);if(this._cache[b]){var h=this._cache[b].type;if(h==this._filterKeys.list){e.setContent(_tx("\u3053\u306e\u30ea\u30b9\u30c8\u306b\u306f\u53cb\u9054\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093\u3002"));d.setContent(_tx("\u53cb\u9054\u3092\u30ea\u30b9\u30c8\u306b\u8ffd\u52a0"));d.setAttribute('href','#');d.listen('click',function(j){this._showMFS(false,j);return false;}.bind(this,b));}else if(h==this._filterKeys.all_friends){e.setContent(_tx("\u3042\u306a\u305f\u306b\u306f\u307e\u3060\u53cb\u9054\u304c\u3044\u307e\u305b\u3093\u3002\u53cb\u9054\u304c\u3067\u304d\u308b\u3068\u3001\u3053\u3053\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002"));d.setContent(_tx("\u53cb\u9054\u3092\u691c\u7d22"));var i=URI.getRequestURI();i.setQueryData({filter:this._filterKeys.find_friends});d.href=i.toString();}else if(h==this._filterKeys.network){var f=this._cache[b].name;e.setContent(_tx("\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u306f\u53cb\u9054\u304c\u3044\u307e\u305b\u3093\u3002{name_of_network}\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u53c2\u52a0\u3057\u3066\u3044\u308b\u53cb\u9054\u3092\u8ffd\u52a0\u3059\u308b\u3068\u3001\u3053\u306e\u30d5\u30a3\u30eb\u30bf\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002",{name_of_network:f}));d.setContent(_tx("{name_of_network}\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u53cb\u9054\u3092\u691c\u7d22\u3059\u308b",{name_of_network:f}));var i=new URI('/srch.php');i.setQueryData({n:this._cache[b].value});d.href=i.toString();}else if(h==this._filterKeys.recently_added){e.setContent(_tx("\u3053\u306e\u30d5\u30a3\u30eb\u30bf\u3067\u306f\u3001\u6700\u8fd1\u8ffd\u52a0\u3057\u305f\u53cb\u9054\u3092\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u65b0\u3057\u3044\u53cb\u9054\u3092\u8ffd\u52a0\u3059\u308b\u3068\u3001\u3053\u3053\u306b2\u9031\u9593\u8868\u793a\u3055\u308c\u307e\u3059\u3002"));d.setContent(_tx("\u53cb\u9054\u3092\u691c\u7d22"));var i=URI.getRequestURI();i.setQueryData({filter:this._filterKeys.find_friends});d.href=i.toString();}else if(h==this._filterKeys.recently_updated){e.setContent(_tx("\u3042\u306a\u305f\u306f\u6700\u8fd1\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u304c\u66f4\u65b0\u3055\u308c\u305f\u53cb\u9054\u304c\u3044\u307e\u305b\u3093\u3002"));d.setContent(_tx("\u53cb\u9054\u3092\u691c\u7d22"));var i=URI.getRequestURI();i.setQueryData({filter:this._filterKeys.find_friends});d.href=i.toString();}else if(h==this._filterKeys.mobile_subscriptions){e.setContent(_tx("You are not subscribed to anyone via SMS."));d.setContent(_tx("\u53cb\u9054\u3092\u30ea\u30b9\u30c8\u306b\u8ffd\u52a0"));d.setAttribute('href','#');d.listen('click',function(j){this._showMFS(false,j);return false;}.bind(this,b));}}else if(g){e.setContent(_tx("\u540d\u524d\u306b\u300c{search_term}\u300d\u3092\u542b\u3080\u53cb\u9054\u306f\u3044\u307e\u305b\u3093\u3002",{search_term:g}));d.setContent(_tx("Facebook\u3067\u300c{search_term}\u300d\u3092\u691c\u7d22\u3059\u308b\uff0e\uff0e\uff0e",{search_term:g}));var i=new URI('/search/');i.setQueryData({q:g});d.href=i.toString();}else if(this._getNavItem(b).data.type==this._filterKeys.browse){var a=this._cache[this._filterKeys.all_friends];if(a&&a.members.length==0){e.setContent(_tx("\u3042\u306a\u305f\u306b\u306f\u307e\u3060\u53cb\u9054\u304c\u3044\u307e\u305b\u3093\u3002\u53cb\u9054\u304c\u4f55\u4eba\u304b\u3067\u304d\u305f\u3089\u3001\u6761\u4ef6\u3054\u3068\u306b\u7d5e\u308a\u8fbc\u3093\u3067\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002"));d.setContent(_tx("\u53cb\u9054\u3092\u691c\u7d22"));var i=URI.getRequestURI();i.setQueryData({filter:this._filterKeys.find_friends});d.href=i.toString();}else if(this._networkFilters&&hasArrayNature(this._networkFilters)){e.setContent(_tx("\u3069\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u3082\u53cb\u9054\u304c\u3044\u307e\u305b\u3093\u3002"));d.addClass('hidden_elem');}else{e.setContent(_tx("\u3053\u306e\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u30e1\u30cb\u30e5\u30fc\u3092\u4f7f\u3063\u3066\u3001\u53cb\u9054\u3092\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5225\u306b\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002"));d.addClass('hidden_elem');}}return c;};FriendsPage.prototype._getPagerSummaryText=function(a,e,b){if(e==0)return '';if(e<=b){if(e==1){return _tx("\u3064\u306a\u304c\u308a1\u4ef6");}else return _tx("\u3064\u306a\u304c\u308a{num_connections}\u4ef6",{num_connections:e});}else{if(a+b<e){var c=((a/b+1)*b);}else var c=e;var d=_tx("\u3064\u306a\u304c\u308a{number_of_friends}\u4ef6\u306e\u3046\u3061{starting_offset}\u301c{ending_offset}\u4ef6",{starting_offset:(a+1),ending_offset:c,number_of_friends:e});return d;}};FriendsPage.prototype._editListButtonClick=function(){var a=this._cache[this._currentView].type;if(a==this._filterKeys.list||a==this._filterKeys.mobile_subscriptions){this._showMFS(false,this._currentView);}else if(a==this._filterKeys.news_feed){var b=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,b);}return false;};FriendsPage.prototype._deleteListButtonClick=function(){var a=Dialog.newButton('delete',_tx("\u30ea\u30b9\u30c8\u3092\u524a\u9664"));var b=new Dialog().setTitle(_tx("\u30ea\u30b9\u30c8\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f")).setBody(_tx("\u3053\u306e\u30ea\u30b9\u30c8\u3092\u524a\u9664\u3057\u3066\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f\u4e00\u5ea6\u524a\u9664\u3059\u308b\u3068\u5143\u306b\u623b\u3059\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002")).setButtons([a,Dialog.CANCEL]);b.setHandler(function(e,c){var d=this._cache[e];var f=this._getNavItem(d.filter);if(f){this._listNav.removeItem(f);this._editFriendsAsync([],d.value,'delete');delete this._cache[e];URI.getRequestURI().setQueryData({filter:this._filterKeys.all_friends,offset:0}).go();}}.bind(this,this._currentView));b.show();return false;};FriendsPage.prototype._removeConnectionFromUI=function(c,e){var d=this._cache[e].members;for(var b=0;b<d.length;b++)if(d[b]==c){d.splice(b,1);break;}if(this._displayedObjectsMap[c]){var a=this._displayedObjectsMap[c].getActionControl();if(a)a.hideMenu();DOM.remove(this._displayedObjectsMap[c].root);for(var b=0;b<this._displayedObjects.length;b++)if(this._displayedObjects[b].root===this._displayedObjectsMap[c].root){this._displayedObjects.splice(b,1);break;}delete this._displayedObjectsMap[c];}delete this._friendCache[c];if(d.length==0)this._paintFriends(this._cache[e],false,0);};FriendsPage.prototype._showRemoveConnectionDialog=function(c,f,d,e){var a=Dialog.newButton('remove',_tx("\u524a\u9664"));var b=new Dialog().setButtons([a,Dialog.CANCEL]);var g={profile:e||this._friendCache[c].title};if(d){b.setBody(_tx("\u30d5\u30a1\u30f3\u306e\u30ea\u30b9\u30c8\u304b\u3089\u300c{profile}\u300d\u3092\u524a\u9664\u3057\u3066\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",g));b.setTitle(_tx("\u79c1\u306e\u30d5\u30a1\u30f3\u304b\u3089\u300c{profile}\u300d\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f",g));}else if(f){b.setBody(_tx("{profile}\u3055\u3093\u3078\u306e\u3064\u306a\u304c\u308a\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u524a\u9664\u3057\u3066\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",g));b.setTitle(_tx("{profile}\u3055\u3093\u3068\u3064\u306a\u304c\u308a\u306b\u306a\u308b\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f",g));}else{b.setBody(_tx("{profile}\u3068\u306e\u3064\u306a\u304c\u308a\u3092\u524a\u9664\u3057\u3066\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",g));b.setTitle(_tx("{profile}\u3055\u3093\u3068\u306e\u3064\u306a\u304c\u308a\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f",g));}b.setHandler(function(i,h){new AsyncRequest().setURI('/friends/ajax/remove_friend.php').setData({friend:i,type:d?'fan':'friend'}).send();this._removeConnectionFromUI(i,this._filterKeys.default_view);}.bind(this,c));b.show();};FriendsPage.prototype._showMFS=function(c,a){if(!c){var b=this._cache[a].value;}else var b=null;Dialog.bootstrap(DialogBootstrapEndpoints.LIST_EDITOR,{new_list:c,list_id:b});return false;};FriendsPage.prototype._listEditorSave=function(e,b){if(e==Arbiter.LIST_EDITOR_LISTS_CHANGED)if(b.is_new_list){this._createNewList(b.list_info.list_id,b.list_info.name,b.list_info.members,false,false);}else{var c=b.list_info.list_id;var a=this._filterKeys.list+'_'+c;if(c==this._filterKeys.mobile_list_id){a=this._filterKeys.mobile_subscriptions;}else{var d=b.list_info.name;this._listNav.setItemTitle(this._getNavItem(a),d);this._cache[a].name=d;}this._cache[a].members=b.list_info.members;this._getFriends({filter:a,offset:0},false);this._selectNavItem(a);}};FriendsPage.prototype._createNewList=function(g,h,i,k,a){if(a)this._editFriendsAsync(i,g,'create',h);var b=this._filterKeys.list+'_'+g;this._cache[b]={members:i,value:g,type:this._filterKeys.list,editable:true,name:h,filter:b,deletable:true};var c={filter:b,type:this._filterKeys.list,value:g,editable:true};var d=URI.getRequestURI();d.setQueryData({filter:b});var f=this._listNav.getItems();var j=1;for(var e=0;e<f.length;e++)if(f[e].data.type==this._filterKeys.list){j=e;break;}this._listNav.addItem(h,d.toString(),j,'/images/friend_lists/friend_list_icon_with_hover.gif',c);if(k){d.go();}else{for(var e=0;e<i.length;e++)this._updateFriendListing(i[e]);this._dirtyAllMenus();}};
function mobile_activation_show_carriers(){var b=$('selected_country').value;var a=$('carrier_country').value;if(b)hide($(b+'_carrier_select'));$('selected_country').value=a;$('selected_carrier').value=0;show($(a+'_carrier_select'));}function mobile_activation_update_carrier(){var a=$('selected_country').value+'_carrier_select';$('selected_carrier').value=$(a).value;}function MobileSmsActivationController(a,c,b){copy_properties(this,{profile_id:a,parent:parent,source:c,misc:b,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(a){if(a==2){this.getShortCode();return;}else if(a==3){this.getConfirmCode();return;}this.start();},start:function(a){new AsyncRequest().setURI(this.AJAX_URI).setData({profile_id:this.profile_id,get_carriers:1,source:this.source,misc:this.misc,error:a}).setHandler(this.showCarriers.bind(this)).send();},showCarriers:function(a){var b=a.getPayload();new Dialog().setTitle(b.title).setBody(b.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(a){var b=a.getPayload();new Dialog().setTitle(b.title).setBody(b.html).setHandler(this.getConfirmCode.bind(this)).setButtons([Dialog.NEXT,Dialog.CANCEL]).show();},getConfirmCode:function(b,a){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:a}).setHandler(this.showConfirmCode.bind(this)).send();return false;},showConfirmCode:function(a){var b=a.getPayload();new Dialog().setTitle(b.title).setBody(b.html).setHandler(this.activate.bind(this)).setButtons([Dialog.CONFIRM,Dialog.CANCEL]).show();},activate:function(){var a=$('sms_code').value;var b=ge('profile_add');b=b?b.checked:null;if(!a){this.getConfirmCode(false,true);return false;}new AsyncRequest().setURI(this.AJAX_URI).setData({profile_id:this.profile_id,confirm:1,code:a,profile_add:b,source:this.source,misc:this.misc}).setHandler(this.confirmCode.bind(this)).send();},confirmCode:function(a){var b=a.getPayload();if(b.success){if(b.redirect_now){goURI(b.redirect);return;}this.redirect_uri=b.redirect;new Dialog().setTitle(b.title).setBody(b.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"]); }