				/* Google Maps mash-up and custom map artwork created by Francis Johnston, Ski-Ride Media;
				 * geodata set and custom map artwork Copyright 2010 Ski-Ride Media (ski-ride.co.uk).
				 */

		/*
		 * MAIN LOAD FUNCTION
		 */

		function initialize() {

  var myOptions = {
    zoom: 3,
    center: new google.maps.LatLng(52.53627304145948, 19.599609375),
    mapTypeId: google.maps.MapTypeId.SATELLITE,
	navigationControl: false,
	streetViewControl: false,
	mapTypeControl: false,
	disableDoubleClickZoom: true
  }
  var map = new google.maps.Map(document.getElementById("map_canvas"),
                                myOptions);

  fueraMap = map;
  // Enables references to the map to be made from outside of this load function
  // ie for text-based Quick Zoom controls in doc html.


/* CUSTOM MARKERS
 * Marker sizes are expressed as a Size of X,Y
 * where the origin of the image (0,0) is located
 * in the top left of the image.
 * Origins, anchor positions and coordinates of the marker
 * increase in the X direction to the right and in
 * the Y direction down.
 */
  var imageP = new google.maps.MarkerImage('http://ski-ride.co.uk/mapicons/markers/imageP.png',
      // This marker is 15 pixels wide by 15 pixels tall.
      new google.maps.Size(15, 15),
      // The origin for this image is 0, 0.
      new google.maps.Point(0, 0),
      // The anchor for this image is bottom centre: ie 8, 15.
      new google.maps.Point(8, 15));
  
  var shadow = new google.maps.MarkerImage('http://ski-ride.co.uk/mapicons/markers/imagePshad.png',
      // The shadow image is larger in the horizontal dimension
      // while the position and offset are the same as for the main image.
      new google.maps.Size(23, 15),
      new google.maps.Point(0, 0),
      new google.maps.Point(8, 15));
  
  var shape = {
      coord: [0, 0, 0, 15, 15, 15, 15, 0],
      type: 'poly'
  };
  // Shapes define the clickable region of the icon.
  // The type defines an HTML <area> element 'poly' which
  // traces out a polygon as a series of X,Y points.
  // The final coordinate closes the poly by connecting to the first coordinate.


// LATEST MARKER NUMBER: 12

/* *****
 * MARKERS: NATIONS
 */
	var nation1 = new google.maps.LatLng(42.48019996901214, 1.51611328125);
	var contentString1 = '<div class="m_text"><strong>Andorra</strong><br>Mountain Range: Pyrenees<br><br><a href="http://ski-ride.net/pages/andorra" class="m_text" title="View a map of the mountains &#38; ski resorts of Andorra">View the Ski-Ride Map of Andorra &#187;</a><br> &#160;</div>';
    var infowindow1 = new google.maps.InfoWindow({
        content: contentString1,
		maxWidth: 220
    });
	var marker1 = new google.maps.Marker({
        position: nation1,
        map: map,
		shadow: shadow,
        icon: imageP,
        shape: shape,
        title: 'Andorra'
    });
    google.maps.event.addListener(marker1, 'click', function() {
      infowindow1.open(map, marker1);
    });
	marker1.setMap(map);
	
	var nation2 = new google.maps.LatLng(47.33882269482199, 13.60107421875);
	var contentString2 = '<div class="m_text"><strong>Austria</strong><br>Mountain Range: Alps<br><br><a href="http://ski-ride.net/pages/austria" class="m_text" title="View a map of the mountains &#38; ski resorts of Austria">View the Ski-Ride Map of Austria &#187;</a><br> &#160;</div>';
    var infowindow2 = new google.maps.InfoWindow({
        content: contentString2,
		maxWidth: 220
    });
	var marker2 = new google.maps.Marker({
        position: nation2,
        map: map,
		shadow: shadow,
        icon: imageP,
        shape: shape,
        title: 'Austria'
    });
    google.maps.event.addListener(marker2, 'click', function() {
      infowindow2.open(map, marker2);
    });
	marker2.setMap(map);
	
	var nation3 = new google.maps.LatLng(46.57396679652779, 3.1201171875);
	var contentString3 = '<div class="m_text"><strong>France</strong><br>Mountain Ranges: Alps, Pyrenees,<br>Jura, Massif Central, Vosges<br><br><a href="http://ski-ride.net/pages/france" class="m_text" title="View a map of the mountains &#38; ski resorts of France">View the Ski-Ride Map of France &#187;</a><br> &#160;</div>';
    var infowindow3 = new google.maps.InfoWindow({
        content: contentString3,
		maxWidth: 220
    });
	var marker3 = new google.maps.Marker({
        position: nation3,
        map: map,
		shadow: shadow,
        icon: imageP,
        shape: shape,
        title: 'France'
    });
    google.maps.event.addListener(marker3, 'click', function() {
      infowindow3.open(map, marker3);
    });
	marker3.setMap(map);
	
	var nation4 = new google.maps.LatLng(44.276671273775186, 10.37109375);
	var contentString4 = '<div class="m_text"><strong>Italy</strong><br>Mountain Ranges: Alps, Apennines, Dolomites<br><br><a href="http://ski-ride.net/pages/italy" class="m_text" title="View a map of the mountains &#38; ski resorts of Italy">View the Ski-Ride Map of Italy &#187;</a><br> &#160;</div>';
    var infowindow4 = new google.maps.InfoWindow({
        content: contentString4,
		maxWidth: 220
    });
	var marker4 = new google.maps.Marker({
        position: nation4,
        map: map,
		shadow: shadow,
        icon: imageP,
        shape: shape,
        title: 'Italy'
    });
    google.maps.event.addListener(marker4, 'click', function() {
      infowindow4.open(map, marker4);
    });
	marker4.setMap(map);
	
	var nation5 = new google.maps.LatLng(46.800059446787316, 8.23974609375);
	var contentString5 = '<div class="m_text"><strong>Switzerland</strong><br>Mountain Range: Alps<br><br><a href="http://ski-ride.net/pages/switzerland" class="m_text" title="View a map of the mountains &#38; ski resorts of Switzerland">View the Ski-Ride Map of Switzerland &#187;</a><br> &#160;</div>';
    var infowindow5 = new google.maps.InfoWindow({
        content: contentString5,
		maxWidth: 220
    });
	var marker5 = new google.maps.Marker({
        position: nation5,
        map: map,
		shadow: shadow,
        icon: imageP,
        shape: shape,
        title: 'Switzerland'
    });
    google.maps.event.addListener(marker5, 'click', function() {
      infowindow5.open(map, marker5);
    });
	marker5.setMap(map);
	
	var nation6 = new google.maps.LatLng(42.779275360241904, 25.13671875);
	var contentString6 = '<div class="m_text"><strong>Bulgaria</strong><br>Mountain Ranges: Balkans (Stara Planina),<br>Pirin, Rhodope Massif, Rila,<br>Slavyanka, Stargach, Strandzha<br><br><a href="http://ski-ride.net/pages/bulgaria" class="m_text" title="View a map of the mountains &#38; ski resorts of Bulgaria">View the Ski-Ride Map of Bulgaria &#187;</a><br> &#160;</div>';
    var infowindow6 = new google.maps.InfoWindow({
        content: contentString6,
		maxWidth: 220
    });
	var marker6 = new google.maps.Marker({
        position: nation6,
        map: map,
		shadow: shadow,
        icon: imageP,
        shape: shape,
        title: 'Bulgaria'
    });
    google.maps.event.addListener(marker6, 'click', function() {
      infowindow6.open(map, marker6);
    });
	marker6.setMap(map);
	
	var nation7 = new google.maps.LatLng(60.930432202923335, 8.26171875);
	var contentString7 = '<div class="m_text"><strong>Norway</strong><br>Mountain Range: Kjolen (Kj&#248;len)<br><br><a href="http://ski-ride.net/pages/norway" class="m_text" title="View a map of the mountains &#38; ski resorts of Norway">View the Ski-Ride Map of Norway &#187;</a><br> &#160;</div>';
    var infowindow7 = new google.maps.InfoWindow({
        content: contentString7,
		maxWidth: 220
    });
	var marker7 = new google.maps.Marker({
        position: nation7,
        map: map,
		shadow: shadow,
        icon: imageP,
        shape: shape,
        title: 'Norway'
    });
    google.maps.event.addListener(marker7, 'click', function() {
      infowindow7.open(map, marker7);
    });
	marker7.setMap(map);
	
	var nation8 = new google.maps.LatLng(62.431074232920906, 14.94140625);
	var contentString8 = '<div class="m_text"><strong>Sweden</strong><br>Mountain Range: Kjolen (K&#246;len)<br>(aka: Fj&#228;llen)<br><br><a href="http://ski-ride.net/pages/sweden" class="m_text" title="View a map of the mountains &#38; ski resorts of Sweden">View the Ski-Ride Map of Sweden &#187;</a><br> &#160;</div>';
    var infowindow8 = new google.maps.InfoWindow({
        content: contentString8,
		maxWidth: 220
    });
	var marker8 = new google.maps.Marker({
        position: nation8,
        map: map,
		shadow: shadow,
        icon: imageP,
        shape: shape,
        title: 'Sweden'
    });
    google.maps.event.addListener(marker8, 'click', function() {
      infowindow8.open(map, marker8);
    });
	marker8.setMap(map);
	
	var nation9 = new google.maps.LatLng(64.69910544204765, 26.89453125);
	var contentString9 = '<div class="m_text"><strong>Finland</strong><br>Mountain Ranges:<br>Kjolen (K&#246;li)<br>+ various isolated fells (tunturi)<br><br><a href="http://ski-ride.net/pages/finland" class="m_text" title="View a map of the mountains &#38; ski resorts of Finland">View the Ski-Ride Map of Finland &#187;</a><br> &#160;</div>';
    var infowindow9 = new google.maps.InfoWindow({
        content: contentString9,
		maxWidth: 220
    });
	var marker9 = new google.maps.Marker({
        position: nation9,
        map: map,
		shadow: shadow,
        icon: imageP,
        shape: shape,
        title: 'Finland'
    });
    google.maps.event.addListener(marker9, 'click', function() {
      infowindow9.open(map, marker9);
    });
	marker9.setMap(map);
	
	var nation10 = new google.maps.LatLng(52.696361078274485, -117.0703125);
	var contentString10 = '<div class="m_text"><strong>Canada</strong><br>Mountain Ranges: Rocky Mountains,<br>Laurentian Highlands, Mackenzie Mountains<br><br><a href="http://ski-ride.net/pages/canada" class="m_text" title="View a map of the mountains &#38; ski resorts of Canada">View the Ski-Ride Map of Canada &#187;</a><br> &#160;</div>';
    var infowindow10 = new google.maps.InfoWindow({
        content: contentString10,
		maxWidth: 220
    });
	var marker10 = new google.maps.Marker({
        position: nation10,
        map: map,
		shadow: shadow,
        icon: imageP,
        shape: shape,
        title: 'Canada'
    });
    google.maps.event.addListener(marker10, 'click', function() {
      infowindow10.open(map, marker10);
    });
	marker10.setMap(map);
	
	var nation11 = new google.maps.LatLng(39.232253141714885, -104.765625);
	var contentString11 = '<div class="m_text"><strong>USA</strong><br>Mountain Ranges:<br>Appalachians, Rocky Mtns, Sierra Nevada,<br>Aleutian/Alaska Range, Brooks Range,<br>Coast Mtns<br><br><a href="http://ski-ride.net/pages/usa" class="m_text" title="View a map of the mountains &#38; ski resorts of the USA">View the Ski-Ride USA Map &#187;</a><br> &#160;</div>';
    var infowindow11 = new google.maps.InfoWindow({
        content: contentString11,
		maxWidth: 220
    });
	var marker11 = new google.maps.Marker({
        position: nation11,
        map: map,
		shadow: shadow,
        icon: imageP,
        shape: shape,
        title: 'USA'
    });
    google.maps.event.addListener(marker11, 'click', function() {
      infowindow11.open(map, marker11);
    });
	marker11.setMap(map);
	
	var nation12 = new google.maps.LatLng(40.38002840251183, -3.66943359375);
	var contentString12 = '<div class="m_text"><strong>Spain</strong><br>Mountain Ranges:<br>Cordillera Cant&#225;brica, Meseta Plateau,<br>Pyrenees, Sierra Morena, Sierra Nevada<br><br><a href="http://ski-ride.net/pages/spain" class="m_text" title="View a map of the mountains &#38; ski resorts of Spain">View the Ski-Ride Map of Spain &#187;</a><br> &#160;</div>';
    var infowindow12 = new google.maps.InfoWindow({
        content: contentString12,
		maxWidth: 220
    });
	var marker12 = new google.maps.Marker({
        position: nation12,
        map: map,
		shadow: shadow,
        icon: imageP,
        shape: shape,
        title: 'Spain'
    });
    google.maps.event.addListener(marker12, 'click', function() {
      infowindow12.open(map, marker12);
    });
	marker12.setMap(map);

		} // Main Load Function END

/*
 * Text-based Quick Zoom controls in doc html.
 */
function moveMapEurope() {
	fueraMap.setCenter(new google.maps.LatLng(52.53627304145948, 19.599609375)),
	fueraMap.setZoom(3);
}	
function moveMapNAmerica() {
	fueraMap.setCenter(new google.maps.LatLng(51.83577752045248, -105.8203125)),
	fueraMap.setZoom(2);
}
