// Pour gestion-bloc
function creer_alerte(code_trans,recherche_infos) {
	   //alert("creerAlerte " + code_trans + " " + recherche_infos );
	  // verification de l'email
	    var email = document.getElementById("email").value;
	  	if (!verifMail(email)) {
	  		return false;
	  	}
     	var xhr=null;

	    if (window.XMLHttpRequest) { 
	        xhr = new XMLHttpRequest();
	    }
	    else if (window.ActiveXObject) 
	    {
	        xhr = new ActiveXObject("Microsoft.XMLHTTP");
	    }
	    //on définit l'appel de la fonction au retour serveur
	    xhr.onreadystatechange = function() { alerte_mail_creer(xhr); };
	    
//	    alert("recherche_infos" + recherche_infos);
	    var tabInfos = recherche_infos.split("-");
	    var res = "";
	    for (i = 0 ; i < tabInfos.length ; i++) {
	    	var item = tabInfos[i];
	    	var tabElt = item.split("=");
	    	res += 'recherche_infos[' + tabElt[0] +'] =' + tabElt[1];
	    	if (i < tabInfos.length -1) res += "&";
	    }
	    res += '&' + 'recherche_infos[email] =' + email;
	    var url =  "reponse_creer_alerte.php?code_trans="+code_trans+"&"+res;
        //alert ("url : " + url)
	    //on appelle le fichier reponse.txt
	    xhr.open("GET", url, true);
	    xhr.send(null);
	    return false;
 
    }
    
function alerte_mail_creer(xhr) {
	 if (xhr.readyState==4) {
	 	//ecrire que l'alerte a ou non bien été créer
	 	var docXML= xhr.responseXML;
    	var items = docXML.getElementsByTagName("resultat");
    	if (items.item(0).firstChild != null ) {
    		var message = items.item(0).firstChild.data;
    		// alert ("message" + message);
    		document.getElementById("form_alerte").innerHTML = '&nbsp;&nbsp;' + message;
    	}
	 	return false;
	 }
}

// Pour module accueil
function modifierHautBlanc (haut) {
		document.getElementById('blanc').style.height = haut+'px';
}
function modifierlargBlanc (larg) {
		var largCentre = larg -5;
		document.getElementById('blanc').style.width = larg+'px';
		document.getElementById('centre').style.width = largCentre +'px';
}
function ac_updatecritere(type_trans,elem) {
	var trans = document.getElementById(elem);
	if (type_trans != 30 ) {
		trans.style.display='none';
	} else trans.style.display='block';
}
function visibilityControl(action, elem, elem2, elem3) {
	switch(action) {
		
		case "auto" :
			if (document.getElementById( elem ).style.visibility =='visible') {
				document.getElementById( elem ).style.visibility='hidden';
				if (elem2 != "")
					document.getElementById( elem2 ).style.visibility='visible';
				if (elem3 != "")
					document.getElementById( elem3 ).style.visibility='visible';
			}
			else {
				document.getElementById( elem ).style.visibility='visible';
				if (elem2 != "")
					document.getElementById( elem2 ).style.visibility='hidden';
				if (elem3 != "")
					document.getElementById( elem3 ).style.visibility='hidden';
			}
			break;
		case "show" :
			document.getElementById( elem ).style.visibility='visible';
			if (elem2 != "")
				document.getElementById( elem2 ).style.visibility='hidden';
			if (elem3 != "")
				document.getElementById( elem3 ).style.visibility='hidden';
			break;

		case "hide" :
			document.getElementById( elem ).style.visibility='hidden';
			if (elem2 != "")
				document.getElementById( elem2 ).style.visibility='visible';
			if (elem3 != "")
				document.getElementById( elem3 ).style.visibility='visible';
			break;
	}
}
function condition(urlB)
    {
    var options = "Width=675,Height=530" ;
    var nomProc = urlB+"CG.html";
    // alert (nomProc);
    window.open(nomProc,"conditions",options) ;
    }
