/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  December 11th 2009 4:35:33 AM PST                            */
/*      Machine:  10.16.139.102                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/37fw3mrf70aowosk.pkg.js h:7dwv906z                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/37fw3mrf70aowosk.pkg.js                                   */

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


function PageCacheFeedTracking(){this.data=[];}
PageCacheFeedTracking.instance=null;PageCacheFeedTracking.getInstance=function(){if(!PageCacheFeedTracking.instance){PageCacheFeedTracking.instance=new PageCacheFeedTracking();}
return PageCacheFeedTracking.instance;};copy_properties(PageCacheFeedTracking.prototype,{register:function(metadata){var newEntry={'meta':metadata};this.data.push(newEntry);},dispatch:function(){var async=new AsyncRequest().setMethod('POST').setURI('/ajax/feed_tracking_pagecache.php').setReadOnly(true).setOption('bundle',true).setData({'data':this.data}).send();return true;}});

function InstrumentedLogger(instance_id){if(this===window){return new InstrumentedLogger(instance_id);}
if(InstrumentedLogger._instances[instance_id]){return InstrumentedLogger._instances[instance_id];}
copy_properties(this,{id:instance_id,_phases:{}});return InstrumentedLogger._instances[instance_id]=this;}
copy_properties(InstrumentedLogger,{_instances:{}});copy_properties(InstrumentedLogger.prototype,{beginPhase:function(name){if(this._phases[name]&&this._phases[name].start){this.endPhase(name);}
if(typeof(this._phases[name])=='undefined'){this._phases[name]={start:0,count:0,duration:0};}
this._phases[name].start=new Date().getTime();return this;},endPhase:function(name){var phase=this._phases[name];if(phase&&phase.start){phase.count++;phase.duration+=new Date().getTime()-phase.start;phase.start=null;}
return this;},dumpAndReset:function(){this.dump();return this.reset();},dump:function(){for(var name in this._phases){var p=this._phases[name];var label=(this.id?this.id+'::':'')+name;Util.warn(' %s %f ms [%d ms / %d]',label,p.duration/p.count,p.duration,p.count);}
return this;},get:function(name){if(this._phases[name]){return this._phases[name].duration/this._phases[name].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;

Base64={_initialized:false,_chars:null,_inv:null,_init:function(){Base64._chars=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"];Base64._inv={"A":0,"B":1,"C":2,"D":3,"E":4,"F":5,"G":6,"H":7,"I":8,"J":9,"K":10,"L":11,"M":12,"N":13,"O":14,"P":15,"Q":16,"R":17,"S":18,"T":19,"U":20,"V":21,"W":22,"X":23,"Y":24,"Z":25,"a":26,"b":27,"c":28,"d":29,"e":30,"f":31,"g":32,"h":33,"i":34,"j":35,"k":36,"l":37,"m":38,"n":39,"o":40,"p":41,"q":42,"r":43,"s":44,"t":45,"u":46,"v":47,"w":48,"x":49,"y":50,"z":51,"0":52,"1":53,"2":54,"3":55,"4":56,"5":57,"6":58,"7":59,"8":60,"9":61,"+":62,"/":63};Base64._initialized=true;},encodeObject:function(obj){return Base64.encode(JSON.encode(obj));},decodeObject:function(base64Data){return JSON.decode(Base64.decode(base64Data));},_toUtf8:function(s){var result='';for(var i=0;i<s.length;i++){var c=s.charCodeAt(i);if(c<0x80){result+=String.fromCharCode(c);}else{if(c<0x800){result+=String.fromCharCode((c>>6)|0xc0);}else{if(c<0x10000){result+=String.fromCharCode((c>>12)|0xe0);}else{result+=String.fromCharCode((c>>18)|0xf0);result+=String.fromCharCode(((c>>12)&0x3f)|0x80);}
result+=String.fromCharCode(((c>>6)&0x3f)|0x80);}
result+=String.fromCharCode((c&0x3f)|0x80);}}
return result;},_fromUtf8:function(s){var result='';for(var i=0;i<s.length;i++){var c=s.charCodeAt(i);if(c<0x80){result+=String.fromCharCode(c);}else if(c<0xc0){}else if(c<0xe0&&s.length>i+1){result+=String.fromCharCode(((c&0x1f)<<6)|(s.charCodeAt(++i)&0x3f));}else if(c<0xf0&&s.length>i+2){result+=String.fromCharCode(((c&0x0f)<<12)|((s.charCodeAt(++i)&0x3f)<<6)|(s.charCodeAt(++i)&0x3f));}else if(c<0xf8&&s.length>i+3){result+=String.fromCharCode(((c&0x07)<<18)|((s.charCodeAt(++i)&0x3f)<<12)|((s.charCodeAt(++i)&0x3f)<<6)|(s.charCodeAt(++i)&0x3f));}}
return result;},encode:function(s){if(!Base64._initialized){Base64._init();}
s=Base64._toUtf8(s);var r='';var p='';var c=s.length%3;if(c>0){for(;c<3;c++){p+='=';s+="\0";}}
for(c=0;c<s.length;c+=3){var n=(s.charCodeAt(c)<<16)+(s.charCodeAt(c+1)<<8)+s.charCodeAt(c+2);n=[(n>>>18)&63,(n>>>12)&63,(n>>>6)&63,n&63];r+=Base64._chars[n[0]]+Base64._chars[n[1]]+Base64._chars[n[2]]+Base64._chars[n[3]];}
return r.substring(0,r.length-p.length)+p;},decode:function(s){if(!Base64._initialized){Base64._init();}
s=s.replace(new RegExp('[^'+Base64._chars.join("")+'=]','g'),"");var p=(s.charAt(s.length-1)=='='?(s.charAt(s.length-2)=='='?'AA':'A'):"");var r="";s=s.substr(0,s.length-p.length)+p;for(var c=0;c<s.length;c+=4){var n=(Base64._inv[s.charAt(c)]<<18)+(Base64._inv[s.charAt(c+1)]<<12)+
(Base64._inv[s.charAt(c+2)]<<6)+Base64._inv[s.charAt(c+3)];r+=String.fromCharCode((n>>>16)&255,(n>>>8)&255,n&255);}
r=r.substring(0,r.length-p.length);return Base64._fromUtf8(r);}};

function UIPagelet(element,src,context_data,data){this._id=element||null;this._element=ge(element||$N('div'));this._src=src||null;this._context_data=context_data||{};this._data=data||{};this._handler=bagofholding;return this;}
copy_properties(UIPagelet.prototype,{getElement:function(){return this._element;},setHandler:function(handler){this._handler=handler;return this;},go:function(src,data){if(arguments.length>=2||typeof src=='string'){this._src=src;this._data=data||{};}else if(arguments.length==1){this._data=src;}
this.refresh();return this;},refresh:function(reattach){var handler=function(response){if(reattach&&this._id){this._element=ge(this._id);}
this._element.setContent(HTML(response.getPayload()));this._handler();}.bind(this);new AsyncRequest().setURI(this._src).setMethod('GET').setData({data:JSON.encode(merge(this._context_data,this._data))}).setReadOnly(true).setHandler(handler).setOption('bundle',true).send();return this;}});

function UISelectList(){this._callback=bagofholding;this.container=$N('div',{className:'UISelectList clearfix'});this._mode=UISelectList.MULTI_SELECT_MODE;this._inputName='UISelectList_name_'+gen_unique();this._items={};}
copy_properties(UISelectList,{MULTI_SELECT_MODE:1,SINGLE_SELECT_MODE:2,MULTI_SELECT_MODE_CHECKED_CLASS_NAME:'UISelectList_check_Checked',SINGLE_SELECT_MODE_CHECKED_CLASS_NAME:'UISelectList_radio_Checked'});UISelectList.prototype={setMode:function(mode){if(mode!=UISelectList.MULTI_SELECT_MODE&&mode!=UISelectList.SINGLE_SELECT_MODE){Util.error('invalid mode %s passed to UISelectList.selectMode',mode);return this;}
if(!is_empty(this._items)){Util.error("You have to set `mode' before adding any items to "+"UISelectList");return this;}
this._mode=mode;return this;},setCallback:function(fn){this._callback=fn;return this;},addItem:function(label,checked,key){var item={label:label,checked:checked,key:key};this._renderItem(item);return this;},addItems:function(items){for(var i=0;i<items.length;i++){this.addItem(items[i].label,items[i].checked,items[i].key);}
return this;},clearItems:function(){this._items={};DOM.empty(this.container);return this;},setSelected:function(key,selected){if(this._items[key]){var input=this._items[key].input;input.checked=!selected;input.click();}
return this;},getElement:function(){return this.container;},reset:function(){for(var key in this._items){var input=this._items[key].input;var label=this._items[key].label;input.checked=input.defaultChecked;CSS.conditionClass(label,this._getCheckedClass(),input.checked);}},_renderItem:function(item){var input=$N('input',{type:this._getInputType(),name:this._inputName});input.checked=item.checked;input.defaultChecked=item.checked;var link=$N('a',{className:'UISelectList_Label',href:'#'},item.label);if(item.checked){link.addClass(this._getCheckedClass());}
link.listen('click',Event.kill);link.listen('mouseup',this._linkClicked.bind(this,input));input.listen('click',this._clicked.bind(this,input,link,item.key));this.container.appendContent($N('div',{className:'UISelectList_Item'},[input,link]));item.input=input;item.label=link;this._items[item.key]=item;},_getInputType:function(){if(this._mode==UISelectList.MULTI_SELECT_MODE){return'checkbox';}
return'radio';},_getCheckedClass:function(){if(this._mode==UISelectList.MULTI_SELECT_MODE){return UISelectList.MULTI_SELECT_MODE_CHECKED_CLASS_NAME;}
return UISelectList.SINGLE_SELECT_MODE_CHECKED_CLASS_NAME;},_linkClicked:function(input,e){input.click();},_clicked:function(input,label,key,e){var clickedElemChecked;if(this._mode==UISelectList.SINGLE_SELECT_MODE){for(var k in this._items){var checked=input==this._items[k].input;CSS.conditionClass(this._items[k].label,this._getCheckedClass(),checked);}
clickedElemChecked=true;}else{clickedElemChecked=input.checked;CSS.conditionClass(label,this._getCheckedClass(),input.checked);}
this._callback(clickedElemChecked,key);$E(e).stop();}};

function SortableGroup(){this.namespace='sortable'+(++SortableGroup.instanceCount);this.draggables={};this.droppables={};this.sortables={};this.linkedGroups=[];this.linkedGroups.onlinkjump=bagofholding;this.rootNode=null;this.boundingBox=null;this.neverEmpty=false;this.hasEmptyMessage=false;this.isDroppable=true;this.anchor=null;}
SortableGroup.instanceCount=0;SortableGroup.prototype.gutter=15;SortableGroup.prototype.setBoundingBox=function(bounding_box){this.boundingBox=bounding_box;for(var k in this.draggables){this.draggables[k].setBoundingBox(this.boundingBox);}
return this;}
SortableGroup.prototype.setDroppable=function(val){this.isDroppable=val;return this;}
SortableGroup.prototype._initializeAdded=function(key,obj){if(this.rootNode===null){this.rootNode=obj.parentNode;if(!this.linkedGroups.placeholder){this.linkedGroups.placeholder=this.placeholder=$N(obj.tagName,{className:'dragPlaceholder',style:{padding:'0px'}});}else{this.placeholder=this.linkedGroups.placeholder;}}else if(this.rootNode!=obj.parentNode){throw new Error('All sortables of a collection must share the same parentNode');}
if(key in this.draggables){throw new Error('All sortables must have a unique key');}}
SortableGroup.prototype.addSortable=function(key,obj,handle){this._initializeAdded(key,obj);this.sortables[key]=obj;this.draggables[key]=(new Draggable(obj)).setNamespace(this.namespace).setGutter(this.gutter).setUseAbsolute(true).setGrabHandler(this.grabHandler.bind(this,key)).setDropHandler(this.dropHandler.bind(this,key)).setKey('key',key).setBoundingBox(this.boundingBox);if(handle){this.draggables[key].addHandle(handle);}
this.droppables[key]=(new Droppable(obj)).setNamespace(this.namespace).setDragOverHandler(this._dragOverHandlerShim.bind(null,this,key));return this;}
SortableGroup.prototype.addEmptyMessage=function(obj,root){var key='placeholder';if(obj.parentNode!=root){root.appendContent(obj);}
this._initializeAdded(key,obj);this.hasEmptyMessage=true;this.sortables[key]=obj;this.droppables[key]=(new Droppable(obj)).setNamespace(this.namespace).setDragOverHandler(this._dragOverHandlerShim.bind(null,this,key));return this;}
SortableGroup.prototype.setNeverEmpty=function(neverEmpty){this.neverEmpty=neverEmpty;}
SortableGroup.prototype.link=function(sortgroup){sortgroup.linkedGroups=this.linkedGroups;if(!this.linkedGroups.length){this.linkedGroups.push(this);}
this.linkedGroups.push(sortgroup);for(var i=0;i<this.linkedGroups.length;i++){if(this.linkedGroups[i].namespace!=this.namespace){this.linkedGroups[i].namespace=this.namespace;for(var j in this.linkedGroups[i].droppables){this.linkedGroups[i].droppables[j].setNamespace(this.namespace);this.linkedGroups[i].draggables[j].setNamespace(this.namespace);}}}
return this;}
SortableGroup.prototype.getOrder=function(){if(!this.rootNode){return[];}
var ret=[],childNodes=this.rootNode.childNodes;for(var i=0;i<childNodes.length;i++){for(var k in this.sortables){if(this.sortables[k]==childNodes[i]){ret.push(k);break;}}}
return ret;}
SortableGroup.prototype.migrateLinkedSortable=function(key){for(var i=0;i<this.linkedGroups.length;i++){if(key in this.linkedGroups[i].draggables){this.sortables[key]=this.linkedGroups[i].sortables[key];this.draggables[key]=this.linkedGroups[i].draggables[key];this.draggables[key].setGrabHandler(this.grabHandler.bind(this,key)).setDropHandler(this.dropHandler.bind(this,key));this.droppables[key]=this.linkedGroups[i].droppables[key];this.droppables[key].setDragOverHandler(this._dragOverHandlerShim.bind(null,this,key));delete this.linkedGroups[i].sortables[key];delete this.linkedGroups[i].draggables[key];delete this.linkedGroups[i].droppables[key];return true;}}
return false;}
SortableGroup.prototype.setLinkJumpHandler=function(func){this.linkedGroups.onlinkjump=func;return this;}
SortableGroup.prototype.onorderchange=bagofholding;SortableGroup.prototype.setOrderChangeHandler=function(func){this.onorderchange=func;return this;}
SortableGroup.prototype.ongrabcallback=bagofholding;SortableGroup.prototype.setGrabCallback=function(func){this.ongrabcallback=func;return this;}
SortableGroup.prototype._checkLastRemaining=function(draggable){var oneNodeLeft=this.hasEmptyMessage?2:1;return this.neverEmpty&&this.rootNode.childNodes.length==oneNodeLeft;}
SortableGroup.prototype.grabHandler=function(draggableKey){if(this._checkLastRemaining()){this.draggables[draggableKey].killDrag();return;}
CSS.setClass(this.placeholder,this.sortables[draggableKey].className);CSS.addClass(this.placeholder,'droppable_placeholder');CSS.addClass(this.sortables[draggableKey],'drag');Vector2.getElementDimensions(this.sortables[draggableKey]).setElementDimensions(this.placeholder);this.rootNode.insertBefore(this.placeholder,this.sortables[draggableKey]);this.ongrabcallback(draggableKey);if(!this.isDroppable){var sortable=this.sortables[draggableKey];this.anchor=sortable.nextSibling;if(!this.anchor){this.anchor=$N('div');sortable.parentNode.appendChild(this.anchor);}}}
SortableGroup.prototype.ondropcallback=bagofholding;SortableGroup.prototype.setDropCallback=function(func){this.ondropcallback=func;return this;}
SortableGroup.prototype.dropHandler=function(draggableKey){if(this._checkLastRemaining()){this.draggables[draggableKey].resetPosition();return;}
CSS.removeClass(this.sortables[draggableKey],'drag');this.draggables[draggableKey].resetPosition();this.rootNode.insertBefore(this.sortables[draggableKey],this.placeholder);this.rootNode.removeChild(this.placeholder);for(var i=0;i<this.linkedGroups.length;i++){if(this.linkedGroups[i].anchor){delete this.linkedGroups[i].anchor;}}
this.ondropcallback(draggableKey);this.onorderchange();}
SortableGroup.prototype._dragOverHandlerShim=function(that,droppableKey,draggable){that.dragOverHandler(droppableKey,draggable.getKey('key'));};SortableGroup.prototype.dragOverHandler=function(droppableKey,draggableKey){if(!this.isDroppable&&!this.anchor){return;}
var jumped=false;if(!(draggableKey in this.draggables)){if(!this.migrateLinkedSortable(draggableKey)){throw new Error('Draggable dropped onto a foreign droppable!');}
jumped=true;}
var before=true,childNodes=this.rootNode.childNodes,draggable=this.sortables[draggableKey],droppable=this.sortables[droppableKey];if(!this.anchor){for(var i=0;i<childNodes.length;i++){if(childNodes[i]==droppable){break;}else if(childNodes[i]==draggable){before=false;break;}}}else{droppable=this.anchor;}
if(before||this.anchor){this.rootNode.insertBefore(this.placeholder,droppable);}else{this.rootNode.insertBefore(this.placeholder,droppable.nextSibling);}
this.rootNode.insertBefore(draggable,this.placeholder);this.ondragover(draggable,droppable);if(jumped){this.linkedGroups.onlinkjump.call(this,draggableKey);}}
SortableGroup.prototype.ondragover=bagofholding;SortableGroup.prototype.setDragOverCallback=function(func){this.ondragover=func;return this;}
SortableGroup.prototype.destroy=function(){for(var k in this.droppables){this.droppables[k].destroy();}
for(var k in this.draggables){this.draggables[k].destroy();}
this.droppables=this.draggables=this.rootNode=null;this.linkedGroups.remove(this);for(var i=0;i<this.linkedGroups.length;i++){this.linkedGroups[i].linkedGroups=this.linkedGroups;}}
SortableGroup.prototype.removeSortable=function(key){if(key in this.sortables){this.draggables[key].destroy();this.droppables[key].destroy();delete this.draggables[key];delete this.droppables[key];delete this.sortables[key];}}
SortableGroup.prototype.keyExists=function(key){return this.sortables[key];}

function typeahead_source(){}
typeahead_source.prototype.cache_results=false;typeahead_source.prototype.enumerable=false;typeahead_source.prototype.allow_fake_results=false;typeahead_source.prototype.search_limit=10;typeahead_source.prototype.check_limit=10;typeahead_source.prototype.bootstrap=bagofholding;typeahead_source.check_match=function(search,value){value=typeahead_source.tokenize(value);for(var i=0,il=search.length;i<il;i++){if(search[i].length){var found=false;for(var j=0,jl=value.length;j<jl;j++){if(value[j].length>=search[i].length&&value[j].substring(0,search[i].length)==search[i]){found=true;value[j]='';break;}}
if(!found){return false;}}}
return true;}
typeahead_source.tokenize=function(text,capture,noflatten){return(noflatten?text:typeahead_source.flatten_string(text)).split(capture?typeahead_source.normalizer_regex_capture:typeahead_source.normalizer_regex);}
typeahead_source.normalizer_regex_str='(?:(?:^| +)["\'.\\-]+ *)|(?: *[\'".\\-]+(?: +|$)|[@_]| +)';typeahead_source.normalizer_regex=new RegExp(typeahead_source.normalizer_regex_str,'g');typeahead_source.normalizer_regex_capture=new RegExp('('+typeahead_source.normalizer_regex_str+')','g');typeahead_source.flatten_string=function(text){if(!typeahead_source.accents){typeahead_source.accents={a:/\u0430|\u00e0|\u00e1|\u00e2|\u00e3|\u00e4|\u00e5/g,b:/\u0431/g,c:/\u0446|\u00e7/g,d:/\u0434|\u00f0/g,e:/\u044d|\u0435|\u00e8|\u00e9|\u00ea|\u00eb/g,f:/\u0444/g,g:/\u0433/g,h:/\u0445/g,i:/\u0438|\u00ec|\u00ed|\u00ee|\u00ef/g,j:/\u0439/g,k:/\u043a/g,l:/\u043b/g,m:/\u043c/g,n:/\u043d|\u00f1/g,o:/\u043e|\u00f8|\u00f6|\u00f5|\u00f4|\u00f3|\u00f2/g,p:/\u043f/g,r:/\u0440/g,s:/\u0441/g,t:/\u0442/g,u:/\u0443|\u044e|\u00fc|\u00fb|\u00fa|\u00f9/g,v:/\u0432/g,y:/\u044b|\u00ff|\u00fd/g,z:/\u0437/g,ae:/\u00e6/g,oe:/\u0153/g,ts:/\u0446/g,ch:/\u0447/g,sh:/\u0448/g,ya:/\u044f/g}}
text=text.toLowerCase();for(var i in typeahead_source.accents){text=text.replace(typeahead_source.accents[i],i);}
return text;}
typeahead_source.prototype.set_owner=function(obj){this.owner=obj;if(this.is_ready){this.owner.update_status(typeaheadpro.STATUS_IDLE);}}
typeahead_source.prototype.ready=function(){if(this.owner&&!this.is_ready){this.is_ready=true;this.owner.update_status(typeaheadpro.STATUS_IDLE);}else{this.is_ready=true;}}
typeahead_source.highlight_found=function(result,search){var html=[];resultv=typeahead_source.tokenize(result,true,true);result=typeahead_source.tokenize(result,true);search=typeahead_source.tokenize(search);search.sort(typeahead_source._sort);for(var i=0,il=resultv.length;i<il;i++){var found=false;for(var j=0,jl=search.length;j<jl;j++){if(search[j]&&result[i].lastIndexOf(search[j],0)!=-1){html.push('<em>',htmlspecialchars(resultv[i].substring(0,search[j].length)),'</em>',htmlspecialchars(resultv[i].substring(search[j].length,resultv[i].length)));found=true;break;}}
if(!found){html.push(htmlspecialchars(resultv[i]));}}
return html.join('');}
typeahead_source._sort=function(a,b){return b.length-a.length;}
typeahead_source.prototype.gen_nomatch=function(){return this.text_nomatch!=null?this.text_nomatch:_tx("No matches found");}
typeahead_source.prototype.gen_loading=function(){return this.text_loading!=null?this.text_loading:_tx("Loading...");}
typeahead_source.prototype.gen_placeholder=function(){return this.text_placeholder!=null?this.text_placeholder:_tx("Start typing...");}
typeahead_source.prototype.gen_noinput=function(){return this.text_noinput!=null?this.text_noinput:_tx("Start typing...");}
typeahead_source.prototype.onselect_not_found=function(){if(typeof this.tokenizer._ontokennotfound!='undefined'){this.tokenizer._ontokennotfound(this.obj.value);}
if(typeof this.tokenizer.onselect!='undefined'){return this.tokenizer.onselect();}}

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(values){return values.filter((function(value){return!this.exclude_ids[value.i];}).bind(this));}
static_source.prototype.build_index=function(){var index=[];var values=this.values;var gen_id=values.length&&typeof values[0].i=='undefined';for(var i=0,il=values.length;i<il;i++){var tokens=typeahead_source.tokenize(values[i].t);for(var j=0,jl=tokens.length;j<jl;j++){index.push({t:tokens[j],o:values[i]});}
if(this.index_includes_hints&&values[i].s){var tokens=typeahead_source.tokenize(values[i].s);for(var j=0,jl=tokens.length;j<jl;j++){index.push({t:tokens[j],o:values[i]});}}
if(gen_id){values[i].i=i;}}
index.sort(function(a,b){return(a.t==b.t)?0:(a.t<b.t?-1:1)});this.index=index;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(text){if(!this.is_ready){return;}
var results;if(text==''){results=this.values;}else{var ttext=typeahead_source.tokenize(text).sort(typeahead_source._sort);var index=this.index;var lo=0;var hi=this.index.length-1;var p=Math.floor(hi/2);while(lo<=hi){if(index[p].t>=ttext[0]){hi=p-1;}else{lo=p+1;}
p=Math.floor(lo+((hi-lo)/2));}
var results=[];var stale_keys={};var check_ignore=typeof _ignoreList!='undefined';for(var i=lo;i<index.length&&index[i].t.lastIndexOf(ttext[0],0)!=-1;i++){var elem_id=index[i].o.flid?index[i].o.flid:index[i].o.i;if(typeof stale_keys[elem_id]!='undefined'){continue;}else{stale_keys[elem_id]=true;}
if((!check_ignore||!_ignoreList[elem_id])&&!this.exclude_ids[elem_id]&&(ttext.length==1||typeahead_source.check_match(ttext,index[i].o.t))){results.push(index[i].o);}}}
results.sort(this._sort_text_obj.bind(this));if(this.owner&&this.owner.max_results){results=results.slice(0,this.owner.max_results);}
return results;}
static_source.prototype.set_exclude_ids=function(ids){this.exclude_ids=ids;}

function search_friend_source(get_param,manual_init){this.get_param=get_param;this.parent.construct(this);if(!manual_init){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.cache_results=true;search_friend_source.prototype.updated_pics={};search_friend_source.prototype._allowed_types=null;search_friend_source.prototype.initialize=function(callback){var current_time=(new Date()).getTime();new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_search.php?'+this.get_param).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(response){var payload=response.getPayload();this.values=payload.entries;this.build_index.bind(this).defer();search_typeahead_log(this.udata,'getdata',current_time);var now_minus_5_min=((new Date()).getTime()/1000)-60*5;if(payload.gen_time<now_minus_5_min){new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/recent_pics.php').setData({ref_time:payload.gen_time}).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(response){this.updated_pics=response.getPayload().updated_pics;}.bind(this)).send();}
if(callback){callback();}}.bind(this)).setOption('nectar',false).send();};search_friend_source.url_templates={};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 history=this.history?this.history.entries:undefined;if(history!=undefined){this.values=this.values.each(function(value){value.o=history[value.i]!=undefined?history[value.i]:value.o;return value;});}
this.parent.build_index();};search_friend_source.image_load=function(image_elm,insertion_time,user_id){var current_time=(new Date()).getTime();search_friend_source.loaded_images[user_id]=true;if((current_time-insertion_time)<100){CSS.setOpacity(image_elm,1);}else{animation(image_elm).to('opacity',1).duration(100).go();}};search_friend_source.prototype.gen_html=function(friend,highlight){var icon_url=friend.it;if(!icon_url&&friend.ty&&search_friend_source.url_templates[friend.ty]){icon_url=search_friend_source.url_templates[friend.ty].icon;}
if(this.updated_pics[friend.i]){icon_url=this.updated_pics[friend.i];}
switch(friend.ty){case search_friend_source.TYPES.USER:case search_friend_source.TYPES.CONNECTION:case search_friend_source.TYPES.PAGE:if(!icon_url){return['<div>',typeahead_source.highlight_found(friend.t,highlight),'</div><div><small>',friend.n||'&nbsp;','</small></div>'].join('');}else{if(!search_friend_source.loaded_images[friend.i]){var insertion_time=(new Date()).getTime();var attrs=sprintf('onload="search_friend_source.image_load(this, %d, %d);" style="opacity:0;filter:alpha(opacity=0);"',insertion_time,friend.i);}
return['<img ',attrs,' alt="" src="',icon_url,'"/>','<div class="with_pic"><span>',typeahead_source.highlight_found(friend.t,highlight),'</span><small>',friend.n||'&nbsp;','</small></div>'].join('');}
break;case search_friend_source.TYPES.SEARCH:return['<div class="app"><div class="icon" style="background-image: url(',icon_url,')">&nbsp;</div>','<span>',friend.t,'</span></div>'].join('');break;default:return['<div class="app clearfix"><div class="icon" style="background-image: url(',icon_url,')">&nbsp;</div>','<span>',typeahead_source.highlight_found(friend.t,highlight),'</span></div>'].join('');}};search_friend_source.prototype.allowTypes=function(type_arr){this._allowed_types=type_arr;return this;};search_friend_source.prototype.search_value=function(text,searching){var results;if(this.owner.enableSearchResults){if(this._searchQueryTimer){clearTimeout(this._searchQueryTimer);this._searchQueryTimer=null;}}
var enough_tokens=false;var tokens=typeahead_source.tokenize(text);for(var i=0;i<tokens.length;i++){if(tokens[i]!=''){enough_tokens=true;break;}}
if(enough_tokens){this.owner.less_than_n_chars=false;results=this.parent.search_value(text);}else if(this.is_ready){this.owner.less_than_n_chars=true;results=[];}
var non_people_search=(results&&results.length)?false:true;if(results){for(var i=0;i<results.length;i++){if((results[i].ty!=search_friend_source.TYPES.USER)&&(results[i].ty!=search_friend_source.TYPES.CONNECTION)){non_people_search=true;break;}}}
if(this.owner.enableSearchResults){if(!searching&&!(results&&results.length>(this.search_limit-1))){this._searchQueryTimer=setTimeout(this.search_value.bind(this,text,true),300);if(!results||(results&&results.length==0)){this.owner.set_message(_tx("Searching Facebook..."));this.owner.show();return;}
this.owner.loadingResults=true;}
if(searching&&!(results&&results.length>(this.search_limit-1))){new AsyncRequest().setMethod('GET').setReadOnly(true).setData({q:text}).setURI('/ajax/universal_search.php').setHandler(function(text,results,response){if(this._searchQueryTimer){return;}
this.owner.loadingResults=false;var new_results=response.payload.results;if(!results){var results=[];}
for(var i=0;i<new_results.length;i++){if(results.length>(this.search_limit-1)){break;}
results.push(new_results[i]);}
this.owner.found_suggestions(results,text,false);}.bind(this,text,results)).send();return;}}
if(results&&non_people_search&&enough_tokens&&search_friend_source.WEBSEARCH_USER){results.push({t:_tx("Search Facebook"),ty:search_friend_source.TYPES.SEARCH,i:text});results.push({t:_tx("Search the Web"),ty:search_friend_source.TYPES.WEB,i:text});}
if(results&&this._allowed_types){results=results.filter(function(result){return this._allowed_types.contains(result.ty);}.bind(this));}
return results;};search_friend_source.prototype._sort_text_obj=function(a,b){var history=this.history?this.history.entries:undefined;if(history!=undefined){a.o=history[a.i]||a.o;b.o=history[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;window.ADVANCED_SEARCH_TYPEAHEAD=false;

function Template(source){copy_properties(this,{_templateSource:source});}
copy_properties(Template,{_operatorRepeat:function(s,data){var value='';var parts=s.match(/([^:]*):(.*)/);if(!parts){Util.warn('Invalid template call: %s',s);}else if(!TemplateRegistry.hasTemplate(parts[2])){Util.warn('Template not available: %s',s);}else{if(data[parts[1]]){var template=TemplateRegistry.getTemplate(parts[2]);var data_objs=arrayize(data[parts[1]]);value+=data_objs.map(function(template,data){return template.render(data);}.curry(template)).join(' ');}}
return value;}});copy_properties(Template.prototype,{getSource:function(){return this._templateSource;},render:function(template_data){var replaceFunction=function(data,all_matches,operator,key){switch(operator){case'H':return data[key]||'';case'R':return Template._operatorRepeat(key,data);default:return data[key]?htmlize(data[key]):'';}
return data[key]?translator(data[key]):'';}.curry(template_data||{});return this._templateSource.replace(/\$(H|R)?{([^\}]*)\}/g,replaceFunction);}});var TemplateRegistry={_storage:{},registerTemplate:function(name,template){if(typeof(template)=="string"){template=new Template(template);}
this._storage[name]=template;return this;},unregisterTemplate:function(name){delete this._storage[name];},hasTemplate:function(name){return name in this._storage;},getTemplate:function(name){if(this.hasTemplate(name)){return this._storage[name];}
return null;},registerServerSideTemplate:function(path,callback,synchronous,evaluate){callback=callback||bagofholding;synchronous=!!synchronous;evaluate=!!evaluate;if(this.hasTemplate(path)){callback();return this;}
var async=new AsyncRequest(path).setReadOnly(true).setMethod('GET').setOption('asynchronous',!synchronous).setOption('suppressEvaluation',!evaluate)
if(!synchronous){async.setErrorHandler(this._registerErrorHandler.bind(this,path)).setHandler(this._registerHandler.bind(this,path,evaluate,callback));}
async.send();if(synchronous){var template_source=this._stripHasteComments(async.transport.responseText);this.registerTemplate(path,new Template(template_source));callback();}
return this;},_registerErrorHandler:function(path,response){Util.warn('Failed to register template "%s"',path);},_registerHandler:function(path,evaluate,callback,response){var payload=response.getPayload();var template=null;if(evaluate){if(payload.template){template=payload.template;}}else{template=this._stripHasteComments(payload.responseText);}
if(template){this.registerTemplate(path,template);callback();}else{Util.error('No template found in response payload');}},_stripHasteComments:function(source){return source.replace(/^\s*\/\*\*?(.|\n)*\*\//m,'');},_onRegisterTemplate:function(type,data){if(type=='template/registerTemplate'){if(!data||!data.name||!data.template){Util.warn('TemplateRegister: Invalid template data.')}else{this.registerTemplate(data.name,data.template);}
return false;}
Util.warn('TemplateRegister: Invalid arbiter message type: %s',type);return true;}}
Arbiter.subscribe('template/registerTemplate',TemplateRegistry._onRegisterTemplate.bind(TemplateRegistry),Arbiter.SUBSCRIBE_ALL);

function TemplateObject(template,data){data=data||{};if(!(template instanceof Template)){if(TemplateRegistry.hasTemplate(template)){template=TemplateRegistry.getTemplate(template);}else if(template instanceof URI){TemplateRegistry.registerServerSideTemplate(template.toString(),null,true);template=TemplateRegistry.getTemplate(template);}}
if(template==null){throw new Error("Template could not be found");}
var rendered=template.render(data);copy_properties(this,{_nodes:HTML(rendered).getNodes(),_template:template,_rendered:rendered});TemplateObject.bindNodes(this._nodes,this);}
copy_properties(TemplateObject,{bindNodes:function(nodes,scope){var all_nodes=[];for(var i=0;i<nodes.length;i++){if(nodes[i].nodeType==DOM.NODE_TYPES.ELEMENT){all_nodes.push(nodes[i]);var node_collection=nodes[i].getElementsByTagName('*');all_nodes=all_nodes.concat(to_array(node_collection));}}
for(var i=0;i<all_nodes.length;i++){var bind_point=all_nodes[i].getAttribute('bindPoint');var listeners=all_nodes[i].getAttribute('listen');if(bind_point){if(hasArrayNature(scope[bind_point])){scope[bind_point].push(all_nodes[i]);}else{scope[bind_point]=all_nodes[i];}}
if(listeners){listeners.replace(/(\w+) *: *(\w+)/g,function(node,match_str,event_name,handler){if(typeof(this[handler])=="function"){Event.listen(node,event_name,bind(this,this[handler]));}else{Event.listen(node,event_name,bind(this,TemplateObject._eventWrapper,handler));}}.bind(scope,all_nodes[i]));}}},_eventWrapper:function(handler_name,event){if(typeof(this[handler_name])=="function"){return this[handler_name](event);}else{Util.warn('Event wrapper [%s] not defined for template object',handler_name);return true;}}});copy_properties(TemplateObject.prototype,{getNodes:function(){return this._nodes;},getRendered:function(){return this._rendered;}});

PresenceMessage={STARTED:'presence/started',SHUTDOWN:'presence/shutdown',RESTARTED:'presence/restarted',WINDOW_RESIZED:'presence/window-resized',TAB_CLOSED:'presence/tab-closed',TAB_OPENED:'presence/tab-opened',PRESENCE_UPDATER_READY:'presence/updater-ready',getAppMessageType:function(appid,event_name){return'presence/app_message:'+appid+':'+event_name;},getArbiterMessageType:function(event_name){return'presence/message:'+event_name;}};

function search_validate(search_input_id){var search_input=$(search_input_id);var value=search_input.value;if(!value.match(/^\s*$/)&&value!=search_input.getAttribute('placeholder')){return true;}
search_input.focus();return false;}

function NewsFeedEditor(filterKey){this.modified=false;this.filterKey=filterKey;NewsFeedEditor.instance=this;}
NewsFeedEditor.prototype.setAutoUpdate=function(checkbox,checkedValue,uncheckedValue){this.modified=true;var value;if(checkbox.checked){value=checkedValue;}else{value=uncheckedValue;}
new AsyncRequest().setURI('/ajax/feed/filter_action.php').setData({filter_key:this.filterKey,action:'auto_update',value:value}).send();}
NewsFeedEditor.prototype.addToNewsFeed=function(data){this.modified=true;new AsyncRequest().setURI('/ajax/feed/filter_action.php').setData({filter_key:this.filterKey,action:data.action,value:data.id}).setHandler(function(payload){ObjectBrowserController.getController(data.element).removeItem(data.id);}).send();}
NewsFeedEditor.show=function(filterKey,onModified){if(NewsFeedEditor.instance){return false;}
if(!onModified){onModified=bagofholding;}
var async=new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/feed/hidden_people_settings.php').setData({filter_key:filterKey});new Dialog().setAsync(async).setCloseHandler(function(){if(NewsFeedEditor.instance){if(NewsFeedEditor.instance.modified){onModified();}
delete NewsFeedEditor.instance;}}).show();return false;}

