var VM=VM||{};VM.Events={init:function(){var n=$("#classifieds-map"),t;n.length!==0&&(t=this.getLocationData(),t.length>0&&(n.data("data-loaded",!0),n.data("data",t),VM.Mapping.loadMapApi(function(){n.removeClass("hidden");var t=VM.Mapping.initializeMap(n);VM.Mapping.loadData(n,t)})))},getLocationData:function(){var n=[];return VM.$body.find(".media").each(function(){var t=$(this),u=t.data("lat"),f=t.data("lng");if(u&&f){var i={lat:parseFloat(u),lng:parseFloat(f),title:t.find("h2").text(),subtitle:t.find(".media-badge").text(),description:t.data("address"),url:t.attr("href")},e=t.find(".media-left"),r=t.find(".classified-date");e.hasClass("media-noimg")||(i.src=e.find("img").attr("src"));r.length>0&&(i.description=i.description?r.text()+" - "+i.description:r.text());n.push(i)}}),n},onAfterAjaxTrigger:function(){var n,t;if(VM.setup(),VM.Events.$map!=null&&(n=VM.Events.$map.data("markers"),n&&n.length>0))for(t=0;t