function addVal(elem, valeur, method) {
	switch (method) {
		case "equ" :
			document.getElementById( elem ).value = value;
			// alert ("addval " + elem + value + method);
			break;
		case "auto" :
			var str = document.getElementById( elem ).value;
			var pattern = eval('/'+valeur+'/i');
			//var pattern = eval('/'+valeur+'/');
			// alert ("str :'" + str + "' pattern :" + pattern + "valeur :" +valeur+":" );
			// alert (pattern.test(str));
			if ( pattern.test(str) ) {
				var new_str = str.replace(pattern, '');
				document.getElementById( elem ).value = new_str;
			} else {
				if (elem == 'type_biens_enter') {
					if (valeur == 'Indifferent,') {
						document.getElementById('Indifferent').checked = true;
						document.getElementById( elem ).value += valeur;
					} else {
						var new_str = str.replace('Indifferent,', '');
						document.getElementById('Indifferent').checked = false;
						document.getElementById( elem ).value = new_str + valeur;
					}
				} else {
					document.getElementById( elem ).value += valeur;
				}
			}
			break;		
	}
}
// BulleAIde
var IB=new Object;

var posX=0;posY=0;

var xOffset=10;yOffset=10;

function AffBulle(texte) {


  var contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='"+IB.ColContour+"'><TD><TABLE border=0 cellpadding=2 cellspacing=0 bgcolor='"+IB.ColFond+"'><TR><TD><FONT size='-2' face='arial' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;";

  var finalPosX=posX-xOffset;

  if (finalPosX<0) finalPosX=0;

  if (document.layers) {

    document.layers["bulle"].document.write(contenu);

    document.layers["bulle"].document.close();

    document.layers["bulle"].top=posY+yOffset;

    document.layers["bulle"].left=finalPosX;

    document.layers["bulle"].visibility="show";}

  if (document.all) {

    //var f=window.event;

    //doc=document.body.scrollTop;

    document.all["bulle"].innerHTML=contenu;

    document.all["bulle"].style.top=posY+yOffset;

    document.all["bulle"].style.left=finalPosX;//f.x-xOffset;

    document.all["bulle"].style.visibility="visible";

  }

  //modif CL 09/2001 - NS6 : celui-ci ne supporte plus document.layers mais document.getElementById

  else if (document.getElementById) {

    document.getElementById("bulle").innerHTML=contenu;

    document.getElementById("bulle").style.top=posY+yOffset;

    document.getElementById("bulle").style.left=finalPosX;

    document.getElementById("bulle").style.visibility="visible";

  }

}

function getMousePos(e) {

  if (document.all) {

  posX=event.x+document.body.scrollLeft; //modifs CL 09/2001 - IE : regrouper l'évènement

  posY=event.y+document.body.scrollTop;

  }

  else {

  posX=e.pageX; //modifs CL 09/2001 - NS6 : celui-ci ne supporte pas e.x et e.y

  posY=e.pageY; 

  }

}

function HideBulle() {

	if (document.layers) {document.layers["bulle"].visibility="hide";}

	if (document.all) {document.all["bulle"].style.visibility="hidden";}

	else if (document.getElementById){document.getElementById("bulle").style.visibility="hidden";}

}



function InitBulle(ColTexte,ColFond,ColContour,NbPixel) {

	IB.ColTexte=ColTexte;IB.ColFond=ColFond;IB.ColContour=ColContour;IB.NbPixel=NbPixel;

	if (document.layers) {
		window.captureEvents(Event.MOUSEMOVE);window.onMouseMove=getMousePos;

		document.write("<LAYER name='bulle' top=0 left=0 visibility='hide'></LAYER>");

	}

	if (document.all) {
		
		document.onmousemove=getMousePos;
		document.write("<DIV id='bulle' style='position:absolute;top:50;left:50;visibility:hidden'></DIV>");
	}

	//modif CL 09/2001 - NS6 : celui-ci ne supporte plus document.layers mais document.getElementById

	else if (document.getElementById) {
			
	        document.onmousemove=getMousePos;

	        document.write("<DIV id='bulle' style='position:absolute;top:50;left:50;visibility:hidden'></DIV>");

	}


}

// JavaScript Document
var lang;
var map;
var mapsBounds;
var startZoom;
var zoomcourant;
var type_trans = 90;
var tb_markers;
var icon;
var icon1;
var iconV;
var iconL;
var iconLV;

// Mots en francais
var annonce_fr = 'annonce';
var region_parisienne_fr = "Région Parisienne";
var piece_fr = "pièce";
var mois_fr = "mois";
var detail_fr = "détail";
var maj_fr = "Mise à jour";
var ref_fr = "Réf";
var vente_fr = "Vente";
var location_fr = "Location";
var vacances_fr = "Vacances";
var terrain_fr = "terrain";
var terrasse_fr = "terrasse";
var chambres_fr = "chambres";
var supp_selection_fr = 'Supprimez de "Ma S&eacute;lection"';
var add_selection_fr = 'Ajouter &agrave; "Ma S&eacute;lection"';

