/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  February 10th 2010 3:33:33 AM PST                            */
/*      Machine:  10.16.139.108                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/41u4hl3y3mg4wwg8.pkg.js h:a5fd7j9d                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/41u4hl3y3mg4wwg8.pkg.js                                   */

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

var SocialGraphManager=function(){var _L0=false;var _L1=-1;var _L2=-1;var _L3=null;var _L4=function(_L7){if(!_L0)return null;var _L8={'class':_L1,'node_id':_L2};copy_properties(_L7,_L8);return _L7;};var _L5=function(uri,_L8,_L9){new AsyncRequest().setURI(uri).setData(_L4(_L8)).setHandler(_L9?_L9:bagofholding).send();return false;};var _L6=function(uri,_L8){if(!(_L8=_L4(_L8)))return;var _L9=new AsyncRequest().setMethod('POST').setURI(uri).setData(_L8);_L3=new Dialog().setModal(true).setAsync(_L9).show();return false;};return {init:function(_L7,_L8){_L0=true;_L1=_L7;_L2=_L8;return this;},getCurrentNodeID:function(){return _L2;},showInviteDialog:function(){_L6('/ajax/social_graph/invite_dialog.php',{});},showAddAdminDialog:function(){_L6('/ajax/social_graph/add_admin_dialog.php',{});},showBrowseDialog:function(_L7){var _L8=URI.getRequestURI().getQueryData();if('viewas' in _L8){if(_L7==null)_L7={};_L7['viewas']=_L8['viewas'];}_L6('/ajax/social_graph/dialog/browse.php',_L7||{});},submitDialog:function(_L7,_L8){if(Dialog.getCurrent()){var _L9=serialize_form($(_L7));Dialog.getCurrent().hide();if(_L9['ids']||_L9['email_addresses'])_L6(_L8,_L9);}},cancelDialog:function(){if(_L3)_L3.hide();},fetch:function(_L7,_L8,_L9,_La,_Lb){var uri='/ajax/social_graph/fetch.php';var _Ld={'edge_type':_L7,'page':_L9,'limit':_La};var _Le=URI.getRequestURI().getQueryData();if('viewas' in _Le)_Ld['viewas']=_Le['viewas'];if(_L8)copy_properties(_Ld,_L8);return _L5(uri,_Ld,_Lb);},search:function(_L7,_L8,_L9){var uri='/ajax/social_graph/search.php';var _Lb={'query':_L7};if(_L8)copy_properties(_Lb,_L8);return _L5(uri,_Lb,_L9);},add:function(_L7,_L8,_L9,_La,_Lb,_Lc){var uri='/ajax/social_graph/add.php';var _Le={'fbids':_L7,'edge_type':_L8,'app_id':_La,'message':_Lb};if(_L9)copy_properties(_Le,_L9);return _L5(uri,_Le,_Lc);},remove:function(_L7,_L8,ban,_La,_Lb,_Lc){var uri='/ajax/social_graph/remove.php';var _Le={'fbid':_L7,'edge_type':_L8,'ban':ban,'message':_Lb};if(_La)copy_properties(_Le,_La);return _L5(uri,_Le,_Lc);}};}();
function ProfileStream(_L0,_L1,_L2,_L3,_L4,_L5,_L6,_L7){this.profile_id=_L0;this.viewer_id=_L1;this.filter=_L3;this.can_edit=_L5;this.is_page=_L6;this.is_split=_L7;this.settings_loaded=false;this.min_time=0;this.max_time=_L2;this.ajax_endpoint_uri='/ajax/stream/profile.php';this.streamElem=$('profile_minifeed');this.streamContainerElem=$('profile_stream_container');this.settingsElem=ge('profile_settings');this.pagerNextElem=ge('profile_pager_container');this.cache={};this.cache[this.filter]={'html':this.streamElem.innerHTML,'max_time':this.max_time,'see_more':_L4};if(ua.ie()<7){var _L8=null,_L9=$('profile_minifeed');var _La=function(_Lb){while(_Lb!=_L9&&!CSS.hasClass(_Lb,'UIStory'))_Lb=_Lb.parentNode;return CSS.hasClass(_Lb,'UIStory')&&_Lb;};Event.listen(_L9,'mouseover',function(_Lb){_L8=_La(_Lb.getTarget());_L8&&CSS.addClass(_L8,'UIStory_hover');});Event.listen(_L9,'mouseout',function(_Lb){_L8&&CSS.removeClass(_L8,'UIStory_hover');});}if(ProfileStream.instance)delete ProfileStream.instance;ProfileStream.instance=this;return this;}ProfileStream.getInstance=function(){return ProfileStream.instance;};ProfileStream.animationDuration=300;ProfileStream.dirtyCache=function(){if(stream=ProfileStream.getInstance())stream.cache={};};ProfileStream.FILTER={'ALL_POSTS':1,'POSTS_BY_ME':2,'POSTS_BY_OTHERS':3,'SINGLE_STORY':4,'SETTINGS':-1};ProfileStream.clearStatus=function(_L0){new AsyncRequest().setURI('/ajax/updatestatus.php').setData({'profile_id':_L0,'clear':1}).setHandler(ProfileStream.clearStatusUI).send();};ProfileStream.clearStatusUI=function(){var ps=$('profile_status');animation(ps).to('opacity',0).duration(200).ondone(function(){CSS.addClass(ps,'hidden_elem');}).go();};ProfileStream.setOnVisible=function(_L0){ProfileStream.onVisible=_L0;};ProfileStream.prototype.setStatus=function(_L0){if(this.can_edit&&_L0){var ps=ge('profile_status');if(!ps)return;var _L2=150;var st=$('status_text');var sti=$('status_time_inner');var _L5=function(){st.setContent(HTML(_L0));sti.setContent(HTML(_tx("poco fa")));var _L6=ge('status_source');var _L7=ge('status_mobile_indicator');if(_L6)CSS.addClass(_L6,'hidden_elem');if(_L7)CSS.addClass(_L7,'hidden_elem');CSS.removeClass(ps,'hidden_elem');new animation(ps).to('opacity',1).duration(_L2).go();};if(DOM.getText(st).trim()){new animation(ps).to('opacity',0).duration(_L2).ondone(_L5).go();}else{CSS.setOpacity(ps,0);_L2=300;_L5();}}};ProfileStream.prototype.addContent=function(_L0){var _L1=bagofholding;var _L2=false;var _L3=null;if(this.filter!=ProfileStream.FILTER.ALL_POSTS){if(this.can_edit&&this.filter!=ProfileStream.FILTER.POSTS_BY_ME){_L2=true;_L3=this.is_split?_tx("Questo post verr\u00e0 trasferito nella scheda Stream."):_tx("Questo post apparir\u00e0 nel tuo filtro.");}if(!this.can_edit&&this.filter!=ProfileStream.FILTER.POSTS_BY_OTHERS){_L2=true;_L3=this.is_split?_tx("Questo messaggio verr\u00e0 spostato in Bacheca."):(this.is_page?_tx("Questo post apparir\u00e0 nel filtro Sostenitori."):_tx("Questo post apparir\u00e0 nel filtro Amici."));}}if(_L2){var _L4=HTML('<div class="UIMessageBox status">'+_L3+'</div>');_L0=DOM.create('div',{},[_L4,_L0]);_L1=function(){animation(_L0).duration(6000).checkpoint().to('opacity','0').duration(ProfileStream.animationDuration).ondone(function(){DOM.remove(_L0);}).go();};}CSS.setStyle(_L0,'height','0px');CSS.setOpacity(_L0,'0');var _L5=this.streamElem.find('div.UIIntentionalStory_Profile_First');if(_L5)_L5.removeClass('UIIntentionalStory_Profile_First');CSS.addClass(_L0,'UIIntentionalStory_Profile_First');$(this.streamElem).prependContent(_L0);ProfileStream.dirtyCache();new animation(_L0).to('height','auto').to('opacity','1').duration(ProfileStream.animationDuration).ondone(_L1).go();var _L6=this.streamElem.scry('div.empty_wall');if(_L6.length)new animation(_L6[0]).to('opacity','0').duration(ProfileStream.animationDuration).ondone(function(){DOM.remove(_L6[0]);}).go();};ProfileStream.prototype.fadeAndSwap=function(e1,e2){animation(e1).to('opacity',0).duration(100).hide().ondone(function(){CSS.setOpacity(e2,0);animation(e2).to('opacity',1).from(0).duration(100).show().go();}).go();return true;};ProfileStream.prototype.showSettings=function(_L0){if(this.filter==ProfileStream.FILTER.SETTINGS)return false;this.filter=ProfileStream.FILTER.SETTINGS;var _L1=function(){this.fadeAndSwap(this.streamContainerElem,this.settingsElem);}.bind(this);if(this.settings_loaded){_L1();}else{var _L2={id:this.profile_id};var _L3=URI.getRequestURI().getQueryData();var _L4=['show_importer','import_sid','import_uid'];for(var i=0;i<_L4.length;++i){var _L6=_L4[i];if(_L3[_L6])_L2[_L6]=_L3[_L6];}new AsyncRequest().setMethod('GET').setReadOnly(true).setData(_L2).setHandler(function(_L7){DOM.setContent($('profile_settings'),HTML(_L7.getPayload().innards));this.settings_loaded=true;_L1();}.bind(this)).setURI('/ajax/profile/show_settings.php').send();}return false;};ProfileStream.prototype.loadStream=function(_L0){var _L1=function(_L4,_L5){DOM.setContent(this.streamElem,HTML(_L4));if(_L5)this.fadeAndSwap(this.settingsElem,this.streamContainerElem);}.bind(this);var _L2=this.max_time;var _L3=false;if(this.min_time==0&&this.cache[this.filter]){this.max_time=this.cache[this.filter].max_time;if(this.pagerNextElem)CSS.conditionClass(this.pagerNextElem,'UIShowMore_NoMore',!this.cache[this.filter].see_more);_L1(this.cache[this.filter].html,_L0);_L0=false;_L3=false;}if(ProfileStream.onVisible){ProfileStream.onVisible.remove();ProfileStream.onVisible=null;}this.loading=true;new AsyncRequest().setMethod('GET').setReadOnly(true).setURI(this.ajax_endpoint_uri).setData({profile_id:this.profile_id,viewer_id:this.viewer_id,filter:this.filter,max_time:_L2,try_scroll_load:_L3}).setContextData('clicktype','Filter Stories or Pagination',this.viewer_id!=this.profile_id).setHandler(function(_L4){if(this.max_time==0)this.cache[this.filter]={'html':_L4.payload.stream_html,'max_time':_L4.payload.max_time,'see_more':_L4.payload.see_more};this.max_time=_L4.payload.max_time;if(this.pagerNextElem)CSS.conditionClass(this.pagerNextElem,'UIShowMore_NoMore',!_L4.payload.see_more);_L1(_L4.payload.stream_html,_L0);}.bind(this)).setFinallyHandler(function(){this.loading=false;}.bind(this)).send();};ProfileStream.prototype.showStream=function(_L0){if(this.loading)return false;var _L1=this.filter;this.filter=_L0;this.min_time=0;this.max_time=0;this.loadStream(_L1==ProfileStream.FILTER.SETTINGS);return false;};ProfileStream.prototype.showMore=function(_L0,_L1){this.loading=true;new AsyncRequest().setMethod('GET').setReadOnly(true).setStatusElement(this.pagerNextElem).setURI(this.ajax_endpoint_uri).setData({profile_id:this.profile_id,viewer_id:this.viewer_id,filter:this.filter,is_scroll_load:_L1,max_time:this.max_time}).setContextData('clicktype','Filter Stories or Pagination',this.viewer_id!=this.profile_id).setHandler(function(_L3){if(this.pagerNextElem)CSS.conditionClass(this.pagerNextElem,'UIShowMore_NoMore',!_L3.payload.see_more);DOM.appendContent(this.streamElem,HTML(_L3.payload.stream_html));this.max_time=_L3.payload.max_time;if(this.min_time==0)this.cache[this.filter]={'html':this.streamElem.innerHTML,'max_time':this.max_time,'see_more':_L3.payload.see_more};}.bind(this)).setFinallyHandler(function(){this.loading=false;}.bind(this)).send();if(!_L1){var _L2={src:ft.NF_SOURCE_MINIFEED,evt:ft.NF_EVENT_SEE_MORE,actrs:this.profile_id,type:'page'};ft.logData(_L2);}};ProfileStream._createDialogOptionField=function(id,_L1){var _L2='<div class="dialog_option">'+'<input type="checkbox" id="'+id+'"/>'+'<span class="dialog_option_text">'+_L1+'</span>'+'</div>';return _L2;};

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