
var GooglemapHelper={map:null,activeIw:null,activePos:null,overlays:[],days:[],addListener:function(listener){this.listeners.push(listener);},attachOverlays:function(evts)
{for(var i=0;i<this.overlays.length;i++){this.overlays[i].setMap(null);}
this.overlays.length=0;this.days.length=0;for(var i=0;i<evts.length;i++)
{var evt=evts[i];var m=new google.maps.Marker({position:new google.maps.LatLng(evt.latlng[0],evt.latlng[1]),map:this.map,icon:evt.iconUrl});this.attachIw(m,evt.content);this.overlays.push(m);this.days.push(evt.days);}},filterOverlays:function(low,high)
{for(var i=0;i<this.overlays.length;i++)
{if(this.days[i]!==false&&(this.days[i]<low||this.days[i]>high))
{this.overlays[i].setMap(null);}}},revealOverlays:function()
{for(var i=0;i<this.overlays.length;i++)
{if(this.overlays[i].map==null)
this.overlays[i].setMap(this.map);}},attachIw:function(marker,content)
{var iw=new google.maps.InfoWindow({content:content});var self=this;google.maps.event.addListener(marker,'click',function()
{if(self.activeIw!=null){self.activeIw.close();}
iw.open(this.map,marker);self.activeIw=iw;self.activePos=marker.getPosition();$('.eventDiv .next').each(function(x)
{$(this).click(function(y)
{$(this).parent().parent().hide();$(this).parent().parent().next().show();return false;});});$('.eventDiv .prev').each(function(x)
{$(this).click(function(y)
{$(this).parent().parent().hide();$(this).parent().parent().prev().show();return false;});});google.maps.event.addListenerOnce(self.activeIw,'closeclick',function()
{self.activePos=null;});});},centerMap:function(lat,lon){this.map.setCenter(new google.maps.LatLng(lat,lon));}};
