/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  December 17th 2009 4:01:39 PM PST                            */
/*      Machine:  10.16.139.103                                                */
/*       Source:  Global Cache                                                 */
/*     Location:  js/2k3ukxxcsveo0ko8.pkg.js h:9wh4y90n                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/2k3ukxxcsveo0ko8.pkg.js                                   */

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

function UINav(a,c,b){this.controller=a;this.data=b;copy_properties(this,{controller:a,data:b,items:[],selectedItem:null,selectedClass:this.selectedClass||''});this.initializeItems(c);UINav.instances[a.id]=this;}UINav.instances={};UINav.prototype.getItemContainers=abstractMethod;UINav.prototype.getItemLinks=abstractMethod;UINav.prototype.getItems=function(){return this.items;};UINav.prototype.initializeItems=function(d){var a=this.getItemContainers();for(var b=0;b<a.length;b++){var e=(a[b].scry('a')||[])[0];if(!e)break;var c={};if(this.is_wrapped){c=(d[b]||{});}else c={container:a[b],link:e,data:(d[b]||{})};this.items.push(c);if(CSS.hasClass(c.container,this.selectedClass))this.selectedItem=c;c.addClickHandler=this.addClickHandler.bind(this,c);c.addClickHandler(this.selectItem.bind(this,c));}};UINav.prototype.selectItem=function(a){if(a==this.selectedItem)return true;if(this.selectedItem)CSS.removeClass(this.selectedItem.container,this.selectedClass);if(a)CSS.addClass(a.container,this.selectedClass);this.selectedItem=a;return true;};UINav.prototype.deselectAll=function(){if(this.selectedItem)CSS.removeClass(this.selectedItem.container,this.selectedClass);this.selectedItem=null;};UINav.prototype.getSelectedItem=function(){return this.selectedItem;};UINav.prototype.addClickHandler=function(b,a){if(typeof b=='function'){a=b;this.getItems().each(function(c,d){this.addClickHandler(d,c);}.bind(this,a));return true;}else return Event.listen(b.link,'click',a);};function UINavGeneric(a,c,b){if(!this.selectedClass)this.selectedClass='UINavGeneric_ItemSelected';this.parent.construct(this,a,c,b);}UINavGeneric.extend('UINav');UINavGeneric.prototype.getItemContainers=function(){if(!this.containers)this.containers=DOM.scry(this.controller,'li');return this.containers;};UINavGeneric.prototype.getItemLinks=function(){if(!this.containerLinks)this.containerLinks=DOM.scry(this.controller,'li a');return this.containerLinks;};function UITabStructure(a,c,b){if(!this.selectedClass)this.selectedClass='UITabStructure_TabSelected';this.parent.construct(this,a,c,b);}UITabStructure.extend('UINavGeneric');UITabStructure.prototype.getItemContainers=function(){if(!this.tab_containers){this.tab_containers=[];var b=DOM.scry(this.controller,'li');for(var a=0;a<b.length;a++)this.tab_containers.push(b[a].childNodes[0]);}return this.tab_containers;};function UISourceList(a,c,b){if(!this.selectedClass)this.selectedClass='UISourceList_ItemSelected';this.parent.construct(this,a,c,b);}UISourceList.extend('UINavGeneric');
function UIFilterList(a,c,b){this.selectedClass='selected';this._itemsContainer=DOM.scry(a,'div.UIFilterList_List')[0];this.parent.construct(this,a,c,b);}UIFilterList.extend('UINav');UIFilterList.prototype.getItemContainers=function(){if(!this.containers)this.containers=DOM.scry(this.controller,'div.UIFilterList_Item');return this.containers;};UIFilterList.prototype.getItemLinks=function(){if(!this.containerLinks)this.containerLinks=DOM.scry(this.controller,'div.UIFilterList_Item a');return this.containerLinks;};UIFilterList.prototype.resetItemContainers=function(){this.containers=null;};UIFilterList.prototype.resetItemLinks=function(){this.containerLinks=null;};UIFilterList.prototype.setEditIconHandler=function(a){this._editIconHandler=a;return this;};UIFilterList.prototype.setLoading=function(a){CSS.conditionClass(this.controller,'UIFilterList_Loading',a);};UIFilterList.prototype.setCreateLinkHandler=function(b){var a=DOM.find(this.controller,'a.UIFilterList_Create');a.listen('click',b);};UIFilterList.prototype.addItem=function(l,b,k,c,a){if(!k)k=0;var g=this.getItems();a=a?a:{};var j=$N('div',{className:'UIFilterList_Item'});var h=$N('a',{className:'UIFilterList_ItemLink',href:b});if(c){var d=$N('span',{className:'UIImageBlock_Image UIFilterList_Icon'});d.setStyle('backgroundImage','url('+c+')');var e=$N('div',{className:'UIImageBlock clearfix'});e.appendContent(d);e.appendContent($N('div',{className:'UIImageBlock_Content UIFilterList_Title'},l));h.appendContent(e);}else h.appendContent($N('div',{className:'UIImageBlock_Content UIFilterList_Title '+'UIFilterList_TitleWithoutIcon'},l));var i=$N('span',{className:'UIFilterList_LoadingIndicator'});j.setContent([h,i]);var f={container:j,link:h,data:a};if(g.length>0){if(this.getItems()[k]){DOM.insertBefore(j,g[k].container);}else{k=k-1;DOM.insertAfter(g[k].container,j);}}else{this._itemsContainer.appendContent(j);CSS.removeClass(this.controller,'UIFilterList_HasBlankState');}this.getItems().splice(k,0,f);this.getItemContainers().splice(k,0,f.container);this.getItemLinks().splice(k,0,f.link);return f;};UIFilterList.prototype.setItemTitle=function(a,b){var c=DOM.find(a.link,'div.UIFilterList_Title');c.setContent(b);};UIFilterList.prototype.removeItem=function(b){var d=this.getItems();var c=null;for(var a=0;a<d.length;a++)if(d[a]==b){c=a;break;}if(c!=null){if(this.selectedItem==b)this.selectItem(null);this.getItemContainers().splice(c,1);this.getItemLinks().splice(c,1);this.getItems().splice(c,1);DOM.remove(b.container);}if(d.length==0)CSS.addClass(this.controller,'UIFilterList_HasBlankState');};
function UIStaticHomeFilter(f,a,d,e,c,g){this.parent.construct(this,f,d,c);copy_properties(this,{root:f,stream:g,assoc_id:a,num_visible:e});if(this.stream){UIStaticHomeFilter.activate(this,this.stream.getID());var b=function(){UIStaticHomeFilter.active[this.stream.getID()].each(function(i){if(this!==i)i.deselectAll();}.bind(this));}.bind(this);this.addClickHandler(b);this.stream.setHomeFilter(this);}var h=UIStaticHomeFilter.handlePageTransition.bind(this);PageTransitions.registerHandler(h);this.editModeLink=f.find('a.UIFilterList_EditLink');this.editModeLink.listen('click',this.enableEdit.bind(this));if(CSS.hasClass(this.root,'UIFilterList_ShowHiddenSection'))this.enableEdit();Arbiter.subscribe(Arbiter.LIST_EDITOR_LISTS_CHANGED,this._listsChanged.bind(this),Arbiter.SUBSCRIBE_NEW);}UIStaticHomeFilter.extend('UIFilterList');UIStaticHomeFilter.prototype={loadFilterByKey:function(a){if(a==UIIntentionalStream.FEED_FILTER_KEY_NEW_HIGHLIGHTS||a==UIIntentionalStream.FEED_FILTER_KEY_NEWS_FEED)a=UIIntentionalStream.FEED_FILTER_KEY_DUAL_NEWS_FEED;for(var b=0,d=this.items.length;b<d;b++){var c=this.items[b];if(c.data.filter==a)return this.selectItem(c);}return false;},_listsChanged:function(b,a){if(b==Arbiter.LIST_EDITOR_LISTS_CHANGED)if(a.is_new_list){var a={new_key:'fl'+'_'+a.list_info.list_id,id:this.assoc_id};new AsyncRequest().setURI('/ajax/filterlist.php').setData(a).setHandler(function(c){goURI(URI('/home.php').addQueryData({filter:c}),true);}.bind(null,a.new_key)).send();}else goURI(URI('/home.php'),true);}};UIStaticHomeFilter.handlePageTransition=function(c){var a=c.getQueryData();if(!this.stream||a.disable_nile||a.ref||(c.getPath()!='/'&&c.getPath()!='/home.php'))return false;this.loadFilterByKey(a.filter);var b={filter:a.filter};this.stream.refresh(UIIntentionalStream.REFRESH_TRANSITION,a,b);return true;};UIStaticHomeFilter.activate=function(a,b){if(!UIStaticHomeFilter.active[b])UIStaticHomeFilter.active[b]=[];UIStaticHomeFilter.active[b].push(a);};UIStaticHomeFilter.active={};UIStaticHomeFilter.prototype.enableEdit=function(){if(this.homeFilter){this.homeFilter.beginEditMode();}else Bootloader.loadComponents('UIHomeFilter',this.loadedResources.bind(this));};UIStaticHomeFilter.prototype.loadedResources=function(){this.homeFilter=new UIHomeFilter(this.controller,this.assoc_id,this.items,this.num_visible,this.data,true);this.homeFilter.beginEditMode();};
var MegaphoneHelper={hideStory:function(f,e,d,a){var b={mp_id:f,location:e,context:a};new AsyncRequest().setURI('/ajax/megaphone/megaphone_hide.php').setMethod('POST').setData(b).setHandler(function(h){if(h.isReplay()){var g=ge(d);g&&hide(g);}}).send();var c=ge(d);if(c)animation(c).to('height',0).duration(500).hide().go();},createModalStory:function(g,a,b,f,e,c){var d;if(!b||!b.length){b=Dialog.CLOSE;d=this.hideStory.bind(this,f,e,c);}else d=bagofholding;new Dialog().setImmediateRendering(true).setTitle(g).setBody(a).setModal(true,Dialog.MODALITY.WHITE).setStackable(true,true).setContentWidth(670).setAutoFocus(false).setButtons(b).setHandler(d).show();}};

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