/*
HTTP Host: static.ak.fbcdn.net
Generated: March 11th 2010 11:38:01 AM PST
Machine: 10.16.140.110
Locale: nu_ll
Path: js/541vqmnkn340848c.pkg.js
*/

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

var Toggler={active:null,togglers:{},show:function(_L0){this.active=$(_L0).addClass('openToggler');DOM.appendContent(_L0,this.getToggler('next'));DOM.prependContent(_L0,this.getToggler('prev'));},hide:function(){this.active&&this.active.removeClass('openToggler');this.clicked&&this.clicked.focus();this.clickEvent&&this.clickEvent.remove();for(var _L0 in this.togglers){_L0=this.togglers[_L0];_L0&&_L0.parentNode&&_L0.parentNode.removeChild(_L0);}this.active=this.clicked=this.token=null;},toggle:function(_L0,_L1){var _L2=_L0.parentNode,_L3=this.active;this.clicked=_L0;this.hide();this.clickEvent=Event.listen(document.body,'click',function(_L4){var _L5=_L4.getTarget(),_L6=false;if((_L2!=_L3||(_L0!=_L5&&!DOM.contains(_L0,_L5)))&&DOM.contains(_L2,_L5)){this.show(_L2);_L6=true;}else this.hide();_L1&&_L1(_L6,_L2);}.bind(this),Event.Priority.URGENT);},getToggler:function(_L0){if(!this.togglers[_L0])this.togglers[_L0]=$N('a',{href:'#',className:'hideToggler',onfocus:this.hide.bind(this)},HTML('&nbsp;'));return this.togglers[_L0];}};Arbiter.subscribe(Arbiter.PAGE_TRANSITION,Toggler.hide.bind(Toggler));
function FBXNotifications(_L0,_L1,_L2,_L3,_L4,_L5,_L6){this.parent.construct(this,_L0,_L1,_L2,_L3,_L4,_L5,_L6);}FBXNotifications.extend('ChatNotifications');copy_properties(FBXNotifications.prototype,{_init:function(){this.wrapperID='notificationsWrapper';this.contentID='jewelNotifs';this.navInboxID='mailWrapper';this.timeElement='small.time';this.alertList.setItemTag('li');this.alertList.setUnreadItemClass('jewelItemNew');this.alertList.setNoItemsClass('empty');this.parent._init();if(this.wrapper){this.countSpan=DOM.find(this.wrapper,'div.jewelCount div');if(this.isTabOpen())this.loadTab();}},markRead:function(_L0,_L1,_L2){this.parent.markRead(_L0,_L1,_L2);CSS.removeClass(this.wrapper,'jewelNew');CSS.addClass(this.wrapper,'jewel');},_updateCount:function(){if(this.countSpan)DOM.setText(this.countSpan,this.countNew);CSS.conditionClass(this.wrapper,'jewelNew',(this.countNew>0));},_updateInboxMarkup:function(_L0,_L1){CounterDisplay.setCount('messages_unread',_L0);this.navInbox&&CSS.addClass(this.navInbox,'jewelUnread');},_updateInboxUnseenCount:function(_L0){CounterDisplay.setCount('messages_unseen',_L0);_L0&&this.navInbox&&CSS.addClass(this.navInbox,'jewelNew');},_signalContentChanged:function(){return;},isTabOpen:function(){return this.wrapper&&CSS.hasClass(this.wrapper,'jewelOn');}});
var Jewel={toggle:function(_L0,_L1){Toggler.toggle(_L0,this.markSeen.bind(this,_L1));},markSeen:function(_L0,_L1,_L2){if(_L1){CSS.removeClass(_L2,'jewelNew');_L0=='[fb]messages'&&MenubarMessageController.fetch();new AsyncSignal('/ajax/gigaboxx/endpoint/UpdateLastSeenTime.php',{folder:_L0}).send();}else if(/requests/.test(_L0))DOM.scry(_L2,'li.jewelItemNew').removeClass('jewelItemNew');}};
function MenubarMessageController(_L0,_L1){}copy_properties(MenubarMessageController,{ensureInitialized:function(_L0,_L1){if(this.initialized)return false;if(!ge(_L1))return false;var _L2=[CounterDisplay.EVENT_TYPE_ADJUST+'/messages_unread',CounterDisplay.EVENT_TYPE_UPDATE+'/messages_unread'];Arbiter.subscribe(_L2,this.onCounterUpdate.bind(this),Arbiter.SUBSCRIBE_NEW);this.navID=_L0;this.menuID=_L1;this.initialized=true;this._dirty=false;var nav=$(_L0);Event.listen(nav,'mouseover',this._doRefetch.bind(this));this.fetch();},_doRefetch:function(){if(this._dirty){this._dirty=false;this.fetch();}},fetch:function(){new AsyncRequest().setURI('/ajax/gigaboxx/endpoint/ListThreads.php').setHandler(this.onFetchComplete.bind(this)).setErrorHandler(bagofholding).setData({'folder':'[fb]messages','start':0,'limit':5,'previews':true}).send();},onFetchComplete:function(_L0){var _L1=ge(this.menuID);if(_L1)DOM.setContent(_L1,HTML(_L0.payload));},onCounterUpdate:function(){this._dirty=true;}});

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