function preg_replace (array_pattern, array_pattern_replace, my_string)  {
	var new_string = String (my_string);
		for (i=0; i<array_pattern.length; i++) {
			var reg_exp= RegExp(array_pattern[i], "gi");
			var val_to_replace = array_pattern_replace[i];
			new_string = new_string.replace (reg_exp, val_to_replace);
		}
		return new_string;
	}
	 
function DisplayCom(commentaire, contenerid){
	/*
	if(contenerid == ""){
		$("#info").empty(commentaire);
		$("#info").append(commentaire);
		$("#commentaire").empty(commentaire);
		$("#commentaire").append(commentaire);
	}else{
		$("#" + contenerid).empty(commentaire);
		$("#" + contenerid).append(commentaire);
	}
	*/
}

function Displayurgence(commentaire){
	
	if (commentaire == ""){
		ReloadUrgency();
	}
	
	//alert(map.getZoom());
	
	if(map.getZoom() < 15){
		$('#td1urgence').html("<strong>Les dernières annonces</strong>");
	}else{
		$('#td1urgence').html("<strong>Les annonces dans un rayon de 8km</strong>");	
	}
	$("#td2urgence").empty(commentaire);
	$("#td2urgence").append(commentaire);
	
}	
	
function no_accent (my_string) {
	var new_string = "";
	var pattern_accent = new Array("é", "è", "ê", "ë", "ç", "à", "â", "ä", "î", "ï", "ù", "ô", "ó", "ö", "'", "û");
	var pattern_replace_accent = new Array("e", "e", "e", "e", "c", "a", "a", "a", "i", "i", "u", "o", "o", "o", " ", "u");
	//var pattern_replace_accent = new Array("&eacute;", "&egrave;", "&ecirc;", "&euml;", "&ccedil;", "&agrave;", "&acirc;", "&auml;", "&icirc; ", "&iuml;", "&ugrave;", "&ocirc;", "&oacute;", "&oacute;", " ");
	if (my_string && my_string!= "") {
		new_string = preg_replace(pattern_accent, pattern_replace_accent, my_string);
	}
	return new_string;
}
	
function OpenThickBox(PageName, PageUrl, ArgUrl){
	var newURL = PageUrl + ".php?" + ArgUrl + "&height=300&width=500"; 	
	tb_show(PageName, newURL); 
}

//IE6 Hack
if(!Array.indexOf){
  Array.prototype.indexOf = function(obj){
   for(var i=0; i<this.length; i++){
    if(this[i]==obj){
     return i;
    }
   }
   return -1;
  }
}

