	function	loadMap(region_num, arrond_paris, france, resto, lang, root)	{		if (!document.getElementById('map'))			return ;		if (!region_num && !arrond_paris && !france && !resto)			return ;		if (GBrowserIsCompatible())		{			// preload stuff			function getHTTPObject()			{				var xhr = null;				if(window.XMLHttpRequest) // Firefox et autres					xhr = new XMLHttpRequest(); 				else if(window.ActiveXObject){ // Internet Explorer 				   try				  	{						xhr = new ActiveXObject("Msxml2.XMLHTTP");					}					catch (e)					{						xhr = new ActiveXObject("Microsoft.XMLHTTP");					}				}				else				{ // XMLHttpRequest non supporté par le navigateur 					alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 					xhr = false; 				}				return xhr;			}			var path_correc = '';			if (root)				path_correc = '/apps/gmap/';			var http = getHTTPObject();			var url = path_correc+"json_data.php";			var jsonDoc = '';						function	handleHttpResponse()			{				if (http.readyState == 1) // preloading stuff					document.getElementById('map').innerHTML = '<table width="100%" height="100%"><tr><td valign="middle" align="center"><img src="'+path_correc+'map_loading.gif" alt="loading..."></td></tr></table>';				if (http.readyState == 4) // stuff preloaded \o/				{					jsonDoc = http.responseText;					if (jsonDoc == '0') // mauvais parametres						document.getElementById('map').innerHTML = '<table width="100%" height="100%"><tr><td valign="middle" align="center" style="font-family:verdana;font-size:10px;">Impossible d\'afficher la carte</td></tr></table>'					else if (jsonDoc == '1') // rien trouve dans la bdd						document.getElementById('map').innerHTML = '<table width="100%" height="100%"><tr><td valign="middle" align="center" style="font-family:verdana;font-size:10px;">Aucun r&eacute;sultat trouv&eacute;</td></tr></table>'					else // c'est bon on affiche la carte						placeMap(jsonDoc, path_correc);				}			}			// envoi des parametres			http.open("POST", url, true);			http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");			http.onreadystatechange = handleHttpResponse;			if (resto != 0)				var data = 'idresto='+encodeURI(resto);			else if (france == 1)				var data = 'france='+1;			else if (arrond_paris == 0)				var data = 'rid='+encodeURI(region_num);			else				var data = 'arrond='+encodeURI(arrond_paris);			data += '&lang='+encodeURI(lang);			http.send(data); // envoye			function	placeMap(jsonDoc, path_correc)			{				var map	= new GMap2(document.getElementById("map"));				//map.enableScrollWheelZoom(); zoomer avec la molette				//map.addControl(new GScaleControl()); // echelle				//map.addControl(new GLargeMapControl()); // zoom avec ascenseur				map.addControl(new GSmallMapControl()); // zoom avec juste +/-				//map.addControl(new GMapTypeControl()); // plan, satellite, mixte				map.addControl(new GMenuMapTypeControl()); // select pour les types daffichage				//map.addControl(new GOverviewMapControl(new GSize(100,100))); // minimap en bas a gauche				map.setCenter(new GLatLng(0, 0), 0); // init defaut				ew = new EWindow(map, E_STYLE_7); // style de la info window				map.addOverlay(ew);				GEvent.addListener(map, "click", function(marker, point) {if (point) {ew.hide();}}); // ferme notre info window				function creerMarker(point, descrip, nom)				{					var icon				= new GIcon();					icon.image				= path_correc+"iconeresto.png"; // icone resto					icon.iconSize			= new GSize(30, 13);					icon.iconAnchor			= new GPoint(16, 16);					icon.infoWindowAnchor 	= new GPoint(15, 1);					var marker				= new GMarker(point, icon);					// affichage du nom du resto au passage de la souris					function ToolTip(marker,html,width)					{						this.html_		= html;						this.width_		= (width ? width + 'px' : 'auto');						this.marker_	= marker;					}					ToolTip.prototype = new GOverlay();					ToolTip.prototype.initialize = function(map)					{						var div = document.createElement("div");						div.style.display = 'none';						map.getPane(G_MAP_FLOAT_PANE).appendChild(div);						this.map_ = map;						this.container_ = div;					}					ToolTip.prototype.remove = function()					{						this.container_.parentNode.removeChild(this.container_);					}					ToolTip.prototype.copy = function()					{						return new ToolTip(this.html_);					}					ToolTip.prototype.redraw = function(force)					{						if (!force) return;						var pixelLocation = this.map_.fromLatLngToDivPixel(this.marker_.getPoint());						this.container_.innerHTML = this.html_;						this.container_.style.position = 'absolute';						this.container_.style.left = pixelLocation.x + "px";						this.container_.style.top = pixelLocation.y+15 + "px";						this.container_.style.width = this.width_;						this.container_.style.font = 'bold 10px/10px verdana, arial, sans';						this.container_.style.border = '1px solid black';						this.container_.style.color = '#610029';						this.container_.style.background = 'white';						this.container_.style.padding = '4px';						//one line to desired width						this.container_.style.whiteSpace = 'nowrap';						if(this.width_ != 'auto') this.container_.style.overflow = 'hidden';						this.container_.style.display = 'block';					}					GMarker.prototype.ToolTipInstance = null;					GMarker.prototype.openToolTip = function(content)					{					//don't show the tool tip if there is a custom info window						if(this.ToolTipInstance == null)						{							this.ToolTipInstance = new ToolTip(this,content)							map.addOverlay(this.ToolTipInstance);						}					}					GMarker.prototype.closeToolTip = function()					{						if(this.ToolTipInstance != null)						{							map.removeOverlay(this.ToolTipInstance);							this.ToolTipInstance = null;						}					}										GEvent.addListener(marker,'mouseover',function() {marker.openToolTip(nom);}); // affiche le nom du resto au passage de la souris					GEvent.addListener(marker,'mouseout',function() {marker.closeToolTip();}); // cache					// fin affichage nom resto au passage souris					GEvent.addListener(marker, "click", function() {/*map.setCenter(point, 13);*/ew.openOnMarker(marker, descrip);}); // info window a nous					//GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(descrip);}); //Ginfo window					map.getContainer().style.overflow = 'hidden';					return marker;				}				function	placeAll(jsonDoc)				{					var jsonData	= eval('(' + jsonDoc + ')'); // transforme le contenu recupere en tableau d'objets					var bounds		= new GLatLngBounds(); // init bords pour ajuster apres automatiquement l'affichage (centrage/zoom)					for (var i = 0; i < jsonData.markerlist.length; i++)					{						// recup + traitement des infos						var nom		=	jsonData.markerlist[i].nom;						var adresse	=	jsonData.markerlist[i].adr;						var ville	=	jsonData.markerlist[i].ville;						var cp		=	jsonData.markerlist[i].cp;						var photo	=	'http://www.idealgourmet.fr/images/restos/'+jsonData.markerlist[i].rid+'/kdo_1_100x80.jpg';						var lienig	=	jsonData.markerlist[i].lien;						var lat		=	jsonData.markerlist[i].lat;						var lng		=	jsonData.markerlist[i].lng;						var descrip	=	"<table width='270' height='130' cellpadding='3' cellspacing='0' style='font-family:verdana; font-size:10px;color:#610029;background-color:#ECE4CA;border:2px solid white;cursor:pointer;' onclick='window.open(\""+lienig+"\", \"_blank\")'>"+										"<tr><td valign='top' align='center' colspan='2'><div style='color: #610029; font-size: 12px; font-weight:bold;'>"+nom+"</div></td></tr><tr><td width='175'>"+adresse+"<br/>"+cp+"<br />"+ville+"<br/>01 45 72 07 14<br/>"+										"<u>acc&eacute;der &agrave; la fiche</u></td>"+										"<td align='center' valign='middle' width='95'>"+										"<img src='"+photo+"' border='0' />"+										"</td></tr></table>";						if (lat == 0) // si a lequateur on affiche pas							continue;						var point	= new GLatLng(lat, lng, 9); // cree le point						var marker	= creerMarker(point, descrip, nom); // cree le marker pour le point												map.addOverlay(marker); // ajoute marker a la carte						bounds.extend(point); // elargi les bords du rectangle ou se trouvent les restos pour les avoir tous dedans					} // rof					map.setZoom(map.getBoundsZoomLevel(bounds)); // ajuste le zoom en fonction du rectangle					map.setCenter(bounds.getCenter()); // centre en fonction du rectangle				} // placeAll				placeAll(jsonDoc);			}// placeMap       }//fi	   else		document.getElementById('map').innerHTML = 'google maps n\'est pas support&eacute; par votre navigateur';     }//loadMap	 	  	function	openMapPopup(sid, lang)	{		if (sid && sid > 0)		{			var carte = window.open('apps/gmap/map_popup.php?sidresto='+sid+'&lang='+lang, 'plan', 'width=520,height=390','toolbar=0,directories=0,scrollbars=0,resizable=0,dependent,top=1,left=1');			carte.focus();		}	}