window.addEvent("domready", function()
{
	if (GBrowserIsCompatible())
	{
		var map = new GMap2(document.getElementById("google_map"));

		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());

		map.setCenter(new GLatLng(51.04296, -114.08032), 14);

		var icon = new GIcon();
		icon.image = "/assets/images/map_pin.png";
		icon.iconSize = new GSize(38, 39);
		icon.iconAnchor = new GPoint(14, 38);

		var point = new GLatLng(51.04296, -114.08032);
		map.addOverlay(new GMarker(point, icon));
	}
});

function click_directions(directions)
{
	if(directions.value == "Enter your address for directions")
		directions.value = "";
}

function blur_directions(directions)
{
	if(directions.value == "")
		directions.value = "Enter your address for directions";
}

function find_directions()
{
	window.open("http://maps.google.com/maps?daddr=822+11+Ave+SW,+Calgary,+AB,+Canada&saddr=" + encodeURI(document.getElementById('map_directions').value));
}

