/*1358150653,178142497*/

if (self.CavalryLogger) { CavalryLogger.start_js(["pACU\/"]); }

__d("legacy:rect",["Rect"],function(a,b,c,d){a.Rect=b('Rect');},3);
__d("clip",[],function(a,b,c,d,e,f){function g(h,i,j){return Math.min(Math.max(h,i),j);}e.exports=g;});
__d("MapRects",["Rect","Vector","clip","copyProperties"],function(a,b,c,d,e,f){var g=b('Rect'),h=b('Vector'),i=b('clip'),j=b('copyProperties');function k(){}j(k,{containsPoint:function(l,m,n){if(n===undefined)n=0;return l.t<=m.y+n&&l.r>=m.x-n&&l.b>=m.y-n&&l.l<=m.x+n;},pad:function(l,m){return k.padXY(l,m,m);},padX:function(l,m){return k.padXY(l,m,0);},padY:function(l,m){return k.padXY(l,0,m);},padXY:function(l,m,n){return new g(l.t-n,l.r+m,l.b+n,l.l-m,l.domain);},collides:function(l,m){return (l.t<m.b&&l.b>m.t&&l.l<m.r&&l.r>m.l);},boundPoint:function(l,m){var n=new h(0,0);n.x=i(m.x,l.l,l.r);n.y=i(m.y,l.t,l.b);return n;},boundingBox:function(l,m){return new g(Math.min(l.t,m.t),Math.max(l.r,m.r),Math.max(l.b,m.b),Math.min(l.l,m.l));},scale:function(l,m,n){return new g(l.t*m/n,l.r*m/n,l.b*m/n,l.l*m/n);}});e.exports=k;});
__d("BingMaps",["MapRects","Rect","Vector","clip","copyProperties"],function(a,b,c,d,e,f){var g=b('MapRects'),h=b('Rect'),i=b('Vector'),j=b('clip'),k=b('copyProperties');function l(){}k(l,{MIN_LATITUDE:-85.05112878,MAX_LATITUDE:85.05112878,MIN_LONGITUDE:-180,MAX_LONGITUDE:180,pows:{},MAX_ZOOM:20,BING_MAP_ZOOM_LEVEL_CITY:12,EARTH_CIRCUMFERENCE_METERS:40074784,scale:function(m,n){var o=n-m;if(!l.pows[o])l.pows[o]=Math.pow(2,o);return l.pows[o];},mapSize:function(m){return 512*l.scale(1,m);},latLongToXY:function(m,n){var o=j(m.latitude,l.MIN_LATITUDE,l.MAX_LATITUDE),p=(m.longitude+180)/360,q=Math.sin(o*Math.PI/180),r=.5-Math.log((1+q)/(1-q))/(4*Math.PI),s=l.mapSize(n);return new i(Math.floor(p*(s-1)+.5),Math.floor(r*(s-1)+.5));},xyToLatLong:function(m,n){var o=l.mapSize(n),p=(j(m.x,0,o-1)/o)-.5,q=.5-(j(m.y,0,o-1)/o),r=90-360*Math.atan(Math.exp(-q*2*Math.PI))/Math.PI,s=360*p;return {latitude:r,longitude:s};},getViewForLatLongs:function(m,n,o,p,q,r){if(!o.length)throw new Error('the proper view for zero point(s) is completely ambiguous');p=p||new h(0,0,0,0);q=q||1;r=r||Infinity;var s=l._getBoundingBox(o),t=p.l+p.r,u=p.t+p.b,v=l.MAX_ZOOM,w;if(o.length>1){w=l.mapSize(v);while((v>q&&(l._getWidth(s,w)>m-t||s.h()>n-u)||v>r)){s=g.scale(s,1,2);v--;w=l.mapSize(v);}}else while(v!==l.BING_MAP_ZOOM_LEVEL_CITY){v--;s=g.scale(s,1,2);}var x=s.l-p.l,y=s.r+p.r;if(y<x)y+=l.mapSize(v);var z=new h(s.t-p.t,y,s.b+p.b,x);w=l.mapSize(v);var aa=new i(z.getCenter().x%w,z.getCenter().y),ba=l.xyToLatLong(aa,v);return {center:ba,width:m,height:n,zoom:v};},_getWidth:function(m,n){return l._calculateRightDistanceAToB(m.l,m.r,n);},_getBoundingBox:function(m){var n=[],o=l.mapSize(l.MAX_ZOOM);for(var p=0;p<m.length;p++){var q=m[p];n.push(l.latLongToXY(q,l.MAX_ZOOM));}n.sort(function(z,aa){return z.x-aa.x;});var r=n.length-1,s=l._calculateRightDistanceAToB(n[r].x,n[0].x,o),t=0,u=r,v=[n[0].y],w;for(var x=1;x<n.length;x++){v.push(n[x].y);var y=l._calculateRightDistanceAToB(n[x-1].x,n[x].x,o);if(y>s){s=y;t=x;u=x-1;}}w=new h(Math.min.apply(null,v),n[u].x,Math.max.apply(null,v),n[t].x);return w;},_calculateRightDistanceAToB:function(m,n,o){if(!o)throw new Error('zero or null map width not allowed');return (o+n-m)%o;}});e.exports=l;});
__d("mod",[],function(a,b,c,d,e,f){function g(h,i){var j=h%i;if(j*i<0)j+=i;return j;}e.exports=g;});
__d("BingMapCoordinate",["BingMaps","copyProperties","Vector","mod"],function(a,b,c,d,e,f){var g=b('BingMaps'),h=b('copyProperties'),i=b('Vector'),j=b('mod');function k(){this.absoluteX=null;this.absoluteY=null;this.latitude=null;this.longitude=null;}h(k,{MAX_ZOOM:18,MIN_ZOOM:1,fromAbsolute:function(l,m){if(arguments.length==1){m=l.y;l=l.x;}var n=new k();n.absoluteX=l;n.absoluteY=m;var o=g.xyToLatLong(new i(l,m),k.MAX_ZOOM);n.latitude=o.latitude;n.longitude=o.longitude;return n;},fromLatLong:function(l,m){if(arguments.length==1){m=l.longitude;l=l.latitude;}var n=new k();n.latitude=l;n.longitude=m;var o=g.latLongToXY({latitude:l,longitude:m},k.MAX_ZOOM);n.absoluteX=o.x;n.absoluteY=o.y;return n;},fromMap:function(l,m,n){var o=g.scale(n,k.MAX_ZOOM);return k.fromAbsolute(l*o,m*o);}});h(k.prototype,{getLatitude:function(){return this.latitude;},getLongitude:function(){return this.longitude;},getAbsoluteX:function(){return this.absoluteX;},getAbsoluteY:function(){return this.absoluteY;},getAbsoluteXY:function(){return new i(this.absoluteX,this.absoluteY);},getMapX:function(l){return this.getMapXY(l).x;},getMapY:function(l){return this.getMapXY(l).y;},getMapXY:function(l){var m=g.scale(k.MAX_ZOOM,l),n=this.absoluteX*m,o=this.absoluteY*m;return new i(n,o);},add:function(l,m){var n=this.getMapXY(l);return k.fromMap(n.x+m.x,n.y+m.y,l);},calculateDistanceSq:function(l,m){var n=this.calculateDistanceX(l,m),o=this.calculateDistanceY(l,m);return n*n+o*o;},calculateDistanceX:function(l,m){var n=g.mapSize(l),o=j(m.getMapX(l)-this.getMapX(l),n);return Math.min(o,n-o);},calculateDistanceY:function(l,m){return Math.abs(m.getMapY(l)-this.getMapY(l));}});e.exports=k;});
__d("legacy:bing-map-coordinate",["BingMapCoordinate"],function(a,b,c,d){var e=b('BingMapCoordinate');a.BingMapCoordinate=e;},3);
__d("legacy:bing-maps-utils",["BingMaps"],function(a,b,c,d){var e=b('BingMaps');a.BingMaps=e;},3);
__d("GeoRectangle",["copyProperties"],function(a,b,c,d,e,f){var g=b('copyProperties');function h(i,j,k,l){this.n=i;this.w=j;this.s=k;this.e=l;}g(h.prototype,{containsLat:function(i){return i>=this.s&&i<=this.n;},getCenter:function(){var i=(this.n+this.s)/2,j;j=(this.e+this.w)/2;if(this.w>this.e){j-=180;if(j<-180)j+=360;}return {latitude:i,longitude:j};},containsLon:function(i){if(this.w>this.e)return i>=this.w||i<=this.e;return i>=this.w&&i<=this.e;},containsPoint:function(i,j){return this.containsLat(i)&&this.containsLon(j);},containsGeoRectangle:function(i){return this.containsPoint(i.n,i.w)&&this.containsPoint(i.s,i.e);},toArray:function(){return {n:this.n,w:this.w,s:this.s,e:this.e};}});e.exports=h;});
__d("legacy:geo-rectangle",["GeoRectangle"],function(a,b,c,d){a.GeoRectangle=b('GeoRectangle');},3);
function AggregatedMapIframe(){}copyProperties(AggregatedMapIframe.prototype,ArbiterMixin,{mapOptions:{},init:function(a,b,c){this.mapDiv=b;this.id=a;this.arbiterEvents=[];this.parentArbiter=parent.window.Arbiter;this.mapOptions.mapTypeId=Microsoft.Maps.MapTypeId.road;this.mapOptions.backgroundColor=new Microsoft.Maps.Color(1,177,189,214);this.mapOptions.center=new Microsoft.Maps.Location(c.lat,c.lon);copyProperties(this.mapOptions,c);this.map=new Microsoft.Maps.Map(this.mapDiv,this.mapOptions);this.parentArbiter.subscribe('DynamicMap/'+this.id+'/init',this.onInit.bind(this));},onInit:function(a,b){this.arbiter=b.DynamicMapArbiter;this.bingMapEvents=[Microsoft.Maps.Events.addHandler(this.map,'viewchange',this._onViewChange.bind(this)),Microsoft.Maps.Events.addHandler(this.map,'dblclick',this._onDoubleClick.bind(this)),Microsoft.Maps.Events.addHandler(this.map,'viewchangeend',this._onViewChangeEnd.bind(this)),Microsoft.Maps.Events.addHandler(this.map,'copyrightchanged',this._onCopyrightChange.bind(this)),Microsoft.Maps.Events.addHandler(this.map,'mouseup',this._onMouseUp.bind(this)),Microsoft.Maps.Events.addHandler(this.map,'mousedown',this._onMouseDown.bind(this))];this._publicMethod('zoom');this._publicMethod('setView');this._publicMethod('mouseEvent');onunloadRegister(this._onBeforeLeave.bind(this));this._onViewChange();this._onCopyrightChange();this.arbiter.inform("AggregatedMap/iframeReady",null,Arbiter.BEHAVIOR_STATE);},mouseEvent:function(a,b){var c=b.e,d=b.offset,e=document.createEvent('MouseEvents');e.initMouseEvent(c.type,false,true,window,c.detail,c.screenX,c.screenY,c.clientX-d.x,c.clientY-d.y,c.ctrlKey,c.altKey,c.shiftKey,c.metaKey,c.button,c.relatedTarget);this.map.getRootElement().dispatchEvent(e);},setView:function(a,b){var c;if(b.center)b.center=new Microsoft.Maps.Location(b.center.latitude,b.center.longitude);this.map.setView(b);},zoom:function(a,b){var c=null,d=null;if(b.anchor){d=this.map.tryPixelToLocation(new Microsoft.Maps.Point(b.anchor.x,b.anchor.y),Microsoft.Maps.PixelReference.control);c=new Microsoft.Maps.Point(b.anchor.x-this.map.getWidth()/2,b.anchor.y-this.map.getHeight()/2);}this._zoom(b.animate,b.zoom,d,c);},_zoom:function(a,b,c,d){b=Math.max(BingMapCoordinate.MIN_ZOOM,Math.min(this.map.getZoom()+b,BingMapCoordinate.MAX_ZOOM));this.map.setView({animate:a,zoom:b,center:c,centerOffset:d});},_getLocationRectFromLocations:function(a){if(a.length>1){var b,c={},d=[],e=[];for(b=0;b<a.length;b++){if(!c[a[b].longitude]){c[a[b].longitude]=true;d.push(a[b].longitude);}e.push(a[b].latitude);}d.sort(function(p,q){return p-q;});var f,g,h=Infinity;for(b=0;b<d.length;++b){var i=(b+1)%d.length,j=this._calculateEastwardDistance(d[i],d[b]);if(j<h){h=j;f=d[i];g=d[b];}}var k=Math.max.apply(null,e),l=Math.min.apply(null,e),m=new Microsoft.Maps.Location((k+l)/2,Microsoft.Maps.Location.normalizeLongitude(f+h/2)),n=k-l,o=new Microsoft.Maps.LocationRect(m,h,n);return o;}else return Microsoft.Maps.LocationRect.fromLocations(a);},_calculateEastwardDistance:function(a,b){return (b-a+360)%360;},_getMapView:function(){return {center:this.map.getCenter(),zoom:this.map.getZoom(),width:this.map.getWidth(),height:this.map.getHeight()};},_onCopyrightChange:function(){this.arbiter.inform('DynamicMap/'+this.id+'/copyrightChange',this.map.getCopyrights(),Arbiter.BEHAVIOR_PERSISTENT);},_publicMethod:function(a){this.arbiterEvents.push(this.arbiter.subscribe('AggregatedMap/'+a,this[a].bind(this)));},_onViewChangeEnd:function(){this.arbiter.inform('AggregatedMap/viewchangeend',this._getMapView());},_onViewChange:function(){var a=this.map.getBounds(),b=new GeoRectangle(a.getNorth(),a.getWest(),a.getSouth(),a.getEast());this.arbiter.inform('AggregatedMap/viewchanged',this._getMapView());},_onMouseDown:function(a){this.xDown=a.pageX;this.yDown=a.pageY;},_onMouseUp:function(a){if(this.xDown==a.pageX&&this.yDown==a.pageY)this.arbiter.inform('AggregatedMap/click');},_onDoubleClick:function(a){var b=this.map.tryPixelToLocation(new Microsoft.Maps.Point(a.getX(),a.getY()),null);this._zoom(true,1,b);a.handled=true;return false;},_onBeforeLeave:function(){this.bingMapEvents.forEach(function(a){this.removeHandler(a);},Microsoft.Maps.Events);this.arbiterEvents.forEach(function(a){this.arbiter.unsubscribe(a);},this);this.map=null;}});
function TimelineFileInput(a,b,c){this.container=a;this.input=b;this.form=c;Event.listen(this.input,'click',function(event){event.stop();});Event.listen(this.input,'change',this._onValueChange.bind(this));Event.listen(this.container,'mousemove',this._onMouseMove.bind(this));}copyProperties(TimelineFileInput.prototype,{_onValueChange:function(event){if(this.input.value){this.form.onsubmit(event);this.form.submit();this.input.value=null;}var a=Parent.byClass(this.container,'uiSelector');a&&Selector.toggle(a);},_onMouseMove:function(event){if(!this.inputDimensions)this.inputDimensions=Vector2.getElementDimensions(this.input);this.containerPosition=Vector2.getElementPosition(this.container);this.containerRect=Rect.newFromVectors(this.containerPosition,Vector2.getElementDimensions(this.container));var a=Vector2.getEventPosition(event),b=0,c=0;if(this.containerRect.contains(a)){b=(a.x-this.containerPosition.x+30-this.inputDimensions.x)+'px';c=(a.y-this.containerPosition.y-10)+'px';}Style.set(this.input,'top',c);Style.set(this.input,'left',b);}});
__d("DynamicMap",["Arbiter","ArbiterMixin","CSS","DOM","Run","Style","Vector","copyProperties","ge"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('ArbiterMixin'),i=b('CSS'),j=b('DOM'),k=b('Run'),l=b('Style'),m=b('Vector'),n=b('copyProperties'),o=b('ge'),p={};function q(){}n(q.prototype,h,{queueInit:function(s,t,u,v,w,x){w=w||{};var y=n(w,{map_options:u,pins:v,DynamicMapArbiter:this});g.inform('DynamicMap/'+s+'/init',y,g.BEHAVIOR_PERSISTENT);if(x){var z=this.subscribe('DynamicMap/'+s+'/copyrightChange',function(aa,ba){j.setContent(x,ba.join(' \u00b7 '));});k.onLeave(function(){this.unsubscribe(z);}.bind(this));}g.subscribe('DynamicMap/moveInfoBox',r.bind(null,t,s));}});function r(s,t,u,v){if(v.mapid!=t)return;var w=parseInt(v.boundingbox.l+(v.boundingbox.r-v.boundingbox.l)/2,10),x=v.boundingbox.t,y=o(v.popupinfobox),z=v.closeinfobox,aa=v.map,ba=v.centerOffset,ca,da=false;if(y){if(v.action==='click'){if(!y.justDragged){if(!p[y.id]){if(o(z)){i.hide(z);delete p[z];}p[y.id]=y;da=true;}else delete p[y.id];}else{y.justDragged=false;for(ca in p)i.removeClass(p[ca],'mapPopUpInfoboxInactive');}}else if(v.action==='drag'){y.justDragged=true;for(ca in p)i.addClass(p[ca],'mapPopUpInfoboxInactive');}else y.justDragged=false;if(p[y.id]){var ea=m.getElementDimensions(s);if(v.boundingbox.l<0||v.boundingbox.t<0||v.boundingbox.r>ea.x||v.boundingbox.b>ea.y){i.hide(y);}else{i.show(y);var fa=m.getElementDimensions(y),ga=w,ha=x-fa.y;if(v.isplacemapinfobox){ga-=(fa.x/2);}else ga-=11;l.set(y,'left',ga+'px');l.set(y,'top',ha+'px');if(da){var ia=aa.getWidth()-(ga+fa.x),ja=aa.getHeight()-(ha+fa.y);ba.x=(ga<0)?-ga:0;ba.x=(ia<0)?ia:ba.x;ba.y=(ha<0)?-ha:0;ba.y=(ja<0)?ja:ba.y;var ka={animate:true,center:aa.getCenter(),centerOffset:ba};aa.setView(ka);}}}else i.hide(y);}}e.exports=q;});
__d("legacy:DynamicMap",["DynamicMap"],function(a,b,c,d){a.DynamicMap=b('DynamicMap');},3);