function OverlayObjectBase(Type,Id,Obj){this.Type=Type;this.Id=Id;this.Obj=Obj;}function OverlayCacheBase(){this.OCollection=new Array();OverlayCacheBase.prototype.Add=function(type,id,obj){var OverlayObject=new OverlayObjectBase(type,id,obj);for(var x=0;x<this.OCollection.length;x++){if(this.OCollection[x].Type==type&&this.OCollection[x].Id==id){return;}}this.OCollection.push(OverlayObject);};OverlayCacheBase.prototype.Remove=function(obj){var TempOCollection=new Array();for(var x=0;x<this.OCollection.length;x++){if(this.OCollection[x].Obj!=obj){TempOCollection.push(this.OCollection[x]);}}this.OCollection=TempOCollection;};OverlayCacheBase.prototype.RemoveCacheType=function(Type){var TempOCollection=new Array();for(var x=0;x<this.OCollection.length;x++){if(this.OCollection[x].Type!=Type){TempOCollection.push(this.OCollection[x]);}}this.OCollection=TempOCollection;};OverlayCacheBase.prototype.RemoveCacheTypes=function(arrTypes){for(var x=0;x<arrTypes.length;x++){this.RemoveCacheType(arrTypes[x]);}};OverlayCacheBase.prototype.GetType=function(Type){var TempOCollection=new Array();for(var x=0;x<this.OCollection.length;x++){if(this.OCollection[x].Type==Type){TempOCollection.push(this.OCollection[x].Obj);}}return TempOCollection;};OverlayCacheBase.prototype.GetByTypeId=function(Type,Id){for(var x=0;x<this.OCollection.length;x++){if(this.OCollection[x].Type==Type){if(this.OCollection[x].Id==Id){return this.OCollection[x].Obj;}}}return null;};OverlayCacheBase.prototype.RemoveByTypeId=function(Type,Id){var TempOCollection=new Array();for(var x=0;x<this.OCollection.length;x++){if(this.OCollection[x].Type!=Type){if(this.OCollection[x].Id!=Id){TempOCollection.push(this.OCollection[x]);}}}this.OCollection=TempOCollection;};OverlayCacheBase.prototype.RenderOverlayTypes=function(arrType){for(var x=0;x<arrType.length;x++){for(var y=0;y<this.OCollection.length;y++){if(this.OCollection[y].Type==arrType[x]){map.addOverlay(this.OCollection[y].Obj);}}}};OverlayCacheBase.prototype.RenderOverlayType=function(Type){for(var y=0;y<this.OCollection.length;y++){if(this.OCollection[y].Type==Type){map.addOverlay(this.OCollection[y].Obj);}}};OverlayCacheBase.prototype.RemoveOverlayType=function(Type){for(var y=0;y<this.OCollection.length;y++){if(this.OCollection[y].Type==Type){map.removeOverlay(this.OCollection[y].Obj);}}};OverlayCacheBase.prototype.RemoveOverlayTypes=function(arrTypes){for(var x=0;x<arrTypes.length;x++){this.RemoveOverlayType(arrTypes[x]);}};OverlayCacheBase.prototype.GetMapBoundsByTypes=function(arrType){var MapBounds=new GLatLngBounds();for(x=0;x<arrType.length;x++){MapBounds=this.ExtendMapBoundsByType(arrType[x],MapBounds);}return MapBounds;};OverlayCacheBase.prototype.GetMapBoundsByType=function(Type){if(Type=="PrimeNeighborhood"){if(this.GetType(Type).length>0){var Bounds=new GLatLngBounds();Bounds=this.GetType(Type)[0].getBounds();return Bounds;}else{return this.GetMapBoundsByType("Listing");}}else{var MapBounds=new GLatLngBounds();MapBounds=this.ExtendMapBoundsByType(Type,MapBounds);return MapBounds;}};OverlayCacheBase.prototype.ExtendMapBoundsByType=function(Type,MapBounds){var arrElements=this.GetType(Type);for(var x=0;x<arrElements.length;x++){MapBounds.extend(arrElements[x].getPoint());}return MapBounds;};}var OverlayCache=new OverlayCacheBase();