/* ************************ */
/*  base js for google map  */
/* ************************ */

var aLocations = new Array ();

// create a base icon for all of markers
var baseIcon = new GIcon ();
baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
baseIcon.iconSize = new GSize (20, 34);
baseIcon.shadowSize = new GSize (37, 34);
baseIcon.iconAnchor = new GPoint (9, 34);
baseIcon.infoWindowAnchor = new GPoint (9, 2);
baseIcon.infoShadowAnchor = new GPoint (18, 25);		

function createMarkerWithMsg (point, html, icontype) {
	
	var icon = new GIcon (baseIcon);

	if (icontype == "custom") {
		
		icon.image = "http://www.augustahouse.net/img/icons/google/custom.png";
		icon.iconSize = new GSize (20, 34);
		
	} else {
		
		icon.image = "http://www.augustahouse.net/img/icons/google/" + icontype + ".png";
		icon.iconSize = new GSize (20, 34);
		
	};

	var marker = new GMarker (point,icon);

	// show this marker's address/msg in the info window when it is clicked
	GEvent.addListener(marker, "click", function () { 
		
		marker.openInfoWindowHtml (html); 
		
	});
	
	return marker;
	
}	
			
// open the info box for the specified marker
function openWindowHTML (i) {
	
	GEvent.trigger (aLocations[i], "click");
	
}	
