
$(document).ready(function() {	

	$(function () {
	
      if (GBrowserIsCompatible()) {
		//alert("map items - MODULE");
        var map = new GMap2(document.getElementById("map"), {size:new GSize(271,221)});
		//41.04421,-75.338659
		//37.0625,-95.677068
		//41.04421,-75.338659
		var aIcon = new GIcon(G_DEFAULT_ICON);
		var bIcon = new GIcon(G_DEFAULT_ICON);
		var cIcon = new GIcon(G_DEFAULT_ICON);
		aIcon.image = "http://www.careworkshealth.com/images/google_a.png";
		bIcon.image = "http://www.careworkshealth.com/images/google_b.png";
		cIcon.image = "http://www.careworkshealth.com/images/google_c.png";
		
		geocoder = new GClientGeocoder();
		
        map.setCenter(new GLatLng(41.24421,-75.438659), 8);
		var icons = [aIcon, bIcon, cIcon];
		addresses = ['1020 Northern Blvd., Clarks Summit, PA','RR 611, Tannersville, PA 18372', '1070 North 9th Street, Stroudsburg, PA'];
		if(geocoder) {
			geocoder.getLatLng(
				addresses[0],
				function(point) {
					if (point) {
						var marker = new GMarker(point, { icon:icons[0] });
						GEvent.addListener(marker, "click", function() {
							marker.openInfoWindowHtml("<div style='color:#000'>Inside of Weis Markets<br />Clarks Summit, PA<br />1020 Northern Blvd.</div>");
						});
						map.addOverlay(marker);
					}
				}
			);
			geocoder.getLatLng(
				addresses[1],
				function(point) {
					if (point) {
						var marker = new GMarker(point, { icon:icons[1] });
						GEvent.addListener(marker, "click", function() {
							marker.openInfoWindowHtml("<div style='color:#000'>Inside of Mr. Z's Market<br />Rt. 611 - Tannersville Plaza<br />Tannersville, PA</div>");
						});
						map.addOverlay(marker);
					}
				}
			);
			geocoder.getLatLng(
				addresses[2],
				function(point) {
					if (point) {
						var marker = new GMarker(point, { icon:icons[2] });
						GEvent.addListener(marker, "click", function() {
							marker.openInfoWindowHtml("<div style='color:#000'>Inside of Mr. Z's Market<br />Stroudsburg, PA<br />1070 North 9th Street</div>");
						});
						map.addOverlay(marker);
					}
				}
			);
		}
		
      }
    });

});
