
    window.onerror = function(){
		return true;
    }
    var marker,map,help=true;
	function load(lat,lng) {
		map=new GMap2(document.getElementById("map"));
		var center=new GLatLng(lat,lng);
		map.setCenter(center,13);
		marker=new GMarker(center,{draggable:true});
		/*
		GEvent.addListener(map,'click',function(overlay,point){
                marker.setPoint(point);
				AfficherCoordonnees(marker);
			});		
		GEvent.addListener(marker,"dragstart",function(){
				map.closeInfoWindow();
			});
		GEvent.addListener(marker,"dragend",function(){
				AfficherCoordonnees(marker);
			});*/
		map.addOverlay(marker);
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		AfficherCoordonnees(marker);
	}
	function AfficherCoordonnees(marker){
		var point=marker.getPoint();
		var lat=point.lat();
		var lng=point.lng();
		var html='<table>';
		/*if(help){
			html +=	'<tr><td colspan=2>Vous pouvez <b><i>cliquer</i></b> sur la carte ou<br/><b><i>glisser</i></b> le marqueur pour modifier l\'emplacement.</td></tr>';
			help=false;
			marker.openInfoWindowHtml(html);
		}
		html+=	'<tr><td colspan=2><b>Coordonnées actuelles</b></td></tr>'+
				'<tr><td>Latitude: </td><td>'+lat+'</td></tr>'+
				'<tr><td>Longitude: </td><td>'+lng+'</td></tr></table>';
		marker.openInfoWindowHtml(html);*/
	}
	function Enregistrer(lat,lng){
		window.opener.EnregistrerCoordonnees(lat,lng);
		top.close();
	}
	function AnnulerEnregistrer(){
		top.close();
	}