// Mots en anglais
var annonce_en = 'ad';
var region_parisienne_en = "Paris Region"; 
var piece_en = "room";
var mois_en = "month";
var detail_en = "detail";
var maj_en = "Update";
var ref_en = "Ref";
var vente_en = "Sale";
var location_en = "Rent";
var vacances_en = "Holidays";
var terrain_en = "field";
var terrasse_en = "terrasse";
var chambres_en = "bedrooms";
var supp_selection_en = 'Delete My selection ';
var add_selection_en = "Add to 'My selection'";

// Mots en espagnol
var annonce_es = 'anuncio';
var region_parisienne_es = "Región de París";
var piece_es = "habitacion";
var mois_es = "meses";
var detail_es = "detalle";
var maj_es = "Actualizado";
var ref_es = "Ref";
var vente_es = "Venta";
var location_es = "Llegadas";
var vacances_es = "Vacaciones";
var terrain_es = "terreno";
var terrasse_es = "terrasse";
var chambres_es = "dormitorio";
var supp_selection_es = 'Ma Quitar selección';
var add_selection_es = 'Añadir a mi selección';

var supp_selection="";
var add_selection="";

	function init(lg) {
		lang = lg;
		switch (lang) {
			case 'en' :
				supp_selection = supp_selection_en;
				add_selection = add_selection_en;
				break;
			case 'es' :
				supp_selection = supp_selection_es;
				add_selection = add_selection_es;
				break;
			default :
				supp_selection = supp_selection_fr;
				add_selection = add_selection_fr;
				break;
    	}
	}

function showListeVente(latitude,longitude) {
	  // alert("showPoint " + latitude + " " + longitude );
	  // Create our "tiny" marker icon
	  icon = new GIcon();// mm_20_blue.png,mm_20_red.png
      icon.image = "icones/bleu.png";
      icon.shadow = "icones/mm_20_shadow.png";
      //icon.iconSize = new GSize(12, 20);
      icon.iconSize = new GSize(13, 22);
      //icon.shadowSize = new GSize(22, 20);
      icon.iconAnchor = new GPoint(6, 20);
      icon.infoWindowAnchor = new GPoint(5, 1);
      
	  map = new GMap2(document.getElementById("acMap"));
	  map.addControl(new GSmallMapControl());
	  map.addControl(new GMapTypeControl());
	  map.setCenter(new GLatLng(latitude, longitude),5);
	  type_trans = 10;
	  GEvent.addListener(map, "zoomend", function() { 
	    zoomcourant = map.getZoom();
	    //alert ('zoom ' + zoomcourant);
	    if (zoomcourant < 6)
	    	ajaxVente();
	    else ajaxZoomVente();
		});
      // recuperation des données
      zoomcourant = map.getZoom();
      ajaxVente();
    }
    
	