function LoadMarker(urlstr, customIcons) {
	
	// alert(map.getBounds() + ' ' + map.getZoom());	
	//alert(map.getZoom());
	CptUrgence = 0;
	TabUrgence = '';
	//alert(ITypeOfSearch);
	ShowAstuceBox();
	
	//Publicité
	geocoderPubCP = new GClientGeocoder();
	geocoderPubCP.getLocations(map.getCenter(), PutPub);
	
	urlstr =  urlstr + "bounds=" + map.getBounds() + '&zoom=' + map.getZoom() + '&ITypeOfSearch=' + ITypeOfSearch;
	//alert(urlstr);
	GDownloadUrl(urlstr, function(data) {
	//alert(data + "\n" + urlstr + "\n" + map.getBounds() + ' ' + map.getZoom());
	//alert(urlstr + "\n" + map.getBounds() + ' ' + map.getZoom()); 
	var tmppoint;
	var bounds = map.getBounds();
	TabUrgence = '';
	//On vire les anciens
	for (var i=0; i<gloadmarkers.length; i++) {
		tmppoint = new GLatLng(parseFloat(gloadmarkers[i].getPoint().lat()),parseFloat(gloadmarkers[i].getPoint().lng()));
		//alert(gloadmarkers[i]);
		if (bounds.contains(tmppoint) == false || (map.getZoom() < zoom_normal)){
			map.removeOverlay(gloadmarkers[i]);
			//alert(gloadmarkers[i].getPoint().lat())
			ShowingMarkers[ShowingMarkers.indexOf(gloadmarkers[i].getPoint().lat() + "_" + gloadmarkers[i].getPoint().lng())] = "";
		}
		tmppoint = "";
	}
	
	if(ITypeOfSearch+"" != "" && ITypeOfSearch+"" != "1"){
		for (var i=0; i < Gparent.length; i++) {
			 map.removeOverlay(Gparent[i]);
			 ShowingMarkers[ShowingMarkers.indexOf(Gparent[i].getPoint().lat() + "_" + Gparent[i].getPoint().lng())] = "";
			 /*if(ShowingMarkers.indexOf(markers[i].getAttribute("ID") + "_parent") != -1){
				alert(ShowingMarkers.indexOf(markers[i].getAttribute("ID") + "_parent")); 
			 }
			 */

			 //ShowingMarkers.push(marker.getPoint().lat() + "_" + marker.getPoint().lng());
		}
		
	}
	
	if(ITypeOfSearch+"" != "" && ITypeOfSearch+"" != "2"){
		for (var i=0; i < Gnounou.length; i++) {
			 map.removeOverlay(Gnounou[i]);
			 ShowingMarkers[ShowingMarkers.indexOf(Gnounou[i].getPoint().lat() + "_" + Gnounou[i].getPoint().lng())] = "";
		}
	}
	
	 var LoadField = [];	
	 var zoom_temp = zoom;

	 var xml = GXml.parse(data);
	 var markers = xml.documentElement.getElementsByTagName("marker");
	// alert(map.getZoom());
	 for (var i = 0; i < markers.length; i++) {
		//if(ShowingMarkers.indexOf(markers[i].getAttribute("ID") + "_nounou") == -1 && ShowingMarkers.indexOf(markers[i].getAttribute("ID") + "_parent") == -1){
			//alert('doublon');
		
			LoadField = [];
			var url = markers[i].getAttribute("url");
			var point = new GLatLng(parseFloat(markers[i].getAttribute("Latitude")),parseFloat(markers[i].getAttribute("Longitude")));
			if(markers[i].getAttribute("Type_recherche") == 'Parent5' || markers[i].getAttribute("Type_recherche") == 'Parent6'){
				zoom_temp = zoom_urgence;
			}else{
				zoom_temp = zoom_normal;
			}
			if (bounds.contains(point) == true && map.getZoom() >= zoom_temp)		
			{
			if (markers[i].getAttribute("Type_recherche") == 'Parent3' || markers[i].getAttribute("Type_recherche") == 'Parent7'){
				//ShowingMarkers.push(markers[i].getAttribute("ID") + "_nounou");
				//alert(markers[i].getAttribute("Nb_place"));
				LoadField["ID"] =  markers[i].getAttribute("ID");
				LoadField["Email"] =  markers[i].getAttribute("Email");
				LoadField["Reference"] =  markers[i].getAttribute("Reference");
				LoadField["Prenom"] =  markers[i].getAttribute("Prenom");
				LoadField["Nb_place"] =  markers[i].getAttribute("Nb_place");
				LoadField["Type_garde"] =  markers[i].getAttribute("Type_garde");
				LoadField["Type_Nounou"] =  markers[i].getAttribute("Type_Nounou");
				LoadField["Experience"] =  markers[i].getAttribute("Experience");
				LoadField["Description"] =  markers[i].getAttribute("Description");
				LoadField["Dt_agrement"] =  markers[i].getAttribute("Dt_agrement");
				LoadField["Num_agrement"] =  markers[i].getAttribute("Num_agrement");
				LoadField["fnb_place"] =  markers[i].getAttribute("fnb_place");
				LoadField["fdate"] =  markers[i].getAttribute("fdate");
				LoadField["Adresse"] =  markers[i].getAttribute("Adresse");
				LoadField["Age_enfant"] =  markers[i].getAttribute("Age_enfant");
				LoadField["Age2_enfant"] =  markers[i].getAttribute("Age2_enfant");
				LoadField["Journee"] =  markers[i].getAttribute("Journee");
				LoadField["Latitude"] =  markers[i].getAttribute("Latitude");
				LoadField["Longitude"] =  markers[i].getAttribute("Longitude");
				LoadField["Type_recherche"] =  markers[i].getAttribute("Type_recherche");
			}else{
				//ShowingMarkers.push( markers[i].getAttribute("ID") + "_parent");
				LoadField["ID"] =  markers[i].getAttribute("ID");
				LoadField["Email"] =  markers[i].getAttribute("Email");
				LoadField["Reference"] =  markers[i].getAttribute("Reference");
				LoadField["Dt_urgence"] =  markers[i].getAttribute("Dt_urgence");
				LoadField["Nb_enfant"] =  markers[i].getAttribute("Nb_enfant");
				LoadField["Type_garde"] =  markers[i].getAttribute("Type_garde");
				LoadField["Type_Nounou"] =  markers[i].getAttribute("Type_Nounou");
				LoadField["Description"] =  markers[i].getAttribute("Description");
				LoadField["Adresse"] =  markers[i].getAttribute("Adresse");
				LoadField["Age_enfant"] =  markers[i].getAttribute("Age_enfant");
				LoadField["Dt_urgence"] =  markers[i].getAttribute("Dt_urgence");
				LoadField["Latitude"] =  markers[i].getAttribute("Latitude");
				LoadField["Longitude"] =  markers[i].getAttribute("Longitude");
				LoadField["Type_recherche"] =  markers[i].getAttribute("Type_recherche");
			}
	
			if(chemin == ""){
				var marker = createMarker(point, LoadField, customIcons[LoadField["Type_recherche"]], LoadField["Type_recherche"]);
			}else{
				var marker = createMarkerAdmin(point, LoadField, customIcons[LoadField["Type_recherche"]], LoadField["Type_recherche"]);
			}
			if(LoadField["Type_recherche"] == 'Parent5' || LoadField["Type_recherche"] == 'Parent6'){		   
				Gparent.push(marker);
			}else{
				  if((ITypeOfSearch+"" == "" || ITypeOfSearch+"" == "1") && (LoadField["Type_recherche"] == 'Parent1' || LoadField["Type_recherche"] == 'Parent2') ){
						
						Gparent.push(marker);
						
				  }
				   if((ITypeOfSearch+"" == "" || ITypeOfSearch+"" == "2") && (LoadField["Type_recherche"] == 'Parent3' || LoadField["Type_recherche"] == 'Parent7')){
						
						Gnounou.push(marker);
						
				  }
			}
			
			if(ShowingMarkers.indexOf(markers[i].getAttribute("Latitude") + "_" + markers[i].getAttribute("Longitude")) == -1){
				map.addOverlay(marker);
				ShowingMarkers.push(markers[i].getAttribute("Latitude") + "_" + markers[i].getAttribute("Longitude"));
			}
			
		//}
	   }
	 }
	
	if(map.getZoom() < 15){
		//Displayurgence(TabUrgence);
		ReloadUrgency();
	}else{
		ReloadUrgency();
	}
	
	});
	if(map.getZoom() < zoom_ins){
		DisplayCom("<span class=\"violet\">Info</span> : Pour placer ou voir une annonce, vous devez zoomer plus", "");
		//urlstr = "sup-marker.php5";
	 }
	 else{
		DisplayCom("<span class=\"violet\">Info</span> : N'oubliez pas, c'est gratuit!", "");
	 }
	 
	if(map.getZoom() < zoom_show){
		DisplayCom("<span class=\"violet\">Info</span> : Pour voir les annonces, vous devez zoomer plus", "infosearch");
		//urlstr = "sup-marker.php5";
	 }
	 else{
		DisplayCom("<span class=\"violet\">Info</span> : N'oubliez pas, c'est gratuit!", "infosearch");
	 }
	 
	
	
}

