/*
HTTP Host: b.static.ak.fbcdn.net
Generated: March 19th 2010 2:25:26 AM PDT
Machine: 10.16.140.109
Locale: nu_ll
Path: js/4ncnwcdryx6o8ss0.pkg.js
*/

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

function InstrumentedLogger(a){if(this===window)return new InstrumentedLogger(a);if(InstrumentedLogger._instances[a])return InstrumentedLogger._instances[a];copy_properties(this,{id:a,_phases:{}});return InstrumentedLogger._instances[a]=this;}copy_properties(InstrumentedLogger,{_instances:{}});copy_properties(InstrumentedLogger.prototype,{beginPhase:function(a){if(this._phases[a]&&this._phases[a].start)this.endPhase(a);if(typeof(this._phases[a])=='undefined')this._phases[a]={start:0,count:0,duration:0};this._phases[a].start=new Date().getTime();return this;},endPhase:function(a){var b=this._phases[a];if(b&&b.start){b.count++;b.duration+=new Date().getTime()-b.start;b.start=null;}return this;},dumpAndReset:function(){this.dump();return this.reset();},dump:function(){for(var b in this._phases){var c=this._phases[b];var a=(this.id?this.id+'::':'')+b;}return this;},get:function(a){if(this._phases[a])return this._phases[a].duration/this._phases[a].count;return 0;},reset:function(){this._phases={};return this;}});InstrumentedLogger.prototype.b=InstrumentedLogger.prototype.beginPhase;InstrumentedLogger.prototype.e=InstrumentedLogger.prototype.endPhase;InstrumentedLogger.prototype.d=InstrumentedLogger.prototype.dump;InstrumentedLogger.prototype.D=InstrumentedLogger.prototype.dumpAndReset;InstrumentedLogger.prototype.r=InstrumentedLogger.prototype.reset;var IL=InstrumentedLogger;
function static_source(){this.values=null;this.index=null;this.index_includes_hints=false;this.exclude_ids={};this.parent.construct(this);}static_source.extend('typeahead_source');static_source.prototype.enumerable=true;static_source.prototype.filter_excluded=function(a){return a.filter((function(b){return !this.exclude_ids[b.i];}).bind(this));};static_source.prototype.build_index=function(){var d=[];var h=this.values;var a=h.length&&typeof h[0].i=='undefined';for(var b=0,c=h.length;b<c;b++){var g=typeahead_source.tokenize(h[b].t);for(var e=0,f=g.length;e<f;e++)d.push({t:g[e],o:h[b]});if(this.index_includes_hints&&h[b].s){var g=typeahead_source.tokenize(h[b].s);for(var e=0,f=g.length;e<f;e++)d.push({t:g[e],o:h[b]});}if(a)h[b].i=b;}d.sort(function(i,j){return (i.t==j.t)?0:(i.t<j.t?-1:1);});this.index=d;this.ready();};static_source.prototype._sort_text_obj=function(a,b){if(a.e&&!b.e)return 1;if(!a.e&&b.e)return -1;return a.t.localeCompare(b.t);};static_source.prototype.search_value=function(k,a){if(!this.is_ready)return;var i;if(k==''){i=this.values;}else{var l=typeahead_source.tokenize(k).sort(typeahead_source._sort);var f=this.index;var g=0;var d=this.index.length-1;var h=Math.floor(d/2);while(g<=d){if(f[h].t>=l[0]){d=h-1;}else g=h+1;h=Math.floor(g+((d-g)/2));}var i=[];var j={};var b=typeof _ignoreList!='undefined';for(var e=g;e<f.length&&f[e].t.lastIndexOf(l[0],0)!=-1;e++){var c=f[e].o.flid?f[e].o.flid:f[e].o.i;if(typeof j[c]!='undefined'){continue;}else j[c]=true;if((!b||!_ignoreList[c])&&!this.exclude_ids[c]&&(l.length==1||typeahead_source.check_match(l,f[e].o.t)))i.push(f[e].o);}}i.sort(this._sort_text_obj.bind(this));if(this.owner&&this.owner.max_results)i=i.slice(0,this.owner.max_results);if(a)a(this,k,i);return i;};static_source.prototype.set_exclude_ids=function(a){this.exclude_ids=a;};
function search_friend_source(a,b){this.get_param=a;this.parent.construct(this);if(!b)this.initialize();}search_friend_source.extend('static_source');search_friend_source.prototype.text_noinput=search_friend_source.prototype.text_placeholder=search_friend_source.prototype.text_nomatch='';search_friend_source.prototype.updated_pics={};search_friend_source.prototype.search_limit=5;search_friend_source.prototype._allowed_types=null;search_friend_source.prototype.do_dark_test=false;search_friend_source.prototype.initialize=function(a){var b=(new Date()).getTime();new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_search.php?'+this.get_param).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(e){var d=e.getPayload();this.values=d.entries;search_friend_source.url_templates=this.templates=d.templates;this.build_index.bind(this).defer();search_typeahead_log(this.udata,'getdata',b);var c=((new Date()).getTime()/1000)-60*5;if(d.gen_time<c)new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/recent_pics.php').setData({ref_time:d.gen_time}).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(f){this.updated_pics=f.getPayload().updated_pics;}.bind(this)).send();if(a)a();}.bind(this)).send();};search_friend_source.loaded_images={};search_friend_source.TYPES={USER:'u',CONNECTION:'c',FOLLOWER:'fl',PAGE:'p',APP:'a',GROUP:'g',EVENT:'e',SEARCH:'search',WEB:'web'};search_friend_source.prototype.build_index=function(){var a=this.history?this.history.entries:undefined;if(a!=undefined)this.values=this.values.each(function(b){b.o=a[b.i]!=undefined?a[b.i]:b.o;return b;});this.parent.build_index();};search_friend_source.image_load=function(b,c,d){var a=(new Date()).getTime();search_friend_source.loaded_images[d]=true;if((a-c)<100){CSS.setOpacity(b,1);}else animation(b).to('opacity',1).duration(100).go();};search_friend_source.prototype.gen_html=function(b,c){var d=b.it;if(!d&&b.ty&&this.templates[b.ty])d=this.templates[b.ty].icon;if(this.updated_pics[b.i])d=this.updated_pics[b.i];switch(b.ty){case search_friend_source.TYPES.USER:case search_friend_source.TYPES.CONNECTION:case search_friend_source.TYPES.PAGE:if(!d){return ['<div>',typeahead_source.highlight_found(b.t,c),'</div><div><small>',b.n||'&nbsp;','</small></div>'].join('');}else{if(!search_friend_source.loaded_images[b.i]){var e=(new Date()).getTime();var a=sprintf('onload="search_friend_source.image_load(this, %d, %d);" style="opacity:0;filter:alpha(opacity=0);"',e,b.i);}return ['<img ',a,' alt="" src="',d,'"/>','<div class="with_pic"><span>',typeahead_source.highlight_found(b.t,c),'</span><small>',b.n||'&nbsp;','</small></div>'].join('');}break;case search_friend_source.TYPES.SEARCH:return ['<div class="app"><div class="icon" style="background-image: url(',d,')">&nbsp;</div>','<span>',b.t,'</span></div>'].join('');break;default:return ['<div class="app clearfix"><div class="icon" style="background-image: url(',d,')">&nbsp;</div>','<span>',typeahead_source.highlight_found(b.t,c),'</span></div>'].join('');}};search_friend_source.prototype.allowTypes=function(a){this._allowed_types=a;return this;};search_friend_source.prototype.search_value=function(f){if(this.do_dark_test)new AsyncSignal('/ajax/search/typeahead_dark.php',{query:f}).send();var e;var a=false;var g=typeahead_source.tokenize(f);for(var b=0;b<g.length;b++)if(g[b]!=''){a=true;break;}if(a){this.owner.less_than_n_chars=false;e=this.parent.search_value(f);}else if(this.is_ready){this.owner.less_than_n_chars=true;e=[];}var c=(e&&e.length)?false:true;if(e)for(var b=0;b<e.length;b++)if((e[b].ty!=search_friend_source.TYPES.USER)&&(e[b].ty!=search_friend_source.TYPES.CONNECTION)){c=true;break;}var d=this.search_limit;if(e)d-=e.length;if(e&&c&&a&&search_friend_source.WEBSEARCH_USER){e.push({t:_tx("Search Facebook"),ty:search_friend_source.TYPES.SEARCH,i:f});e.push({t:_tx("Search the Web"),ty:search_friend_source.TYPES.WEB,i:f});}if(e&&this._allowed_types)e=e.filter(function(h){return this._allowed_types.contains(h.ty);}.bind(this));return e;};search_friend_source.prototype._sort_text_obj=function(a,b){var c=this.history?this.history.entries:undefined;if(c!=undefined){a.o=c[a.i]||a.o;b.o=c[b.i]||b.o;}if(a.o!=b.o)return a.o-b.o;return a.t.localeCompare(b.t);};search_friend_source.WEBSEARCH_USER=false;
function Template(a){copy_properties(this,{_templateSource:a});}copy_properties(Template,{_operatorRepeat:function(d,a){var f='';var c=d.match(/([^:]*):(.*)/);if(!(!c))if(!(!TemplateRegistry.hasTemplate(c[2])))if(a[c[1]]){var e=TemplateRegistry.getTemplate(c[2]);var b=arrayize(a[c[1]]);f+=b.map(function(h,g){return h.render(g);}.curry(e)).join(' ');}return f;}});copy_properties(Template.prototype,{getSource:function(){return this._templateSource;},render:function(b){var a=function(d,c,f,e){switch(f){case 'H':return d[e]||'';case 'R':return Template._operatorRepeat(e,d);default:return d[e]?htmlize(d[e]):'';}return d[e]?translator(d[e]):'';}.curry(b||{});return this._templateSource.replace(/\$(H|R)?{([^\}]*)\}/g,a);}});var TemplateRegistry={_storage:{},registerTemplate:function(a,b){if(typeof(b)=="string")b=new Template(b);this._storage[a]=b;return this;},unregisterTemplate:function(a){delete this._storage[a];},hasTemplate:function(a){return a in this._storage;},getTemplate:function(a){if(this.hasTemplate(a))return this._storage[a];return null;},registerServerSideTemplate:function(d,b,e,c){b=b||bagofholding;e=!!e;c=!!c;if(this.hasTemplate(d)){b();return this;}var a=new AsyncRequest(d).setReadOnly(true).setMethod('GET').setOption('asynchronous',!e).setOption('suppressEvaluation',!c);if(!e)a.setErrorHandler(this._registerErrorHandler.bind(this,d)).setHandler(this._registerHandler.bind(this,d,c,b));a.send();if(e){var f=this._stripHasteComments(a.transport.responseText);this.registerTemplate(d,new Template(f));b();}return this;},_registerErrorHandler:function(a,b){},_registerHandler:function(c,b,a,e){var d=e.getPayload();var f=null;if(b){if(d.template)f=d.template;}else f=this._stripHasteComments(d.responseText);if(f){this.registerTemplate(c,f);a();}},_stripHasteComments:function(a){return a.replace(/^\s*\/\*\*?(.|\n)*\*\//m,'');},_onRegisterTemplate:function(b,a){if(b=='template/registerTemplate'){if(!(!a||!a.name||!a.template))this.registerTemplate(a.name,a.template);return false;}return true;}};Arbiter.subscribe('template/registerTemplate',TemplateRegistry._onRegisterTemplate.bind(TemplateRegistry),Arbiter.SUBSCRIBE_ALL);
function TemplateObject(c,a){a=a||{};if(!(c instanceof Template))if(TemplateRegistry.hasTemplate(c)){c=TemplateRegistry.getTemplate(c);}else if(c instanceof URI){TemplateRegistry.registerServerSideTemplate(c.toString(),null,true);c=TemplateRegistry.getTemplate(c);}if(c==null)throw new Error("Template could not be found");var b=c.render(a);copy_properties(this,{_nodes:HTML(b).getNodes(),_template:c,_rendered:b});TemplateObject.bindNodes(this._nodes,this);}copy_properties(TemplateObject,{bindNodes:function(f,g){var a=[];for(var c=0;c<f.length;c++)if(f[c].nodeType==DOM.NODE_TYPES.ELEMENT){a.push(f[c]);var e=f[c].getElementsByTagName('*');a=a.concat(to_array(e));}for(var c=0;c<a.length;c++){var b=a[c].getAttribute('bindPoint');var d=a[c].getAttribute('listen');if(b)if(hasArrayNature(g[b])){g[b].push(a[c]);}else g[b]=a[c];if(d)d.replace(/(\w+) *: *(\w+)/g,function(k,j,h,i){if(typeof(this[i])=="function"){Event.listen(k,h,bind(this,this[i]));}else Event.listen(k,h,bind(this,TemplateObject._eventWrapper,i));}.bind(g,a[c]));}},_eventWrapper:function(a,event){if(typeof(this[a])=="function"){return this[a](event);}else return true;}});copy_properties(TemplateObject.prototype,{getNodes:function(){return this._nodes;},getRendered:function(){return this._rendered;}});
Arbiter.inform("template\/registerTemplate", {"name":"\/templates\/UIActionMenu.tmpl","template":"\n<div class=\"UIActionMenu\" bindPoint=\"root\">\n  <a class=\"UIActionMenu_Wrap\" bindPoint=\"wrap\" href=\"#\">\n    <span class=\"UIActionMenu_Icon\" bindPoint=\"icon\"><\/span>\n    <span class=\"UIActionMenu_Text\" bindPoint=\"text\"><\/span>\n    <span class=\"UIActionMenu_Chevron\"><\/span>\n  <\/a>\n  <div class=\"UIActionMenu_Menu\" bindPoint=\"menu\"><\/div>\n<\/div>\n"}, Arbiter.BEHAVIOR_PERSISTENT);
function UIActionMenu(a){this.root=null;this.wrap=null;this.icon=null;this.text=null;this.menu=null;this._dirty=true;this._title=a;this._contentCallback=bagofholding;this._selectList=null;this.parent.construct(this,URI('/templates/UIActionMenu.tmpl'));this._initialize();}UIActionMenu.extend('TemplateObject');copy_properties(UIActionMenu,{ICONS:{LOCK:'UIActionMenu_Lock',PEOPLE:'UIActionMenu_People'},COLORS:{BLUE:'UIActionMenu_Blue'}});UIActionMenu.mixin('Arbiter',{_initialize:function(){Event.listen(this.wrap,'click',this.click.bind(this));Event.listen(this.menu,'mouseover',function(event){var a=DOM.getNearest(event.getTarget(),'a');a&&a.focus();});},hideMenu:function(){Toggler.hide();return this;},click:function(event){if(this._dirty){this.buildMenu();this.setDirty(false);}this.inform('menuActivated');Toggler.toggle(this.wrap);event.prevent();},setAlignRight:function(a){this._right=a;CSS.conditionClass(this.root,'UIActionMenu_AlignRight',a);return this;},setContentCallback:function(a){this._contentCallback=a;return this;},setSuppressButton:function(a){CSS.conditionClass(this.root,'UIActionMenu_SuppressButton',a);return this;},setSuppressText:function(a){CSS.conditionClass(this.root,'UIActionMenu_SuppressText',a);return this;},setColor:function(a){switch(a){case UIActionMenu.COLORS.BLUE:if(this.color)CSS.removeClass(this.root,this.color);CSS.addClass(this.root,a);this.color=a;break;default:if(this.color){CSS.removeClass(this.root,this.color);this.color=null;}}return this;},setIcon:function(a){switch(a){case UIActionMenu.ICONS.LOCK:case UIActionMenu.ICONS.PEOPLE:CSS.addClass(this.root,'UIActionMenu_IconIncluded');CSS.addClass(this.icon,a);break;default:CSS.removeClass(this.root,'UIActionMenu_IconIncluded');}return this;},_getContent:function(){var a=this._contentCallback();return a;},setTitle:function(a){this._title=a;DOM.setContent(this.text,this._title);return this;},setTooltip:function(a){if(this.tooltip){if(a){DOM.setContent(this.tooltip.firstChild,a);}else{DOM.remove(this.tooltip);CSS.removeClass(this.wrap,'uiTooltip');this.tooltip=null;}}else{this.tooltip=$N('span',{className:'uiTooltipWrap'},$N('span',{className:'uiTooltipText'},a));CSS.addClass(this.wrap,'uiTooltip');if(this._right)CSS.addClass(this.tooltip,'right');DOM.prependContent(this.wrap,this.tooltip);}return this;},getNodes:function(){DOM.setContent(this.text,this._title);return [this.root];},buildMenu:function(){DOM.setContent(this.menu,this._getContent());return this;},useSelectList:function(b,a,c){c=c||UISelectList.MULTI_SELECT_MODE;this.setContentCallback(function(){this._selectList=new UISelectList().setMode(c).setCallback(function(d,e){this.hideMenu();a&&a(d,e);}.bind(this)).addItems(b);return this._selectList.getElement();}.bind(this));return this;},resetSelectList:function(){this._selectList&&this._selectList.reset();},getSelectList:function(){return this._selectList;},setDirty:function(a){this._dirty=a;return this;}});

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