function ajaxVente()
	{
	    var xhr=null;
	   
		try {
		   xhr = new ActiveXObject("Microsoft.XMLHTTP");    // Essayer Internet Explorer 
		}
		catch(e)   // Echec
		{
		  xhr = new XMLHttpRequest();  // Autres navigateurs
		}
	    map.clearOverlays();
	    tb_markers = new Array;
	    //on définit l'appel de la fonction au retour serveur
	    xhr.onreadystatechange = function() { alert_ajax(xhr); };	    
	    //on affiche le message d'accueil
	    document.getElementById("messageAccueil").className="tumevois";
	    //on appelle le fichier reponse.txt
	    xhr.open("GET", "reponse_ville.php?code_trans=10&loc_pays=FR" , true);
	    xhr.send(null);
	}
	
	function ajaxZoomVente()
	{
	    var xhr=null;
	    if (window.XMLHttpRequest) { 
	        xhr = new XMLHttpRequest();
	    }
	    else if (window.ActiveXObject) 
	    {
	        xhr = new ActiveXObject("Microsoft.XMLHTTP");
	    }
	    map.clearOverlays();
	    //on définit l'appel de la fonction au retour serveur
	    xhr.onreadystatechange = function() { alert_ajax_zooom(xhr); };	    
	    //on affiche le message d'accueil
	    document.getElementById("messageAccueil").className="tumevois";
	    //on appelle le fichier reponse.txt
	    var url =  "reponse_critere.php?code_trans=10&recherche_infos[loc_pays]=FR";
	    xhr.open("GET", url, true);
	    xhr.send(null);
	}
	
	function showListeLocation(latitude,longitude) {
	  // alert("showPoint " + latitude + " " + longitude );
	  // Create our "tiny" marker icon
	  icon = new GIcon();// mm_20_blue.png,mm_20_red.png
	  icon.image = "icones/vermillon.png";
      icon.shadow = "icones/mm_20_shadow.png";

      icon.iconSize = new GSize(13, 23);
      //icon.shadowSize = new GSize(22, 20);
      icon.iconAnchor = new GPoint(7, 20);
      icon.infoWindowAnchor = new GPoint(5, 1);
      
	  map = new GMap2(document.getElementById("acMap"));
	  map.addControl(new GSmallMapControl());
	  map.addControl(new GMapTypeControl());
	  map.setCenter(new GLatLng(latitude, longitude),5);
	  type_trans = 20;
      // recuperation des données
      GEvent.addListener(map, "zoomend", function() { 
	    zoomcourant = map.getZoom();
	    //alert ('zoom ' + zoomcourant);
	    if (zoomcourant < 6)
	    	ajaxLoc();
	    else ajaxZoomLoc();
		});
      // recuperation des données
      zoomcourant = map.getZoom();
      ajaxLoc();
    }
    
function ajaxLoc()
	{
	    var xhr=null;
	    if (window.XMLHttpRequest) { 
	        xhr = new XMLHttpRequest();
	    }
	    else if (window.ActiveXObject) 
	    {
	        xhr = new ActiveXObject("Microsoft.XMLHTTP");
	    }
	    tb_markers = new Array;
	     map.clearOverlays();
	    //on définit l'appel de la fonction au retour serveur
	    xhr.onreadystatechange = function() { alert_ajax(xhr); };
	    
	    //on affiche le message d'accueil
	    document.getElementById("messageAccueil").className="tumevois";
	    //on appelle le fichier reponse.txt
	    xhr.open("GET", "reponse_ville.php?code_trans=20&loc_pays=FR" , true);
	    xhr.send(null);
	}
	
function ajaxZoomLoc()
	{
	    var xhr=null;
	    if (window.XMLHttpRequest) { 
	        xhr = new XMLHttpRequest();
	    }
	    else if (window.ActiveXObject) 
	    {
	        xhr = new ActiveXObject("Microsoft.XMLHTTP");
	    }
	    //on définit l'appel de la fonction au retour serveur
	    xhr.onreadystatechange = function() { alert_ajax_zooom(xhr); };
	    map.clearOverlays();
	    //on affiche le message d'accueil
	    document.getElementById("messageAccueil").className="tumevois";
	    //on appelle le fichier reponse.txt
	    var url =  "reponse_critere.php?code_trans=20&recherche_infos[loc_pays]=FR";
	    xhr.open("GET", url, true);
	    xhr.send(null);
	}
	
function showListeVac(latitude,longitude) {
	  icon = new GIcon();// mm_20_blue.png,mm_20_red.png
	  icon.image = "icones/vert.png";
      icon.shadow = "icones/mm_20_shadow.png";
      icon.iconSize = new GSize(13, 22);
      icon.iconAnchor = new GPoint(7, 20);
      icon.infoWindowAnchor = new GPoint(5, 1);
	  map = new GMap2(document.getElementById("acMap"));
	  map.addControl(new GSmallMapControl());
	  map.addControl(new GMapTypeControl());
	  map.setCenter(new GLatLng(latitude, longitude),5);
	  type_trans = 30;
	  GEvent.addListener(map, "zoomend", function() { 
	    zoomcourant = map.getZoom();
	    //alert ('zoom Vac ' + zoomcourant);
	    if (zoomcourant < 6)
	    	ajaxVac();
	    else ajaxZoomVac();
		});
      // recuperation des données
      zoomcourant = map.getZoom();
      // recuperation des données
      ajaxVac();
    }
    
    function ajaxVac()
	{
	    var xhr=null;
	    
	    if (window.XMLHttpRequest) { 
	        xhr = new XMLHttpRequest();
	    }
	    else if (window.ActiveXObject) 
	    {
	        xhr = new ActiveXObject("Microsoft.XMLHTTP");
	    }
	    tb_markers = new Array;
	     map.clearOverlays();
	    //on définit l'appel de la fonction au retour serveur
	    xhr.onreadystatechange = function() { alert_ajax(xhr); };
	    
	    //on affiche le message d'accueil
	    document.getElementById("messageAccueil").className="tumevois";
		
	    //on appelle le fichier reponse.txt
	    xhr.open("GET", "reponse_ville.php?code_trans=30&loc_pays=FR" , true);
	    xhr.send(null);
	}
	
