	//creer un marker avec plusieurs onglet depuis un point
	function creerMarker(point, onglet1, onglet2, onglet3,idmag) {
		/*var pic = new GIcon();
		          pic.iconSize=new GSize(60,31);
		          pic.shadowSize=new GSize(56,32);
		          pic.iconAnchor=new GPoint(30,32);
		          pic.infoWindowAnchor=new GPoint(30,0);
		var pic = new GIcon(pic, "/images/mags/alentour.png");*/
		
		var marker = new GMarker(point);
		
		if ((onglet3!='')&&(onglet3!=undefined)){
			var infoTabs = [
			  new GInfoWindowTab("Contact", '<div style="width:280px;">'+onglet2+'</div>'),
			  new GInfoWindowTab("Infos", '<div style="width:280px;">'+onglet1+'</div>') ,
			  new GInfoWindowTab("Avantages", '<div style="width:280px;">'+onglet3+'</div>') 
			  ];
		}else{
			if ((onglet1!='')&&(onglet1!=undefined)){
				var infoTabs = [
				  new GInfoWindowTab("Contact", '<div style="width:280px;">'+onglet2+'</div>'),
				  new GInfoWindowTab("Infos", '<div style="width:280px;">'+onglet1+'</div>')  
				  ];
			}else{
				var infoTabs = [
				  new GInfoWindowTab("Contact", '<div style="width:280px;">'+onglet2+'</div>') 
				  ];
			}
		}
		  marker.idmag=idmag;
		  marker.infoTab=infoTabs;

		GEvent.addListener(marker, "click", function() {
			marker.openInfoWindowTabsHtml(infoTabs);
		 });
		  
		return marker;
	}
       
       
    //creer marker depuis adresse et cré un taleau de point avec leurs markers
    function markerDepuisAdresse(address,adresse,adresse_secour,idmag,infos,avantages) {  
       if (geocoder) {
         geocoder.getLatLng(
           address,
           function(point) {
             if (!point) {
               //console.log(address + " introuvable");
               if(adresse_secour!=0){
               		markerDepuisAdresse(adresse_secour,adresse,0,idmag);    
               	}    
             } else {
             	point.addresse=address;
             	var marker = creerMarker(point,infos,adresse,avantages,idmag );
             	//$('destination').value=address;

       			mm.addMarker(marker,0,17); 
             	 //map.addOverlay(marker);

               	map.setCenter(point, 14);
             }
           }
         );
       }
     }
     
	