(function(a){a.createGoogleMap=function(j,e,c,b,g,k){var h=a.extend({showMapTypes:true,showScale:true,showOverview:true,isZoomToFit:false},k||{});
Anmida.GoogleMap=h;h.googleMap=null;h.bounds=null;h.markerArray=[];h.closeAllInfoWindows=function(){for(var l=0;
l<h.markerArray.length;l++){if(h.markerArray[l].infowindow){h.markerArray[l].infowindow.close();
}}};h.addMarkerToGoogleMap=function(q,m,n,o,p,s){var l=new google.maps.LatLng(q,m);
h.bounds.extend(l);var r=new google.maps.Marker({position:l,map:h.googleMap,title:n});
if(o!=""){r.infowindow=new google.maps.InfoWindow({content:o});google.maps.event.addListener(r,"click",function(){h.closeAllInfoWindows();
r.infowindow.open(h.googleMap,r);});}if(p!=""){r.setIcon(p);}r.setDraggable(s);
h.markerArray.push(r);google.maps.event.addListenerOnce(h.googleMap,"tilesloaded",function(){if(!h.googleMap.getBounds().contains(l)){h.recenter(l);
}});return r;};h.goToMarker=function(l){google.maps.event.trigger(h.markerArray[l],"click");
};h.clearMarkers=function(){for(var l=0;l<h.markerArray.length;l++){h.markerArray[l].setMap(null);
}h.markerArray.length=0;};h.recenter=function(){h.googleMap.setCenter(h.markerArray[0].position);
};h.getZoomLevel=function(){return h.googleMap.getZoom();};h.setZoomLevel=function(l){return h.googleMap.setZoom(l);
};h.getCenter=function(){return h.googleMap.getCenter();};h.setCenter=function(l,m){return h.googleMap.setCenter(new google.maps.LatLng(l,m));
};h.zoomToFit=function(){h.googleMap.fitBounds(h.bounds);};var f=new google.maps.LatLng(0,0);
var d={center:f,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:h.showMapTypes,scaleControl:h.showScale};
h.googleMap=new google.maps.Map(document.getElementById(j),d);h.bounds=new google.maps.LatLngBounds();
for(i=0;i<e.length;i++){h.addMarkerToGoogleMap(e[i].Latitude,e[i].Longitude,e[i].Title,e[i].Content,e[i].ImageUrl,false);
}if(h.isZoomToFit){h.zoomToFit();}else{h.googleMap.setCenter(new google.maps.LatLng(c,b));
h.setZoomLevel(g);}h.reset=function(){google.maps.event.trigger(h.googleMap,"resize");
if(h.isZoomToFit){h.zoomToFit();}else{h.googleMap.setCenter(new google.maps.LatLng(c,b));
h.setZoomLevel(g);}};return h;};})(jQuery);