function alert_ajax(xhr)
{
   if (xhr.readyState==4) 
    {
    	var docXML= xhr.responseXML;
    	var items = docXML.getElementsByTagName("donnee")
    	//on fait juste une boucle sur chaque element "donnee" trouvé
    	document.getElementById("messageAccueil").className="tumevoispas";
    	for (i=0;i<items.length;i++)
    	{
    		// alert (items.item(i).firstChild.data);
    		var itemNom = docXML.getElementsByTagName("nom")
    		var nom = itemNom.item(i).firstChild.data;
    		var itemDpt = docXML.getElementsByTagName("dpt")
    		var dpt = itemDpt.item(i).firstChild.data;
    		var itemLat = docXML.getElementsByTagName("latitude")
    		var latitude = itemLat.item(i).firstChild.data;
    		var itemLong = docXML.getElementsByTagName("longitude")
    		var longitude = itemLong.item(i).firstChild.data;
    		var itemNb = docXML.getElementsByTagName("nbannonces")
    		var nombre = itemNb.item(i).firstChild.data;
    		var itemInfos = docXML.getElementsByTagName("recinfos")
    		var recInfos = itemInfos.item(i).firstChild.data;
    		
    		var url =  'index.php?module=afficherAnnonces&code_trans=' + type_trans +'&recherche_infos[localisation]=';
    		url += recInfos;
    		var description = "<html><head>";
    		description2 = '<style type="text/css">';
    		description2 += '#main {width:40px;color: #00a650;font-style: italic;}';
			description2 += "</style>";
    		description += "</head><body align='center' >";
    		description += "<div id='main' align='center' style='font-style: italic;'>";
    		var ann;
    		var paris;
    		switch (lang) {
    			case 'en' :
    				ann = annonce_en;
    				paris = region_parisienne_en;
    				break;
				case 'es' :
    				ann = annonce_es;
    				paris = region_parisienne_es;
    				break;
    			default :
    				ann = annonce_fr;
    				paris = region_parisienne_fr;
    				break;
    		}
    		if (nom == "Paris") {
    			description +=  "<br> " + paris;
    		} else {
    			description +=  "<br>  " + nom;
    		}
    		
    		description += '<br> <a href=" ' + url + '"> ' + nombre + ' ' + ann ;
    		if (nombre > 1 ) description += 's';
    		description += '</a>';
    		description += '</div>';
    		description += "</body></html>";
    		//alert ("description" + description);
    		
    		if (nombre > 0 ) {
	    		addMarkersToMap(latitude , longitude,
			      	description);
			}
    	}
    	// type_trans type de transaction
    	var xhr=null;
	    if (window.XMLHttpRequest) { 
	        xhr = new XMLHttpRequest();
	    }
	    else if (window.ActiveXObject) 
	    {
	        xhr = new ActiveXObject("Microsoft.XMLHTTP");
	    }
	    //on définit l'appel de la fonction au retour serveur
	    xhr.onreadystatechange = function() { alert_ajax_etranger(xhr); };	    
	    //on affiche le message d'accueil
	    document.getElementById("messageAccueil").className="tumevois";
	    //on appelle le fichier reponse.txt
	    var url =  "rep_etranger_acc.php?code_trans="+type_trans;
	    xhr.open("GET", url, true);
	    xhr.send(null);
    }
}
function alert_ajax_etranger(xhr)
{
   if (xhr.readyState==4) 
    {
    	var docXML= xhr.responseXML;
    	var taille = tb_markers.length;
    	var items = docXML.getElementsByTagName("code_postal")
    	//on fait juste une boucle sur chaque element "donnee" trouvé
    	document.getElementById("messageAccueil").className="tumevoispas";
    	var items = docXML.getElementsByTagName("code_postal");    
    	//on fait juste une boucle sur chaque element "code_postal" trouvé
    	var nbItemsCP = items.length;
    	for (i=0;i<nbItemsCP;i++)
    	{
    		var nombre = items.item(i).getAttribute("nb");
    		var latitude = items.item(i).getAttribute("latitude");
    		var longitude = items.item(i).getAttribute("longitude");
    		var nom = items.item(i).getAttribute("nom");
    		if (items.item(i).firstChild.data != null ) {
    			var code_postal = items.item(i).firstChild.data;
    		} else {
    			var code_postal = "00000";

    		}
    		var url =  'index.php?module=afficherAnnonces&code_trans=' + type_trans +'&recherche_infos[localisation]=';
    		url += code_postal;
    		
    		var description = "<div align='center'>";
    		var ann;
    		switch (lang) {
    			case 'en' :
    				ann = annonce_en;
    				break;
				case 'es' :
    				ann = annonce_es;
    				break;
    			default :
    				ann = annonce_fr;
    				break;
    		}
    		description +=  "<br>  " + nom;
    		description += '<br> <a href=" ' + url + '"> ' + nombre + ' ' + ann ;
    		if (nombre > 1 ) description += 's';
    		description += ' </a></div>';
    		//alert ("description" + description);
    		
    		if (nombre > 0 ) {
	    		addMarkersToMap(latitude , longitude,
			      	description);
			}
    	}
    }
}

    function addMarkersToMap(latitude, longitude, description) {
    	var marker = new GMarker(new GLatLng(latitude,longitude),icon);
    	tb_markers.push(marker);
    	var options = {maxWidth:208};
    	/*GEvent.addListener(marker, 'click',
    		function () {
    			marker.openInfoWindowHtml(description,options);
    			
    		}
    	);*/
    	GEvent.addListener(marker, 'mouseover',
    		function () {
    			marker.openInfoWindowHtml(description,options);
    			
    		}
    	);
    	map.addOverlay(marker);    	
    }
    
    function alert_ajax_zooom(xhr)
{
   if (xhr.readyState==4) 
    {
    	var docXML= xhr.responseXML;
    	var taille = tb_markers.length;
    	var items = docXML.getElementsByTagName("code_postal")
    	//on fait juste une boucle sur chaque element "donnee" trouvé
    	document.getElementById("messageAccueil").className="tumevoispas";
    	var items = docXML.getElementsByTagName("code_postal");    
    	//on fait juste une boucle sur chaque element "code_postal" trouvé
    	var nbItemsCP = items.length;
    	for (i=0;i<nbItemsCP;i++)
    	{
    		var nombre = items.item(i).getAttribute("nb");
    		var latitude = items.item(i).getAttribute("latitude");
    		var longitude = items.item(i).getAttribute("longitude");
    		var nom = items.item(i).getAttribute("nom");
    		if (items.item(i).firstChild.data != null ) {
    			var code_postal = items.item(i).firstChild.data;
    		} else {
    			var code_postal = "00000";

    		}
    		var url =  'index.php?module=afficherAnnonces&code_trans=' + type_trans +'&recherche_infos[localisation]=';
    		url += code_postal;
    		
    		var description = "<div style='width :auto; height:auto;' align='center' >";
    		var ann;
    		switch (lang) {
    			case 'en' :
    				ann = annonce_en;
    				break;
				case 'es' :
    				ann = annonce_es;
    				break;
    			default :
    				ann = annonce_fr;
    				break;
    		}
    		description +=  "<br>  " + nom;
    		description += '<br> <a href=" ' + url + '"> ' + nombre + ' ' + ann ;
    		if (nombre > 1 ) description += 's';
    		description += ' </a></div>';
    		//alert ("description" + description);
    		
    		if (nombre > 0 ) {
	    		addMarkersToMap(latitude , longitude,
			      	description);
			}
    	}
    	var xhr=null;
	    if (window.XMLHttpRequest) { 
	        xhr = new XMLHttpRequest();
	    }
	    else if (window.ActiveXObject) 
	    {
	        xhr = new ActiveXObject("Microsoft.XMLHTTP");
	    }
	    //on définit l'appel de la fonction au retour serveur
	    xhr.onreadystatechange = function() { alert_ajax_etranger(xhr); };	    
	    //on affiche le message d'accueil
	    document.getElementById("messageAccueil").className="tumevois";
	    //on appelle le fichier reponse.txt
	    var url =  "reponse_etranger.php?code_trans="+type_trans+"&recherche_infos[etranger]=1";
	    xhr.open("GET", url, true);
	    xhr.send(null);
    }
}
