// A TextualZoomControl is a GControl that displays textual "Zoom In"
// and "Zoom Out" buttons (as opposed to the iconic buttons used in
// Google Maps).
function TextualZoomControl()
{}
TextualZoomControl.prototype = new GControl();

// Creates a one DIV for each of the buttons and places them in a container
// DIV which is returned as our control element. We add the control to
// to the map container and return the element for the map class to
// position properly.
TextualZoomControl.prototype.initialize = function(map) {
  var container = document.createElement("div");

  var zoomInDiv = document.createElement("div");
  this.setButtonStyle_(zoomInDiv);
  container.appendChild(zoomInDiv);
  zoomInDiv.appendChild(document.createTextNode("Zoom avant"));
  GEvent.addDomListener(zoomInDiv, "click", function() {
    map.zoomIn();
  });

  var zoomOutDiv = document.createElement("div");
  this.setButtonStyle_(zoomOutDiv);
  container.appendChild(zoomOutDiv);
  zoomOutDiv.appendChild(document.createTextNode("Zoom Arri�re"));
  GEvent.addDomListener(zoomOutDiv, "click", function() {
    map.zoomOut();
  });

  map.getContainer().appendChild(container);
  return container;
}

// By default, the control will appear in the top left corner of the
// map with 7 pixels of padding.
TextualZoomControl.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
}