function ReloadUrgency(){
	//alert('ajax-marker-urgente.php5?' + "Cbounds=" + map.getCenter());
	
	$.ajax({
	  url: 'ajax-marker-prox.php5?' + "Cbounds=" + map.getCenter() + '&ITypeOfSearch=' + ITypeOfSearch + '&zoom=' + map.getZoom(),
	  success: function(data) {
		//$('#td1urgence').html("<strong>Les annonces dans un rayon de 8km</strong>");
		if(map.getZoom() < 15){
			$('#td1urgence').html("<strong>Les dernières annonces</strong>");
		}else{
			$('#td1urgence').html("<strong>Les annonces dans un rayon de 8km</strong>");	
		}
		$('#td2urgence').html(data);
	  }
	});	
	
}


function Remplace(expr,a,b) {
      var i=0
      while (i!=-1) {
         i=expr.indexOf(a,i);
         if (i>=0) {
            expr=expr.substring(0,i)+b+expr.substring(i+a.length);
            i+=b.length;
         }
      }
      return expr
   }
  

function createMarker(point, TabLoadField, UseIcons, Type_Recherche) {
  
	var marker = new GMarker(point, UseIcons);

	GEvent.addListener(marker, "mouseover", function() {
		 // marker.hide();
		marker.setImage(tabimg2[Type_Recherche]);
		  //marker.show();
	});
	GEvent.addListener(marker, "mouseout", function() {
		marker.setImage(tabimg[Type_Recherche]);
	});

  gloadmarkers.push(marker);
  
  if(Type_Recherche == "Parent3" || Type_Recherche == "Parent7"){

	var html = "<div style=\"width: 300px\"><strong>Pr&eacute;nom : </strong>" + TabLoadField["Prenom"] + "<br />";
	html = html + "<strong>Nombre de place(s) libre(s) : </strong>" + TabLoadField["Nb_place"] + "<br />";
	html = html + "<strong>Age minimum : </strong>" + TabLoadField["Age_enfant"] + " " +  TabLoadField["Age2_enfant"] + "<br />";
	html = html + "<strong>Type de nounou : </strong>" + TabLoadField["Type_Nounou"] + "<br />";
	html = html + "<strong>Type de garde : </strong>" + TabLoadField["Type_garde"] + "<br />";
	html = html + "<strong>Expérience : </strong>" + TabLoadField["Experience"] + "<br />";
	
	if (TabLoadField["fnb_place"] != "" && TabLoadField["fnb_place"] != "0"){
		html = html + "<strong>" + TabLoadField["fnb_place"] + " place(s) libre(s) &agrave; partir du " +  TabLoadField["fdate"] + "</strong><br />";
	}
	if (TabLoadField["Description"] != ""){
		html = html + "<strong>Description : </strong>" + TabLoadField["Description"] + "<br />";
	}
	html = html + "<strong>Journee : </strong>" + TabLoadField["Journee"] + "<br />";
	html = html + "<strong>Date agrément : </strong>" + TabLoadField["Dt_agrement"] + "<br />";
	html = html + "<strong>N° agrément : </strong>" + TabLoadField["Num_agrement"] + "<br />";
	html = html + "<strong>Adresse : </strong>" + TabLoadField["Adresse"] + "<br />";
	html = html + "<br />";
	html = html + "<center><strong><a href=\"#\" onClick=\"tb_open_new('', 'ContactNounou.php?reference=" + TabLoadField["Reference"] + "&TB_iframe=true&height=400&width=610')\">Contacter cette " + TabLoadField["Type_Nounou"] + "</a></strong></center></div>";
  }else if(Type_Recherche == "Parent5" || Type_Recherche == "Parent6"){
	
	var html = "<div style=\"width: 300px\"><center><strong><span style=\"font-size: 13px\">---- ANNONCE URGENTE ----</span></strong></center><br />"
	html = html + "<strong>Le / A partir du : </strong>" + TabLoadField["Dt_urgence"] + "<br />";
	html = html + "<strong>Nombre d'enfants à garder : </strong>" + TabLoadField["Nb_enfant"] + "<br />";
	html = html + TabLoadField["Age_enfant"];
	html = html + "<strong>Type de nounou : </strong>" + TabLoadField["Type_Nounou"] + "<br />";
	html = html + "<strong>Type de garde : </strong>" + TabLoadField["Type_garde"] + "<br />";
	html = html + "<strong>Description : </strong>" + TabLoadField["Description"] + "<br />";
	html = html + "<strong>Adresse : </strong>" + TabLoadField["Adresse"] + "<br />";
	html = html + "<br />";	
	html = html + "<center><strong><a href=\"#\" onClick=\"tb_open_new('Contact', 'ContactParent.php?reference=" + TabLoadField["Reference"] + "&TB_iframe=true&height=400&width=610')\">Contacter cette personne</a></strong></center></div>";
	
	if(CptUrgence < 5){
		//alert(html);
		var HtmlUrgence = html;
		HtmlUrgence = Remplace(HtmlUrgence, "'", "\\'");
		HtmlUrgence = Remplace(HtmlUrgence, "\"", "&quot;");
		var tempUrgence = "<p>"
		tempUrgence = tempUrgence + "<strong>" + TabLoadField["Adresse"] + "</strong> : " + TabLoadField["Description"];
		tempUrgence = tempUrgence + "<br />";		
		tempUrgence = tempUrgence + "<strong>Pour le : </strong>" + TabLoadField["Dt_urgence"] + " / <a style=\"cursor:pointer\" onclick=\"map.setCenter(new GLatLng("+parseFloat(TabLoadField["Latitude"]) + "," + parseFloat(TabLoadField["Longitude"]) +"));map.openInfoWindowHtml(new GLatLng("+parseFloat(TabLoadField["Latitude"]) + "," + parseFloat(TabLoadField["Longitude"]) +"), '"+HtmlUrgence+"'); map.setZoom(18);\"><b>Cliquez-ici</b></a>";
		tempUrgence = tempUrgence + "</p>";
		tempUrgence = tempUrgence + "<hr />";
		TabUrgence = TabUrgence + tempUrgence;
	}
	CptUrgence = CptUrgence + 1;
	}else{
		var html = "<div style=\"width: 300px\"><strong>Nombre d'enfants à garder : </strong>" + TabLoadField["Nb_enfant"] + "<br />";
		html = html + TabLoadField["Age_enfant"];
		html = html + "<strong>Type de nounou : </strong>" + TabLoadField["Type_Nounou"] + "<br />";
		html = html + "<strong>Type de garde : </strong>" + TabLoadField["Type_garde"] + "<br />";
		html = html + "<strong>Description : </strong>" + TabLoadField["Description"] + "<br />";
		html = html + "<strong>Adresse : </strong>" + TabLoadField["Adresse"] + "<br />";
		html = html + "<br />";
		html = html + "<center><strong><a href=\"#\" onClick=\"tb_open_new('', 'ContactParent.php?reference=" + TabLoadField["Reference"] + "&TB_iframe=true&height=400&width=610')\">Contacter cette personne</a></strong></center></div>";
	}
	
	/*GEvent.addListener(marker, 'click', function() {
		if (map.getZoom() < 13){
			map.setCenter(point, '');
			map.setZoom(16);
			marker.openInfoWindowHtml(html);
		}else if(map.getZoom() >= 13 && map.getZoom() < 17){
			map.setCenter(point, '');
			map.setZoom(17);
			marker.openInfoWindowHtml(html);
		}else{
			marker.openInfoWindowHtml(html);
		}
		
	});*/
	
	GEvent.addListener(marker, 'click', function() {
		marker.openInfoWindowHtml(html);
		
	});
	
	CptPoint = CptPoint + 1 ;
	return marker;
}

