//<![CDATA[
var map;
var gmarkers = [];
var i = 0;

function Gload() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));

    map.addControl(new GLargeMapControl());
    map.addControl(new GScaleControl());
    //map.addControl(new GMapTypeControl());
    map.enableContinuousZoom();
    map.enableScrollWheelZoom();

    // Taken from http://econym.googlepages.com/example_maptypecontrols2.htm
    // Add the Terrain Map Type
    map.addMapType(G_PHYSICAL_MAP);
    // Create a Hierercical map type control
    var hierarchy = new GHierarchicalMapTypeControl();
    // make Google Satellite Hybrid be the satellite default
    hierarchy.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, null, true);
    // add that control to the map
    map.addControl(hierarchy);

    Gload2();
  }
}

function Gload_mini() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));

    map.addControl(new GSmallMapControl());
    maptype = new GMapTypeControl(1);
    map.addControl( maptype );
    map.removeMapType( G_SATELLITE_MAP );
    //map.addControl(new GMapTypeControl());
    //map.enableContinuousZoom();
    //map.enableScrollWheelZoom();

//    // Taken from http://econym.googlepages.com/example_maptypecontrols2.htm
//    // Add the Terrain Map Type
//    map.addMapType(G_PHYSICAL_MAP);
//    // Create a Hierercical map type control
//    var hierarchy = new GHierarchicalMapTypeControl();
//    // make Google Satellite Hybrid be the satellite default
//    hierarchy.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, null, true);
//    // add that control to the map
//    map.addControl(hierarchy);

    Gload2();
  }
}

function Gload_micro() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));

    map.addControl(new GSmallZoomControl());
    //maptype = new GMapTypeControl(1)
    //map.addControl( maptype );
    //map.removeMapType( G_SATELLITE_MAP );
    //map.removeMapType( G_HYBRID_MAP );
    //map.addControl(new GMapTypeControl());
    //map.enableContinuousZoom();
    //map.enableScrollWheelZoom();

//    // Taken from http://econym.googlepages.com/example_maptypecontrols2.htm
//    // Add the Terrain Map Type
//    map.addMapType(G_PHYSICAL_MAP);
//    // Create a Hierercical map type control
//    var hierarchy = new GHierarchicalMapTypeControl();
//    // make Google Satellite Hybrid be the satellite default
//    hierarchy.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, null, true);
//    // add that control to the map
//    map.addControl(hierarchy);

    Gload2();
  }
}

// taken from Google Maps API Tutorial [and modified]
// -- usage --
//  var marker = createMarker(43.65654,-79.90138,'<div style="width:240px">Some stuff to display in the First Info Window. With a <a href="http://www.econym.demon.co.uk">Link</a> to my home page</div>')
//  map.addOverlay( marker );
   function createMarker(lat,lon,m_icon,label,info_html,label_sidebar) {
     // in order to add icon - new GMarker(point, {icon:myIcon, title:label})
     var marker = new GMarker( new GLatLng(lat,lon), {icon:m_icon, title:label} );
     if ( info_html ) {
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(info_html);
        });
     }

     // save the info we need to use later for the side_bar
     gmarkers[i] = marker;

     if ( label_sidebar ) {
        // add a line to the side_bar html
        //document.getElementById("markers").innerHTML += '<a href="javascript:myclick(' + i + ')">' + label + '</a><br>';
        document.getElementById("select").options[i] = new Option( label, i );
     }
     i++;

     return marker;
   }

function p(a){if(a.match(/\-/)){a= a.replace(/\-/,'');return parseInt(a,36)/(-10000);}else{return parseInt(a,36)/10000;}}

// Icons
// G_DEFAULT_ICON, G_END_ICON, G_PAUSE_ICON, G_START_ICON
//  var baseIcon = new GIcon(); new GIcon(G_DEFAULT_ICON); new GIcon(G_DEFAULT_ICON, "numbers/tretton.png");
//  baseIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png";
//  baseIcon.iconSize=new GSize(32,32);
//  baseIcon.shadowSize=new GSize(32,32);
//  baseIcon.iconAnchor=new GPoint(16,16);
//  baseIcon.infoWindowAnchor=new GPoint(16,16);

//]]>