// Ajout d'un détecteur de chargement de la page 
$(document).ready(function () {
	initialize();														
});

window.onunload = function() {
  GUnload();
}

function initialize() {
	if (GBrowserIsCompatible()) {
		var point = new GLatLng(43.6831428, 5.5051696);
		var infowindowtext = '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: #000;"><strong>XP-Internet.com</strong><br />23 rue Benjamin Franklin<br />84120 Pertuis<br />France</span>';
		
		var map = new GMap2(document.getElementById("map_canvas"));
		map.setCenter(point, 12);
    map.enableContinuousZoom();
    map.enableDoubleClickZoom();
    map.addControl(new GLargeMapControl());
    map.addControl(new GScaleControl());
    map.addControl(new GMapTypeControl());

    var icon = new GIcon();
    var markerStyle = 'Google Traditional (pillow)';
    var markerColor = 'Desert Spice';
    icon.image = 'http://google.webassist.com/google/markers/traditionalpillow/desertspice.png';
    icon.shadow = 'http://google.webassist.com/google/markers/traditionalpillow/shadow.png';
    icon.iconSize = new GSize(34,35);
    icon.shadowSize = new GSize(34,35);
    icon.iconAnchor = new GPoint(9,23);
    icon.infoWindowAnchor = new GPoint(19,0);
    icon.printImage = 'http://google.webassist.com/google/markers/traditionalpillow/desertspice.gif';
    icon.mozPrintImage = 'http://google.webassist.com/google/markers/traditionalpillow/desertspice_mozprint.png';
    icon.printShadow = 'http://google.webassist.com/google/markers/traditionalpillow/shadow.gif';
    icon.transparent = 'http://google.webassist.com/google/markers/traditionalpillow/desertspice_transparent.png';

    var marker = new GMarker(point, icon);
		GEvent.addListener(marker, 'click', function() {
    	marker.openInfoWindowHtml(infowindowtext);
    });
    map.addOverlay(marker);
    marker.openInfoWindowHtml(infowindowtext);

		//map.openInfoWindowHtml(map.getCenter(),                    document.createTextNode());
	}
}