function GetSTypeOfSearch(){
	ITypeOfSearch = $('#ITypeOfSearch').val();
	LoadMarker(urlstr, customIcons);
}
function showAddress(address, SearchType) {
	if (map.getZoom() >= zoom_ins || SearchType == 0){
	  if (geocoder) {
		if(address == ""){
				geocoder.getLocations(map.getCenter(), function(response){
				var place = response.Placemark[0];								   
				address = place.address;
				ContinuAddress(address, SearchType);
		   });	
		}else{
			ContinuAddress(address, SearchType);	
		}
		
		//PutPubCP(address);
		
	  }
	}else{
		ContinuAddress(address, SearchType);	
	}
}

function PutPubCP(AdressSearch){
	//alert(AdressSearch.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode.PostalCodeNumber);
}

function IsNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }


function ContinuAddress(address, SearchType){
	geocoder.getLatLng(address,function(point) {
		
			if (!point) {
				if(map.getZoom() >= zoom_ins){
				 	 alert("L'adresse n'a pas été trouvée. Saisissez le nom de votre ville puis utilisez le zoom pour trouver votre rue.\n ("  + address + " non trouvée)");
				 /* }else if(zoom_ins - map.getZoom() <= 3){
					 map.setCenter(point, zoom_show);
					if(SearchType == 1){
						createMarkerDragable (new GLatLng(map.getCenter().lat(), map.getCenter().lng()), "jecherche", "Je recherche une nounou...");
					}else if(SearchType == 2){
						createMarkerDragable (new GLatLng(map.getCenter().lat(), map.getCenter().lng()), "jesuis", "Gardez-vous des enfants ici / dans ce quartier?");
					}else if(SearchType == 3){
						createMarkerDragable (new GLatLng(map.getCenter().lat(), map.getCenter().lng()), "urgence", "Demande urgente...");
					}
				  }else{
					  tb_show("Zoom", "zoom.php?height=500&width=720&TB_iframe=true"); 
				  }*/
				}else{
					if(ancre== ""){
						tb_show("Zoom", "zoom.php?height=500&width=720&TB_iframe=true"); 
					}
				}
				
			} else {	
				//le code postal???
				//alert(point);
				//var markerPubCP = new GMarker(point,{draggable:true});
				geocoderPubCP = new GClientGeocoder();
				geocoderPubCP.getLocations(point, PutPub);
				
				
				
				
				
				
				/*
				geocoder.getLocations(address, function (response) {
					
					 if (!response || response.Status.code == 200) {
						var zip;
						
						//alert(response.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.SubAdministrativeAreaName);	
						//alert(response.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode.PostalCodeNumber);
						//si on a le code postal retourné...
						//alert(response.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode);
						if(typeof(response.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode) != 'undefined' ){	
								//alert(response.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode.PostalCodeNumber);
								//if (typeof(response.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode.PostalCodeNumber) != 'undefined'){
									//alert('rrr');
									zip = response.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode.PostalCodeNumber;
								//}
								//else{
									//alert('merde');	
								//}
								//alert(zip.substr(0, 2));
						//sinon, on renvoi le nom du département....
						}else{
							var tmp = response.Placemark[0].address;
							
							//alert(response.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCodeNumber);
							
							if(IsNumeric(tmp.substr(0, 5))){
								zip = tmp.substr(0, 5);						
							}else{
								$.ajax({
								  async: false,
								  url: 'ajax-GetZipCode.php5?' + "NameVille=" + tmp.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName,
								  success: function(data) {
									zip = data;
									//alert(place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName);
								  }
								});	
							}
								//alert(response.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.SubAdministrativeAreaName);
								//alert(response.Placemark[0].address);				
						}
						
						
						
						if(zip != ""){
							alert(zip);	
						}	
						
						
					 }
					 else{
						 alert(response.Status.code);
					 }
					 
					 
				});
				
				*/
				//alert(point);
				clearMarkerCreateByHuman2(gmarkers);
				
				if(SearchType == 0){
					map.setCenter(point, zoom_ins);
					markersearch = new GMarker(point);
					map.addOverlay(markersearch);
					gclikers.push(markersearch);
					//map.setCenter(point, zoom_ins);
				}else{
					if (map.getZoom() < zoom_ins){
						map.setCenter(point, zoom_ins);
					}else{
						map.setCenter(point, map.getZoom());
					}
					
					if(SearchType == 1){
						createMarkerDragable (new GLatLng(map.getCenter().lat(), map.getCenter().lng()), "jecherche", "Je recherche une assmat/nounou/babysitter...");
					}else if(SearchType == 2){
						createMarkerDragable (new GLatLng(map.getCenter().lat(), map.getCenter().lng()), "jesuis", "Gardez-vous des enfants ici / dans ce quartier?");
					}else if(SearchType == 3){
						createMarkerDragable (new GLatLng(map.getCenter().lat(), map.getCenter().lng()), "urgence", "Demande urgente...");
					}
				}
			}
		
	  }
	);	
}

