window.addEvents({
	'domready': function() { // Starts executing the initializing functions when the DOM structure of the page has been loaded.
		initRoutedescription();
	}
});

// Shows the selected hotel info panel:
function initRoutedescription() {	
	if (!$('route')) return;

	if (GBrowserIsCompatible()) { 
		var adres = $('route').innerHTML;

		gmap = new GMap2(document.getElementById("route"));
		
		var geocoder = new GClientGeocoder();			
		geocoder.getLocations(adres, tournamentInfoLoadGoogleMaps);	
	}
}

function tournamentInfoLoadGoogleMaps(response) {
	var place = response.Placemark[0];
	var point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
	var marker = new GMarker(point);
	gmap.setCenter(point, 9, G_NORMAL_MAP);
	gmap.addControl(new GSmallMapControl());
	gmap.addOverlay(marker);
}
