// JavaScript Document

// display current year for copyright
function showYear() {
	var to = new Date();
	var year = to.getFullYear();
	if (year != '2008')	document.write(" - " + year + " ");
}

function showFlags() {
	var domain = window.location.host;	// allow for langstonemanor.co.uk and langstone-manor.co.uk
	
	document.write('<a href="http://www.google.com/translate?langpair=en|nl&u=' + domain + '"><img src="/images/flags/flag_dutch.gif" alt="Translate into Dutch" width="25" height="17" border="0" /></a><a href="http://www.google.com/translate?langpair=en|fr&u=' + domain + '"><img src="/images/flags/flag_french.gif" alt="Translate into French" width="25" height="17" border="0" /></a><a href="http://www.google.com/translate?langpair=en|de&u=' + domain + '"><img src="/images/flags/flag_german.gif" alt="Translate into German" width="25" height="17" border="0" /></a><a href="http://www.google.com/translate?langpair=en|it&u=' + domain + '"><img src="/images/flags/flag_italian.gif" alt="Translate into Italian" width="25" height="17" border="0" /></a><a href="http://www.google.com/translate?langpair=en|pl&u=' + domain + '"><img src="/images/flags/flag_polish.gif" alt="Translate into Polish" width="25" height="17" border="0" /></a><a href="http://www.google.com/translate?langpair=en|es&u=' + domain + '"><img src="/images/flags/flag_spanish.gif" alt="Translate into Spanish" width="25" height="17" border="0" /></a>');
	
}

    //<![CDATA[

function loadMap() {

    // Check to see if this browser can run the Google API
    if (GBrowserIsCompatible()) {

		// Display the map
		var map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(50.5457, -4.0851), 14);
		// create marker for Crown Hotel
		var point = new GLatLng(50.5457, -4.0851);
		var marker = new GMarker(point);
		marker.my_html = "Langstone Manor<br />Dartmoor National Park";
		map.addOverlay(marker);
	
		GEvent.addListener(map, "click", function(overlay, point) {
				if (overlay) {
					  if (overlay.my_html) {
						overlay.openInfoWindowHtml(overlay.my_html);
					  }
				}
		  });      
    }

    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
}
	//]]>
