// Base Javascript for Google Map what to do pages

var aLocations = new Array();

// Create a base icon for all of our markers that specifies the
// shadow, icon dimensions, etc.
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://hoteldeluxeportland.com/images/icons/markers/custom.png";
		icon.iconSize = new GSize(20, 34);
		}
	else {
		icon.image = "http://hoteldeluxeportland.com/images/icons/markers/" + 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");
}

function createGenericMarkerWithMsg(point, html, icontype) {
	var marker;
	if (icontype == "custom") {
		var icon = 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);
		icon.image = "http://hoteldeluxeportland.com/images/icons/markers/custom.png";
		icon.iconSize = new GSize(20, 34);
		marker = new GMarker(point,icon);		
	};
	marker = new GMarker(point);		
	

	// Show this marker's address/msg in the info window when it is clicked
	GEvent.addListener(marker, "click", function() { 
		marker.openInfoWindowHtml(html); 
	});
	
	return marker;
}	
