/*    HTTP Host:  b.static.ak.fbcdn.net                                        */
/*    Generated:  December 21st 2009 3:58:46 PM PST                            */
/*      Machine:  10.16.139.104                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/bypjmi3i3l4o8sk8.pkg.js h:b1shdebd                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/bypjmi3i3l4o8sk8.pkg.js                                   */

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

function static_source(){this.values=null;this.index=null;this.index_includes_hints=false;this.exclude_ids={};this.parent.construct(this);}static_source.extend('typeahead_source');static_source.prototype.enumerable=true;static_source.prototype.filter_excluded=function(a){return a.filter((function(b){return !this.exclude_ids[b.i];}).bind(this));};static_source.prototype.build_index=function(g){var d=[];var i=this.values;var a=i.length&&typeof i[0].i=='undefined';for(var b=0,c=i.length;b<c;b++){var h=typeahead_source.tokenize(i[b].t);for(var e=0,f=h.length;e<f;e++)d.push({t:h[e],o:i[b]});if(this.index_includes_hints&&i[b].s){var h=typeahead_source.tokenize(i[b].s);for(var e=0,f=h.length;e<f;e++)d.push({t:h[e],o:i[b]});}if(a)i[b].i=b;}d.sort(function(j,k){return (j.t==k.t)?0:(j.t<k.t?-1:1);});this.index=d;if(!g)this.ready();};static_source.prototype._sort_text_obj=function(a,b){if(a.e&&!b.e)return 1;if(!a.e&&b.e)return -1;return a.t.localeCompare(b.t);};static_source.prototype.search_value=function(k,a){if(!this.is_ready)return;var i;if(k==''){i=this.values;}else{var l=typeahead_source.tokenize(k).sort(typeahead_source._sort);var f=this.index;var g=0;var d=this.index.length-1;var h=Math.floor(d/2);while(g<=d){if(f[h].t>=l[0]){d=h-1;}else g=h+1;h=Math.floor(g+((d-g)/2));}var i=[];var j={};var b=typeof _ignoreList!='undefined';for(var e=g;e<f.length&&f[e].t.lastIndexOf(l[0],0)!=-1;e++){var c=f[e].o.flid?f[e].o.flid:f[e].o.i;if(typeof j[c]!='undefined'){continue;}else j[c]=true;if((!b||!_ignoreList[c])&&!this.exclude_ids[c]&&(l.length==1||typeahead_source.check_match(l,f[e].o.t)))i.push(f[e].o);}}i.sort(this._sort_text_obj.bind(this));if(this.owner&&this.owner.max_results)i=i.slice(0,this.owner.max_results);if(a)a(this,k,i);return i;};static_source.prototype.set_exclude_ids=function(a){this.exclude_ids=a;};
function search_friend_source(a,b){this.get_param=a;this.parent.construct(this);if(!b)this.initialize();}search_friend_source.extend('static_source');search_friend_source.prototype.text_noinput=search_friend_source.prototype.text_placeholder=search_friend_source.prototype.text_nomatch='';search_friend_source.prototype.updated_pics={};search_friend_source.prototype.search_limit=5;search_friend_source.prototype._allowed_types=null;search_friend_source.prototype.do_dark_test=false;search_friend_source.prototype.initialize=function(a){var b=(new Date()).getTime();new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_search.php?'+this.get_param).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(e){var d=e.getPayload();this.values=d.entries;search_friend_source.url_templates=this.templates=d.templates;this.build_index.bind(this).defer();search_typeahead_log(this.udata,'getdata',b);var c=((new Date()).getTime()/1000)-60*5;if(d.gen_time<c)new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/recent_pics.php').setData({ref_time:d.gen_time}).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(f){this.updated_pics=f.getPayload().updated_pics;}.bind(this)).send();if(a)a();}.bind(this)).send();};search_friend_source.loaded_images={};search_friend_source.TYPES={USER:'u',CONNECTION:'c',FOLLOWER:'fl',PAGE:'p',APP:'a',GROUP:'g',EVENT:'e',SEARCH:'search',WEB:'web'};search_friend_source.prototype.build_index=function(){var a=this.history?this.history.entries:undefined;if(a!=undefined)this.values=this.values.each(function(b){b.o=a[b.i]!=undefined?a[b.i]:b.o;return b;});this.parent.build_index();};search_friend_source.image_load=function(b,c,d){var a=(new Date()).getTime();search_friend_source.loaded_images[d]=true;if((a-c)<100){CSS.setOpacity(b,1);}else animation(b).to('opacity',1).duration(100).go();};search_friend_source.prototype.gen_html=function(b,c){var d=b.it;if(!d&&b.ty&&this.templates[b.ty])d=this.templates[b.ty].icon;if(this.updated_pics[b.i])d=this.updated_pics[b.i];switch(b.ty){case search_friend_source.TYPES.USER:case search_friend_source.TYPES.CONNECTION:case search_friend_source.TYPES.PAGE:if(!d){return ['<div>',typeahead_source.highlight_found(b.t,c),'</div><div><small>',b.n||'&nbsp;','</small></div>'].join('');}else{if(!search_friend_source.loaded_images[b.i]){var e=(new Date()).getTime();var a=sprintf('onload="search_friend_source.image_load(this, %d, %d);" style="opacity:0;filter:alpha(opacity=0);"',e,b.i);}return ['<img ',a,' alt="" src="',d,'"/>','<div class="with_pic"><span>',typeahead_source.highlight_found(b.t,c),'</span><small>',b.n||'&nbsp;','</small></div>'].join('');}break;case search_friend_source.TYPES.SEARCH:return ['<div class="app"><div class="icon" style="background-image: url(',d,')">&nbsp;</div>','<span>',b.t,'</span></div>'].join('');break;default:return ['<div class="app clearfix"><div class="icon" style="background-image: url(',d,')">&nbsp;</div>','<span>',typeahead_source.highlight_found(b.t,c),'</span></div>'].join('');}};search_friend_source.prototype.allowTypes=function(a){this._allowed_types=a;return this;};search_friend_source.prototype.search_value=function(f){if(this.do_dark_test)new AsyncSignal('/ajax/search/typeahead_dark.php',{query:f}).send();var e;var a=false;var g=typeahead_source.tokenize(f);for(var b=0;b<g.length;b++)if(g[b]!=''){a=true;break;}if(a){this.owner.less_than_n_chars=false;e=this.parent.search_value(f);}else if(this.is_ready){this.owner.less_than_n_chars=true;e=[];}var c=(e&&e.length)?false:true;if(e)for(var b=0;b<e.length;b++)if((e[b].ty!=search_friend_source.TYPES.USER)&&(e[b].ty!=search_friend_source.TYPES.CONNECTION)){c=true;break;}var d=this.search_limit;if(e)d-=e.length;if(e&&c&&a&&search_friend_source.WEBSEARCH_USER){e.push({t:_tx("Search Facebook"),ty:search_friend_source.TYPES.SEARCH,i:f});e.push({t:_tx("Search the Web"),ty:search_friend_source.TYPES.WEB,i:f});}if(e&&this._allowed_types)e=e.filter(function(h){return this._allowed_types.contains(h.ty);}.bind(this));return e;};search_friend_source.prototype._sort_text_obj=function(a,b){var c=this.history?this.history.entries:undefined;if(c!=undefined){a.o=c[a.i]||a.o;b.o=c[b.i]||b.o;}if(a.o!=b.o)return a.o-b.o;return a.t.localeCompare(b.t);};search_friend_source.WEBSEARCH_USER=false;
function UIComposerAttachmentArea(b,c){this.composer=b;this.root=c;this.area=c.find('div.UIComposer_AttachmentArea_Cache');this.cache={};this.visible=null;this.attachment={};this.dirtyOnReset=false;var a=c.find('a.UIComposer_AttachmentArea_CloseButton');Event.listen(a,'click',function(event){Event.kill(event);b.reset(true);});}UIComposerAttachmentArea.prototype={show:function(b,c){this.composer.addState(UIComposer.STATE.ATTACHMENT_AREA);this.attachment=b;this.dirtyOnReset=false;if(ua.ie()<7)this.area.setStyle('width',this.area.offsetWidth);var a=b.app_id;if(this.cache[a]&&!c){this.showAttachment(a);}else this.loadAttachment(a,c);},loadAttachment:function(a,c){var b={app_id:a,composer_id:this.composer.id,stream_id:this.composer.targetID,is_inbox:this.composer.isInbox};if(c)copy_properties(b,{data:c});new AsyncRequest().setURI(UIComposerAttachmentArea.ENDPOINT).setData(b).setHandler(UIComposerAttachmentArea.handleResponse.bind(this,c)).setErrorHandler(this.composer.handleError.bind(this.composer)).setTransportErrorHandler(this.composer.handleError.bind(this.composer)).send();},showAttachment:function(a){if(!this.composer.hasState(UIComposer.STATE.ATTACHMENT_AREA))return;this.visible=this.cache[a];this.visible.addClass(UIComposerAttachmentArea.CLASS.VISIBLE);this.composer.addState(UIComposer.STATE.ATTACHMENT_LOADED);this.fireAttachmentEvent('load');},createAttachment:function(b){var a=$N('div',{className:UIComposerAttachmentArea.CLASS.CACHED});this.area.appendChild(a).setContent(HTML(b.html));return a;},setAttachment:function(a){if(this.attachment){this.attachment.controller=a;a.initialize(this.composer,this.cache[this.attachment.app_id],this.attachment.app_id);}return this;},getAttachment:function(){if(this.attachment&&this.attachment.controller)return this.attachment.controller;return null;},getData:function(){if(this.attachment&&this.attachment.controller)return this.attachment.controller.getData();return null;},getEndpoint:function(a){if(this.attachment&&this.attachment.controller)return this.attachment.controller.getEndpoint(a);return null;},post:function(){if(!this.visible)return;var a=this.getData();var b=this.getEndpoint(true);if(!a||!b)return;a.composer_id=this.composer.id;this.composer.removeState(UIComposer.STATE.ATTACHMENT_LOADED);new AsyncRequest().setURI(b).setData(a).setHandler(UIComposerAttachmentArea.handleResponse.bind(this,null)).setErrorHandler(this.composer.handleError.bind(this.composer)).send();},reset:function(){if(!this.visible)return;this.visible.removeClass(UIComposerAttachmentArea.CLASS.VISIBLE);this.visible=null;if(this.dirtyOnReset){var a=this.attachment.app_id;this.cache[a].remove();this.cache[a]=null;}this.fireAttachmentEvent('reset');},fireAttachmentEvent:function(event){if(this.attachment&&this.attachment.controller)this.attachment.controller[event]();}};copy_properties(UIComposerAttachmentArea,{handleResponse:function(e,g){var a=this.attachment.app_id,b=this.cache[a],f=g.getPayload(),d=g.getError(),c=g.getErrorIsWarning();if(d&&c)this.composer.showError(g.getErrorSummary(),g.getErrorDescription());if(!b){this.cache[a]=this.createAttachment(f);this.dirtyOnReset=!!e;}else{b.setContent(HTML(f.html));this.dirtyOnReset=true;}this.showAttachment(a);}});copy_properties(UIComposerAttachmentArea,{CLASS:{CACHED:'UIComposer_Attachment_Cached',VISIBLE:'UIComposer_Attachment_Visible'},ENDPOINT:'/ajax/composer/attachment.php',PARAM_STRUCTURE:'app_data[attachment][params]'});
function dropmenu(a){if(this==window){return new dropmenu(a);}else{this.className=null;this.menu=null;this.menuClickArea=null;this.showHandler=null;this.hideHandler=null;this.alignment=null;this.direction=null;this.isShown=false;this.canHide=false;this.show_hooks=[];this.hide_hooks=[];this.clickTarget=$(a);this.displayTarget=$(a);this.id=null;this.rtl=false;this._clickToHide=true;this._markupContentCallback=bagofholding;this.clickHandle=this.clickTarget.listen('click',this.toggle.bind(this));this.container=ge('dropmenu_container')||document.body;return this;}}dropmenu.ALIGN_RIGHT=1;dropmenu.ALIGN_LEFT=2;dropmenu.DIRECTION_UP=3;dropmenu.DIRECTION_DOWN=4;dropmenu.INSTANCES={};dropmenu.prototype.setPosition=function(a){this.alignment=a;return this;};dropmenu.prototype.setDirection=function(a){this.direction=a;return this;};dropmenu.prototype.setMenuClickArea=function(a){this.menuClickArea=$(a);return this;};dropmenu.prototype.setDisplayTarget=function(a){this.displayTarget=$(a);return this;};dropmenu.prototype.setClickToHide=function(a){this._clickToHide=a;return this;};dropmenu.prototype.setMarkupContent=function(b,a,c){this.menuContent=c;this.className=a;this.id=b;return this;};dropmenu.prototype.setMarkupContentCallback=function(a){this._markupContentCallback=a;return this;};dropmenu.prototype._getMarkupContent=function(){return this.menuContent||this._markupContentCallback();};dropmenu.prototype.registerHTMLMenu=function(a){this.registered_menu_id=a;return this;};dropmenu.prototype.addHook=function(b,a){this[b+'_hooks'].push(a);return this;};dropmenu.prototype.removeHook=function(c,a){for(var b=0;b<this[c+'_hooks'].length;b++)if(a==this[c+'_hooks'][b]){this[c+'_hooks'].splice(b,1);return true;}return this;};dropmenu.prototype.toggle=function(a){if(!this.isShown){this._show();this.canHide=false;}else this._hide();if(a)$E(a).prevent();};dropmenu.prototype.show=function(){this._show();};dropmenu.prototype.hide=function(){if(!this.menu)return;this._hide();};dropmenu.prototype.destroy=function(){if(this.menu&&this.menu.parentNode){this.menu.parentNode.removeChild(this.menu);this.menu=null;}};dropmenu.prototype._buildMenu=function(){if(intl_locale_is_rtl()&&!this.rtl){this.alignment=(this.alignment==dropmenu.ALIGN_RIGHT)?dropmenu.ALIGN_LEFT:dropmenu.ALIGN_RIGHT;this.rtl=true;}if(this.registered_menu_id){this.menu=$(this.registered_menu_id);if(this.alignment||this.direction)this.container.appendChild(this.menu);}else this._buildDynamicMenu();dropmenu.INSTANCES[this.id]=this;this.menuClickArea=this.menuClickArea||DOM.scry(this.menu,'div.menu_content');this.menuClickArea.onclick=chain(this.menuClickArea.onclick,Event.stop);var b=DOM.scry(this.menu,'a');for(var a=0;a<b.length;a++)addEventBase(b[a],'click',function(){if(this._clickToHide)this._hide();}.bind(this),this.menu_id+'_link_'+a);};dropmenu.prototype._buildDynamicMenu=function(){this.menu=document.createElement('div');this.menu.className='dropdown_menu hidden_elem '+(this.className?' '+this.className:'');this.menu.id='dropdown_menu_'+this.id;var a=this._getMarkupContent();if(!is_scalar(a)){DOM.setContent(this.menu,a);}else set_inner_html(this.menu,a);this.container.appendChild(this.menu);};dropmenu.prototype._positionMenu=function(){if(this.alignment||this.direction||(!this.alignment&&!this.direction&&!this.registered_menu_id)){if(this.menu.parentNode!=this.container)this.container.appendChild(this.menu);var b=Vector2.getElementPosition(this.displayTarget,'document');var a=Vector2.getElementPosition(this.container,'document');var e=b.x-a.x;var f=b.y-a.y+this.displayTarget.offsetHeight;if(this.alignment==dropmenu.ALIGN_RIGHT||this.direction==dropmenu.DIRECTION_UP){CSS.removeClass(this.menu,'hidden_elem');this.menu.style.left='-9999px';this.menu.style.top='-9999px';if(this.alignment==dropmenu.ALIGN_RIGHT){var d=this.menu.offsetWidth;e=e+this.displayTarget.offsetWidth-d;}if(this.direction==dropmenu.DIRECTION_UP){var c=this.menu.offsetHeight;f=f-this.displayTarget.offsetHeight-c+1;}CSS.addClass(this.menu,'hidden_elem');}this.menu.style.left=e+'px';this.menu.style.top=f+'px';}};dropmenu.prototype._onclick=function(event){this._hide();return false;};dropmenu.prototype._show=function(){if(!this.menu)this._buildMenu();this._positionMenu();CSS.removeClass(this.menu,'hidden_elem');var a=this._documentHideHandler.bind(this);this.click_event=addEventBase(document.body,'click',a,this.menu.id);onbeforeunloadRegister(a);this.isShown=true;for(var b=0;b<this.show_hooks.length;b++)this.show_hooks[b]();};dropmenu.prototype._documentHideHandler=function(a){if(!this.canHide){this.canHide=true;}else this._hide();};dropmenu.prototype._hide=function(){if(this.menu)CSS.addClass(this.menu,'hidden_elem');if(this.click_event)removeEventBase(document.body,'click',this.click_event,this.menu.id);this.click_event=null;this.isShown=false;for(var a=0;a<this.hide_hooks.length;a++)this.hide_hooks[a]();if(!this.registered_menu_id)this.destroy();};dropmenu.prototype._build_menu_shim=function(){this.shim=null;if(ua.ie()<7){this.shim=document.createElement('iframe');CSS.setClass(shim,'iframe_shim');this.container.appendChild(this.shim);}};dropmenu.getExistingInstance=function(a){return dropmenu.INSTANCES[a];};function flyout_menu(a){if(this==window){return new flyout_menu(a);}else{this.title='';this.parent.construct(this,a);}}flyout_menu.extend('dropmenu');flyout_menu.prototype.setMarkupContent=function(b,a,d,c){this.parent.setMarkupContent(b,a,c);this.title=d;return this;};flyout_menu.prototype.setIconPosition=function(a){this.iconElem=a;return this;};flyout_menu.prototype._buildDynamicMenu=function(){this.menu=document.createElement('div');CSS.addClass(this.menu,(this.className||'')+' flyout_menu hidden_elem');if(this.alignment==dropmenu.ALIGN_RIGHT)CSS.addClass(this.menu,'flyout_menu_left');this.menu.id='flyout_menu_'+this.id;var c='content_'+this.id;var a=[];a.push('<div class="flyout_menu_header_shadow">');a.push('<div class="flyout_menu_header clearfix">');a.push('<div class="flyout_menu_mask"></div>');a.push('<div class="flyout_menu_title">'+this.title+'</div>');a.push('</div></div>');a.push('<div class="flyout_menu_content_shadow">');a.push('<div class="menu_content" id="content_'+this.id+'">');a.push('</div></div>');set_inner_html(this.menu,a.join(''));this.container.appendChild(this.menu);var b=this._getMarkupContent();if(!is_scalar(b)){DOM.setContent($(c),b);}else set_inner_html($(c),b);this.menuClickArea=$(c);};flyout_menu.prototype._positionMenu=function(){if(this.alignment||(!this.alignment&&!this.registered_menu_id)){var e;var a=this.iconElem?this.iconElem:this.clickTarget;switch(this.alignment){case dropmenu.ALIGN_LEFT:case null:e=elementX(a)-elementX(this.container);break;case dropmenu.ALIGN_RIGHT:this.menu.style.left='-9999px';this.menu.style.top='-9999px';CSS.removeClass(this.menu,'hidden_elem');var b=Vector2.getElementDimensions(this.menu).x;var d=Rect.getElementBounds(a).r-elementX(this.container);var c=4;e=d-b+c*2;CSS.addClass(this.menu,'hidden_elem');break;}var f=elementY(a)-elementY(this.container);this.menu.style.left=e+'px';this.menu.style.top=f+'px';}};function hover_menu(a){if(this==window){return new hover_menu(a);}else{this.parent.construct(this,a);this.timeOut=0;this.clickHandle.remove();this.enterTimer=null;this.exitTimer=null;}}hover_menu.extend('dropmenu');hover_menu.prototype.setTimeoutInterval=function(a){this.timeOut=a;return this;};hover_menu.prototype._clickTarget_onmouseover=function(b,a){clearTimeout(this.exitTimer);if(!this.isShown)this.enterTimer=setTimeout(function(){this._show();}.bind(this),this.timeOut);};hover_menu.prototype._clickTarget_onmouseout=function(c,a){a=a||window.event;var b=(a.relatedTarget)?a.relatedTarget:a.toElement;if(DOM.contains(c,b))return;clearTimeout(this.enterTimer);if(this.isShown&&!DOM.contains(this.menu,b))this.exitTimer=setTimeout(function(){this._hide();}.bind(this),this.timeOut);};hover_menu.prototype._menu_onmouseover=function(b,a){clearTimeout(this.exitTimer);};hover_menu.prototype._menu_onmouseout=function(c,a){a=a||window.event;var b=(a.relatedTarget)?a.relatedTarget:a.toElement;if(DOM.contains(c,b))return;clearTimeout(this.enterTimer);if(this.isShown)this.exitTimer=setTimeout(function(){this._hide();}.bind(this),this.timeOut);};hover_menu.prototype.initialize=function(){if(!this.menu)this._buildMenu();this.clickTarget.listen('mouseover',this._clickTarget_onmouseover.bind(this,this.clickTarget));this.clickTarget.listen('mouseout',this._clickTarget_onmouseout.bind(this,this.clickTarget));this.menu.listen('mouseout',this._menu_onmouseout.bind(this,this.menu));this.menu.listen('mouseover',this._menu_onmouseover.bind(this,this.menu));this._positionMenu();return this;};
function custom_source(b){this.parent.construct(this);if(b.length&&typeof(b[0])=="string")for(var a=0;a<b.length;a++)b[a]={t:b[a],i:b[a]};this.values=b;this.build_index();}custom_source.extend('static_source');custom_source.prototype.text_placeholder=custom_source.prototype.text_noinput=false;custom_source.prototype.gen_html=function(c,a){var b=['<div>',typeahead_source.highlight_found(c.t,a),'</div>'];if(c.s)b.push('<div><small>',htmlspecialchars(c.s),'</small></div>');return b.join('');};
function newBoxAdded(f,b,g,e){if(!ge(e+b))return;var a=$(e+b);var c=document.createElement('div');var d='<div class="popcontent_advanced border_frame">'+'<div class="pop_content popcontent_old" id="pop_content"></div>'+'<div class="dialog_buttons">'+'<input type="submit" class="inputsubmit inputbutton" value="Keep"/>'+'<input type="submit" class="inputaux inputbutton" value="Remove">'+'</div></div>';set_inner_html(c,d);c.getElementsByTagName('input')[0].onclick=function(){animation(a.previousSibling).to('opacity',0).duration(200).hide().go();return false;};c.getElementsByTagName('input')[1].onclick=function(){removeAppBox(f,b,g,e);DOM.remove(a.previousSibling);};CSS.addClass(c,'add_new_box_border');c.childNodes[0].style.width=a.offsetWidth+20+'px';c.childNodes[0].style.position='absolute';c.childNodes[0].childNodes[0].style.height=a.offsetHeight+9+'px';a.parentNode.insertBefore(c,a);animation(DOMScroll.getScrollRoot()).to('scrollTop',elementY(a)-40).ease(animation.ease.end).duration(800).go();}function removeAppBox(d,b,e,c){if(!ge(c+b))return false;new AsyncRequest().setURI('/ajax/profile/box.php').setData({profile_id:d,app_id:b,action:'remove',tab_id:e}).send();var a=$(c+b);animation(a).to('opacity',0).duration(200).hide().ondone(DOM.remove.bind(null,c+b)).go();return false;}function moveToTab(d,a,b,e,f,c){new AsyncRequest().setURI('/ajax/profile/box.php').setData({to_tab:e,profile_id:d,app_id:a,action:'move_to_tab',from_tab:b}).setHandler(function(g){tab_controller.dirtyCachedView(f);if(f=='feed'||f=='wall')tab_controller.dirtyCachedView('box_3');DOM.remove('box_app_'+a);goURI(c);DOMScroll.scrollTo(new Vector2(0,0,'document'),false);}).send();return false;}
function ProfileTabController(j,u,e,s,m,f,n,r,p,b,k,a,l,g){this.tabs={};this.addTabLink=null;this.moreLink=null;this.topBar=s;this.numTabs=0;addEventBase($('top_bar_pic'),'click',function(v,event){v.onselect('wall');return Event.kill(event);}.bind(null,this));var q=m.getElementsByTagName('li');for(var i=0;i<q.length;i++){var d=q[i].getAttributeNode('view');if(d?d.specified:false){var t=q[i].getAttribute('view');if(CSS.hasClass(q[i],'selected'))this.currentView=t;this._hookUpTab(q[i],t);this.tabs[t]=q[i];var c=q[i].getElementsByTagName('a')[0];$(c).listen('click',function(event){if(this.activeDrag)return event.kill();});if(q[i].getElementsByTagName('a').length>1){var h=q[i].getElementsByTagName('a')[1];this._hookUpEdit(h,t,c.innerHTML);}this.numTabs++;}}if(ge(r)){this.tab_more=$(r);this.moreDropMenu=dropmenu(this.tab_more.childNodes[0]).registerHTMLMenu('menu_tab_more').setPosition(dropmenu.ALIGN_LEFT).addHook('show',function(){CSS.addClass(this.tab_more,'selected_tab_more');}.bind(this)).addHook('hide',function(){CSS.removeClass(this.tab_more,'selected_tab_more');}.bind(this));}if(ge(p)){this.add_tab=$(p);CSS.removeClass(this.add_tab,'hidden_elem');this.addMenu=flyout_menu(this.add_tab.childNodes[0]).registerHTMLMenu('flyout_menu_profile_add_tab').setMenuClickArea(DOM.find($('profile_tab_add'),'div.add_tab_app_typeahead')).setPosition(dropmenu.ALIGN_LEFT).addHook('show',function(){CSS.addClass(this.add_tab,'selected_menu_icon');}.bind(this)).addHook('hide',function(){CSS.removeClass(this.add_tab,'selected_menu_icon');}.bind(this));}this.id=j;this.viewer=u;this.is_impersonated=k;this.can_edit=e;this.root=m;this.canvas=f;this.leftColumn=f.firstChild;this.href='';this.cachedTabs={};this.ads_wanted=a;this.rightColumn=$('tab_canvas');if(!b){this.cachedTabs[n]=this.rightColumn.childNodes[0];}else onloadRegister(this.selectView.bind(this,n));this.nonSortables=l;this.maxSortableTabs=ProfileTabController.MAX_TABS-this.nonSortables.length;this.composerTab=g;if(e){this.sortableMainRoot=$('profile_tabs');this.sortableMoreRoot=this.tab_more&&this.tab_more.getElementsByTagName('ul')[0];this.sortableMain=new SortableGroup();if(this.sortableMore=this.sortableMoreRoot&&new SortableGroup())this.sortableMain.link(this.sortableMore);this.sortableMain.setLinkJumpHandler(this.onSortableLinkJump.bind(this));for(t in this.tabs){var o=this.tabs[t];if(!this.nonSortables.contains(o.getAttribute('view')))(o.parentNode==this.sortableMainRoot?this.sortableMain:this.sortableMore).addSortable(t,o,o.getElementsByTagName('a')[0]);}this.sortableMain.setOrderChangeHandler(this.saveTabOrder.bind(this));this.sortableMore.setOrderChangeHandler(this.saveTabOrder.bind(this));}PageTransitions.registerHandler(bind(this,'handleNavigation',n));tab_controller=this;}ProfileTabController.MAX_TABS=6;ProfileTabController.twoColumnViews={posts:true,info:true,wall:true};ProfileTabController.facebookTabs=['wall','posts','info','photos','box_3','app_2347471856','app_2392950137','app_2344061033','app_2373072738','app_6261817190'];ProfileTabController.prototype.getLastDisplayedView=function(){var a=this.sortableMain.getOrder();if(!a.length)return null;return a[a.length-1];};ProfileTabController.prototype.getFirstOverflowView=function(){var a=this.sortableMore.getOrder();if(!a.length)return null;return a[0];};ProfileTabController.prototype.onSortableLinkJump=function(b){var d=this.sortableMain.getOrder(),c=null;if(d.length>this.maxSortableTabs){for(var a=d.length-1;a>=0;a--)if(d[a]!=b&&d[a]!=this.currentView){c=d[a];break;}this.sortableMoreRoot.insertBefore(this.tabs[c],this.sortableMoreRoot.firstChild);this.sortableMore.migrateLinkedSortable(c);}else if(d.length<this.maxSortableTabs){d=this.sortableMore.getOrder();for(var a=0;a<d.length;a++)if(d[a]!=b){c=d[a];break;}this.sortableMainRoot.insertBefore(this.tabs[c],this.tab_more);this.sortableMain.migrateLinkedSortable(c);}if(this.moreDropMenu)this.moreDropMenu._positionMenu();};ProfileTabController.prototype._hookUpTab=function(d,e,a){var c=null;if(this.numTabs>=ProfileTabController.MAX_TABS){if(a){var b=$('tabs_more_menu').firstChild;b.appendChild(d);this.numTabs++;CSS.removeClass(this.tab_more,'hidden_elem');c=this.sortableMore;}}else if(a){if(this.tab_more){this.root.insertBefore(d,this.tab_more);}else this.root.insertBefore(d,this.add_tab);this.numTabs++;c=this.sortableMain;}if(c)c.addSortable(e,d,d.getElementsByTagName('a')[0]);};ProfileTabController.prototype.onselect=function(a){if(this.currentView==a||this.waitingForAjax)return;goURI(URI.getRequestURI().addQueryData({v:a}));};ProfileTabController.prototype._hookUpEdit=function(e,d,a){var c=document.createElement('div');var b=document.createElement('a');b.innerHTML=_tx("Delete Tab");b.setAttribute('href','#');b.onclick=this.deleteTab.bind(this,d);c.appendChild(b);flyout_menu(e).setMarkupContent('edit_menu_'+d,'link_menu flyout_menu_18',_tx("Tab Options"),c).addHook('show',function(){CSS.addClass(e,'selected');}.bind(this)).addHook('hide',function(){CSS.removeClass(e,'selected');}.bind(this));return false;};ProfileTabController.prototype.handleNavigation=function(a,h){var e=h.getQueryData();var f=e.viewas||this.viewer;var c=function(i){if(this.ads_wanted&&parseInt(this.viewer)>0)ads_refresh(this.currentView,new URI(h).getPath(),false,false,false,i);PageTransitions.transitionComplete();}.bind(this);if(e.app_page){this.selectPage(e.fbhref,c);return true;}if(e.story_fbid)return false;if(!(ProfileURIController.isDestinationURIProfilePage(h)&&f==this.viewer))return false;if(!e.v&&this.currentView==a)return false;if(window.ProfilePhotosTabController){var g=ProfilePhotosTabController.transitionHandler(this.currentView,h,a);if(g!==null)return g;}var b={v:1,id:1,viewas:1,ref:1};for(var d in e)if(!b[d])return false;if(e.ref=='search')search_log_2nd_action('Select tab:'+e.v);this.selectView(e.v||a,c);return true;};ProfileTabController.prototype.selectView=function(b,a){if(this.addMenu)this.addMenu.hide();if(!this.tabs[b]){new URI('/profile.php').addQueryData({v:b}).go();return false;}this.selectTab(b);if(!ProfileTabController.twoColumnViews[b]&&ProfileTabController.twoColumnViews[this.currentView]){CSS.removeClass(document.body,'profile_two_columns');}else if(ProfileTabController.twoColumnViews[b]&&!ProfileTabController.twoColumnViews[this.currentView])CSS.addClass(document.body,'profile_two_columns');this.changePage(b,'',a);};ProfileTabController.prototype.selectTab=function(h){if(intl_locale_is_rtl()){var g='padding-left';}else var g='padding-right';for(var c in this.tabs)if(c==h){if(this.sortableMore&&this.sortableMore.getOrder().contains(h)){var e=this.getLastDisplayedView();var d=this.tabs[e];var b=this.getFirstOverflowView();var a=this.tabs[b];var f=d.previousSibling;DOM.insertBefore(d,a);DOM.insertAfter(f,this.tabs[c]);this.sortableMore.migrateLinkedSortable(e);this.sortableMain.migrateLinkedSortable(h);}if(this.tabs[c].childNodes[1]){animation(this.tabs[c].childNodes[0]).from(g,'11px').to(g,'25px').duration(100).go();animation(this.tabs[c].childNodes[1]).from('width','0').to('width','19px').duration(100).go();}CSS.addClass(this.tabs[c],'selected');}else if(CSS.hasClass(this.tabs[c],'selected')){CSS.removeClass(this.tabs[c],'selected');if(this.tabs[c].childNodes[1])animation(this.tabs[c].childNodes[0]).from(g,'25px').to(g,'11px').duration(100).go();}};ProfileTabController.prototype.selectPage=function(a,b){this.changePage(this.currentView,a,b);};ProfileTabController.prototype.fetchPage=function(e,b,a,c,d){c=c||'';subdomain=ProfileTabController.facebookTabs.contains(e)?'www':'apps';var f={id:this.id,v:e,href:b,iframe:true};if(this.is_impersonated&&this.viewer)f.viewas=this.viewer;new AsyncRequest().setOption('useIframeTransport',true).setReadOnly(true).setMethod('GET').setURI(new URI('/ajax/profile/tab.php').setSubdomain(subdomain)).setData(f).setContextData('src_tab_name',c).setContextData('dst_tab_name',e).setNectarActionData().setHandler(function(h){var g=h.getPayload();if(g.redirect){goURI(g.redirect);}else{var i=!b;a(HTML(g.tab_content),e,i,g.additional_content);}}.bind(this)).setFinallyHandler(function(g){this.waitingForAjax=false;d&&d(0);}.bind(this)).send();this.waitingForAjax=true;};ProfileTabController.prototype.changePage=function(f,a,d){var e=this.rightColumn;while(this.rightColumn.childNodes.length)this.rightColumn.removeChild(this.rightColumn.childNodes[0]);CSS.addClass(this.rightColumn,'loading');var b=this.currentView;this.currentView=f;this.href=a;var c=function(k,m,l,g){if(g)for(var j=0;j<g.length;++j){var h=g[j];DOM.setContent($(h.div_id),HTML(h.html));}CSS.removeClass(e,'loading');var n;if(k instanceof HTML){var i=$N('div');e.appendChild(i);DOM.setContent(i,k);if(l)this.cachedTabs[m]=i;n=false;}else{e.appendChild(k);n=true;}}.bind(this);if(this.cachedTabs[f]&&!a&&(b!=f)){c(this.cachedTabs[f],f,true);d&&d(1);}else this.fetchPage(f,a,c,b,d);};ProfileTabController.prototype.dirtyCachedView=function(a){if(this.cachedTabs[a])delete this.cachedTabs[a];};ProfileTabController.prototype.addNewTab=function(g,a,f,b){if(this.addMenu)this.addMenu.hide();var e=document.createElement('li');var d=document.createElement('a');CSS.setClass(d,'tab_link');d.innerHTML=f;var c=document.createElement('a');CSS.setClass(c,'edit');e.appendChild(d);e.appendChild(c);if(b){new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'add_app_tab'}).setHandler(function(h){var i='box_'+h.payload.tab_id;e.setAttribute('view',i);this._hookUpTab(e,i,true);this._hookUpView(e,d,c,f,i);if(g)CSS.addClass(g,'hidden_elem');}.bind(this)).send();}else new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'add_tab',tab_id:a}).setHandler(function(h){var i=(f=="Photos"?'photos':'app_'+a);e.setAttribute('view',i);this._hookUpTab(e,i,true);this._hookUpView(e,d,c,f,i);if(g)CSS.addClass(g,'hidden_elem');}.bind(this)).send();};ProfileTabController.prototype._hookUpView=function(e,d,c,a,g){var b=ProfileURIController.getCurrentProfileBaseURI();var f={v:g};if(this.is_impersonated&&this.viewer)f.viewas=this.viewer;d.href=b.addQueryData(f).toString();this._hookUpEdit(c,g,a);this.tabs[g]=e;this.onselect(g);};ProfileTabController.prototype.editTabName=function(j,d){var i=j.split('_')[1];var h=this.tabs[j];h.style.width=h.offsetWidth-2+'px';h.style.height=h.offsetheight+'px';var c=h.firstChild.offsetWidth-16;for(var e=0;e<h.childNodes.length;e++)hide(h.childNodes[e]);var f=document.createElement('form');var g=DOM.find(h,'.app_tab_title').innerHTML;f.innerHTML='<input type="text" id="tab_name_edit" class="inputtext" style="width:'+c+'px" value="'+g+'">';h.appendChild(f);$('tab_name_edit').focus();function b(k){f.onsubmit();}function a(k){Event.kill(k);}f.onsubmit=function(){var l=f.firstChild.value;var m=DOM.find(h,'.app_tab_title');m.innerHTML=l;h.removeChild(f);for(var k=0;k<h.childNodes.length;k++)show(h.childNodes[k]);document.body.removeEventListener('click',b,false);h.removeEventListener('click',a,true);new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'rename_tab',tab_id:i,tab_name:l}).send();h.style.width=null;return false;}.bind(this);document.body.addEventListener('click',b,false);h.addEventListener('click',a,true);Event.kill(d);};ProfileTabController.prototype.deleteTab=function(h){var g;if(h=='photos'){g=2305272732;}else g=h.split('_')[1];new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'delete_tab',tab_id:g}).send();var b=this.getFirstOverflowView();var a=this.tabs[b];var d=this.getLastDisplayedView();var c=this.tabs[d];if(b)DOM.insertAfter(c,a);this.sortableMain.migrateLinkedSortable(b);this.sortableMain.removeSortable(h);this.root.removeChild(this.tabs[h]);delete this.tabs[h];this.numTabs--;var e=ge('new_tab_'+g);if(e)CSS.removeClass(e,'hidden_elem');var f=this.getFirstOverflowView();if(!f)CSS.addClass(this.tab_more,'hidden_elem');this.onselect('wall');return false;};ProfileTabController.prototype.saveTabOrder=function(){var a=this.sortableMain.getOrder();if(this.sortableMore)a=a.concat(this.sortableMore.getOrder());new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'reorder_tabs',tab_order:a}).send();};var ProfileURIController={_profileId:0,_profilePage:false,init:function(a){this._profileId=a;this._profileURI=URI.getRequestURI();this._setProfilePage(true);onunloadRegister(this._setProfilePage.bind(this,false));},_setProfilePage:function(a){this._profilePage=a;},isProfilePage:function(){return this._profilePage;},isDestinationURIProfilePage:function(b){if(!this.isProfilePage())return false;var a=b.getQueryData().id;if(b.getPath()=='/profile.php')return a==this._profileId;return this._profileURI.getPath()==b.getPath();},getCurrentProfileBaseURI:function(){var b=URI.getMostRecentURI();var a=b.getQueryData().id;var c={};if(a)c.id=a;return b.setQueryData(c);}};

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