Event.observe(window,'load',function(){
	if(GBrowserIsCompatible()) {
		
		var map			=	new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		
		var duquesnePT	=	new GLatLng(40.438056, -79.99404);
		var centermapPT	=	new GLatLng(40.438056, -79.99404);
		
		var duquesneMK	=	new GMarker(duquesnePT,null,false);
		
		GEvent.addListener(duquesneMK, "click", function() { duquesneMK.openInfoWindowHtml(buildDirectionContent("Donahue School of Business","600 Forbes Avenue, Pittsburgh, PA 15282","40.438056, -79.99404")); } );
		
		map.setCenter(centermapPT,15);
		map.addOverlay(duquesneMK);
	}
});



function buildDirectionContent(title, string,latlon) {
	ret_str	=	"<p><strong>" + title + "</strong><br />";
	ret_str	+=	string + "</p>";
	ret_str	+=	"<p style=\"padding-bottom:0px\">Get Directions to here:</p>";
	ret_str	+=	"<input type=\"text\" id=\"address\" width=\"30\" />";
	ret_str +=	"<input type=\"button\" onclick=\"Javascript:getDirections('" + latlon + "')\" value=\"Go &raquo;\" />";
	
	return ret_str;
}

function getDirections(to) {
	var from	=	document.getElementById("address").value;
	from = from.split(" ").join("+").split("#").join("");
	to = to.split(" ").join("+").split("#").join("");
	var uri	=	"http://maps.google.com/maps?f=d&hl=en&saddr=" + from + "&daddr=" + to;
	window.open( uri, "mapwindow");
}