// JavaScript Document

//<![CDATA[
var map;

function createMarker(point,icon) {

  var marker = new GMarker(point,icon);
  
  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml("<img src='http://www.cesefor.com/img_web/logocesefor.jpg' />");
  });
  return marker;
}

function load() {
  if (GBrowserIsCompatible()) {
	map = new GMap2(document.getElementById("map"));
	
	map.setCenter(new GLatLng(41.773568, -2.48615), 14);
	map.enableDoubleClickZoom();
	map.enableContinuousZoom();
	map.addControl(new GSmallMapControl());
	//map.addControl(new GMapTypeControl());
	//map.addOverlay(new GMarker(map.getCenter()));
	//map.openInfoWindow(map.getCenter(), document.createTextNode("Cesefor"));
	map.setMapType(G_HYBRID_MAP);
	var point = new GLatLng(41.773568, -2.48615);
	
	var icon = new GIcon();
	icon.image = "http://www.cesefor.com/img_web/ho.png";
	icon.iconSize = new GSize(53, 92);
	icon.iconAnchor = new GPoint(25, 95);
	icon.infoWindowAnchor = new GPoint(31, 8);

	map.addOverlay(createMarker(point,icon));
  }
}

function controlCheck()
{
   if (document.getElementById("chk").checked)
	{
		map.setMapType(G_SATELLITE_TYPE);
	}
	else
	{
		map.setMapType(G_MAP_TYPE);
	}
}


//]]>