// JavaScript Document

function popMap()
{
	 
	$("body").prepend("<div id='Mapmid' class='Mapmid'</div>");
	$("body").prepend("<div id='Mapdiv' class='Mapdiv' onclick='hideMap()'></div>");
document.getElementById("Mapdiv").style.display ='block';
document.getElementById("Mapmid").style.display ='block';
	
	 var makeHTML = "<div class='Title' id='Title'>Pedal for Scotland Full Route</div><div class='Options' id='Options'  style = 'cursor:pointer' onclick='hideMap()'>Click to Close</div><div id='map_canvas' style='width: 560px; height: 560px'></div><div class='GEDownload' id='GEDownload'><a href='http://www.pedalforscotland.org/Route/Pedal_for_Scotland5.kml'>Download Map for Google Earth</a></div>";

	 $("#Mapmid").prepend(makeHTML);
	 initialize();
	 
}

function popMap2()
{
	 
	$("body").prepend("<div id='Mapmid' class='Mapmid'</div>");
	$("body").prepend("<div id='Mapdiv' class='Mapdiv' onclick='hideMap()'></div>");
document.getElementById("Mapdiv").style.display ='block';
document.getElementById("Mapmid").style.display ='block';
	
	 var makeHTML = "<div class='Title' id='Title'>Pedal for Scotland Sportive Route</div><div class='Options' id='Options'  style = 'cursor:pointer' onclick='hideMap()'>Click to Close</div><div id='map_canvas' style='width: 560px; height: 560px'></div><div class='GEDownload' id='GEDownload'><a href='http://www.pedalforscotland.org/Route/Sportive1.kml'>Download Map for Google Earth</a></div>";

	 $("#Mapmid").prepend(makeHTML);
	 initialize2();
	 
}

function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(55.90, -3.70), 9);
		
		var kml = new GGeoXml("http://pedalforscotland.org/Route/Pedal_for_Scotland5.kml");
   		map.addOverlay(kml);
        map.setUIToDefault();
      }
    }

function initialize2() {
      if (GBrowserIsCompatible()) {
        var map = new GMap(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(55.90, -3.70), 9);
		
		var kml = new GGeoXml("http://pedalforscotland.org/Route/Sportive1.kml");
   		map.addOverlay(kml);
        map.setUIToDefault();
      }
    }

function hideMap()
{
$("div.Mapmid").remove();
$("div.Mapdiv").remove();
GUnload();
}