function PutPub(reponse)
	{
		//alert(reponse.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode.PostalCodeNumber);
		//alert(map.getZoom());
		var zip = '';
		var reg=new RegExp("[|#|]+", "g");
		var texte_court = '';
		var texte_long = '';
		
		if (map.getZoom() >= zoom_pub){
			
			var ville = reponse.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName;
			
			if(typeof(reponse.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.DependentLocality) != 'undefined' ){
				var param_tmp = reponse.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.DependentLocality.PostalCode.PostalCodeNumber + '&ville=' + ville;
			}else{
				var param_tmp = reponse.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode.PostalCodeNumber + '&ville=' + ville;
			}
				$.ajax({
				  async: false,
				  url: 'ajax-GetZipCode.php5?' + 'CP=' + param_tmp,
				  success: function(data) {

					var temp = data.split("|#|");
					
					$("#PubVille").html(temp[2]);
					//$("#PubVille").fadeOut(800).fadeIn(800);
					$("#PubIndex").html(temp[0]);
					//$("#PubIndex").fadeOut(800).fadeIn(800);
					$("#PubMap").html(temp[1] + '<br><br><a href="#" onclick="tb_open_new(\'Contacter Nounoumap.Fr\', \'contact.php?ville='+ ville +'&keepThis=true&amp;height=400&amp;width=610&amp;TB_iframe=true\', false)"><strong>Votre publicité ici? Contactez nous!</strong></a>');
					
					
					//$("#TDPubVille").css("background-color" ,"#F3D2DA");
					
					//document.title = "NounouMap.fr : Parents ou nounous, localisez sur " + ville + " des enfants à garder ou une nounou facilement."
					
					$('#PubMap').mouseleave(function(){
							$(this).stop().animate({ width: '210px', height: '40px', opacity: '0.6', filter : 'alpha(opacity=60)'}, 250)
									.html(temp[1]);
					});

					$('#PubMap').mouseenter(function(){
						$(this).stop().animate({ width: '300px', height: '130px', opacity: '1', filter : 'alpha(opacity=100)'}, 250)
								.html(temp[0] + '<br><br><a href="#" onclick="tb_open_new(\'Contacter Nounoumap.Fr\', \'contact.php?ville='+ ville +'&keepThis=true&amp;height=400&amp;width=610&amp;TB_iframe=true\', false)"><strong>Votre publicité ici sur '+ ville +'? Contactez nous!</strong></a>');
								
					 });
					//$("#PubMap").fadeOut(800).fadeIn(800);
				  }
				});
			
			
			
			
			
		}else{
			
			//document.title = "NounouMap.fr : Parents ou nourrices, localisez des enfants à garder ou une nounou facilement."
			
			$("#TDPubVille").css("background-color" ,"#FFFFFF");
			
			$("#PubVille").html("<a href=\"#\" onclick=\"tb_open_new('Contacter Nounoumap.Fr', 'contact.php?ville="+ville+"&keepThis=true&amp;height=400&amp;width=610&amp;TB_iframe=true', false)\"><strong></a>");	
			$("#PubIndex").html('<a href="http://www.nounoumap.fr/" target="_blank" class="pubmap"><strong>NounouMap.Fr : Trouver une assamt, nounou, babysitter ou des enfants à garder en un clic dans votre quartier!</strong></a><br /><br />Nounoumap.Fr vous permet de consulter et de voir gratuitement les annonces d\'assistantes maternelle, de nounou ou de babysitter mais aussi des parents qui recherchent à faire garder leurs bébés ou leurs enfants proche de chez vous.<br><br><a href="#" onclick="tb_open_new(\'Contacter Nounoumap.Fr\', \'contact.php?keepThis=true&amp;height=400&amp;width=610&amp;TB_iframe=true\', false)"><strong>Votre publicité ici?</strong></a>');
			$('#PubMap').mouseenter(function(){
					$(this).stop().animate({ width: '300px', height: '130px', opacity: '1', filter : 'alpha(opacity=100)'}, 250)
							.html('<a href="http://www.nounoumap.fr/" target="_blank" class="pubmap"><strong>NounouMap.Fr : Trouver une nounou ou des enfants à garder en un clic dans votre quartier!</strong></a><br /><br />Nounoumap.Fr vous permet de consulter et de voir gratuitement les annonces d\'assistante maternelle, de nounou ou de babysitter mais aussi des parents qui recherchent à faire garder leurs bébés ou leurs enfants proche de chez vous.<br><br><a href="#" onclick="tb_open_new(\'Contacter Nounoumap.Fr\', \'contact.php?keepThis=true&amp;height=400&amp;width=610&amp;TB_iframe=true\', false)"><strong>Votre publicité ici?</strong></a>');
							
				 });
			$('#PubMap').mouseleave(function(){
						$(this).stop().animate({ width: '210px', height: '40px', opacity: '0.6', filter : 'alpha(opacity=60)'}, 250)
								.html('<a href="http://www.nounoumap.fr/" target="_blank" class="pubmap"><strong>NounouMap.Fr : Trouver une nounou ou des enfants à garder en un clic dans votre quartier!</strong></a>');
				});
		}
		//alert(zip);
	}


function showAddress_detail(lat, long) {
  if (geocoder) {
	  var point = new GLatLng(parseFloat(lat),parseFloat(long));
	  clearMarkerCreateByHuman2(gmarkers);	
	  map.setCenter(point, 19);
	  markersearch = new GMarker(point);
	  map.addOverlay(markersearch);
	  gclikers.push(markersearch);
	  markersearch.openInfoWindowHtml('Cliquez sur l\'icone pour voir le détail.');
  }
}

function clearMarkerCreateByHuman2(MyTab){
	for (var i=0; i<MyTab.length; i++) {
	  map.removeOverlay(MyTab[i]);
	}
}
		