function Tabset(id,selectedId){if(!Tabset.instances){Tabset.instances={};}
Tabset.instances[id]=this;onunloadRegister(function(){Tabset.instances={}});this.id=id;this.selectedId=selectedId;}
Tabset.getInstance=function(id){if(Tabset.instances&&Tabset.instances[id]){return Tabset.instances[id];}
return null;}
Tabset.prototype.getFullTabId=function(tabId){return this.id+'_'+tabId;}
Tabset.prototype.selectTab=function(tabId,func,beforeClickFunc){if(beforeClickFunc&&!beforeClickFunc()){return false;}
if(this.selectedId){this.lastSelected=this.selectedId;CSS.removeClass(ge(this.selectedId),'Tabset_selected');}
this.selectedId=tabId;CSS.addClass(ge(this.selectedId),'Tabset_selected');if(func){return func();}
return true;}
Tabset.prototype.unselect=function(){if(this.selectedId){CSS.removeClass($(this.selectedId),'Tabset_selected');}}
Tabset.prototype.hasTabElem=function(id){return ge(this.id+'_'+id);}
Tabset.prototype.getTabElem=function(id){return $(this.id+'_'+id);}
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(title){this.root=null;this.wrap=null;this.icon=null;this.text=null;this.menu=null;this._title=title;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'},COLORS:{BLUE:'UIActionMenu_Blue'}});UIActionMenu.mixin('Arbiter',{_initialize:function(){var cancel=false,init=null;init=Event.listen(this.root,'mousedown',function(){this.buildMenu();init.remove();}.bind(this));if(ua.ie()){Event.listen(this.root,'mousedown',function(event){if(this.menuVisible()&&!DOM.contains(this.menu,event.getTarget())){document.body.focus();}}.bind(this));Event.listen(this.root,'activate',this.showMenu.bind(this));Event.listen(this.root,'deactivate',this.hideMenu.bind(this));Event.listen(this.root,'selectstart',Event.kill);}else{this.input=$N('input',{type:'button'});DOM.prependContent(this.wrap,this.input);Event.listen(this.root,'mousedown',function(event){var target=event.getTarget();if(DOM.contains(this.menu,target)){if(!DOM.isNode(target,'input')){setTimeout(function(){this.input.focus();}.bind(this),100);}
cancel=true;return;}
this.toggleMenu();this.input.focus();return false;}.bind(this));Event.listen(this.input,'blur',function(event){if(cancel){cancel=false;return;}
this.hideMenu();}.bind(this));}
Event.listen(this.wrap,'click',function(event){event.kill();});},menuVisible:function(){return CSS.hasClass(this.root,'UIActionMenu_Active');},hideMenu:function(){CSS.removeClass(this.root,'UIActionMenu_Active');return this;},showMenu:function(){this.inform('menuActivated');CSS.addClass(this.root,'UIActionMenu_Active');return this;},toggleMenu:function(){if(this.menuVisible()){return this.hideMenu();}else{return this.showMenu();}},setAlignRight:function(right){CSS.conditionClass(this.root,'UIActionMenu_AlignRight',right);return this;},setContentCallback:function(fn){this._contentCallback=fn;return this;},setSuppressButton:function(suppress){CSS.conditionClass(this.root,'UIActionMenu_SuppressButton',suppress);return this;},setSuppressText:function(suppress){CSS.conditionClass(this.root,'UIActionMenu_SuppressText',suppress);return this;},setColor:function(color){switch(color){case UIActionMenu.COLORS.BLUE:if(this.color){CSS.removeClass(this.root,this.color);}
CSS.addClass(this.root,color);this.color=color;break;default:if(this.color){CSS.removeClass(this.root,this.color);this.color=null;}}
return this;},setIcon:function(icon){switch(icon){case UIActionMenu.ICONS.LOCK:CSS.addClass(this.root,'UIActionMenu_IconIncluded');CSS.addClass(this.icon,icon);break;default:CSS.removeClass(this.root,'UIActionMenu_IconIncluded');Util.error('invalid icon passed to `UIActionMenu.setIcon`');}
return this;},_getContent:function(){var content=this._contentCallback();if(this.input){var inputs=DOM.scry(content,'input');inputs.each(function(input){Event.listen(input,'blur',function(){this.input.focus();}.bind(this));},this);}
return content;},setTitle:function(title){this._title=title;DOM.setContent(this.text,this._title);return this;},setTooltip:function(tooltip){if(this.tooltip){if(tooltip){DOM.setContent(this.tooltip.firstChild,tooltip);}else{DOM.remove(this.tooltip);CSS.removeClass(this.wrap,'UITooltip');this.tooltip=null;}}else{this.tooltip=$N('span',{className:'UITooltip_Wrap'},$N('span',{className:'UITooltip_Text'},tooltip));CSS.addClass(this.wrap,'UITooltip');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(items,callback,mode){mode=mode||UISelectList.MULTI_SELECT_MODE;this.setContentCallback(function(){this._selectList=new UISelectList().setMode(mode).setCallback(function(checked,key){this.hideMenu();callback&&callback(checked,key);}.bind(this)).addItems(items);return this._selectList.getElement();}.bind(this));return this;},resetSelectList:function(){this._selectList&&this._selectList.reset();},getSelectList:function(){return this._selectList;}});

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