/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  January 27th 2010 11:12:57 AM PST                            */
/*      Machine:  10.16.139.107                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/541vqmnkn340848c.pkg.js h:b2riow8o                        */
/*       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){var _L1=_L0.parentNode,_L2=this.active;this.clicked=_L0;this.hide();this.clickEvent=Event.listen(document.body,'click',function(_L3){var _L4=_L3.getTarget();if((_L1!=_L2||(_L0!=_L4&&!DOM.contains(_L0,_L4)))&&DOM.contains(_L1,_L4)){this.show(_L1);}else this.hide();}.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];}};
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={active:null,show:function(_L0,_L1){CSS.addClass(_L0,'jewelOn');this.active=_L0;_L1&&this.markSeen(_L1);_L1&&(_L1=='[fb]messages')&&this.populateMessages();},hide:function(_L0){if(this.active){CSS.removeClass(this.active,'jewelOn');this.active=null;}if(this.token){this.token.remove();this.token=null;}if(_L0&&/requests/.test(_L0))DOM.scry(this.active,'li.jewelItemNew').removeClass('jewelItemNew');},toggle:function(_L0,_L1,_L2){var _L3=$('jewel'+_L0),_L4=_L3.parentNode,_L5=this.active;this.hide();if(_L4!=_L5){CSS.removeClass(_L4,'jewelNew');_L1&&fbx_ab_log_click(_L0.toUpperCase()+'_JEWEL');}this.token=Event.listen(document.body,'mousedown',function(_L6){var _L7=_L6.getTarget();if((_L4!=_L5||_L3!=_L7)&&DOM.contains(_L4,_L7)){this.show(_L4,_L2);}else this.hide(_L2);}.bind(this));},markSeen:function(_L0){new AsyncSignal('/ajax/gigaboxx/endpoint/UpdateLastSeenTime.php',{folder:_L0}).send();},populateMessages:function(){new AsyncRequest().setURI('/ajax/gigaboxx/endpoint/ListThreads.php').setHandler(function(_L0){$('mailBoxItems').setContent(HTML(_L0.payload));}.bind(this)).setData({'folder':'[fb]messages','start':0,'limit':5,'previews':true}).send();}};Arbiter.subscribe(Arbiter.PAGE_TRANSITION,Jewel.hide.bind(Jewel));
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"]); }