function ValidFormKnow(){
	clearMarkerCreateByHuman2(gmarkers);		
	OpenThickBox("Merci", "Thank", "");
}



function PutFormAdd(BoutonID, Latitude, Longitude, Rue, CP, Ville, Pays){
	if  (map.getZoom() >= zoom_ins){
		if (BoutonID == "jecherche"){
			var newURL = "FormSearch.php?KeepThis=true&height=550&width=500&latitude="+Latitude+"&longitude="+Longitude+"&rue="+no_accent(Rue.replace(/\s+/g,"_"))+"&cp="+CP+"&ville="+Ville.replace(/\s+/g,"_")+"&pays="+Pays.replace(/\s+/g,"_")+"&TB_iframe=true"; 
			tb_show("Je recherche une assmat/nounou/babysitter...", newURL); 
		}
		else if (BoutonID == "jesuis"){
			var newURL = "FormIam.php?KeepThis=true&height=590&width=730&latitude="+Latitude+"&longitude="+Longitude+"&rue="+no_accent(Rue.replace(/\s+/g,"_"))+"&cp="+CP+"&ville="+Ville.replace(/\s+/g,"_")+"&pays="+Pays.replace(/\s+/g,"_")+"&TB_iframe=true"; 
			tb_show("Je suis une nounou...", newURL); 
		}
		else if (BoutonID == "urgence"){
			var newURL = "Urgence.php?KeepThis=true&height=680&width=760&latitude="+Latitude+"&longitude="+Longitude+"&rue="+no_accent(Rue.replace(/\s+/g,"_"))+"&cp="+CP+"&ville="+Ville.replace(/\s+/g,"_")+"&pays="+Pays.replace(/\s+/g,"_")+"&TB_iframe=true"; 
			tb_show("Demande Urgente", newURL); 
		}
	}else{
		OpenThickBox("Zoom", "Zoom", "");
	}
}

function tb_remove_open(reloadLink)
{
	jThickboxReloadLink	=	reloadLink;
	tb_remove();
	setTimeout("jThickboxNewLink();",500);
	return false;
}

function tb_open_new(jThickboxTitle, jThickboxNewLink, bool){
	if (bool){
		DelShowMap();	
	}
	if(jThickboxNewLink != ''){
		tb_show(jThickboxTitle,jThickboxNewLink,null);
	}
}

var jThickboxNewLink;
function tb_remove_open(reloadLink){
jThickboxReloadLink	=	reloadLink;
tb_remove();
setTimeout("jThickboxNewLink();",500);
return false;
}

function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.innerHTML = limitNum - limitField.value.length;
	}
}

function createMarkerDragable(point, BoutonID, texte)
{
	clearMarkerCreateByHuman2(gmarkers);	
	//Initialisation...
	var marker = new GMarker(map.getCenter(),{draggable:true});
	gmarkers.push(marker);			
	
	map.addOverlay(marker);
	//On récupère l'adresse postale
	geocodermove = new GClientGeocoder();
	geocodermove.setBaseCountryCode('fr');
	
	geocodermove.getLocations((marker.getPoint()), AffBulleStart);
	//On autorise son déplacement manuel...
	marker.enableDragging();
	
	for (var i=0; i<gclikers.length; i++) {map.removeOverlay(gclikers[i]);}; gclikers = new Array();
	GEvent.addListener(marker, "dragstart", function()
	 {
	 map.closeInfoWindow();				
	});
	
	GEvent.addListener(marker, "dragend", function()
	{
		geocodermove = new GClientGeocoder();
		geocodermove.setBaseCountryCode('fr');
		geocodermove.getLocations((marker.getPoint()), AffBulleStart);
		
		geocoderPubCP = geocodermove;
		geocoderPubCP.getLocations(marker.getPoint(), PutPub);
		
	});
	
	GEvent.addListener(marker, "click", function()
	{
		geocodermove = new GClientGeocoder();
		geocodermove.setBaseCountryCode('fr');
		geocodermove.getLocations((marker.getPoint()), AffBulleStart);
		
	});
	
	function AffBulleStart(reponse){
		place = reponse.Placemark[0];
	
		
		if (typeof(place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.DependentLocality) == 'undefined'){
		marker.openInfoWindowHtml("<strong>Déplacez moi à l'adresse exacte...</strong><br /> <br /><b> " + texte + "</b><br /> <br /> Est-ce ici?&nbsp;&nbsp;<input type='button' value='Je confirme' onclick=\"PutFormAdd('" + BoutonID + "', " + marker.getPoint().lat() +", " + marker.getPoint().lng() + ", '" + no_accent(place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.Thoroughfare.ThoroughfareName) + "', '" + no_accent(place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode.PostalCodeNumber) + "', '" + no_accent(place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName) +"', '" + no_accent(place.AddressDetails.Country.CountryName) + "')\" /><br /><br /> " + place.address + "<br><a href=\"#\" onclick=\"clearMarkerCreateByHuman2(gmarkers)\">Annuler</a>");
		}else {
			marker.openInfoWindowHtml("<strong>Déplacez moi à l'adresse exacte...</strong><br /> <br /><b> " + texte + "</b><br /> <br /> Est-ce ici?&nbsp;&nbsp;<input type='button' value='Je confirme' onclick=\"PutFormAdd('" + BoutonID + "', " + marker.getPoint().lat() +", " + marker.getPoint().lng() + ", '" + no_accent(place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.DependentLocality.Thoroughfare.ThoroughfareName) + "', '" + no_accent(place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.DependentLocality.PostalCode.PostalCodeNumber) + "', '" + no_accent(place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName) +"', '" + no_accent(place.AddressDetails.Country.CountryName) + "')\" /><br /><br /> " + place.address + "<br><a href=\"#\" onclick=\"clearMarkerCreateByHuman2(gmarkers)\">Annuler</a>");
			
		}

	}
}//Fin fonction createMarkerDragable

function DelShowMap() {
	gmarkers = [];
	ShowingMarkers = [];
	map.closeInfoWindow();
	map.clearOverlays();
	LoadMarker(urlstr, customIcons);
 }//Fin fonction DelShowMap
 
