
Citysearch.Event={listings:[],map:{},mapHeight:410,latitude:0,longitude:-1,listInfoDivId:"listInfo",listInfoDivObj:{},listEntriesDivId:"listEntries",listEntriesDivObj:{},secondaryDivId:"secondaryContainer",secondaryDivObj:{},mapParentDivId:"mapContainer",mapParentDiv:{},listMapDivId:"listMap",listMapDivObj:{},mapWindow:{},hideActionsClass:"hideAllActions",showActionClass:"showAction",sendToClass:"sendTo",secondaryFxObj:{},secondaryDivTop:0,scrollLimit:0,stickyCheckId:"stickyCheck",stickyCheckObj:{},stickyMapText:"follow-along map?",init:function(){if(Citysearch.TempConfig&&Citysearch.TempConfig.eventList){this.listings=Citysearch.TempConfig.eventList;Citysearch.TempConfig.eventList=[];}
else{return;}
this.mapParentDiv=$(this.mapParentDivId);this.listInfoDivObj=$(this.listInfoDivId);this.listEntriesDivObj=$(this.listEntriesDivId);this.secondaryDivObj=$(this.secondaryDivId);this.listMapDivObj=$(this.listMapDivId);this.initList();this.drawMap();},initList:function(){this.mapWindow=new Element('div');for(var i=0;i<this.listings.length;i++){var target=this.listings[i];target.divObj=$(target.divId);if((target.lat===0&&target.lon===0)||(target.lat===0&&target.lon===-1)){var geoAddr=Citysearch.Map.geocode(target.address);var latLng=Citysearch.Map.getLatLng(geoAddr);target.lat=latLng.latitude;target.lon=latLng.longitude;}
target.poi=Citysearch.Map.point(target.lat,target.lon,{'icon':Citysearch.Map.icon(Citysearch.imagePath+Citysearch.Map.getImage(target.count,true)),'hoverIcon':Citysearch.Map.icon(Citysearch.imagePath+Citysearch.Map.getImage(target.count,false)),'popupTitle':target.name,'popupContent':target.address});}},drawMap:function(){var availableWidth=Citysearch.Utils.getDimensions(this.mapParentDiv).x-40;this.mapWindow.setStyles({'width':availableWidth,'height':this.mapHeight});var listMap=Citysearch.Map.draw(this.listMapDivObj,{'lat':this.latitude,'lon':this.longitude,'zoom':Citysearch.Map.Zoom.neighborhood,'type':Citysearch.Map.Type.street});var mapPoisArray=[];for(var i=0;i<this.listings.length;i++){var target=this.listings[i];mapPoisArray.include(target.poi);}
if(mapPoisArray.length===0){return;}
Citysearch.Map.addControl.zoom(listMap);Citysearch.Map.addControl.typeSwitcher(listMap);Citysearch.Map.populate(listMap,mapPoisArray);Citysearch.Map.recenter(listMap);this.listMapDivObj.grab(this.mapWindow);this.resize(listMap,this.mapWindow,this.mapParentDiv);var boundResize=Citysearch.Map.resize.pass([listMap,this.mapWindow,this.mapParentDiv]);window.addEvent('resize',boundResize);},resize:function(map,mapWindow,parentDiv){var availableWidth=Citysearch.Utils.getDimensions(parentDiv).x-40;if(Citysearch.Map.getSize(map).getWidth()===availableWidth){return;}
var height=arguments[3]||410;mapWindow.setStyles({width:availableWidth,height:height});Citysearch.Map.setSize(map,availableWidth,height);}};window.addEvent('domready',function(){Citysearch.Event.init();});