/*!CK:1852560417!*//*1403500152,*/ if (self.CavalryLogger) { CavalryLogger.start_js(["A39Ol"]); } __d("InteractionLogger",["Arbiter","Banzai","Event","copyProperties"],function(a,b,c,d,e,f,g,h,i,j){function k(l,m){m=m||{};this.profiler={};this.log={};this.lastInteraction=Date.now();this.interactionTime=0;this.eventSequence=[];this.projectName=l;if(m.trackInteractionTime)i.listen(document.body,'mousemove',this._pingActive.bind(this));if(m.submitOnLeave||m.submitOnLeave===undefined)this.arbiterToken=g.subscribe('onload/exit',function(){this.submit();this.arbiterToken.unsubscribe();}.bind(this));}j(k,{IDLE_LIMIT:20000});j(k.prototype,{set:function(l,m){this.log[l]=m;},tap:function(l){this.eventSequence.push(l);},bump:function(l,m){if(m===undefined)m=1;this.log[l]=(this.log[l]||0)+m;},bumpTap:function(l,m){this.tap(l);this.bump(l,m);},startRun:function(l){if(!this.profiler[l])this.profiler[l]={average:0,count:0};this.profiler[l].start=+new Date();},endRun:function(l){if(!this.profiler[l]||!this.profiler[l].start)return;this._recordRun(l,new Date()-this.profiler[l].start);this.profiler[l].start=null;},getLog:function(){this._updateLog();return this.log;},submit:function(){this._updateLog();h.post(this.projectName,this.log);},_pingActive:function(){var l=Date.now(),m=l-this.lastInteraction;if(m<(k.IDLE_LIMIT))this.interactionTime+=m;this.lastInteraction=l;},_updateLog:function(){for(var l in this.profiler){this.log[l+'-count']=this.profiler[l].count;this.log[l+'-average']=this.profiler[l].average;}if(this.interactionTime)this.log['interaction-time']=this.interactionTime;if(this.eventSequence.length)this.log['event-sequence']=this.eventSequence;},_recordRun:function(l,m){var n=this.profiler[l];n.average=(n.average*n.count+m)/(n.count+1);n.count++;}});e.exports=k;},null); __d("MapPager",["ArbiterMixin","Event","mixin"],function(a,b,c,d,e,f,g,h,i){var j=i(g);for(var k in j)if(j.hasOwnProperty(k))m[k]=j[k];var l=j===null?null:j.prototype;m.prototype=Object.create(l);m.prototype.constructor=m;m.__superConstructor__=j;function m(n,o){"use strict";h.listen(n,'click',this.inform.bind(this,'previous'));h.listen(o,'click',this.inform.bind(this,'next'));}e.exports=m;},null); __d("TimelineMapStory",["copyProperties"],function(a,b,c,d,e,f,g){function h(i){g(this,i);}e.exports=h;},null); __d("TimelineMapController",["AggregatedMap","shield","AggregatedMapCalloutOrientation","AggregatedMapPin","AggregatedMapRedPinSprite","Arbiter","AsyncRequest","BingMapCoordinate","CSS","DOM","MapRects","Rect","Style","TimelineMapPlace","TimelineMapStory","Vector","$","copyProperties","isEmpty","mod","randomShuffle"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa){var ba=198,ca=132,da=108;function ea(fa,ga,ha,ia,ja,ka,la){this.profileID=null;this.viewasID=null;this.places={};this.visiblePins=null;this.stories={};this.hiddenStories={};this.placesByTime=[];this.category=null;this.pending=null;this.waitingOnConfirmation=false;this.highlightedPin=null;this.arbiterListeners=[];this.calloutBeingFetched=null;this.initialized=false;this._lastResizeCalloutAnchor=null;this._lastResizeCalloutStoryHeight=null;this._lastResizeCalloutStory=null;this._scrollableCalloutController=null;this.inCreation=false;this.lastTypeaheadEvent=null;this.initialPosition=null;this.initialPlace=null;this.initialStory=null;this.hh=0;this.ww=0;this.smartPan=null;this.requestID=0;this.asyncRequests={};this.intervals=[];this.groups=[];this.pagerIndex=null;this.categoryCountUnique={};if(fa)this._init(fa,ga,ha,ia,ja,ka,la);}x(ea.prototype,{HOVER_FETCH_DELAY:100,HOVER_DISMISS_DELAY:300,MAP_BOTTOM_PADDING:40,MIN_MAP_HEIGHT:532,MIN_CALLOUT_STORY_HEIGHT:200,MAX_CALLOUT_HEIGHT:600,RESIZE_CHECK_INTERVAL:50,HOVERCARD_WIDTH:279,HOVERCARD_HEIGHT:251,HOVERCARD_CLOSED:undefined,HOVERCARD_WAITING_TO_FETCH:1,HOVERCARD_BEING_FETCHED:2,HOVERCARD_OPEN:3,HOVERCARD_WAITING_TO_DISMISS:4,TIMELINE_MAP_HOVERCARD_PLACE:'Place',TIMELINE_MAP_HOVERCARD_CITY:'City',TIMELINE_MAP_HOVERCARD_REGION:'Region',TIMELINE_MAP_HOVERCARD_COUNTRY:'Country',HOVERCARD_CITY_REGION_HEURISTIC:3,setCategory:function(fa){this.logger&&this.logger.startRun('set-category');this.map.hideCallout();this.category=fa;this._filter();},setCategoryCountUnique:function(fa){this.categoryCountUnique=fa;},getCategories:function(){var fa={},ga,ha;for(var ia in this.places){var ja=this.places[ia],ka={};for(var la=0;la0){this.pagerIndex=0;}else this.pagerIndex=-1;}else this.pagerIndex+=(fa>0)?1:-1;this.pagerIndex=z(this.pagerIndex,this.sortedGroups.length);var oa=this.sortedGroups[this.pagerIndex];if(oa.pins.length>1){this._openCallout(oa,this.map.throbber(325),this.map.leftRightNoPanningStrategy());oa.hoverPermanent=true;oa.hoverState=this.HOVERCARD_WAITING_TO_FETCH;this._fetchHovercard(oa);}else this.aggregatedMapHandler_pinClick(null,oa.pins[0]);},hovercard:function(fa,ga){var ha=this._getAsyncContext(ga.requestID);if(ha.deleted||ha.hoverState!==this.HOVERCARD_BEING_FETCHED)return;ha.hoverState=this.HOVERCARD_OPEN;var ia=p.create('div');ia.onmouseover=function(){if(!this.map||!this.map.getCallout().getAnchor())return null;this.aggregatedMapHandler_bubbleMouseover(null,this.map.getCallout().getAnchor());}.bind(this);ia.onmouseout=function(){if(!this.map||!this.map.getCallout().getAnchor())return null;this.aggregatedMapHandler_bubbleMouseout(null,this.map.getCallout().getAnchor());}.bind(this);o.setClass(ia,'fbTimelineMapHovercard');p.setContent(ia,ga.content);if(ha===this.map.getCallout().getAnchor()){this.map.getCallout().setContent(ia);}else this._openCallout(ha,ia,this.map.leftRightNoPanningStrategy());this.map.getCallout().recalculateArrowYOffset(true);this.logger&&this.logger.endRun('load-hovercard');},callout:function(fa,ga){var ha=this._getAsyncContext(ga.requestID);if(this.map.getCallout().getAnchor()!==ha)return;this._openCallout(ha,ga.content);this.logger&&this.logger.endRun('load-callout');},addPending:function(fa,ga){var ha=ga.count;this.pending=this.pending||0;this.pending+=ha;this._checkReady();},hideCallout:function(fa,ga){ga=ga||{};ga._instanceid=this.instanceID;l.inform('AggregatedMap/hideCallout',ga);},addStories:function(fa,ga){var ha=ga.stories,ia=ga.places;if(ga.count)this.pending=(this.pending||0)-ga.count;var ja,ka,la,ma;for(ma=0;ma1){s.set(this.mapContainer,'height',ja+'px');this.hh=ja;this.ww=this.map.ww;this._resizeMap();}},resizeCallout:function(){var fa=this.map.getCallout().getContent(),ga=p.scry(fa,'.fbTimelineMapScrollableStory');for(var ha=ga.length-1;ha>=0;ha--)if(!o.hasClass(ga[ha],'hidden_elem')){var ia=ga[ha],ja=p.find(ia,'.fbTimelineMapCalloutStory');break;}if(!(fa&&ja&&ia))return;var ka=v.getElementDimensions(ja).y;if(this.map.getCallout().getAnchor()===this._lastResizeCalloutAnchor&&ka===this._lastResizeCalloutStoryHeight&&ja===this._lastResizeCalloutStory)return;var la=p.find(fa,'.fbTimelineMapCalloutHeader'),ma=v.getElementDimensions(la).y,na=v.getElementPosition(ia).y,oa=v.getElementPosition(this.mapContainer).y,pa=this.hh-this.map.CALLOUT_MARGIN,qa=Math.max(this.MIN_CALLOUT_STORY_HEIGHT,Math.min((oa+pa)-na,pa-ma)),ra=Math.min(ka,qa,this.MAX_CALLOUT_HEIGHT);s.set(ia,'height',ra+'px');this._lastResizeCalloutAnchor=this.map.getCallout().getAnchor();this._lastResizeCalloutStoryHeight=ka;this._lastResizeCalloutStory=ja;if(this._scrollableCalloutController)this._scrollableCalloutController.adjustGripper();this.map.getCallout()._updateDimensions();this.map.getCallout().recalculateArrowYOffset();},_filter:function(){var fa=[];for(var ga in this.places){var ha=this.places[ga];ha.setFilters(this.category);if(ha.count()>0){var ia=this._getPlaceSprite(ha),ja=j.create(ha,ia,ha.name);ha.pin=ja;ja.place=ha;fa.push(ja);}}this.visiblePins=fa;if(this.highlightedPin)this.visiblePins.push(this.highlightedPin);this.map.setPins(fa);},_getPlaceSprite:function(fa){var ga=fa.getStories(),ha=ga.length,ia;if(ha>=100){ia=k.largeBlank(ha);}else if(ha>10){ia=k.mediumBlank(ha);}else if(ha>1){ia=k.smallBlank(ha);}else if(ga[0]&&ga[0].pin){ia=k.mediumBlank(1);ia.text=false;ia.image=ga[0].pin+'.png';}else ia=k.dot();return ia;},_getHighlightedSprite:function(){var fa=k.dot();fa.aggregationRadius=0;fa.css='fbTimelineMapHighlighted';return fa;},_highlightPlace:function(fa,ga){this._cleanUpHiglightedPin();var ha;if(fa&&this.places[fa]!==undefined){ha=this.places[fa].pin;ha.setSprite(this._getHighlightedSprite());this.map.redraw();}else{ha=new j(n.fromLatLong(ga),this._getHighlightedSprite());ha.isPreview=true;this.map.addPin(ha);}this.highlightedPin=ha;o.addClass(this.canvas,'fbTimelineMapDimPinMode');return ha;},_showCallout:function(fa,ga,ha){this._openCallout(fa,this.map.throbber(),this.smartPan);this._fetchCallout(fa,ga,ha);},_fetchCallout:function(fa,ga,ha){this.logger&&this.logger.startRun('load-callout');var ia=this._storeAsyncContext(fa),ja=this.places[ga],ka=[],la={},ma=ja.getStories();for(var na=0;na0)if(!ya){cb=this.TIMELINE_MAP_HOVERCARD_COUNTRY;if(ka.length>1){eb=this.TIMELINE_MAP_HOVERCARD_COUNTRY;}else if(ja.length>1){eb=this.TIMELINE_MAP_HOVERCARD_REGION;}else eb=this.TIMELINE_MAP_HOVERCARD_CITY;}if(ja.length>0&&!cb){var ib=this.HOVERCARD_CITY_REGION_HEURISTIC;if(!xa||ja.length>1&&ia.length>ja.length*ib){cb=this.TIMELINE_MAP_HOVERCARD_REGION;if(ja.length>1){eb=this.TIMELINE_MAP_HOVERCARD_REGION;}else eb=this.TIMELINE_MAP_HOVERCARD_CITY;}}if(ia.length>0&&!cb)if(!wa||ia.length>1){cb=this.TIMELINE_MAP_HOVERCARD_CITY;if(ia.length>1){eb=this.TIMELINE_MAP_HOVERCARD_CITY;}else fb=ha.length;}if(!cb){cb=this.TIMELINE_MAP_HOVERCARD_PLACE;fb=-1;}bb=hb[cb];if(eb)db=hb[eb];var jb={profile_id:this.profileID,request_id:pa,target_count:oa,photo_count:ra,photo_ids:sa,place_counts:ta,target_ids:va,all_places:ua,ids:bb,title_type:cb,subtitle_count:fb,links:db,link_type:eb};if(this.viewasID&&this.viewasID!="0")jb.viewas=this.viewasID;new m().setURI('/ajax/timeline/map/hovercard.php').setMethod('POST').setData(jb).send();},_dismissHovercard:function(fa){delete fa.timeoutToken;delete fa.hoverState;delete fa.hoverPermanent;if(this.map.getCallout().getAnchor()===fa)this.map.hideCallout();},_getStoriesByType:function(fa){var ga={};fa.forEach(function(ha){ga[ha.storyType]=ga[ha.storyType]||[];ga[ha.storyType].push(ha.isEnt?ha.id:ha.unitParams);});return ga;},_removeStories:function(fa,ga){var ha=0,ia=false,ja=this.places[fa],ka=[],la;for(la=0;la=200)ea=(ea%100)+100;ea=z[this.pluralMap[ea]];this.catNames[y]=z[2];i.setContent(i.find(da,'.'+this._classes.text),ea);if(aa){i.setContent(i.find(da,'.'+this._classes.count),p.formatNumber(aa,0,k.numberDelimiter,''));}else i.empty(i.find(da,'.'+this._classes.count));h.conditionClass(da.firstChild,ba,!!ba);if(ca)da.setAttribute('href',ca);h.show(da);},updateCategories:function(y,z){if(z._instanceid!==this.mapID)return;var aa=this.mapController.getCategories(),ba=this.catNames[this.catIndex]||this.initialCatName;this.catNames=[];var ca=0;for(var da=0;dathis._photoLimit))throw new Error('invalid number of photos');return v;}};x.prototype._updatePhotoDisplayType=function(ba){"use strict";var ca=w[this._photoDisplayType];ca&&j.removeClass(this._container,ca);this._photoDisplayType=this._getPhotoType(ba);j.addClass(this._container,w[this._photoDisplayType]);};x.prototype._updateAddMorePhotosClass=function(){"use strict";if(this._pendingPhotoRequests>0){j.addClass(k.find(this._container,'.mleAddMorePhotoButtons'),'disabled');}else j.removeClass(k.find(this._container,'.mleAddMorePhotoButtons'),'disabled');};x.prototype._updatePhotos=function(ba,ca){"use strict";var da=ca,ea=[],fa=this._photoDisplayType;this._updatePhotoDisplayType(ba);if(this._photoDisplayType!==fa){var ga=k.scry(this._grid,'.mlePhotoPreviewThumb');for(var ha=0;ha0){this._pendingPhotoRequests+=ja.length;if(this._photoDisplayType!==v)this._updateAddMorePhotosClass();new h().setURI('/ajax/timeline/mle_photo_select.php').setData({display_elem:this._containerID,existing_image_ids:ea,field_name:'photos',image_ids:da,profile_id:this._profileID,total_photos:ba}).setMethod('POST').send();}};x.prototype._bindPhoto=function(ba){"use strict";this._sortableGroup&&this._sortableGroup.addSortable(k.find(ba,'input').getAttribute('value'),ba);};x.prototype._unbindPhoto=function(ba){"use strict";this._sortableGroup&&this._sortableGroup.removeSortable(k.find(ba,'input').getAttribute('value'));};x.prototype.filterPhotoClick=function(event){"use strict";if((this._pendingPhotoRequests>0)&&(this._photoDisplayType!=v))event.kill();};x.prototype.attachPhoto=function(ba,ca){"use strict";if((!this._loadingIndicators[ca])&&(!this._tempPhotoRef[ca]))return;if(this._tempPhotoRef[ca]){k.replace(this._tempPhotoRef[ca],ba);this._bindPhoto(ba);delete this._tempPhotoRef[ca];}else{var da=this._loadingIndicators[ca].getRoot();if(m.byTag(da,'body')){k.replace(da,ba);this._bindPhoto(ba);}delete this._loadingIndicators[ca];}if(--this._pendingPhotoRequests===0)this._updateAddMorePhotosClass();};x.prototype.detachPhoto=function(ba){"use strict";if(this._pendingPhotoRequests>0)return;this._unbindPhoto(ba);k.remove(ba);var ca=this._getNumPhotos();this._updatePhotos(ca,[]);if(ca===0){j.show(k.find(this._container,'.mlePhotoButtons'));j.hide(k.find(this._container,'.mleAddMorePhotoButtons'));}else if(ca===this._photoLimit-1)j.show(k.find(this._container,'.mleAddMorePhotoButtons'));};x.prototype.createPlaceholder=function(ba){"use strict";var ca=this._progressBarMarkup.cloneNode(true);ca=k.appendContent(this._grid,ca)[0];this._loadingIndicators[ba]=new n(ca);return ca;};x.prototype.addPhotos=function(ba){"use strict";var ca=this._getNumPhotos(),da=ba.length,ea=ca+da;if(ea>this._photoLimit){var fa=q._("The maximum number of photos you can add to this life event is {limit}. Please remove some photos and try again.",{limit:this._photoLimit});i.loadModules(["Dialog"],function(ia){new ia().setTitle("Too Many Photos").setBody(fa).setButtons(ia.OK).show();});return;}if(ea===this._photoLimit)j.hide(k.find(this._container,'.mleAddMorePhotoButtons'));for(var ga=0;gathis._photoLimit){var ga=q._("The maximum number of photos you can add to this life event is {limit}. Please remove some photos and try again.",{limit:this._photoLimit});i.loadModules(["Dialog"],function(la){new la().setTitle("Too Many Photos").setBody(ga).setButtons(la.OK).show();});y(ba);return;}var ha,ia;for(var ja=0;ja1){k.hide(wa);k.show(xa);va.checked=false;va.disabled=true;return;}k.hide(xa);va.disabled=false;var ya=ua&&ua[0],za=l.find(ra,'input.relationshipCurrentPartnerID').value,ab=l.find(ra,'input.relationshipCurrentStatus').value,bb=r.isUnilateralStatus(ta),cb=va.checked&&!bb&&ya&&(za!=ya||ab!=ta);if(ya){var db=sa.text_with[0],eb=l.find(ra,'span.relationshipPartnerName');l.setContent(eb,db);}k.conditionClass(wa,'hidden_elem',!cb);}function la(ra){ra=ra||da.element;if(!ra)return;da={element:ra,state:o.serialize(ra)};}function ma(event){var ra=event.getTarget(),sa=ra.options[ra.selectedIndex];g.inform('TimelineMLE/mleSelectUpdated',ra);var ta=p.byClass(sa,'mleFormContainer');ia(ta);var ua=l.scry(ta,'.mleOtherLabel'),va=l.scry(ta,'.mleOtherField');if(ua.length)ua=ua[0];if(va.length)va=va[0];if(k.hasClass(sa,'mleOther')){k.show(ua);k.show(va);var wa=l.find(va,'.inputOuter').firstChild;wa.focus();}else{k.hide(ua);k.hide(va);}}function na(){if(!ea)return;var ra=ea,sa=l.scry(ra.getInnerContent(),'.mleContainer')[0];sa&&v.destroyPreviewGrid(sa);ra.hide();da={};ea=null;g.inform('TimelineMLE/mleFlyoutHidden');}function oa(ra,sa){l.replace(w(ra),sa);}function pa(ra){if(ra)n.listen(ra,'change',ma);}var qa={cancel:function(ra){if(ga(ra)){qa.hideFlyout();}else{var sa=p.byClass(ra,'mleContainer');sa&&v.destroyPreviewGrid(sa);var ta=p.byClass(ra,'fbTimelineNewMLE'),ua=p.byClass(ra,'fbTimelineCapsule');if(ta){l.remove(ta);}else{ta=p.byClass(ra,'fbTimelineEditMLE');k.removeClass(ta,'fbTimelineEditMLE');l.remove(l.scry(ta,'.timelineUnitContainer')[0]);k.show(l.scry(ta,'.timelineUnitContainer')[0]);}if(k.hasClass(ta,'fbTimelineNotStarred')){k.removeClass(ta,'fbTimelineNotStarred');i.loadModules(["TimelineStar"],function(va){va.unstarUnit(ta.childNodes[0],null,true);});}ua&&s.balanceCapsule(ua);g.inform('TimelineMap/resizeCallout');}da={};return false;},registerButtons:function(ra,sa,ta,ua){ba(n.listen(sa,'mousedown',function(){ra.standalone?ea.setStackable(false):l.setContent(l.find(ua,'.mleInlineErrorMsg'),'');}));if(ta)ba(n.listen(ta,'click',function(va){va.prevent();if(ra.location==='map')g.inform('TimelineMap/cancelCreation');ra.standalone?qa.hideFlyout():qa.cancel(ta);}));},replace:function(ra,sa){var ta=p.byClass(ra,'mleContainer');ta&&v.destroyPreviewGrid(ta);if(ga(ra)){var ua=p.byClass(ra,'fbTimelineEditMLEFlyout');if(ua){ra=p.byClass(w(sa.relativeElementID),'fbTimelineEditMLE');qa.hideFlyout();l.replace(ra,sa.streamStory);ra=w(sa.streamStory);}else{var va=function(ya){var za=aa(sa.relativeElementID);za&&j.reset(za);ya.publish(sa,sa.streamStory);qa.hideFlyout();};if(sa.isFinch){i.loadModules(["PagesStoryPublisher"],va);}else i.loadModules(["TimelineStoryPublisher"],va);ra=w(sa.streamStory);}}var wa=l.scry(ra,'div.keepStarred')[0];if(wa)i.loadModules(["TimelineStar"],function(ya){ya.starUnit(wa,null,true);});var xa=p.byClass(ra,'fbTimelineCapsule');xa&&s.balanceCapsule(xa);return false;},startEdit:function(ra,sa){qa.hideFlyout();var ta=l.scry(ra,'div.timelineUnitContainer')[0];k.hide(ta);k.addClass(ra,'fbTimelineEditMLE');if(!sa)k.addClass(ra,'fbTimelineNotStarred');},showFlyout:function(ra,sa,ta){qa.hideFlyout();ea=ra;ca=0;g.subscribe('TimelineMLE/mleSelectUpdated',function(ya,za){var ab=p.byClass(za,'mleFormOuterContainer'),bb=l.scry(ab,'.registrationLink');if(!bb.length)return;var cb=za.selectedIndex;k.hide(bb[ca]);k.show(bb[cb]);ca=cb;});ra.show();if(sa==='edit'){var ua=w(ta),va=p.byClass(ua,'lifeEventContainer');k.addClass(va,'fbTimelineEditMLE');var wa=l.find(ra.getInnerContent(),'.timelineUnitContainer');k.addClass(wa,'fbTimelineEditMLEFlyout');m.ensureVisible(wa,null,100);}if(sa!='map'){var xa=l.scry(ra.getInnerContent(),'.mleSelect');if(xa.length)pa(xa[0]);}if(sa!=='edit')qa.setEstimatedDate(ra);g.inform('TimelineMLE/mleFlyoutShown',ra);},showPrivacyNotice:function(ra,sa){if(!sa||!ra)return;var ta=l.find(ra.getInnerContent(),'.audienceSelector');sa.setContext(ta).show();fa=sa;n.listen(ta,'click',sa.hide.bind(sa));n.listen(l.find(sa.getContent(),'input'),'click',sa.hide.bind(sa));g.subscribe('TimelineMLE/mleFlyoutHidden',sa.hide.bind(sa));},hideFlyout:na,getFlyout:function(){return ea;},listenForEditChanges:function(ra){var sa=l.find(ra,'form.mleFormContainer'),ta=sa.elements;for(var ua=0;ua