/*
HTTP Host: static.ak.fbcdn.net
Generated: March 16th 2010 6:29:00 AM PDT
Machine: 10.16.140.102
Locale: nu_ll
Path: js/84552j2eyk8wkoo4.pkg.js
*/

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

var message_dialog={_registered:false,register:function(){if(!message_dialog._registered){LinkController.registerHandler(_message_composer_link_handler);message_dialog._registered=true;}},show:function(_L0,_L1,_L2,ref){_L1=_L1?_L1:'';_L2=_L2?_L2:'';var _L4={'id':_L0,'subject':_L1,'message':_L2};var _L5=new AsyncRequest().setMethod('POST').setData(_L4).setContextData('clicktype','Send a Message',ref==="profile_others").setURI('/ajax/inbox/composer.php');new Dialog().setStackable(true).setContentWidth(500).setAsync(_L5).show();return false;},send:function(_L0){var _L1=serialize_form(_L0.form);_L1['action']='compose';new AsyncRequest().setURI('/ajax/inbox/ajax.php').setData(_L1).setHandler(bind(null,message_dialog.send_handle,_L0)).setErrorHandler(bind(null,message_dialog.send_error,_L0)).send();},send_handle:function(_L0,r){var _L2=r.getPayload();var _L3=Dialog.getCurrent();if(_L3){_L3.setTitle(_L2.title).setBody(_L2.content).setButtons([Dialog.OK]).clearHandler().show();if(!_L2.error)_L3.setAutohide(2000);}},send_error:function(_L0,r){var _L2=Dialog.getCurrent();if(_L2){if(r.getError()==kError_Inbox_DuplicateMessages){_L2.hide();return;}_L2.setTitle(_tx("Error")).setBody(_tx("Sorry, an unknown error occurred")).setButtons([Dialog.OK]).clearHandler().show().setAutohide(1100);}}};function _message_composer_link_handler(_L0){return true;var _L1=URI.getRequestURI();if(_L1.getPath().match(/^\/inbox\//))return true;var uri=new URI(_L0.href);if(uri.getPath()=='/inbox/'){var _L3=uri.getQueryData();if((typeof _L3.compose!="undefined")&&(typeof _L3.id!="undefined")&&(_L3.id<2.2e+09)){message_dialog.show(_L3.id);return false;}}return true;}
function Megaboxx(){this._endpoint='/ajax/inbox/ajax.php';}copy_properties(Megaboxx,{_instance:null,getInstance:function(){if(!Megaboxx._instance)Megaboxx._instance=new Megaboxx();return Megaboxx._instance;}});Megaboxx.prototype.select_dropdown_onchange=function(obj){if(obj.value=='^_^')return false;var _L1=obj.value?this['STATUS_'+obj.value.toUpperCase()]:this.STATUS_NONE;this.set_selection(_L1);};Megaboxx.prototype.status_menu_onclick=function(obj,_L1,_L2){_L2=_L2?_L2:this.get_selected_threads();if(!_L2.length||(typeof obj=='object'&&obj.parentNode.className.indexOf('disabled')!=-1)){this.update_status_buttons();return false;}this.reload_needed=false;var _L3={action:_L1,ids:_L2,folder:megaboxx_data.folder,time:megaboxx_data.time};if(_L1=='delete'){if(typeof obj=='boolean'&&obj){var _L4=ge('megaboxx');for(var i=0;i<_L2.length;i++){var row=document.getElementById('thread_'+_L2[i]);row.parentNode.removeChild(row);}_L3.page=megaboxx_data.page;_L3.nav_base=megaboxx_data.nav_base;_L3.slice=_L4.getElementsByTagName('tr').length;var _L7=ge('loading_boxx');if(!_L4.getElementsByTagName('tr').length)this.reload_needed=true;if(!_L7){var _L7=document.createElement('div');_L7.innerHTML=['<table id="loading_boxx" class="',_L4.className,'"><tr><td></td></tr></table>'].join('');_L7=_L7.getElementsByTagName('table')[0];_L4.parentNode.insertBefore(_L7,_L4.nextSibling);}else _L7.style.display='';}else{var _L8;if(_L2.length==1){_L8=_tx("Are you sure you want to delete this thread?");}else _L8=_tx("Are you sure you want to delete these threads?");var _L9=new ContextualDialog().setContext(obj).setTitle(_L8).setBody(_tx("This will remove the associated messages.")).setButtons([Dialog.DELETE,Dialog.CANCEL]).setHandler(function(){this.status_menu_onclick(true,_L1,_L2);_L9.hide();}.bind(this)).show();return false;}}else for(var i=0;i<_L2.length;i++){var row=document.getElementById('thread_'+_L2[i]);var _La=this.get_status(row);if(_L1=='toggle_read'){if(_La==this.STATUS_UNREAD){_L1='mark_read';}else _L1='mark_unread';_L3.action=_L1;}if(_L1=='mark_read'){CSS.removeClass(row,'new_message');}else CSS.setClass(row,trim(row.className.replace(/ ?new_message ?|$/,' new_message ')));}new AsyncRequest().setHandler(this.ajax_callback.bind(this)).setData(_L3).setURI(this._endpoint).send();this.update_status_buttons();var _Lb=ge('message_selector');_Lb?_Lb.selectedIndex=0:false;return false;};Megaboxx.prototype.ajax_callback=function(_L0){var _L1=_L0.getPayload();if(typeof _L1=='undefined')return;if(_L1=='refresh'||this.reload_needed){document.location.reload();return;}if(typeof(_L1.nav)!='undefined'&&(megabox_pager=ge('megabox_pager')))$('megaboxx_pager').innerHTML=_L1.nav;if(typeof(_L1.rows)!='undefined'){if(_L1.rows){var _L2=document.createElement('tbody');var _L3=ge('megaboxx');_L3.appendChild(_L2);_L2.innerHTML=_L1.rows;var _L4=_L2.getElementsByTagName('tr');var _L5=$('megaboxx').getElementsByTagName('tbody')[0];while(_L4.length)_L5.appendChild(_L4[0]);_L2.parentNode.removeChild(_L2);}$('loading_boxx').style.display='none';}if(typeof(_L1.top_nav)!='undefined')$('nav_inbox').setContent(HTML(_L1.top_nav));if(typeof(_L1.dropdown)!='undefined')$('fb_menu_inbox_dropdown').setContent(HTML(_L1.dropdown));};Megaboxx.prototype.selection_onchange=function(obj){this.update_status_buttons();};Megaboxx.prototype.get_status=function(row){if(row.className.indexOf('new_message')!=-1){return this.STATUS_UNREAD;}else return this.STATUS_READ;};Megaboxx.prototype.get_thread_id=function(row){return /thread_(\d+)/.exec(row.id)[1];};Megaboxx.prototype.is_selected=function(row){var _L1=row.getElementsByTagName('input');return _L1.length&&_L1[0].checked;};Megaboxx.prototype.get_selected_threads=function(){var _L0=$('megaboxx').getElementsByTagName('tr');var _L1=[];for(var i=0;i<_L0.length;i++)if(this.is_selected(_L0[i]))_L1.push(this.get_thread_id(_L0[i]));return _L1;};Megaboxx.prototype.set_selection=function(_L0){var _L1=$('megaboxx').getElementsByTagName('tr');var _L2=[];for(var i=0;i<_L1.length;i++)if(!_L0||this.get_status(_L1[i])==_L0)_L2.push(this.get_thread_id(_L1[i]));this.select_threads(_L2,true);};Megaboxx.prototype.select_threads=function(_L0,set){var _L2=$('megaboxx').getElementsByTagName('tr');for(var i=0;i<_L2.length;i++)if(_L0.indexOf(this.get_thread_id(_L2[i]))!=-1){_L2[i].getElementsByTagName('input')[0].checked=true;}else if(set)_L2[i].getElementsByTagName('input')[0].checked=false;this.update_status_buttons();};Megaboxx.prototype.update_status_buttons=function(){var _L0=ge('inbox_status_buttons');if(!_L0)return;var _L1=this.get_selected_threads();var _L2=true;var _L3=true;for(var i=0;i<_L1.length;i++){var _L5=this.get_status(ge('thread_'+_L1[i]));if(_L5==this.STATUS_UNREAD){_L3=false;}else _L2=false;}var _L6=ge('message_selector');if(!_L1.length&&_L6)_L6.selectedIndex=0;var _L7=_L3&&_L2;var li=_L0.getElementsByTagName('li');var _L9=[{l:li[0],d:_L2},{l:li[1],d:_L3},{l:li[2],d:_L7}];for(var i=0;i<_L9.length;i++)if(_L9[i].l)CSS.setClass(_L9[i].l,trim(_L9[i].l.className.replace('menu_disabled',''))+(_L9[i].d?' menu_disabled':''));};Megaboxx.prototype.submit_prehook=function(obj,_L1,_L2){var _L3=ge('compose_message');var _L4=trim(_L3.message.value).length;var _L5=null;var ids=ge('ids');var _L7=ge('fbpage_update');var _L8=inboxAttachments.attachment_added||(_L3.subject&&trim(_L3.subject.value).length);if(_L4==0&&!_L8){_L5=_tx("You may not send a message without any text.");}else if(_L4>10000){_L5=_tx("Your message is too long. Please shorten your message and try again.");}else if(!_L7&&ids&&tokenizer.is_empty(ids))_L5=_tx("You must specify at least one recipient for this message.");if(_L5){var _L9=ge('error');if(_L9)_L9.parentNode.removeChild(_L9);_L9=document.createElement('div');_L9.id='error';_L9.innerHTML='<h2>'+_L5+'</h2>';_L3.insertBefore(_L9,_L3.firstChild);var _La=ge('conf');if(_La)_La.parentNode.removeChild(_La);return false;}if(_L3.rand_id.value==0)_L3.rand_id.value=Math.floor((Math.random()*1e+08));if(inboxAttachments)inboxAttachments.fix_app_inputs_on_send();if(_L1){var _L3=obj.form;var _Lb={action:'send_reply',id:_L3.thread.value,message:_L3.message.value};if(_L2)for(var i=0;i<_L2.length;i++)_Lb[_L2[i].name]=_L2[i].value;var _Ld=ge(inboxAttachments.view_id);var _Le=[];if(_Ld){_Le=_Ld.getElementsByTagName('input');for(var i=0;i<_Le.length;i++)_Lb[_Le[i].name]=_Le[i].value;}if(_L3.extra&&_L3.extra.checked)_Lb['extra']=_L3.extra.value;new AsyncRequest().setURI(this._endpoint).setData(_Lb).setStatusElement('message_post_status').setHandler(this.sendMessageHandler.bind(this,_L3.thread.value)).setErrorHandler(this.sendMessageErrorHandler.bind(this)).setFinallyHandler(function(_L12){get_all_form_inputs(_L3).each(function(obj){obj.disabled=false;});}).send();_Le=[_L3.getElementsByTagName('textarea')[0]];var _Lf=_L3.getElementsByTagName('input');for(var i=0;i<_Lf.length;i++)if(_Lf[i].type=='button')_Le.push(_Lf[i]);for(var i=0;i<_Le.length;i++)_Le[i].disabled=true;}else if(_L2){var _L3=ge('compose_message');var span=document.createElement('span');var html=[];for(var i=0;i<_L2.length;i++)html.push('<input type="hidden" name="',_L2[i].name,'" value="',htmlspecialchars(_L2[i].value),'" />');span.innerHTML=html.join('');_L3.appendChild(span);_L3.onsubmit=null;_L3.submit();}return !_L1;};Megaboxx.prototype.sendMessageHandler=function(_L0,_L1){var _L2=ge('compose_message');if(_L2&&_L2.thread&&_L2.thread.value==_L0){var _L3=_L1.getPayload();var _L4=ge('messages');var msg=document.createElement('div');_L4.appendChild(msg);set_inner_html(msg,_L3);_L2.getElementsByTagName('textarea')[0].value='';var i=0;var msg=null;while(msg=ge('msg_'+(i++)))CSS.removeClass(msg,'unread');inboxAttachments.remove_attachment_view();this.enable_all_attachment_forms();var _L7=ge('hidden_count');if(_L7){_L7.innerHTML=parseInt(_L7.innerHTML,10)+1;var _L8=ge('total_count');_L8.innerHTML=parseInt(_L8.innerHTML,10)+1;}var _L9=ge('error');if(_L9)_L9.parentNode.removeChild(_L9);}};Megaboxx.prototype.sendMessageErrorHandler=function(_L0){var _L1=ge('error');if(_L1)_L1.parentNode.removeChild(_L1);var _L2=DOM.scry($('content'),'#conf .status');if(_L2.length>0)_L2[0].parentNode.removeChild(_L2[0]);var _L3=ge('messages');var _L4=_L0.getPayload();var _L5=_L0.getErrorSummary();var _L6=_L0.getErrorDescription();if(_L3){var _L7='';var id='';var cl='';if(_L4){_L7=_L4;}else if(_L5){id='error';cl='error';_L7='<h2 id="standard_error">'+_L5+'</h2>'+'<p id="standard_explanation">'+_L6+'</p>';}var msg=$N('div',{className:cl},HTML(_L7));if(id)msg.id=id;_L3.appendChild(msg);}};Megaboxx.prototype.submit_delete=function(obj){new Dialog().setTitle(_tx("Delete Thread")).setBody(_tx("Are you sure you want to delete this thread?")).setButtons([Dialog.DELETE,Dialog.CANCEL]).setHandler(function(){var _L1='<input name="delete" type="hidden" value="1" />'+'<input name="folder" type="hidden" value="'+megaboxx_data.folder+'" />'+'<input name="time" type="hidden" value="'+megaboxx_data.time+'" />';var _L2=$N('span',{},HTML(_L1));obj.appendChild(_L2);var _L3=obj.getElementsByTagName('input')[0].form;if(megaboxx_data.folder)_L3.action+='?f=1';_L3.submit();}).show();return false;};Megaboxx.prototype.toggle_all_attachment_forms=function(_L0){(_L0?hide:show)(ge('dd_attachment'));(_L0?hide:show)(ge('dt_attachment'));};Megaboxx.prototype.enable_all_attachment_forms=function(){this.toggle_all_attachment_forms(false);};Megaboxx.prototype.disable_all_attachment_forms=function(){this.toggle_all_attachment_forms(true);};Megaboxx.prototype.reset_rand_id=function(){var _L0=ge('compose_message');if(!_L0||!_L0.rand_id)return;_L0.rand_id.value=0;};Megaboxx.prototype.fetch_thread_history=function(_L0,_L1){_L1.innerHTML='<span class="loading"><span>'+_tx("Loading...")+'</span></span>';new AsyncRequest().setURI(this._endpoint).setData({id:megaboxx_data.thread_id,action:'history',count:_L0,folder:megaboxx_data.folder}).setHandler(function(_L2){var _L3=document.createElement('div');_L1.parentNode.insertBefore(_L3,_L1);hide(_L1);set_inner_html(_L3,_L2.getPayload());}).send();};Megaboxx.prototype.STATUS_ALL=0;Megaboxx.prototype.STATUS_READ=1;Megaboxx.prototype.STATUS_UNREAD=2;Megaboxx.prototype.STATUS_NONE=-1;if(typeof tokenizer!='undefined')tokenizer.prototype.onselect=function(){Megaboxx.getInstance().reset_rand_id();};function inbox_search_onsubmit(_L0){if(_L0){goURI(_L0.u);return false;}}function inbox_search_note_close(){AsyncRequest.pingURI('/ajax/inbox/search_note_close.php',{},false);hide(ge('inbox_search_note'));}
function ScrollArea(_L0,_L1,_L2,_L3){if(this===window){Util.error('You\'re doing this wrong.  This is a class and should be '+'with new ScrollArea(...);');return;}copy_properties(this,{scroll_div:$(_L0),content_div:$(_L1),down_arrow:$(_L2),up_arrow:$(_L3)});copy_properties(this,{auto_move_interval:null,allow_page_scroll:true,max_height:false});this.down_arrow.onmouseout=bind(this,'_endAutoMove',ScrollArea.DOWN);this.down_arrow.onmouseover=bind(this,'_startAutoMove',ScrollArea.HOVER_INTERVAL,ScrollArea.DOWN);this.up_arrow.onmouseout=bind(this,'_endAutoMove',ScrollArea.UP);this.up_arrow.onmouseover=bind(this,'_startAutoMove',ScrollArea.HOVER_INTERVAL,ScrollArea.UP);this.scroll_div.onmouseover=bind(this,'_disallowPageScroll');this.scroll_div.onmouseout=bind(this,'_allowPageScroll');ScrollWheel.addHandler(this._pageScrollResponse.bind(this));ScrollArea.instances.push(this);this.update();}copy_properties(ScrollArea,{HOVER_INTERVAL:50,MOUSE_WHEEL_MULTIPLE:-8,UP:1,DOWN:2,instances:[],build:function(id,_L1,_L2){var _L3=id+'_content';var _L4=id+'_scroll';var _L5=id+'_down';var _L6=id+'_up';var _L7=$N('div',{'className':'scroll_area_content','id':_L3},_L1);var _L8=$N('a',{'className':'arrow down_arrow','id':_L5},HTML('<span>&nbsp;</span>'));_L8.listen('click',Event.kill);var _L9=$N('a',{'className':'arrow up_arrow','id':_L6},HTML('<span>&nbsp;</span>'));_L9.listen('click',Event.kill);var _La=$N('div',{'className':'scroll_area_scroll','id':_L4});_La.appendChild(_L7);_La.appendChild(_L8);_La.appendChild(_L9);var _Lb=$N('div',{'id':id},_La);(function(_L4,_L3,_L5,_L6,_L2){new ScrollArea(_L4,_L3,_L5,_L6).setMaxHeight(_L2);}).bind(this,_L4,_L3,_L5,_L6,_L2).defer();return _Lb;},getInnerInstance:function(_L0){for(var i=0;i<ScrollArea.instances.length;i++)if(DOM.contains(_L0,ScrollArea.instances[i].scroll_div))return ScrollArea.instances[i];return false;}});copy_properties(ScrollArea.prototype,{_startAutoMove:function(_L0,_L1){if(_L1==ScrollArea.UP){this.up_arrow.addClass('arrow_hover');this.up_arrow.addClass('up_arrow_hover');}else{this.down_arrow.addClass('arrow_hover');this.down_arrow.addClass('down_arrow_hover');}var _L2=bind(this,this.moveBy,(_L1==ScrollArea.UP)?-11:11);this.auto_move_interval=setInterval(_L2,_L0);},_endAutoMove:function(_L0){if(_L0==ScrollArea.UP){this.up_arrow.removeClass('arrow_hover');this.up_arrow.removeClass('up_arrow_hover');}else{this.down_arrow.removeClass('arrow_hover');this.down_arrow.removeClass('down_arrow_hover');}clearInterval(this.auto_move_interval);},_disallowPageScroll:function(){this.allow_page_scroll=false;},_allowPageScroll:function(){this.allow_page_scroll=true;},_pageScrollResponse:function(_L0){if(!this.allow_page_scroll){var _L1=_L0>0?Math.ceil:Math.floor;this.moveBy(ScrollArea.MOUSE_WHEEL_MULTIPLE*_L1(_L0));}return this.allow_page_scroll;},_scrollTop:function(){return (-1*parseInt(this.content_div.style.marginTop))||0;},_setScrollTop:function(_L0){_L0=this._enforceRange(_L0);this.content_div.style.marginTop=-_L0+'px';},_isAtTop:function(){return this._scrollTop()==0;},_isAtBottom:function(){var _L0=this._scrollTop();return _L0==this._enforceRange(_L0+1);},_enforceRange:function(_L0){var _L1;var _L2=Vector2.getElementDimensions(this.content_div).y-Vector2.getElementDimensions(this.scroll_div).y;if(_L0<0){_L1=0;}else if(_L0>_L2){_L1=_L2;}else _L1=_L0;return _L1;},setMaxHeight:function(_L0){this.max_height=_L0;return this;},moveBy:function(_L0){var _L1=this._scrollTop();var _L2=_L1+_L0;this._setScrollTop(_L2);this.update();return this;},moveTo:function(_L0){this._setScrollTop(_L0);this.update();return this;},update:function(){var _L0=Vector2.getElementDimensions(this.content_div);var _L1=Vector2.getElementDimensions(this.scroll_div);if(_L0.y)if(_L0.y>=this.max_height&&_L1.y!=this.max_height){this.scroll_div.style.height=this.max_height+'px';}else if(_L0.y<this.max_height&&_L1.y!=_L0.y)this.scroll_div.style.height=_L0.y+'px';this._isAtTop()?CSS.addClass(this.scroll_div,'at_top'):CSS.removeClass(this.scroll_div,'at_top');this._isAtBottom()?CSS.addClass(this.scroll_div,'at_bottom'):CSS.removeClass(this.scroll_div,'at_bottom');return this;}});ScrollWheel=function(){var _L0=false;var _L1=[];var _L2=function(_L3){var _L4=0;_L3=$E(_L3);if(_L3.wheelDelta){_L4=_L3.wheelDelta/120;if(ua.opera())_L4=-_L4;}else if(_L3.detail)_L4=-_L3.detail/3;if(_L4)for(var i=0;i<_L1.length;i++)if(!_L1[i](_L4)){Event.kill(_L3);return;}};return {addHandler:function(_L3){if(!_L0){if(window.addEventListener)window.addEventListener('DOMMouseScroll',_L2,false);window.onmousewheel=document.onmousewheel=_L2;_L0=true;}_L1.push(_L3);}};}();
function StatusEditor(_L0,_L1){this.rootElem=_L0;this.profile_id=_L1;this.statusInput=DOM.find(_L0,'input.status_input');this.placeholder=this.getPlaceholder();this.emptyValue=this.statusInput.value;this.initialValue='';this.location_id=false;this.locationEnabled=false;this._attach();var ix=StatusEditor.instances.push(this)-1;onunloadRegister(function(){delete StatusEditor.instances[ix];});}StatusEditor.instances=[];StatusEditor.update=function(_L0,_L1,_L2){StatusEditor.instances.forEach(function(_L3){if(_L3!=_L2)_L3._onUpdate(_L0,_L1);});};StatusEditor.poll=function(){new AsyncRequest().setURI('/ajax/poll_status.php').setMethod('GET').setReadOnly(true).setOption('bundle',true).setHandler(function(r){var _L1=r.getPayload();StatusEditor.update(_L1,null);}).send();};StatusEditor.prototype._onUpdate=bagofholding;StatusEditor.prototype.getPlaceholder=function(){var _L0=DOM.find(this.rootElem,'input.status_placeholder_input');return _L0;};StatusEditor.prototype._attach=function(){this.statusInput.listen('keypress',this.onkeypress.bind(this));this.statusInput.listen('blur',this.onInputBlur.bind(this));this.placeholder.listen('focus',this._onFocused.bind(this));var _L0=DOM.scry(this.rootElem,'a.location_add_button');for(var i=0;i<_L0.length;i++){_L0[i].listen('click',this._onAddLocation.bind(this));show(_L0[i]);}if(this.locationEnabled)DOM.find(this.rootElem,'a.location_remove_button').listen('click',this._onRemoveLocation.bind(this));};StatusEditor.prototype.onkeypress=function(_L0){switch(Event.getKeyCode(_L0)){case KEYS.ESC:this.statusInput.value=this.emptyValue;this.statusInput.blur();break;case KEYS.RETURN:this.post();return $E(_L0).kill();}};StatusEditor.prototype.onInputBlur=function(){var _L0=trim(this.statusInput.value);if(this.isNonedit(_L0))this.reset();};StatusEditor.prototype.clear=function(){new AsyncRequest().setURI('/ajax/updatestatus.php').setData({'profile_id':this.profile_id,'clear':1}).setHandler(function(){this._onCleared();StatusEditor.update({'markup':''},null,this);}.bind(this)).send();return false;};StatusEditor.prototype._onCleared=bagofholding;StatusEditor.prototype._onFocused=bagofholding;StatusEditor.prototype._onAddLocation=bagofholding;StatusEditor.prototype._onRemoveLocation=bagofholding;StatusEditor.prototype.setLocationSelector=function(_L0){var _L1=function(loc){if(this.location_id!==false)this.location_id=loc.id;}.bind(this);this._locationSelector=_L0;_L0.setLocationHandler(_L1);this.locationEnabled=true;};StatusEditor.prototype.startEdit=function(_L0){this.statusInput.value=_L0;this.initialValue=_L0;this.placeholder.focus();};StatusEditor.prototype.reset=function(){CSS.removeClass(this.rootElem,'placeholder_off');};StatusEditor.prototype.isNonedit=function(_L0){return !_L0||(_L0==trim(this.emptyValue))||(this.initialValue&&(_L0==this.initialValue));};StatusEditor.prototype.post=function(_L0){var _L1=trim(this.statusInput.value);if(this.isNonedit(_L1))return;this.statusInput.disabled=true;CSS.addClass(this.rootElem,'disabled');this.statusInput.blur();var _L2={'profile_id':this.profile_id,'status':_L1};var _L3=URI.getRequestURI();if(_L3.getPath()=='/profile.php'){_L2['profile']=true;}else if(_L3.getPath()=='/home.php'||_L3.getPath()=='/widgets/livefeed.php')if(window.HomeFeed){var _L4=HomeFeed.getInstance();if(_L4)_L2['home_tab_id']=_L4.tabId;}if(ge('status_publish_all'))_L2['publish_all']=ge('status_publish_all').checked;if(ge('post_to_profile'))_L2['post_to_profile']=ge('post_to_profile').checked;if(this.app_id)_L2['app_id']=this.app_id;if(this.stream_id)_L2['live_stream_id']=this.stream_id;if(this.location_id)_L2['location_id']=this.location_id;if(_L0)copy_properties(_L2,_L0);_L2['hey_kid_im_a_composer']=true;new AsyncRequest().setURI('/ajax/updatestatus.php').setData(_L2).setFinallyHandler(function(){this.statusInput.disabled=false;CSS.removeClass(this.rootElem,'disabled');}.bind(this)).setHandler(function(r){this.reset();this.initialValue=this.statusInput.value;var _L6=r.getPayload();this._onPosted(_L6);StatusEditor.update(_L6,null,this);}.bind(this)).send();};StatusEditor.prototype._onPosted=bagofholding;function HomeStatusEditor(_L0,_L1){this.parent.construct(this,_L0,_L1);if(this.showsStatusBody()){this.statusBody=DOM.find(_L0,'div.status_body');DOM.find(_L0,'a.status_clear_link').onclick=this.clear.bind(this);}this.postButton=DOM.find(_L0,'input[type="submit"]');this.postButton.listen('click',this.post.shield(this));}HomeStatusEditor.extend('StatusEditor');HomeStatusEditor.prototype.showsStatusBody=function(){return true;};HomeStatusEditor.prototype._onPosted=function(_L0){this._onUpdate(_L0);};HomeStatusEditor.prototype._onUpdate=function(_L0,_L1){var _L2=_L0.markup;if(!_L2)this._onCleared();if(this.showsStatusBody()&&_L2){DOM.find(this.rootElem,'span.status_text').setContent(HTML(_L2));DOM.find(this.rootElem,'span.status_time').setContent(HTML(_L1||_tx("a moment ago&nbsp;")));var _L3=DOM.scry(this.rootElem,'span.status_location')[0];if(!_L0.location_label){if(_L3)hide(_L3);}else{if(!_L3)DOM.insertAfter(DOM.find(this.rootElem,'span.status_time'),$N('span',{className:'status_location'},[_tx("near {location}",{location:''}),$N('a',{href:_L0.location_href,target:'_blank'},_L0.location_label)]));show(_L3);}if(CSS.hasClass(this.statusBody,'status_empty')){CSS.removeClass(this.statusBody,'status_empty');animation(this.statusBody).to('height','auto').from('0px').to('opacity',1).from(0).blind().show().duration(300).ease(animation.ease.end).go();}else animation(this.statusBody).to('opacity',1).from(0).duration(300).go();}var _L4=window.HomeFeed&&HomeFeed.getInstance();if(_L4){if(_L0.feed){var _L5=_L4.tabId;if(_L5==_L0.feed_tab){var _L6=document.createElement('div');CSS.setClass(_L6,'just_updated_status');_L6.style.display='none';DOM.setContent(_L6,HTML(_L0.feed));var _L7=$('newsfeed_wrapper');var _L8=DOM.scry(_L7,'div.tab_top_stories')[0];_L7.prependContent(_L6);if(_L8&&_L8.firstChild&&CSS.hasClass(_L8.firstChild,'one_liner_cluster'))animation(_L8.firstChild).to('padding-top','0px').duration(300).go();animation(_L6).to('height','auto').from('0px').to('opacity',1).from(0).blind().show().duration(300).ease(animation.ease.end).go();}_L4.removeStoryStatusMessage();}if(_L0.top_status_stories&&_L4.tabId==HomeFeed.TAB_TOP_STORIES){var _L7=$('newsfeed_wrapper');var _L8=DOM.scry(_L7,'div.tab_top_stories')[0];if(_L8&&_L8.firstChild&&CSS.hasClass(_L8.firstChild,'one_liner_cluster')){var _L9=DOM.scry(_L8.firstChild,'div.status_story_wrapper');_L9.forEach(function(_La){_La.remove();});DOM.prependContent(_L8.firstChild,HTML(_L0.top_status_stories));}}}};HomeStatusEditor.prototype._onCleared=function(){CSS.addClass(this.statusBody,'status_empty');animation(this.statusBody).to('height','0px').to('opacity',0).from(1).blind().hide().duration(300).ease(animation.ease.end).go();};HomeStatusEditor.prototype._onAddLocation=function(_L0){CSS.addClass(this.rootElem,'location_composer_shown');var loc=this._locationSelector.getLocation();if(loc)this.location_id=loc.id;return false;};HomeStatusEditor.prototype._onRemoveLocation=function(_L0){CSS.removeClass(this.rootElem,'location_composer_shown');this.location_id=null;return false;};function LiveFeedWidgetStatusEditor(_L0,_L1){this.parent.construct(this,_L0,_L1);this.publish_line=ge('status_publish_all_line');this.publish_line_hover=false;if(this.publish_line){this.publish_line.listen('mouseover',function(){this.publish_line_hover=true;}.bind(this));this.publish_line.listen('mouseout',function(){this.publish_line_hover=false;}.bind(this));}}LiveFeedWidgetStatusEditor.extend('HomeStatusEditor');LiveFeedWidgetStatusEditor.prototype.showsStatusBody=function(){return false;};LiveFeedWidgetStatusEditor.prototype.setApplicationId=function(_L0){this.app_id=_L0;return this;};LiveFeedWidgetStatusEditor.prototype.setStreamId=function(_L0){this.stream_id=_L0;return this;};LiveFeedWidgetStatusEditor.prototype._onFocused=function(_L0){this.parent._onFocused(_L0);if(this.publish_line)this.publish_line.addClass('show_publish_checkbox');};LiveFeedWidgetStatusEditor.prototype.reset=function(_L0){if(this.publish_line_hover)return;this.parent.reset();if(this.publish_line)this.publish_line.removeClass('show_publish_checkbox');};LiveFeedWidgetStatusEditor.prototype.post=function(){var _L0=true;var _L1=true;if(ge('status_publish_all'))_L1=ge('status_publish_all').checked;if(ge('post_to_profile'))_L0=ge('post_to_profile').checked;var _L2=HomeFeed.getInstance();if(_L2){_L2.setSkipCDNTillNextStory(true);var _L3=_L2.getTab();if(_L3==HomeFeed.TAB_LIVEWIDGET_EVERYONE&&!_L1||_L3==HomeFeed.TAB_LIVEWIDGET_FRIENDS&&!_L0)this.showNotification();}this.parent.post();};LiveFeedWidgetStatusEditor.prototype.showNotification=function(){var _L0=ge('status_notification_line');if(_L0)animation(_L0).to('opacity',1).from('opacity',0).show().duration(1000).checkpoint().duration(3000).checkpoint().to('opacity',0).from('opacity',1).duration(1000).hide().go();};LiveFeedWidgetStatusEditor.savePublishAllSetting=function(_L0){if(ge('status_publish_all')){var _L1=ge('status_publish_all').checked;new AsyncSignal('/ajax/live_feed_settings.php',{'publish_all':_L1,'widget_app_id':_L0}).send();}};LiveFeedWidgetStatusEditor.savePostToProfileSetting=function(_L0){if(ge('post_to_profile')){var _L1=ge('post_to_profile').checked;new AsyncSignal('/ajax/live_feed_settings.php',{'post_to_profile':_L1,'widget_app_id':_L0}).send();}};
function Friends(){}copy_properties(Friends,{_id:0,_flid:0,_view:'everyone',_q:'',_my_friends:0,_nk:0,_nt:0,_st:0,_s:0,_p:0,_pagination:false,_from_go:false,_lists:[],_invert:{},_friend_pages:[],_adv_init:0,_fmpt_tab:{'mutual':1,'everyone':1,'recent':1,'status':1,'phonebook':1},_PAGE_SIZE:100,_index:true,_DEFAULT_LIST_NAME:'< '+_tx("New List")+' >',initialize:function(id,_L1,_L2,_L3,_L4,_L5,nk){this._id=id;this._flid=_L1;this._view=_L2;this._my_friends=_L3;this._PAGE_SIZE=_L4;this._friend_pages=_L5;this._nk=nk;this._adv_init=0,document.onselectstart=chain(document.onselectstart,Friends.select);PageTransitions.registerHandler(bind(Friends,'pageTransitionHandler'));$('friends_target').setContent(HTML(this._friend_pages[0]));Friends.setListsMode();if(_L3)Friends._hookLoadListMembership();if(!this._flid&&(this._view=='everyone'||!this._fmpt_tab[this._view]))this.showAdvanced();if(this._view=='status'){show('status_editor_friends');}else hide('status_editor_friends');},_hookLoadListMembership:function(){new AsyncRequest().setReadOnly(true).setMethod("GET").setURI('/friends/ajax/friends.php').setData({'membership':1}).setHandler(function(r){Friends._lists=r.getPayload().lists;Friends._invert=r.getPayload().invert;}).send();},_hookAddToList:function(_L0,uid){if(lists=Friends._invert[uid]){var add=true;for(var i=0;i<lists.length;++i)if(lists[i]==_L0){add=false;break;}if(add)Friends._invert[uid].push(_L0);}else Friends._invert[uid]=[_L0];Friends._hookBuildListsUI(uid);},_hookRemoveFromList:function(_L0,uid){if(lists=Friends._invert[uid])for(var i=0;i<lists.length;++i)if(lists[i]==_L0){delete lists[i];break;}Friends._hookBuildListsUI(uid);},_hookBuildListsUI:function(uid){if((lists=Friends._invert[uid])&&(row=ge('fextlists_'+uid))&&(target=ge('fextlistsc_'+uid))){var _L1=[];for(var i=0;i<lists.length;++i){var _L3=lists[i];if(_L3&&Friends._lists[_L3])_L1.push('<a href="#" onclick="Friends.refreshList('+_L3+');return false;">'+Friends._lists[_L3].name+'</a>'+'<a class="flistrm" href="#" onclick="Friends._removeFromList('+uid+','+_L3+');return false;">&nbsp;</a>'+'<br />');}if(_L1.length){target.innerHTML=_L1.join('');CSS.removeClass(row,'nolists');}else CSS.addClass(row,'nolists');}},setListsMode:function(){if(Friends._my_friends)if((lists=ge('frn_lists'))&&(lists.childNodes.length>2)){CSS.addClass($('fpgc'),'manylists');}else CSS.removeClass($('fpgc'),'manylists');},pageTransitionHandler:function(uri){if(uri.getPath()=='/friends/'){var _L1;if(!this._from_go){var _L2=uri.getQueryData();if(_L2.id!=this._id)return false;var _L3={flid:0,view:'everyone',q:'',nt:0,nk:0,st:0,s:0};_L1=true;for(var v in _L3){_L2[v]=_L2[v]||_L3[v];if(v!='s'&&this['_'+v]!=_L2[v])_L1=false;if(v=='view'||v=='q'){this['_'+v]=_L2[v];}else this['_'+v]=parseInt(_L2[v]);}}else _L1=this._pagination;this._refresh(_L1);this._pagination=false;this._from_go=false;return true;}return false;},toggleAdvanced:function(){if($('friends_advanced').style.display=='none'){this.showAdvanced();}else hide('friends_advanced');},toggleTiny:function(){if(Friends._tiny){CSS.removeClass($('fpgc'),'tiny');Friends._tiny=false;}else{Friends._tiny=true;CSS.addClass($('fpgc'),'tiny');}},dnd:function(e,a,id,_L3){if(!Friends._tiny)return;Friends._dstart=Vector2.getEventPosition(e);Friends._did=id;Friends._dname=_L3;Friends._dobj=false;Friends._drag=true;Friends._dlists=$('frn_lists').getElementsByTagName('div');if(!Friends._dinit){Friends._dinit=true;document.body.onmousemove=chain(document.body.onmousemove,Friends.drag);document.body.onmouseup=chain(document.body.onmouseup,Friends.drop);}CSS.addClass($('frn_lists'),'dragging');return Event.kill(e);},select:function(e){if(Friends._drag)return Event.kill(e);},drag:function(e){if(Friends._drag){var pos=Vector2.getEventPosition(e);if(!Friends._dobj){var _L2=pos.distanceTo(Friends._dstart);if(_L2>5){Friends._dobj=document.createElement('div');Friends._dobj.innerHTML=Friends._dname;CSS.setClass(Friends._dobj,'draggable_friend');Friends._dobj.style.top=(pos.y-8)+"px";Friends._dobj.style.left=(pos.x-8)+"px";var _L3=DOM.getRootElement().firstChild;DOM.getRootElement().insertBefore(Friends._dobj,_L3);}}if(Friends._dobj){Friends._dobj.style.top=(pos.y-8)+"px";Friends._dobj.style.left=(pos.x-8)+"px";for(var i=0;i<Friends._dlists.length;++i)if(Rect.getElementBounds(Friends._dlists[i]).contains(pos)){CSS.addClass(Friends._dlists[i].firstChild,'hover');}else CSS.removeClass(Friends._dlists[i].firstChild,'hover');}}},drop:function(e){if(Friends._drag){var end=Vector2.getEventPosition(e);if(Friends._dobj){DOM.getRootElement().removeChild(Friends._dobj);for(var i=0;i<Friends._dlists.length;++i)if(Rect.getElementBounds(Friends._dlists[i]).contains(end)){Friends.dragAddList(Friends._did,Friends._dlists[i].id.slice(5));break;}}Friends._dobj=false;}for(var i=0;i<Friends._dlists.length;++i)CSS.removeClass(Friends._dlists[i].firstChild,'hover');CSS.removeClass($('frn_lists'),'dragging');Friends._drag=false;},dragAddList:function(uid,_L1){if(!parseInt(_L1)||(Friends._flid==_L1))return;this._showLoading();new AsyncRequest().setURI('/friends/ajax/lists.php').setData({'add':'1','flid':_L1,'quick':1,'id':uid}).setHandler(bind(Friends,'_dragAddHandler',_L1)).setErrorHandler(bind(Friends,'_dragAddError',_L1)).send();},_dragAddHandler:function(_L0,r){this._hideLoading();Friends._dragAnimate(_L0,'#77dd77');},_dragAddError:function(_L0,r){this._hideLoading();Friends._dragAnimate(_L0,'#aa4444');},_dragAnimate:function(_L0,_L1){var _L2=$('frni_'+_L0).firstChild.nextSibling;animation(_L2).from('color',_L1).to('color','#3b5998').duration(1500).ondone(function(){_L2.style.color='';}).go();},phonebookSearchShow:function(){CSS.addClass($('friend_search_box'),'hide_search');CSS.removeClass($('phonebook_search_box'),'hide_search');},phonebookSearchHide:function(){CSS.addClass($('phonebook_search_box'),'hide_search');CSS.removeClass($('friend_search_box'),'hide_search');},showAdvanced:function(){if(this._adv_init){CSS.removeClass($('friends_advanced'),'hide_advanced');}else this._loadAdvanced(true);},_hideAdvanced:function(){CSS.addClass($('friends_advanced'),'hide_advanced');},_loadAdvanced:function(_L0){if(!this._adv_init){if(_L0)this._showLoading();new AsyncRequest().setReadOnly(true).setMethod("GET").setURI('/friends/ajax/filters.php').setData({'id':this._id}).setHandler(bind(this,'_advancedHandler',_L0)).setErrorHandler(bind(this,'_advancedError')).send();}},_advancedHandler:function(_L0,r){this._adv_init=1;$('friends_advanced').innerHTML=r.getPayload().html;if(_L0){this._hideLoading();this.showAdvanced();}},_advancedError:function(r){this._hideLoading();},advancedChange:function(_L0){var _L1=_L0.options[_L0.selectedIndex];if(_L1.value!='')if(_L1.value=='---'){Friends._refreshPageTitle(null,_tx("Grid"));}else Friends._refreshPageTitle(null,_L1.text);},_resetFilters:function(){if(!this._adv_init)return;this._resetNetworkTypeFilters();$('friends_nk').selectedIndex=0;this._nk=0;},_resetNetworkTypeFilters:function(){if(this._nt)hide('friends_nt_'+this._nt);this._nt=0;},refreshList:function(_L0){this._resetFilters();this._flid=_L0;this._s=0;if(_L0>0)this._view='everyone';this._refreshTabList(_L0);this._go();},refreshView:function(_L0){this._resetFilters();this._view=_L0;this._s=0;if(this._view=='everyone'||!this._fmpt_tab[this._view])this._loadAdvanced(false);this._go();},refreshSearch:function(_L0){this._resetFilters();this._flid=0;this._s=0;this._view='search';this._q=_L0;this._go();},refreshStart:function(s){this._s=s;this._pagination=true;this._go();},filterView:function(_L0){this._resetNetworkTypeFilters();this._view=_L0;this._s=0;this._flid=0;this._refreshPageTitle();this._go();},filterNetworkKey:function(nk,_L1){if(_L1&&this._nt){hide('friends_nt_'+this._nt);this._nt=0;}this._s=0;this._flid=0;this._nk=nk;this._view='network';this._go();},filterNetworkType:function(nt){this._flid=0;this._nk=0;this._s=0;if(this._nt)hide('friends_nt_'+this._nt);this._nt=nt;if(nt){$('friends_nt_'+nt).selectedIndex=0;show('friends_nt_'+nt);}this._view='network';this._go();},filterSocialType:function(st){this._flid=0;this._nk=0;this._s=0;if(this._nt)hide('friends_nt_'+this._nt);this._nt=0;this._st=st;this._view='social';this._go();},_showLoading:function(){if(icon=ge('friends_loading'))icon.style.display='block';},_hideLoading:function(){if(icon=ge('friends_loading'))icon.style.display='none';},_go:function(){this._from_go=true;goURI(URI.getRequestURI().setQueryData({id:this._id,flid:this._flid,view:this._view,q:this._q,nt:this._nt,nk:this._nk,s:this._s,st:this._st}));},_refresh:function(_L0){var _L1=(this._s-this._p)/this._PAGE_SIZE;if(_L0&&this._friend_pages[_L1]){$('friends_target').scrollTop=0;DOMScroll.scrollTo(new Vector2(0,0,'document'));$('friends_target').setContent(HTML(this._friend_pages[_L1]));PageTransitions.transitionComplete();}else{this._index=false;this._showLoading();new AsyncRequest().setURI('/friends/ajax/friends.php').setReadOnly(true).setMethod("GET").setData({'id':this._id,'flid':this._flid,'view':this._view,'q':this._q,'nt':this._nt,'nk':this._nk,'st':this._st,'ps':this._PAGE_SIZE,'s':this._s}).setHandler(bind(this,'_refreshHandler')).setErrorHandler(bind(this,'_refreshError')).setTransportErrorHandler(bind(this,'_refreshError')).setFinallyHandler(PageTransitions.transitionComplete).send();}},_refreshTabView:function(_L0){if(_L0=='search'){Friends._refreshPageTitle(null,_tx("Search Results"));}else if(_L0!='advanced')Friends._refreshPageTitle();if(!this._fmpt_tab[_L0])_L0='everyone';var _L1=Tabset.getInstance('friend_pills').getFullTabId(_L0);if(_L1!=Tabset.getInstance('friend_pills').selectedId)Tabset.getInstance('friend_pills').selectTab(_L1);if(_L0=='everyone'&&!this._flid){this.showAdvanced();}else this._hideAdvanced();if(_L0=='phonebook'){this.phonebookSearchShow();}else this.phonebookSearchHide();if(this._view=='status'){show('status_editor_friends');}else hide('status_editor_friends');},_refreshTabList:function(_L0){if(this._my_friends){var _L1=$('frn_lists').getElementsByTagName('div');for(var i=0;i<_L1.length;++i){var _L3=_L1[i];if(_L3.id=='frni_'+_L0){this._highlightList(_L3);}else if(CSS.hasClass(_L3,'active_list'))this._unhighlightList(_L3);}}},_refreshHandler:function(r){this._p=this._s;this._view=r.getPayload().view;this._refreshTabView(this._view);this._refreshTabList(this._flid);this._friend_pages=r.getPayload().friend_pages;$('friends_target').scrollTop=0;if(window.scroll)window.scroll(0,0);$('friends_target').innerHTML=this._friend_pages[0];this._fixDeleteFooter();if((editor=ge('fl_input'))&&(ge('ffriends').childNodes.length==0)){editor.focus();CSS.setOpacity($('friends_step2'),0);$('friends_step2').style.display='block';animation($('friends_step2')).to('opacity',1).duration(200).go();}if(this._my_friends)this._refreshStatusSidebar();this._hideLoading();},_refreshError:function(e){this._hideLoading();goURI('/friends/?id='+this._id);},_unhighlightList:function(_L0){CSS.removeClass(_L0.childNodes[0],'active_list_a');CSS.removeClass(_L0.childNodes[1],'active_list_a');CSS.removeClass(_L0,'active_list');if(_L0.nextSibling)CSS.removeClass(_L0.nextSibling,'prev');},_highlightList:function(_L0){CSS.addClass(_L0.childNodes[0],'active_list_a');CSS.addClass(_L0.childNodes[1],'active_list_a');CSS.addClass(_L0,'active_list');if(_L0.nextSibling)CSS.addClass(_L0.nextSibling,'prev');Friends._refreshPageTitle(_L0.firstChild.nextSibling.innerHTML);},_fixDeleteFooter:function(){if(this._flid!=0)if(($('ffriends').offsetHeight+65)<$('frn_column').offsetHeight){$('friends_delete').style.marginTop=$('frn_column').offsetHeight-$('ffriends').offsetHeight-65+'px';}else $('friends_delete').style.marginTop='-1px';},_refreshPageTitle:function(_L0,_L1){if(!Friends._my_friends)return;if(!_L0)if(elem=ge('frni_'+this._flid))_L0=elem.childNodes[1].innerHTML;if(_L0){$('friends_page_title').innerHTML=_L0;if(this._flid==0){CSS.removeClass($('friends_page_title'),'list');CSS.addClass($('friends_page_title'),'all');}else{CSS.removeClass($('friends_page_title'),'all');CSS.addClass($('friends_page_title'),'list');}}if(this._view=='everyone'){CSS.addClass($('friends_page_subtitle'),'no_title');return;}var _L2=null;if($('friends_page_subtitle'))if(_L1){_L2=_L1;}else if(this._view=='status'){_L2=_tx("Status Updates");}else if(this._view=='recent'){_L2=_tx("Recently Updated");}else if(this._view=='phonebook')_L2=_tx("Phonebook");if(_L2){$('friends_page_subtitle').innerHTML=_L2;CSS.removeClass($('friends_page_subtitle'),'no_title');}},_refreshStatusSidebar:function(){if(this._view=='status'){if(elem=ge('status_sidebar_feed_url')){var uri=new URI(elem.href);uri.addQueryData({flid:this._flid});elem.href=uri.toString();}show('status_sidebar');}else hide('status_sidebar');},editList:function(){this._unhighlightList($('frni_'+this._flid));if(ge('friends_step2'))hide($('friends_step2'));hide('friends_makelist');CSS.setOpacity(ge('friends_step1'),0);show('friends_newlist');animation(ge('friends_step1')).duration(200).checkpoint().to('opacity',1).duration(200).go();$('friends_newlist_name').value=Friends._DEFAULT_LIST_NAME;$('friends_newlist_name').focus();$('friends_newlist_name').select();},editKeypress:function(e){var _L1=e||window.event;var _L2=_L1.keyCode||_L1.which;var _L3=$('friends_newlist_name').value;if((_L2==KEYS.RETURN)&&(_L3==''||_L3==Friends._DEFAULT_LIST_NAME)){this.hideEdit();return false;}if(_L2==KEYS.ESC){this.hideEdit();return false;}if((_L2==KEYS.RETURN)&&_L3){this.hideEdit(true);this._createList(_L3);return true;}return true;},hideEdit:function(_L0){if(!_L0)this._highlightList($('frni_'+this._flid));show('friends_makelist');hide('friends_newlist');return true;},_createList:function(_L0){this._showLoading();new AsyncRequest().setURI('/friends/ajax/lists.php').setData({'create':_L0}).setHandler(bind(Friends,'_createHandler')).setErrorHandler(bind(Friends,'_createError')).send();},_createHandler:function(r){this._hideLoading();$('frn_lists').innerHTML=r.getPayload().html;this._view='everyone';var _L1=r.getPayload().flid;Friends._lists[_L1]={'id2':_L1,'name':r.getPayload().name};Friends.refreshList(_L1);Friends.setListsMode();},_createError:function(r){this._hideLoading();},showDeleteListDialog:function(_L0){var _L1=new Dialog().setTitle(_tx("Delete List?")).setBody(_tx("Are you sure you want to delete this list? This cannot be undone.")).setButtons([Dialog.newButton('delete-list',_tx("Delete List"),'',function(){Friends.deleteList(_L0);_L1.hide();}),Dialog.CANCEL]).show();},deleteList:function(_L0){Friends._showLoading();new AsyncRequest().setURI('/friends/ajax/lists.php').setData({'delete':'1','flid':_L0}).setHandler(bind(Friends,'_deleteHandler')).setErrorHandler(bind(Friends,'_deleteError')).send();},_deleteHandler:function(r){this._hideLoading();var _L1=r.getPayload().flid;delete Friends._lists[_L1];var _L2=$('frni_'+_L1);this._unhighlightList(_L2);_L2.parentNode.removeChild(_L2);this._flid=0;this.refreshList(0);this.setListsMode();},_deleteError:function(r){this._hideLoading();},renameList:function(){Friends._renaming=true;Friends._renameHidden=false;Friends._rename_original=Friends._lists[this._flid].name;hide($('frni_'+this._flid));var _L0=$('friend_list_name_input').cloneNode(true);var div=document.createElement('div');CSS.setClass(div,'renameList');div.appendChild(_L0);$('frni_'+this._flid).parentNode.insertBefore(div,$('frni_'+this._flid));this._renameListElement=div;_L0.style.display='block';_L0.value=Friends._rename_original;_L0.focus();_L0.select();},renameKeypress:function(e){var _L1=e||window.event;var _L2=_L1.keyCode||_L1.which;var _L3=this._renameListElement.firstChild.value;if((_L2==KEYS.RETURN)&&(_L3==''||(_L3==Friends._rename_original))){Friends._renaming=false;this.hideRename();return false;}if(_L2==KEYS.ESC){Friends._renaming=false;this.hideRename();return false;}if((_L2==KEYS.RETURN)&&_L3){Friends._renaming=false;this.hideRename();this._renameList(_L3);return true;}return true;},blurRename:function(){if(Friends._renaming){var _L0=this._renameListElement.firstChild.value;if(_L0&&(_L0!=Friends._rename_original))Friends._renameList(_L0);}Friends._renaming=false;this.hideRename();},hideRename:function(){if(!Friends._renameHidden){Friends._renameHidden=true;this._renameListElement.parentNode.removeChild(this._renameListElement);this._renameListElement=null;show($('frni_'+this._flid));}return true;},_renameList:function(_L0){this._showLoading();new AsyncRequest().setURI('/friends/ajax/lists.php').setData({'rename':_L0,'flid':this._flid}).setHandler(bind(Friends,'_renameHandler')).setErrorHandler(bind(Friends,'_renameError')).send();},_renameHandler:function(r){this._hideLoading();var _L1=r.getPayload().name;var _L2=r.getPayload().flid;if(this._flid==_L2)$('friends_page_title').innerHTML=htmlize(_L1);$('frni_'+_L2).childNodes[1].innerHTML=htmlize(_L1);if(Friends._lists[_L2])Friends._lists[_L2].name=_L1;},_renameError:function(r){this._hideLoading();},noop:function(){return false;},addToList:function(p){var _L1=ge('friends_step2');if(_L1)_L1.style.display='none';if(p&&p.i){Friends._showLoading();new AsyncRequest().setURI('/friends/ajax/lists.php').setData({'add':'1','flid':Friends._flid,'view':Friends._view,'id':p.i}).setHandler(bind(Friends,'_addToListHandler')).setErrorHandler(bind(Friends,'_ajaxListError')).send();$('fl_input').typeahead.clear();}return false;},_addToListHandler:function(r){this._hideLoading();var _L1=r.getPayload();if(e=ge('f'+_L1.id))e.parentNode.removeChild(e);var _L2=$('ffriends').innerHTML;$('ffriends').innerHTML=_L1.html+_L2;this._updateNumFriends();this._fixDeleteFooter();Friends._hookAddToList(_L1.flid,_L1.id);},_updateNumFriends:function(){if(this._friend_pages.length>1){$('summary').innerHTML=_tx("This list has been updated.");}else{var _L0=$('ffriends').childNodes.length;if(_L0==0){$('summary').innerHTML=_tx("This list contains no friends.");}else if(_L0==1){$('summary').innerHTML=_tx("This list contains 1 friend.");}else if(_L0<=this._PAGE_SIZE){$('summary').innerHTML=_tx("This list contains {count} friends.",{'count':_L0});}else $('summary').innerHTML=_tx("This list has been updated.");}},remove_click:function(e,id,_L2,_L3){var _L4=new ContextualDialog().setClassName('remove_click').setContext(e);if(this._flid>0){_L4.setTitle(_tx("Remove from List?")).setBody(_tx("Are you sure you want to remove {name} from this list?"),{'name':_L2}).setButtons([{name:'remove-from-list',label:_tx("Remove from List"),handler:Friends.removeFromList.bind(Friends,id)},{name:'remove-from-friends',label:_tx("Remove from Friends"),handler:Friends.remove.bind(Friends,_L4,id,_L2)},Dialog.CANCEL]).show();}else Friends.remove(_L4,id,_L2,_L3);return false;},remove:function(_L0,id,_L2,_L3){_L0.setTitle(_tx("Remove friend?")).setBody(_L3?_tx("Are you sure you want to cancel your pending friend request with {name}? He or she will not be notified.",{'name':_L2}):_tx("Are you sure you want to remove {name} as a friend? This cannot be undone. {name} will not be notified.",{'name':_L2})).setButtons([{name:'remove-friend',label:_L3?_tx("Remove Friend"):_tx("Remove Friend"),handler:function(){var _L4={value:this.value,trace:Util.stack(),useragent:navigator.userAgent};Friends._remove(id,_L4);}},Dialog.CANCEL]).show();return false;},_remove:function(id,_L1){if(!_L1)_L1='debug info not passed in, coming from somewhere other than remove() function';Friends._showLoading();new AsyncRequest().setURI('/friends/ajax/lists.php').setData({'remove_friend':'1','view':Friends._view,'flid':Friends._flid,'id':id,'debug':_L1}).setHandler(bind(Friends,'_removeHandler')).setErrorHandler(bind(Friends,'_ajaxListError')).send();},removeFromList:function(id){Friends._removeFromList(id,Friends._flid);},_removeFromList:function(id,_L1){Friends._showLoading();new AsyncRequest().setURI('/friends/ajax/lists.php').setData({'remove':'1','flid':_L1,'view':Friends._view,'id':id}).setHandler(bind(Friends,'_removeHandler')).setErrorHandler(bind(Friends,'_ajaxListError')).send();},_removeHandler:function(r){this._hideLoading();var _L1=r.getPayload();if(_L1.remove_friend||(Friends._flid==_L1.flid)){var e=ge('f'+_L1.id);if(e)e.parentNode.removeChild(e);}if(Friends._flid==_L1.flid){this._updateNumFriends();this._fixDeleteFooter();}Friends._hookRemoveFromList(_L1.flid,_L1.id);},_ajaxListError:function(r){this._hideLoading();},multiselect:function(){this._showLoading();new AsyncRequest().setURI('/friends/ajax/selector.php').setData({'flid':this._flid}).setHandler(bind(Friends,'_multiselectHandler')).setErrorHandler(bind(Friends,'_multiselectError')).send();},_multiselectHandler:function(r){this._hideLoading();set_inner_html($('friends_multiselect'),r.getPayload().html);hide('friends_step2');hide('flistedit');show('friends_multiselect');},_multiselectError:function(e){this._hideLoading();},cancelMultiselect:function(){hide('friends_multiselect');show('flistedit');},multiAdd:function(){hide('friends_multiselect');var ids=serialize_form($('friends_form_multiselect')).ids;var _L1='';if(ids){_L1=[];for(var i in ids)_L1.push(ids[i]);_L1=_L1.join(',');}this._showLoading();new AsyncRequest().setURI('/friends/ajax/lists.php').setData({'flid':this._flid,'multiadd':'1','ids':_L1}).setHandler(bind(Friends,'_multiaddHandler')).setErrorHandler(bind(Friends,'_multiaddError')).send();},_multiaddHandler:function(r){this._hideLoading();this._view='everyone';this.refreshList(r.getPayload().flid);Friends._hookLoadListMembership();},_multiaddError:function(r){this._hideLoading();},friendClick:function(_L0,_L1,uid){if(target=$E(_L1).getTarget())if(DOM.isNode(target,'a')||(target.parentNode&&DOM.isNode(target.parentNode,'a')))return;if(Friends._dropdown){Friends._dropdown.parentNode.removeChild(Friends._dropdown);Friends._dropdown=null;}else if(_L0)if(CSS.hasClass(_L0,'click')){CSS.removeClass(_L0,'click');}else{if(this._my_friends)Friends._hookBuildListsUI(uid);CSS.addClass(_L0,'click');}},bodyClick:function(){Friends.friendClick();},listDropdown:function(uid,a){if(Friends._dropdown){Friends._dropdown.parentNode.removeChild(Friends._dropdown);Friends._dropdown=null;return;}var pos=Vector2.getElementPosition(a);document.body.onclick=chain(document.body.onclick,Friends.bodyClick);var e=document.createElement('div');CSS.setClass(e,'flink_dropdown');e.style.left=(pos.x-2)+'px';e.style.top=(pos.y-4)+'px';var _L4=$('frn_lists').getElementsByTagName('div');e.innerHTML='<span>'+_tx("Add to List")+'</span>';var _L5=document.createElement('div');CSS.setClass(_L5,'flink_inner');e.appendChild(_L5);for(var i=0;i<_L4.length;++i){var _L7=_L4[i];var id=parseInt(_L7.id.substr(5));if((id>0)&&(id!=Friends._flid)){var _L9=document.createElement('a');_L5.appendChild(_L9);var _La=_L7.firstChild.nextSibling.innerHTML;_L9.innerHTML=_La;_L9.onclick=bind(this,'dropdownAddList',uid,id,_La);}}DOM.getRootElement().appendChild(e);Friends._dropdown=e;},dropdownAddList:function(uid,_L1,_L2,_L3){Event.stop(_L3);if(Friends._dropdown)Friends._dropdown.innerHTML='<span>'+_tx("Add to List")+'</span>';new AsyncRequest().setURI('/friends/ajax/lists.php').setData({'add':'1','flid':_L1,'quick':1,'id':uid}).setHandler(bind(Friends,'_dropdownAddHandler',_L1,_L2)).setErrorHandler(bind(Friends,'_dropdownAddError',_L1)).send();return false;},_dropdownAddHandler:function(_L0,_L1,r){Friends._hookAddToList(_L0,r.getPayload().id);Friends._dropdownAnimate(_tx("Added to \"{list}\"",{'list':_L1}));},_dropdownAddError:function(_L0,r){Friends._dropdownAnimate(_tx("Sorry, an error occurred."));},_dropdownAnimate:function(str){var e=null;if(e=Friends._dropdown){e.innerHTML='<span>'+_tx("Add to List")+'</span>'+'<p>'+str+'</p>';animation(e).duration(750).checkpoint().to('opacity',0).duration(750).ondone(function(){e.parentNode.removeChild(e);}).go();}Friends._dropdown=null;},initPref:function(_L0){new AsyncRequest().setURI('/friends/ajax/rooster.php').setData({'pref':_L0}).send();},addExternalFriend:function(){return show_external_friend_dialog(null,null,'add',function(){Friends.refreshView('external');});},editExternalFriend:function(uid){return show_external_friend_dialog(uid,null,'edit',function(){Friends.refreshView('external');});}});
function phonebook_search_typeahead(obj,_L1,_L2){this.anchor_block=false;this.parent.construct(this,obj,_L1,_L2);}phonebook_search_typeahead.extend('typeaheadpro');phonebook_search_typeahead.prototype.auto_select=false;phonebook_search_typeahead.prototype.less_than_n_chars=false;phonebook_search_typeahead.prototype.touch_fired=false;phonebook_search_typeahead.prototype.show=function(){if(!this.less_than_n_chars){this.parent.show();this.dropdown.style.width='137px';}else this.hide();};phonebook_search_typeahead.prototype.hide=function(){this.parent.hide();CSS.removeClass(ge('phonebook_search'),'typeahead_border');};phonebook_search_typeahead.prototype.onsubmit=function(p){if(!p){$('fsearch').value=$('phonebook_search').value;$('friend_search').submit();return false;}};phonebook_search_typeahead.prototype.found_suggestions=function(_L0,_L1,_L2){this.parent.found_suggestions(_L0,_L1,_L2);if(this.list.firstChild&&this.list.firstChild.firstChild){CSS.addClass(this.list.firstChild.firstChild,'blue_top_border');CSS.removeClass(this.list,'no_border_list');CSS.addClass(this.list.lastChild.lastChild,'blue_bottom_border');CSS.addClass(ge('phonebook_search'),'typeahead_border');}else{CSS.removeClass(ge('phonebook_search'),'typeahead_border');CSS.removeClass(ge('phonebook_search'),'typeahead_border');CSS.addClass(this.list,'no_border_list');}};function phonebook_search_friend_source(_L0){this.parent.construct(this,_L0);new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/mobile/phonebook_search.php?'+_L0).setErrorHandler(function(){}).setHandler(function(_L1){this.values=_L1.getPayload().entries;this.build_index();}.bind(this)).send();}phonebook_search_friend_source.extend('static_source');phonebook_search_friend_source.prototype.cache_results=true;phonebook_search_friend_source.prototype.gen_html=function(_L0,_L1){var ret=['<div>',typeahead_source.highlight_found(_L0.t,_L1),'</div>'];if(_L0.c!='')ret.push('<div><small>'+_tx("M")+': '+_L0.c+'</small></div>');if(_L0.p!='')ret.push('<div><small>'+_tx("O")+': '+_L0.p+'</small></div>');if(_L0.p==''&&_L0.c=='')ret.push('<div><small>'+_tx("Request Number")+'</small></div>');return ret.join('');};phonebook_search_friend_source.prototype.search_value=function(_L0){return this.parent.search_value(_L0);};function phonebook_search_onselect(p){if(p&&p.i&&(p.c||p.p)){goURI('/profile.php?id='+p.i+'&v=info#contact');return false;}else if(p){var _L1=new Dialog().setTitle(_tx("Request Number")).setBody(_tx("Would you like to request {first-name}'s phone number?",{'first-name':p.f})).setButtons(Dialog.OK_AND_CANCEL).setHandler(_L2).show();return false;}function _L2(){var _L3=new AsyncRequest();_L3.setURI('/ajax/mobile/phonebook_req.php');_L3.setData({req_id:p.i,request:'1'});_L3.setHandler(_L4);_L3.send();function _L4(_L5){var _L1=Dialog.getCurrentDialog();if(_L1)_L1.hide();}}}function phoneEditNumberKeyPress(_L0,_L1){keyPressed=Event.getKeyCode(_L0);if(keyPressed==KEYS.TAB){toggleEditNumberCancel(_L1);return false;}if(keyPressed==KEYS.ESC){toggleEditNumberCancel(_L1);return false;}if(keyPressed==KEYS.RETURN){$('my_'+_L1+'_edit_text').blur();return false;}return true;}function toggleEditNumberOn(_L0){hide('my_'+_L0+'_text');hide('my_'+_L0+'_text_number');hide('my_'+_L0+'_add_link');hide('my_'+_L0+'_edit_link');show(_L0+'_privacy_lock');show('my_'+_L0+'_edit_text');var _L1=$('my_'+_L0+'_edit_text');_L1.selectionStart=0;_L1.selectionEnd=_L1.value.length;_L1.focus();}function toggleEditNumberOff(_L0){var _L1=$('my_'+_L0+'_text_number').innerHTML;hide('my_'+_L0+'_edit_text');hide(_L0+'_save_instructions');if(!_L1)hide(_L0+'_privacy_lock');if(_L1){show('my_'+_L0+'_edit_link');}else show('my_'+_L0+'_add_link');show('my_'+_L0+'_text_number');show('my_'+_L0+'_text');}function toggleEditNumberCancel(_L0){var _L1=$('my_orig_'+_L0+'_number').value;$('my_'+_L0+'_text_number').innerHTML=_L1;toggleEditNumberOff(_L0);$('my_'+_L0+'_edit_text').value=_L1;$('my_'+_L0+'_edit_text').blur();}function toggleEditNumberOffAndSave(_L0){$('my_'+_L0+'_text_number').innerHTML=$('my_'+_L0+'_edit_text').value;toggleEditNumberOff(_L0);$('my_orig_'+_L0+'_number').value=$('my_'+_L0+'_edit_text').value;submitEditNumber($('my_'+_L0+'_edit_text').value,_L0);return true;}function submitEditNumber(_L0,_L1){if(_L1=='mobile'||_L1=='other_phone'){var _L2={};_L2[_L1]=_L0;new AsyncRequest().setURI('/ajax/mobile/updatephone.php').setMethod('POST').setData(_L2).send();}}

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