function RefreshMap() {
	gmarkers = [];
	ShowingMarkers = [];
	map.closeInfoWindow();
	map.clearOverlays();
	LoadMarker(urlstr, customIcons);
 }//Fin fonction DelShowMap

$().ready(function() {
	
	$('#ITypeOfSearch').change(function() {
	  GetSTypeOfSearch();
	});
	
	$('.jecherche').live('click', function() {
		if  (map.getZoom() >= zoom_ins){
			createMarkerDragable (new GLatLng(map.getCenter().lat(), map.getCenter().lng()), $(this).attr("id"), "Je recherche une assmat/nounou/babysitter...");
		}
		else{
			OpenThickBox("Zoom", "Zoom", "");
		}		
	});
	
	
	$('#deposeannonce').live('click', function() {
			$("#jedepose").toggle();	
	});
	
	$('.jesuis').live('click', function() {
		if  (map.getZoom() >= zoom_ins){
			createMarkerDragable (new GLatLng(map.getCenter().lat(), map.getCenter().lng()), $(this).attr("id"), "Gardez-vous des enfants ici / dans ce quartier?");
			}
		else{
			OpenThickBox("Zoom", "Zoom", "");
		}
		
	});

	$('.urgent').live('click', function() {
		if  (map.getZoom() >= zoom_ins){
			createMarkerDragable (new GLatLng(map.getCenter().lat(), map.getCenter().lng()), $(this).attr("id"), "Demande urgente...");
		}
		else{
			OpenThickBox("Zoom", "Zoom", "");
		}
		
	});
	
	ITypeOfSearch = $('#ITypeOfSearch').val();
	
	$('#PubMap').mouseenter(function(){
			/*$(this).css('width', '300px');					 
			$(this).css('height', '130px');		*/
			$(this).stop().animate({ width: '300px', height: '130px', opacity: '1', filter : 'alpha(opacity=100)'}, 250)
					.html('<a href="http://www.nounoumap.fr/" target="_blank" class="pubmap"><strong>NounouMap.Fr : Trouver une nounou ou des enfants à garder en un clic dans votre quartier!</strong></a><br /><br />Nounoumap.Fr vous permet de consulter et de voir gratuitement les annonces d\'assistantes maternelle, de nounou ou de babysitter mais aussi des parents qui recherchent à faire garder leurs bébés ou leurs enfants proche de chez vous.<br><br><a href="#" onclick="tb_open_new(\'Contacter Nounoumap.Fr\', \'contact.php?keepThis=true&amp;height=400&amp;width=610&amp;TB_iframe=true\', false)"><strong>Votre publicité ici?</strong></a>');
				
	 });
	
	
	$('#PubMap').mouseleave(function(){
			$(this).stop().animate({ width: '210px', height: '40px', opacity: '0.6', filter : 'alpha(opacity=60)'}, 250)
					.html('<a href="http://www.nounoumap.fr/" target="_blank" class="pubmap"><strong>NounouMap.Fr : Trouver une nounou ou des enfants à garder en un clic dans votre quartier!</strong></a>');
					
		
	 });
	
	if(first){
		//tb_show('Bienvenue sur Nounoumap.Fr', 'edito.php?width=720&height=600');
	}
	
	
	
	
		
	tb_init('a.thickbox, area.thickbox, input.thickbox');
	
});	//Fin fonction ready
/*
function MyPane() {}
	
	MyPane.prototype = new GControl;
	MyPane.prototype.initialize = function(map) {
	
	var me = this;
	me.panel = document.createElement("div");
	me.panel.position = G_ANCHOR_BOTTOM_LEFT;
	me.panel.style.width = "250px";
	me.panel.id = "legend";
	me.panel.style.height = "153px";
	me.panel.style.border = "1px solid gray";
	me.panel.style.padding = "5px";
	me.panel.style.background = "#F4E3EB";
	me.panel.innerHTML = "<p><span class=\"violet\">Légendes</span> &nbsp; <a href=\"#\" onClick=\"ShowPanel();\">Afficher</a> - <a href=\"#\" onClick=\"RemovePanel();\">Fermer</a> - <a href=\"#\" onClick=\"DeletePanel();\">Supprimer</a></p><div id=\"Slegend\"><img src=\""+chemin+"img/autour.gif\" align=\"absmiddle\" /> Besoin d'une nounou autour de ce point<br /><img src=\""+chemin+"img/ici.gif\" align=\"absmiddle\" /> Besoin d'une nounou à cette adresse<br /><img src=\""+chemin+"img/nounou.gif\" align=\"absmiddle\" /> Une Ass. Mat. avec au moins une place de libre<br /><img src=\""+chemin+"img/tete.gif\" align=\"absmiddle\" /> Une nounou ou babysitter avec au moins une &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;place de libre<br /></div><span id=\"info\"></span>";	
	map.getContainer().appendChild(me.panel);
	return me.panel;
	
};
*/
function DeletePanel(){
	document.getElementById('Slegend').style.display= 'none';
	document.getElementById('legend').style.display= 'none';
}
function RemovePanel(){
	document.getElementById('Slegend').style.display= 'none';
	document.getElementById('legend').style.height= '60px';
}
function ShowPanel(){
	document.getElementById('Slegend').style.display= 'block';
	document.getElementById('legend').style.height= '153px';
}