// Sets the proper CSS for the given button element.
TextualZoomControl.prototype.setButtonStyle_ =
function(button)
{
  //button.style.textDecoration = "underline";
  button.style.color = "white";
  button.style.backgroundColor = "#2D6497";
  button.style.font = "12px 'Trebuchet MS'";
  button.style.border = "2px outset #20476A";
  button.style.paddingTop = "2px";
  button.style.marginBottom = "3px";
  button.style.textAlign = "center";
  button.style.width = "100px";
  button.style.height = "18px";
  button.style.cursor = "pointer";
}
function createInfoMarker(point, text, map)
{
  // Afficher le marqueur
  var marker=getIcon(point);
  map.addOverlay(marker);
   marker.openInfoWindowHtml(text);
  // Lorsque le marqueur est cliqu�, on ouvre l'info-bulle
  GEvent.addListener(marker,
                     "mouseover",
                     function()
                    {
                        marker.openInfoWindowHtml(text);
                    }
  );
}
function getLatLong()
{

}
function getIcon(point)
{
      /*Cr�ation de l'incone */
   var 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);  // Cr�ation d'un marqueur
   var marker = new GMarker(point, icon);


   return marker
}
function dec2dms(l) {
	d = Math.floor(l);
	p = (l - d) * 60;
	m = Math.floor(p);
	s = Math.round((p - m) * 60);
}
function mk_map_around(o_div)
{
//mk_map_around(document.getElementById('map'));
       /* Variable qui va correspondre ï¿½ l'affichage de la carte dans la "div" */
    var map = new GMap2(document.getElementById('map'));
    /* Centre la carte aux coordonnï¿½es indiquï¿½es et rï¿½alise un zoom de niveau 14 */
    var center = new GLatLng(48.64844853090923, -2.0278358459472656);

//    map.addControl(new TextualZoomControl());

    map.setCenter(center, 9);

    var point= new GLatLng(48.6152360080842, -1.9861221313476562);
       createInfoMarker(point, "<table style='color:#686E55;font-size:12px; width:250px;'><tr><td colspan='2' style='font-weight:bold; font-size:14px;'>Domaine de la Ville Huchet</td></tr><tr><td colspan='2' style='text-align:justify'>Camping ****, parc aquatique</td></tr><tr><td style='font-weight:bold;'>Site Web : </td><td><a href='http://www.lavillehuchet.com' title='Domaine de la Ville Huchet' target='_blank'>http://www.lavillehuchet.com</a></td></tr><tr><td rowspan='2' style='font-weight:bold;'>Coordonn&eacute;es GPS</td><td>Latitude : 48&deg;36'55 N</td></tr><tr><td>Longitude : 1&deg;59'10 W</td></tr></table>", map);
var point= new GLatLng(48.41108642511684, -1.7490577697753906);
       createInfoMarker(point, "<table style='color:#686E55;font-size:12px; width:250px;'><tr><td colspan='2' style='font-weight:bold; font-size:14px;'>Combourg</td></tr><tr><td colspan='2' style='text-align:justify'>Cit&eacute; du romantisme du XIX&#232;me si&#232;cle</td></tr><tr><td style='font-weight:bold;'>Site Web : </td><td><a href='http://www.combourg.org/' title='Combourg' target='_blank'>http://www.combourg.org/</a></td></tr></table>", map);
var point= new GLatLng(48.636538782610494, -1.5113067626953125);
       createInfoMarker(point, "<table style='color:#686E55;font-size:12px; width:250px;'><tr><td colspan='2' style='font-weight:bold; font-size:14px;'>Le Mont St Michel</td></tr><tr><td colspan='2' style='text-align:justify'>Site class&#233; patrimoine mondial de l'UNESCO. D&#233;couvrez aux portes de la Bretagne une abbaye hors du commun, merveille des hommes, et la baie du Mont-Saint-Michel, merveille de la nature</td></tr><tr><td style='font-weight:bold;'>Site Web : </td><td><a href='http://www.ot-montsaintmichel.com/' title='Le Mont St Michel' target='_blank'>http://www.ot-montsaintmichel.com/</a></td></tr><tr><td rowspan='2' style='font-weight:bold;'>Coordonn&eacute;es GPS</td><td>Latitude : 48&deg;38'12 N</td></tr><tr><td>Longitude : 1&deg;30'41 W</td></tr></table>", map);
var point= new GLatLng(48.63200099590253, -2.06268310546875);
       createInfoMarker(point, "<table style='color:#686E55;font-size:12px; width:250px;'><tr><td colspan='2' style='font-weight:bold; font-size:14px;'>Dinard</td></tr><tr><td colspan='2' style='text-align:justify'>Cit&#233; Baln&#233;aire renom&#233;e</td></tr><tr><td style='font-weight:bold;'>Site Web : </td><td><a href='http://www.ot-dinard.com' title='Dinard' target='_blank'>http://www.ot-dinard.com</a></td></tr><tr><td rowspan='2' style='font-weight:bold;'>Coordonn&eacute;es GPS</td><td>Latitude : 48&deg;37'55 N</td></tr><tr><td>Longitude : 2&deg;3'46 W</td></tr></table>", map);
var point= new GLatLng(48.67645370777654, -1.856689453125);
       createInfoMarker(point, "<table style='color:#686E55;font-size:12px; width:250px;'><tr><td colspan='2' style='font-weight:bold; font-size:14px;'>Cancale</td></tr><tr><td colspan='2' style='text-align:justify'>Port de p&#234;che renomm&#233;e pour les huitres</td></tr><tr><td style='font-weight:bold;'>Site Web : </td><td><a href='http://www.cancale-tourisme.fr' title='Cancale' target='_blank'>http://www.cancale-tourisme.fr</a></td></tr><tr><td rowspan='2' style='font-weight:bold;'>Coordonn&eacute;es GPS</td><td>Latitude : 48&deg;40'35 N</td></tr><tr><td>Longitude : 1&deg;51'24 W</td></tr></table>", map);
var point= new GLatLng(48.68189420361744, -2.32086181640625);
       createInfoMarker(point, "<table style='color:#686E55;font-size:12px; width:250px;'><tr><td colspan='2' style='font-weight:bold; font-size:14px;'>Cap fr&#233;hel</td></tr><tr><td colspan='2' style='text-align:justify'> Le cap Fr&#233;hel, merveille de la nature, est l'un des sites les plus impressionnants de la Bretagne avec des falaises dominant la mer de 70 m&#232;tres. </td></tr><tr><td style='font-weight:bold;'>Site Web : </td><td><a href='http://www.cap-frehel.net/' title='Cap fr&#233;hel' target='_blank'>http://www.cap-frehel.net/</a></td></tr><tr><td rowspan='2' style='font-weight:bold;'>Coordonn&eacute;es GPS</td><td>Latitude : 48&deg;40'55 N</td></tr><tr><td>Longitude : 2&deg;19'15 W</td></tr></table>", map);
var point= new GLatLng(48.45197645962599, -2.047576904296875);
       createInfoMarker(point, "<table style='color:#686E55;font-size:12px; width:250px;'><tr><td colspan='2' style='font-weight:bold; font-size:14px;'>Dinan</td></tr><tr><td colspan='2' style='text-align:justify'>Citadelle m&#233;di&#233;vale dominant le site exceptionnel de la  vall&#233;e de la Rance, Dinan est sans conteste l'une des plus belles cit&#233;s de Bretagne.</td></tr><tr><td style='font-weight:bold;'>Site Web : </td><td><a href='http://www.dinan-tourisme.com' title='Dinan' target='_blank'>http://www.dinan-tourisme.com</a></td></tr><tr><td rowspan='2' style='font-weight:bold;'>Coordonn&eacute;es GPS</td><td>Latitude : 48&deg;27'07 N</td></tr><tr><td>Longitude : 2&deg;2'51 W</td></tr></table>", map);
var point= new GLatLng(48.64844853090923, -2.0278358459472656);
       createInfoMarker(point, "<table style='color:#686E55;font-size:12px; width:250px;'><tr><td colspan='2' style='font-weight:bold; font-size:14px;'>Saint Malo</td></tr><tr><td colspan='2' style='text-align:justify'>La c&#233;lebre cit&#233; Corsaire</td></tr><tr><td style='font-weight:bold;'>Site Web : </td><td><a href='http://www.saint-malo-tourisme.com/' title='Saint Malo' target='_blank'>http://www.saint-malo-tourisme.com/</a></td></tr><tr><td rowspan='2' style='font-weight:bold;'>Coordonn&eacute;es GPS</td><td>Latitude : 48&deg;38'54 N</td></tr><tr><td>Longitude : 2&deg;1'40 W</td></tr></table>", map);

GEvent.addListener(map, "click",
      function(marker, point)
      {
        new GMarker(point)
      }
   );
    map.addControl(new TextualZoomControl());
}