function cf_timbres_maj(id) {
	document.write('');
}

function toggleGroup(type) {
  for (var i = 0; i < markerGroups[type].length; i++) {
    var marker = markerGroups[type][i];
    if (marker.getVisible()) {
      marker.setVisible(false);
    } else {
      marker.setVisible(true);
    }
  }
}

/**
* change le niveau de zoom de la carte "map"
* @param {String} type Zoom appliquer : 'monde', 'europe' ou 'france'
*/
function cf_gmap_zoom(type) {
  if (type == 'monde') {
    map.setZoom(1);
    map.setCenter(new google.maps.LatLng(46.47, 5.27));
  } else if (type == 'europe') {
    map.setZoom(4);
    map.setCenter(new google.maps.LatLng(46.47, 5.27));
  } else if (type == 'france') {
    map.setZoom(5);
    map.setCenter(new google.maps.LatLng(46.47, 5.27));
  }
}

// A function to create the marker and set up the event window
var markerGroups = { "producteur": [], "jardin": [], "evenement": [], "site": []};
function cf_createMarker2(name, latlng, type) {
	var marker = new google.maps.Marker({position: latlng, map: map, icon: "/images/icones/icone_gmap_"+type+".png"});
	markerGroups[type].push(marker);
	google.maps.event.addListener(marker, "click", function() {
		if (infowindow) infowindow.close();
		infowindow = new google.maps.InfoWindow({content: name});
		infowindow.open(map, marker);
	});
	return marker;
}

// ***********************************************************************************
// Début code de http://gmaps-samples-v3.googlecode.com/svn/trunk/xmlparsing/util.js
// ***********************************************************************************
/**
* Returns an XMLHttp instance to use for asynchronous
* downloading. This method will never throw an exception, but will
* return NULL if the browser does not support XmlHttp for any reason.
* @return {XMLHttpRequest|Null}
*/
function createXmlHttpRequest() {
 try {
   if (typeof ActiveXObject != 'undefined') {
     return new ActiveXObject('Microsoft.XMLHTTP');
   } else if (window["XMLHttpRequest"]) {
     return new XMLHttpRequest();
   }
 } catch (e) {
   changeStatus(e);
 }
 return null;
};

/**
* This functions wraps XMLHttpRequest open/send function.
* It lets you specify a URL and will call the callback if
* it gets a status code of 200.
* @param {String} url The URL to retrieve
* @param {Function} callback The function to call once retrieved.
*/
function downloadUrl(url, callback) {
 var status = -1;
 var request = createXmlHttpRequest();
 if (!request) {
   return false;
 }

 request.onreadystatechange = function() {
   if (request.readyState == 4) {
     try {
       status = request.status;
     } catch (e) {
       // Usually indicates request timed out in FF.
     }
     if (status == 200) {
       callback(request.responseXML, request.status);
       request.onreadystatechange = function() {};
     }
   }
 }
 request.open('GET', url, true);
 try {
   request.send(null);
 } catch (e) {
   changeStatus(e);
 }
};

/**
 * Parses the given XML string and returns the parsed document in a
 * DOM data structure. This function will return an empty DOM node if
 * XML parsing is not supported in this browser.
 * @param {string} str XML string.
 * @return {Element|Document} DOM.
 */
function xmlParse(str) {
  if (typeof ActiveXObject != 'undefined' && typeof GetObject != 'undefined') {
    var doc = new ActiveXObject('Microsoft.XMLDOM');
    doc.loadXML(str);
    return doc;
  }

  if (typeof DOMParser != 'undefined') {
    return (new DOMParser()).parseFromString(str, 'text/xml');
  }

  return createElement('div', null);
}

/**
 * Appends a JavaScript file to the page.
 * @param {string} url
 */
function downloadScript(url) {
  var script = document.createElement('script');
  script.src = url;
  document.body.appendChild(script);
}
// ***********************************************************************************
// Fin code de http://gmaps-samples-v3.googlecode.com/svn/trunk/xmlparsing/util.js
// ***********************************************************************************


