// Custom Hospital Icons
function customIconH(point, html) {
	var icon = new GIcon();
	icon.image = "http://www.gerigsurgical.com/images/map/hospital.png";
	icon.shadow = "http://www.gerigsurgical.com/images/map/shadow.png";
	icon.iconSize = new GSize(24, 36);
	icon.shadowSize = new GSize(41, 36);
	icon.iconAnchor = new GPoint(10, 36);
	icon.infoWindowAnchor = new GPoint(5, 1);
	
	var marker = new GMarker(point, icon);
  	GEvent.addListener(marker, "mouseover", function() {
    marker.openInfoWindowHtml(html);
  	});
	
	map.addOverlay(marker);
}

// Custom Office Icons
function customIconO(point, html) {
	var icon = new GIcon();
	icon.image = "http://www.gerigsurgical.com/images/map/office.png";
	icon.shadow = "http://www.gerigsurgical.com/images/map/shadow.png";
	icon.iconSize = new GSize(24, 36);
	icon.shadowSize = new GSize(41, 36);
	icon.iconAnchor = new GPoint(10, 36);
	icon.infoWindowAnchor = new GPoint(5, 1);
	
	var marker = new GMarker(point, icon);
  	GEvent.addListener(marker, "mouseover", function() {
    marker.openInfoWindowHtml(html);
  	});
	
	map.addOverlay(marker);
}

// Custom Bariatric Icons
function customIconB(point, html) {
	var icon = new GIcon();
	icon.image = "http://www.gerigsurgical.com/images/map/bariatrics.png";
	icon.shadow = "http://www.gerigsurgical.com/images/map/shadow.png";
	icon.iconSize = new GSize(30, 40);
	icon.shadowSize = new GSize(41, 36);
	icon.iconAnchor = new GPoint(10, 36);
	icon.infoWindowAnchor = new GPoint(5, 1);
	
	var marker = new GMarker(point, icon);
  	GEvent.addListener(marker, "mouseover", function() {
    marker.openInfoWindowHtml(html);
  	});
	
	map.addOverlay(marker);
}

function loadPoints() {
	customIconO(new GLatLng(41.6588, -86.1810), "<b>Gerig Surgical</b><br>303 South Main Street, Suite 212<br>Mishawaka, Indiana 46544<br>Telephone: (574) 255-3888<br>Fax: (574) 256-1632<br><br>Get directions: <a href='http://maps.google.com/maps?f=l&hl=en&q=&near=303+S.+Main+Street,+Mishawaka,+IN+46544&ie=UTF8&z=15&t=k&om=1&iwloc=addr' target='_blank'>To here</a>");
	customIconO(new GLatLng(41.5601, -85.8283), "<b>Gerig Surgical</b><br>2006 South Main Street, Suite A<br>Goshen, Indiana 46526<br>Telephone: (574) 535-9100<br>Fax: (574) 535-1020<br><br>Get directions: <a href='http://maps.google.com/maps?f=l&hl=en&q=&near=2006+S.+Main+Street+Goshen+IN+46526&ie=UTF8&z=15&t=k&om=1&iwloc=addr' target='_blank'>To here</a>");
	customIconO(new GLatLng(41.4464, -86.1597), "<b>Bremen Clinic</b><br>1144 W. Plymouth Street<br>Bremen, Indiana 46506<br><br>Get directions: <a href='http://maps.google.com/maps?f=l&hl=en&q=&near=1144+W.+Plymouth+Street+Bremen,+IN+46506&ie=UTF8&z=15&ll=41.446382,-86.15972&spn=0.003603,0.008261&t=k&om=1&iwloc=addr' target='_blank'>To here</a>");
	customIconH(new GLatLng(41.5643, -85.8298), "<b>Goshen General Hospital</b><br>200 High Park Ave.<br>Goshen, Indiana 46526<br>Telephone: (574) 533-2141<br><a href='http://www.goshenhealth.com/' target='_blank'>www.goshenhealth.com</a><br><br>Get directions: <a href='http://maps.google.com/maps?f=l&hl=en&q=&near=200+High+Park+Ave.+Goshen,+IN+46526&ie=UTF8&z=15&ll=41.564248,-85.82983&spn=0.024436,0.053988&t=k&om=1&iwloc=addr' target='_blank'>To here</a>");
	customIconH(new GLatLng(41.4552, -86.1493), "<b>Community Hospital of Bremen</b><br>1020 High Road<br>Bremen, Indiana 46506<br>Telephone: (574) 546-2211<br><a href='http://www.bremenhospital.com/' target='_blank'>www.bremenhospital.com</a><br><br>Get directions: <a href='http://maps.google.com/maps?ie=UTF8&oe=utf-8&q=1020+High+Road,+Bremen,+IN++46506&ll=41.455296,-86.14933&spn=0.003494,0.008261&t=h&z=18' target='_blank'>To here</a>");
	customIconB(new GLatLng(41.5727, -85.8500), "<b>Team:Bariatrics</b><br>1130 Professional Drive<br>Goshen, Indiana 46526<br>Telephone: (574) 537-8326<br><a href='http://www.teambariatrics.com/' target='_blank'>www.teambariatrics.com</a><br><br>Get directions: <a href='http://maps.google.com/maps?f=l&hl=en&q=&near=411+S.+Whitlock+St.+Bremen,+Indiana+46506&ie=UTF8&z=15&t=k&om=1&iwloc=addr' target='_blank'>To here</a>");
	
}

// Office Location Centers and Markers
var map;

function loadMish() {
	map = new GMap2(document.getElementById("map"));
	map.enableDoubleClickZoom();
	map.enableContinuousZoom();
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.setCenter(new GLatLng(41.6590, -86.1809), 13);
	loadPoints();
}

function loadGosh() {
	map = new GMap2(document.getElementById("map"));
	map.enableDoubleClickZoom();
	map.enableContinuousZoom();
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.setCenter(new GLatLng(41.5601, -85.8283), 13);
	loadPoints();
}

function loadBrem() {
	map = new GMap2(document.getElementById("map"));
	map.enableDoubleClickZoom();
	map.enableContinuousZoom();
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.setCenter(new GLatLng(41.4462, -86.1687), 13);
	loadPoints();
}

function loadBar() {
	map = new GMap2(document.getElementById("map"));
	map.enableDoubleClickZoom();
	map.enableContinuousZoom();
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.setCenter(new GLatLng(41.5727, -85.8500), 13);
	loadPoints();
}

// Office Location Panning
function mishawaka() {
	map.panTo(new GLatLng(41.6590, -86.1809));
}

function goshen() {
	map.panTo(new GLatLng(41.5601, -85.8283));
}

function bremen() {
	map.panTo(new GLatLng(41.4462, -86.1687));
}
