//<![CDATA[
var map;
var icon;
var markers = [];

function load() {
  if (GBrowserIsCompatible()) {
	map = new GMap2(document.getElementById("map"), 
     {mapTypes:[G_NORMAL_MAP,G_HYBRID_MAP,G_SATELLITE_MAP]}); 

	
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());
	map.addControl(new GScaleControl());
	map.addControl(new GOverviewMapControl(new GSize(150,150)));

	map.setCenter(new GLatLng(40, 20), 3);

	// Create our "tiny" marker icon
	icon = new GIcon();
	icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
	icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
	icon.iconSize = new GSize(12, 20);
	icon.shadowSize = new GSize(22, 20);
	icon.iconAnchor = new GPoint(6, 20);
	icon.infoWindowAnchor = new GPoint(5, 1);
	
  }
}


//function createMarker(lat,lng,index,region) {
//	var point = new GLatLng(lat,lng)
//	var marker = new GMarker(point,icon);
//	GEvent.addListener(marker, "click", function() {
//		marker.openInfoWindowHtml(region);
//    });
//
//	markers[index] = marker;
//	return marker;
//}

function createInfoMarker(point, address) {

   var marker = new GMarker(point);

   GEvent.addListener(marker, "click",

      function() {

         marker.openInfoWindowHtml(address);

      }

   );

  return marker;

}

function mouseout_region(index) {
	map.removeOverlay(markers[index]);
}


function mouseover_region(index) {
	map.addOverlay(markers[index]);
}
//]]>
