// JavaScript Document
     //<![CDATA[

 var map;

function load() {
      if (GBrowserIsCompatible()) {
		map = new GMap(document.getElementById("map"));
		addGMapOverlays();
	}
}

	
function addGMapOverlays() {

var poly;

map.centerAndZoom (center,initscale);

map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());



       // Generate Overlays
       for (i=0; i<gpoints.length; i++)
       {
	    var mymarker = new MyMarker(gpoints[i],gtext[i],gid[i]);
	    map.addOverlay (mymarker.marker);
            
            // Add Routes
            if (gpoly[i] != null)
            {
              poly = gpoly[i];
              map.addOverlay(new GPolyline(poly));
            }

	}

}
  
function MyMarker(point,html,id) {
      this.li_id = id;
      this.html = html;
      this.point = point;
      this.marker = new GMarker(point);
      this.onClick = function() {
          this.marker.openInfoWindowHtml(this.html);
	  map.centerAndZoom ( this.point,clickscale);
	  map.savePosition();
	  load_featured(this.li_id);
      };
      GEvent.bind(this.marker, "click", this, this.onClick);
}
        
//]]>