/*MyPane.prototype.getDefaultPosition = function() {
return new GControlPosition(
  G_ANCHOR_BOTTOM_RIGHT, new GSize(10, 50));
};

MyPane.prototype.getPanel = function() {
return me.panel;
}	*/
var CtrlPanel;
function initialize() {
	if (google.maps.BrowserIsCompatible()) {
    //http://www.cycloloco.com/shadowmaker/shadowmaker.htm
	//Les icones...
	var iconBlue = new GIcon(); 
	iconBlue.image = chemin + 'img/autour_pointe.gif';
	iconBlue.transparent = 'img/autour_pointe.gif';
	//iconBlue.shadow = 'img/shadow-autour_pointe.gif';
	//iconBlue.iconSize = new GSize(28, 43);
	iconBlue.iconSize = new GSize(22, 37);
	//iconBlue.shadowSize = new GSize(25, 23);
	iconBlue.iconAnchor = new GPoint(14, 39);
	iconBlue.infoWindowAnchor = new GPoint(10, 15);
	
	var iconGreen = new GIcon(); 
	iconGreen.image = chemin + 'img/ici_pointe.gif';
	iconGreen.transparent = 'img/ici_pointe.gif';
	//iconGreen.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
	iconGreen.iconSize = new GSize(22, 37);
	//iconGreen.shadowSize = new GSize(50, 50);
	iconGreen.iconAnchor = new GPoint(14, 39);
	iconGreen.infoWindowAnchor = new GPoint(10, 15);

	var iconRed = new GIcon(); 
	iconRed.image = chemin + 'img/landeau_pointe.gif';
	iconRed.transparent = 'img/landeau_pointe.gif';
	//iconRed.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
	iconRed.iconSize = new GSize(22, 37);
	//iconRed.shadowSize = new GSize(25, 23);
	iconRed.iconAnchor = new GPoint(14, 39);
	iconRed.infoWindowAnchor = new GPoint(10, 15);
	
	var iconTete = new GIcon(); 
	iconTete.image = chemin + 'img/tete_pointe.gif';
	iconTete.transparent = 'img/tete_pointe.gif';
	//iconTete.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
	iconTete.iconSize = new GSize(22, 37);
	//iconTete.shadowSize = new GSize(25, 23);
	iconTete.iconAnchor = new GPoint(14, 39);
	iconTete.infoWindowAnchor = new GPoint(10, 15);
	
	var iconStarHear = new GIcon(); 
	iconStarHear.image = chemin + 'img/urgent_ici_pointe.gif';
	//iconStarHear.shadow = 'img/shadow.png';
	iconStarHear.iconSize = new GSize(36, 58);
	//iconStarHear.shadowSize = new GSize(25, 23);
	iconStarHear.iconAnchor = new GPoint(19, 56);
	iconStarHear.infoWindowAnchor = new GPoint(17, 25);
	
	var iconStarAround = new GIcon(); 
	iconStarAround.image = chemin + 'img/urgent_autour_pointe.gif';
	//iconStarAround.shadow = 'img/shadow.png';
	iconStarAround.iconSize = new GSize(36, 58);
	//iconStarAround.shadowSize = new GSize(25, 23);
	iconStarAround.iconAnchor = new GPoint(19, 56);
	iconStarAround.infoWindowAnchor = new GPoint(17, 25);

	
	customIcons["Parent1"] = iconGreen;
	customIcons["Parent2"] = iconBlue;
	customIcons["Parent3"] = iconRed;
	customIcons["Parent5"] = iconStarHear;
	customIcons["Parent6"] = iconStarAround;
	customIcons["Parent7"] = iconTete;

	
	
	map=new GMap2(document.getElementById('map'));
	map.setUIToDefault();
	G_NORMAL_MAP.getMaximumResolution = function () { return 19 }; 

	//Legendes
	//CtrlPanel = new MyPane();
	//map.addControl(CtrlPanel);
	
	geocoder = new GClientGeocoder();
	geocoder.setBaseCountryCode('fr');
	
	if(Sadresse != ""){
		showAddress_detail(Sadresse);
	}else{
		if(action_ == 'detail'){
			showAddress_detail(latitude, longitude);
		}else{
			if(result != 0 && country_code == 'FR'){
				var center = new GLatLng(latitude, longitude);
				map.setCenter(center, zoom);
			}else{
				var center = new GLatLng(46.75984,1.738281);
				map.setCenter(center, 7);
			}
		}
	}

	if(action == 'activation' && cle_activation != ''){
		OpenThickBox("Activation...", "activation-" + type_dmd, "cle_activation=" + cle_activation + "&type="+ type);
	}else if(action == 'modification' && cle_modification != ''){		
		tb_show('Modification de votre annonce', 'modification-' + type_dmd + '.php?cle_modification=' + cle_modification  + '&type=' + type + '&height=500&width=720&TB_iframe=true');
	}else if(action == 'suppression' && cle_suppression != ''){
		tb_show('Suppression de votre annonce', 'suppression-' + type_dmd + '.php?cle_suppression=' + cle_suppression  + '&type=' + type + '&height=500&width=720&TB_iframe=true');
	}else if(action == 'actiurgence' && cle_urgence != ''){		
		tb_show('Activation urgence', 'activation-urgence.php?cle_urgence=' + cle_urgence  + '&type=' + action + '&height=500&width=720&TB_iframe=true');
	}else if(action == 'reactivation' && cle_reactivation != ''){		
		tb_show('Réactivation de votre annonce', 'reactivation.php?cle_reactivation=' + cle_reactivation  + '&type=' + type + '&height=500&width=720&TB_iframe=true');
	}else if(action == 'mailing' && email_client != ''){		
		tb_show('Désinscription du mailing', 'mailing.php?email_client=' + email_client + '&height=500&width=720&TB_iframe=true');
	}
	
	
	
	GEvent.addListener(map,"click", function(){for (var i=0; i<gclikers.length; i++) {map.removeOverlay(gclikers[i]);}; gclikers = new Array();});
	//GEvent.addListener(map,"moveend", function(){for (var i=0; i<gclikers.length; i++) {map.removeOverlay(gclikers[i]);}; gclikers = new Array();});
	GEvent.addListener(map,"moveend", function(){LoadMarker(urlstr, customIcons);});
	
	
	
	/*Pour le chargement...*/
	LoadMarker(urlstr, customIcons);
	
	if(ancre != "" && ancre != undefined){		
		$('#Sadresse').val(ancre);
		showAddress(ancre, '0');
		//alert(ancre);
	}
	
	
	if(ville != "" && ville != undefined){	
		
		$('#Sadresse').val(ville);
		showAddress(ville, '0');
		//alert(ancre);
	}
	
	
	} //Fin google.maps.BrowserIsCompatible()
	
	
} //Fin initialize
		

