/*
HTTP Host: static.ak.fbcdn.net
Generated: March 16th 2010 2:42:42 PM PDT
Machine: 10.16.140.101
Locale: nu_ll
Path: js/2kw20ls2uuio080s.pkg.js
*/

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

function ads_fetch_admarket_ad(g,e,a,d,c,f){var b={page:g,location:e,adnetwork_id:a,netego:f?f:false};var h=new AsyncRequest().setURI(muffinize('/muffins/ajax/fetch_admarket_muffin.php')).setData(b).setHandler(d).setErrorHandler(c).send();}
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 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("Supprimer l'onglet");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("Options de l'onglet"),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);}};
function motion_spawn_delete_dialog(c,b){var a={v:c,delete_dialog:true};if(b)a.parent_oid=b;new AsyncRequest().setURI('/ajax/motion.php').setData(a).setHandler(function(d){dialog_data=d.getPayload();_motion_show_delete_dialog(c,dialog_data.preview_content,dialog_data.success_content,b);}).send();}function _motion_show_delete_dialog(e,a,d,c){var b=new Dialog().setTitle(a.title).setBody(a.html).setButtons([Dialog.newButton(a.verb.toLowerCase(),a.verb,'',function(){_motion_delete_video(e,d,c);}),Dialog.CANCEL]).show();}function _motion_delete_video(d,c,b){var a={delete_video:true,v:d};if(b)a.parent_oid=b;new AsyncRequest().setURI('/ajax/motion.php').setData(a).setHandler(function(f){var e=Dialog.getCurrent();if(e)e.hide();new Dialog().setTitle(c.title).setBody(c.html).show();goURI.bind(null,c.url).defer(2000);}).send();}function motion_show_profile_video_dialog(d,a,c){var b=new Dialog().setTitle(a.title).setBody(a.html).setButtons([Dialog.newButton('make-profile-video',_tx("Faire de cette vid\u00e9o ma vid\u00e9o de profil"),'',function(){_motion_set_profile_video(d,c);}),Dialog.CANCEL]).show();}function _motion_set_profile_video(b,a){new AsyncRequest().setURI('/ajax/motion.php').setData({profile_video:1,v:b}).setHandler(function(c){goURI('/video/video.php?profile&v='+b);return true;}).send();}function video_send_email_when_processed(c,b){var a={action:'set_send_email',video_id:c,send_email:b?1:0};new AsyncRequest().setURI('/ajax/motion_upload.php').setData(a).setHandler(function(d){$('notification_status').innerHTML=d.getPayload();}).send();}var recorder_dialog;function motion_submit_video_handler(a){video_id=a.video_id;video_category=a.video_category;oid=a.parent_oid;if(!video_id)goURI('/video/editvideo.php?error');switch(video_category){case 1:new AsyncRequest().setURI('/ajax/motion_fvr_dialog.php').setData({action:'fvr_get_permalink',video_id:video_id}).setHandler(function(b){inboxAttachments.attach_link_url(ge('attachment_stage_area'),b.getPayload(),true);}).send();break;case 2:new AsyncRequest().setURI('/ajax/motion.php').setData({obj_attach:1,v:video_id,parent_oid:oid}).setHandler(function(b){goURI('/video/editvideo.php?created&v='+video_id+'&oid='+oid);}).send();break;case 0:default:goURI('/video/editvideo.php?created&v='+video_id);break;}}function video_add_video_msg_inputs(b){video_id=b.video_id;if(inboxAttachments.is_active){var a=ge(inboxAttachments.edit_id);}else var a=ge(wallAttachments.edit_id);if(a)if(ge('video_msg_id')){$('video_msg_id').value=video_id;}else{var d=document.createElement('input');d.name='attachment[params][0]';d.id='video_msg_id';d.value=video_id;d.type='hidden';var c=document.createElement('input');c.name='attachment[type]';c.id='video_msg_share_type';c.value=15;c.type='hidden';a.appendChild(d);a.appendChild(c);}}function video_remove_video_msg_inputs(){if(inboxAttachments.is_active){var a=ge(inboxAttachments.edit_id);}else var a=ge(wallAttachments.edit_id);if(a){var b=ge('video_msg_id');if(b){a.removeChild(b);var c=ge('video_msg_share_type');if(c)a.removeChild(c);}}}function video_toggle_dialog(b,c){var a={action:'toggle_dialog',dialog_type:b,dialog_value:c};new AsyncRequest().setURI('/ajax/motion_invite.php').setData(a).setHandler(function(d){}).send();}

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