	function Ajax_send_get(url,id) {
		var xhr_object = null;
		var position = id;
		
		if (window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
		else if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	
		xhr_object.open("GET", url, true);
		xhr_object.onreadystatechange = function() {
			if ( xhr_object.readyState == 4 ) {
				document.getElementById(position).innerHTML = xhr_object.responseText; // on affiche le retour
			}
		}
		xhr_object.send(null);
	}		







	function Ajax_send_get1(url,id) {
		var xhr_object1 = null;
		var position1 = id;
		
		if (window.XMLHttpRequest) xhr_object1 = new XMLHttpRequest();
		else if (window.ActiveXObject) xhr_object1 = new ActiveXObject("Microsoft.XMLHTTP"); 
	
		xhr_object1.open("GET", url, true);
		xhr_object1.onreadystatechange = function() {
			if ( xhr_object1.readyState == 4 ) {
				document.getElementById(position1).innerHTML = xhr_object1.responseText; // on affiche le retour
			}
		}
		xhr_object1.send(null);
	}		








	function Ajax_send_get2(url,id) {
		var xhr_object2 = null;
		var position2 = id;
		
		if (window.XMLHttpRequest) xhr_object2 = new XMLHttpRequest();
		else if (window.ActiveXObject) xhr_object2 = new ActiveXObject("Microsoft.XMLHTTP"); 
	
		xhr_object2.open("GET", url, true);
		xhr_object2.onreadystatechange = function() {
			if ( xhr_object2.readyState == 4 ) {
				document.getElementById(position2).innerHTML = xhr_object2.responseText; // on affiche le retour
			}
		}
		xhr_object2.send(null);
	}		








	function Ajax_send_get3(url,id) {
		var xhr_object3 = null;
		var position3 = id;
		
		if (window.XMLHttpRequest) xhr_object3 = new XMLHttpRequest();
		else if (window.ActiveXObject) xhr_object3 = new ActiveXObject("Microsoft.XMLHTTP"); 
	
		xhr_object3.open("GET", url, true);
		xhr_object3.onreadystatechange = function() {
			if ( xhr_object3.readyState == 4 ) {
				document.getElementById(position3).innerHTML = xhr_object3.responseText; // on affiche le retour
			}
		}
		xhr_object3.send(null);
	}		
	
	
	
	
	
	
	
	
	
	function Ajax_send_get4(url,id) {
		var xhr_object = null;
		var position = id;
		
		if (window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
		else if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	
		xhr_object.open("GET", url, true);
		xhr_object.onreadystatechange = function() {
			if ( xhr_object.readyState == 4 ) {
				document.getElementById(position).innerHTML = xhr_object.responseText; // on affiche le retour
				Ajax_send_get1("aquarium-action.php?sAqua="+ encodeURI('plantation') +"&bac="+ encodeURI( document.getElementById('bac').value )+"&alert="+ encodeURI( document.getElementById('alert').value ),"aquarium_plantation");				
				Ajax_send_get2("aquarium-action.php?sAqua="+ encodeURI('population') +"&bac="+ encodeURI( document.getElementById('bac').value )+"&alert="+ encodeURI( document.getElementById('alert').value ),"aquarium_population");				
			}
		}
		xhr_object.send(null);
	}			
	
	
	
	
	
	
	
	function Ajax_send_get5(url,id,action_type) {
		var xhr_object = null;
		var position = id;
		
		if (window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
		else if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	
		xhr_object.open("GET", url, true);
		xhr_object.onreadystatechange = function() {
			if ( xhr_object.readyState == 4 ) {
				document.getElementById(position).innerHTML = xhr_object.responseText; // on affiche le retour
				print_values();
			}
		}
		xhr_object.send(null);
	}		








			function chg_autologin() {
				st = document.getElementById('al').value;
				if (st == 1) {
					document.getElementById('img1').src = "/img/cross.jpg";
					document.getElementById('al').value = 0;
				} else {
					document.getElementById('img1').src = "/img/vu.jpg";
					document.getElementById('al').value = 1;
				}
			}
			
			
			
			
			
			
		
		
			
			function showPopUp(file,w,h,referer) {
			
				var popup = document.all ? document.all["popup"] : document.getElementById ? document.getElementById("popup") : "";
				popup.style.backgroundImage = "url('/img/contentbg.jpg')";
				popup.style.borderColor = "black";
			
				popupOn(0,w,h);
				Ajax_send_get("/" + file + ".php?referer="+referer,"popup");
			
			}			




			function show_pop_up_diapo(file,w,h,id_annonce) {
			
				var popup = document.all ? document.all["popup"] : document.getElementById ? document.getElementById("popup") : "";
				popup.style.backgroundImage = "url('/img/contentbg.jpg')";
				popup.style.borderColor = "black";
			
			
			popupOn(0,w,h);
			
				var new_text = "<div class=\"popup_menu\"><a href=\"javascript:closePopUp();\"><a  href=\"javascript:closePopUp();\"><img src=\"image/map_icone/fermer.jpg\" /></a></div><img id=\"ima\" height=\"330\" name=\"ima\" src=\"\" alt=\"\" />";
		
		/*
		
				element_node = document.createElement("img");
				element_node.setAttribute("src","http://loc-europe.com/image/icone/domtom.jpg");
				element_node.setAttribute("class","popup_menu");

				document.getElementById("popup").appendChild(element_node);	
*/
				
				document.getElementById("popup").innerHTML=new_text;	

				
				
		
				document.getElementById("ima").src="/image/img_originale/"+id_annonce+"_1.jpg";
				
				actualise_image(1,id_annonce);


	
				
				
			}	
			
			
			
			function actualise_image(id_img,id_annonce)
				{
				
				document.getElementById("ima").src="/image/img_originale/"+id_annonce+"_"+id_img+".jpg";
				id_img++;
				setTimeout("actualise_image("+id_img+","+id_annonce+")", 3000);
				}

			
				



			function show_pop_up_video(file,w,h,id_annonce,liste_video) {
			
				var popup = document.all ? document.all["popup"] : document.getElementById ? document.getElementById("popup") : "";
				popup.style.backgroundImage = "url('/img/contentbg.jpg')";
				popup.style.borderColor = "black";
			
				document.getElementById("popup").innerHTML="<div ><a href=\"javascript:closePopUp();\"><img src=\"image/icone/cross.jpg\" border=\"0\" /></a><a href=\"javascript:javascript:GMaps(\", Banon, france\");\"><img src=\"image/icone/racine-24.gif\" border=\"0\" /></a><a href=\"javascript:javascript:GMaps(\", Banon, france\");\"><img src=\"image/icone/msn.gif\" border=\"0\" /></a><a href=\"javascript:javascript:GMaps(\", Banon, france\");\"><img src=\"image/icone/info.gif\" border=\"0\" /></a><a href=\"javascript:javascript:GMaps(\", Banon, france\");\"><img src=\"image/icone/vignette-24.png\" border=\"0\" /></a><a href=\"javascript:javascript:GMaps(\", Banon, france\");\"><img src=\"image/icone/video_16.gif\" border=\"0\" /></a></div><object class=\"playerpreview\" width=\"320\" height=\"240\" data=\"/video/player/flv_player/player_flv_multi.swf\" type=\"application/x-shockwave-flash\"><param value=\"/video/player/flv_player/player_flv_multi.swf\" name=\"movie\"/><param value=\"true\" name=\"allowFullScreen\"/><param value=\"flv="+liste_video+"&amp;width=320&amp;height=240&amp;showstop=1&amp;showvolume=1&amp;showtime=1&amp;startimage=/video/player/flv_player/startimage_fr.jpg|/video/player/flv_player/startimage_fr.jpg|/video/player/flv_player/startimage_fr.jpg&amp;showfullscreen=1&amp;bgcolor1=189ca8&amp;bgcolor2=085c68&amp;playercolor=085c68&amp;autoplay=1\" name=\"FlashVars\"/><p>Video</p></object>";
	
				popupOn(0,w,h);
				

				
			}		





			function showPopUpActions(file,w,h) {
			
				var popup = document.all ? document.all["popup"] : document.getElementById ? document.getElementById("popup") : "";
				popup.style.backgroundImage = "url('/img/contentbg.jpg')";
				popup.style.borderColor = "black";
			
				popupOn(0,w,h);
				Ajax_send_get("/" + file,"popup");
			
			}			








			function closePopUp() {
				if (w3c||ie){
					var alpha = document.all ? document.all['alpha'] : document.getElementById ? document.getElementById('alpha') : "";
					alpha.style.display = 'none'; // on cache le filtre alpha
					var popup = document.all ? document.all['popup'] : document.getElementById ? document.getElementById('popup') : "";
					popup.style.visibility = 'hidden'; // on cache la popup
				}	
				document.getElementById("popup").innerHTML=" ";//effacer le contenu du div pop up;

			}
			
			
			
			
			
			
			
			
			
			
			function sendContact() {
				var poststr = 'sujet=' + encodeURI( document.getElementById('sujet').value ) +
											'&nom2=' + encodeURI( document.getElementById('nom2').value ) +
											'&email=' + encodeURI( document.getElementById('email').value ) +
											'&http=' + encodeURI( document.getElementById('http').value ) +
											'&msg=' + encodeURI( document.getElementById('msg').value );
				makePOSTRequest('/contact.php', poststr, 'popup');
			}					













			function sendFriends() {
				var poststr = '&nom2=' + encodeURI( document.getElementById('nom2').value ) +
											'&nom3=' + encodeURI( document.getElementById('nom3').value ) +
											'&referer=' + encodeURI( document.getElementById('referer').value ) +
											'&email=' + encodeURI( document.getElementById('email').value ) +
											'&email2=' + encodeURI( document.getElementById('email2').value );
				makePOSTRequest('/friends.php', poststr, 'popup');
			}				












			function sendBug() {
				var poststr = '&agent=' + encodeURI( document.getElementById('agent').value ) +
											'&referer=' + encodeURI( document.getElementById('referer').value ) +
											'&email=' + encodeURI( document.getElementById('email').value ) +
											'&msg=' + encodeURI( document.getElementById('msg').value );
				makePOSTRequest('/bug.php', poststr, 'popup');
			}	
			
				
				
				
				
				
				
				
				
				
				
				
				
	
			function GMaps(address) {
				
				popupOn(0,600,500);				
				
				var xhr_object = null;
				var position = 'popup';
				
				if (window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
				else if (window.ActiveXObject) xhr_object = new ActiveXObject('Microsoft.XMLHTTP'); 
			
				xhr_object.open('GET', 'googlemaps.php', true);
				xhr_object.onreadystatechange = function() {
					if ( xhr_object.readyState == 4 ) {
						document.getElementById(position).innerHTML = xhr_object.responseText; // on affiche le retour
						showGmaps(address);
					}
				}
				xhr_object.send(null);
			}			
			
			
			
			
			
			
			
			
			
				
			function gmaps_gps(gps) {
				
				popupOn(0,600,500);				
				
				var xhr_object = null;
				var position = 'popup';
				
				if (window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
				else if (window.ActiveXObject) xhr_object = new ActiveXObject('Microsoft.XMLHTTP'); 
			
				xhr_object.open('GET', 'googlemaps.php', true);
				xhr_object.onreadystatechange = function() {
					if ( xhr_object.readyState == 4 ) {
						document.getElementById(position).innerHTML = xhr_object.responseText; // on affiche le retour
						showgmaps_gps(gps);
					}
				}
				xhr_object.send(null);
			}			
			
			
			
			
			
			
			
			
			
			
						
			
			
			function showgmaps_gps(gps) {
				//<![CDATA[
						 popupOn(0,600,500);
						 
						/* Variable qui va correspondre  l'affichage de la carte dans la div */
						var map = new GMap2(document.getElementById('map'));
						/* Centre la carte aux coordonnes indiques et ralise un zoom de niveau 5 */
				
						map.addControl(new GLargeMapControl());
    					map.addControl(new GMapTypeControl());
						
						//map.setCenter(new GLatLng(33,33), 8);
						
						//eval("map.setCenter(new GLatLng"+gps+", 8);");

						//var point_1 = new GLatLng(33,33);
						
						eval("var point_1 = new GLatLng"+gps+";");
						
						eval("map.setCenter(point_1, 8);");

						

						var marker_1 = new GMarker(point_1);

						map.addOverlay(marker_1);
						
			/*document.getElementById("popup").innerHTML="<div style=\"position:absolute; top:0px; left:520px; z-index:1003;\"><a href=\"javascript:closePopUp();\"><img src=\"image/map_icone/fermer.jpg\" border=\"0\" /></a></div>";
	
				*/		
						
						
					
				//}
			 } //]]>



			
			
			
			
			
			
			
			
			
			
			
			
			
			function showGmaps(address) {
				//<![CDATA[
				/* Variable qui va correspondre  l'affichage de la carte dans la div */
				var map = new GMap2(document.getElementById('map'));
				/* Centre la carte aux coordonnes indiques et ralise un zoom de niveau 5 */
				var point = new GLatLng(49.41483, 2.817895);
				map.setCenter(point, 15);
				
				map.addControl(new GLargeMapControl());
				
				/* Cration de l'objet GClientGeocoder */
				var geocoder = new GClientGeocoder();
		
				if (geocoder) {
					geocoder.getLatLng(address, function(point) {
						/* Centrer la carte sur le point */
						map.setCenter(point, 15);
						/* Cration d'un marqueur */
						var marker = new GMarker(point);
						/* Afficher le marqueur */
						map.addOverlay(marker);
					});
				}
			 } //]]>











			function diapo(id_annonce,img_d,img_f) {
				
				popupOn(0,600,500);				
				
				var xhr_object = null;
				var position = 'popup';
				
				if (window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
				else if (window.ActiveXObject) xhr_object = new ActiveXObject('Microsoft.XMLHTTP'); 
			
				xhr_object.open('GET', 'diapo.php?id_annonce='+'id_annonce', true);
				xhr_object.onreadystatechange = function() {
					if ( xhr_object.readyState == 4 ) {
						document.getElementById(position).innerHTML = xhr_object.responseText; // on affiche le retour
						changeimages();
					}
				}
				xhr_object.send(null);
			}		













			function show_popup_v1(type,w,h,id_annonce,gps) {
			
				var popup = document.all ? document.all["popup"] : document.getElementById ? document.getElementById("popup") : "";
				popup.style.backgroundImage = "url('/img/contentbg.jpg')";
				popup.style.borderColor = "black";
			
				document.getElementById("popup").innerHTML="<div style=\"position:absolute; top:0px; left:520px; z-index:1003;\"><a href=\"javascript:closePopUp();\"><img src=\"image/map_icone/fermer.jpg\" border=\"0\" /></a><a href=\"javascript:javascript:GMaps(', Banon, france');\"><img src=\"image/icone/loupe_3.gif\" border=\"0\" /></a></div><object type=\"application/x-shockwave-flash\" data=\"http://loc-europe.com/video/player/flv_player/player_flv_maxi.swf\" width=\"320\" height=\"240\" ><param name=\"movie\" value=\"http://flv-player.net/medias/player_flv_maxi.swf\" /><param name=\"allowFullScreen\" value=\"true\" /><param name=\"FlashVars\" value=\"flv=http://loc-europe.com/video/flv/a950d28afc9f991bb578352f3179c583_video_location_183_num_1_copy_1.flv&showstop=1&showvolume=1&showtime=1&showfullscreen=1&showswitchsubtitles=1&autoplay=1\" /></object>";
	
				popupOn(0,w,h);
				

				
			}		




/*

#########################################################################################################################
##########################################################################################################################


*/



	
	
			function supp_favoris(id_annonce) {
				
						
				new Effect.Highlight(id_annonce);
						
				var xhr_object = null;
			
				if (window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
				else if (window.ActiveXObject) xhr_object = new ActiveXObject('Microsoft.XMLHTTP'); 
			
				xhr_object.open('GET', '../page/ajax/ajax_sup_favoris.php?id_annonce='+id_annonce, true);
				xhr_object.onreadystatechange = function() {
					if ( xhr_object.readyState == 4 ) {
						
						xhr_object.responseText; 
						 
					}
				}
				xhr_object.send(null);
				
				
				maj_favoris(id_annonce);
				
			}		







	

	
	
	
			function add_favoris(id_annonce) {
				
						
				new Effect.Highlight(id_annonce);
						
				var xhr_object = null;
			
				if (window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
				else if (window.ActiveXObject) xhr_object = new ActiveXObject('Microsoft.XMLHTTP'); 
			
				xhr_object.open('GET', '../page/ajax/ajax_sauv_favoris.php?id_annonce='+id_annonce, true);
				xhr_object.onreadystatechange = function() {
					if ( xhr_object.readyState == 4 ) {
						
						xhr_object.responseText; 
						 
					}
				}
				xhr_object.send(null);
				
				
				maj_favoris(id_annonce);
				
			}		

	
	
	
	



	
	//////////////////////////
	
	


function maj_favoris(id_annonce){	

var text = file("page/ajax_favoris.php");

var favoris = document.getElementById("menu_favoris");










var element = document.getElementById("menu_favoris").lastChild;

while (element.firstChild) {
  element.removeChild(element.firstChild);
}










var new_node=toDOM(text);


favoris.insertBefore(new_node,favoris.lastChild.lastChild);


/*






var i=0;

for (var i=0; i<tableau_favoris.length; i++){
   var valeur = tableau_favoris[i];
   //document.write(valeur);
  
  
var element_node_img = document.createElement("img");
element_node_img.setAttribute("height","15");
element_node_img.setAttribute("src","/image/img_micro/"+valeur+"_1.jpg");


var element_node_a = document.createElement("a");

element_node_a.appendChild(element_node_img);






var node = document.createTextNode(valeur);
element_node_a.appendChild(node);


var nodenew = document.createElement("li"); 
 
nodenew.appendChild(element_node_a);



nodenew.setAttribute("class","bulle");

nodenew.setAttribute("onmouseout","BulleHide();");

nodenew.setAttribute("onmouseover","BulleWrite('<img src=/image/img_miniature/"+valeur+"_1.jpg>\',\'event\');");


nodenew.setAttribute("href","index-page-annonce_location-numero-"+valeur+"-lg-fr-location_description-.html");






dd = document.getElementById("menu_favoris").firstChild;	

insertAfter(nodenew,dd);


//document.getElementById("menu_favoris").previousSibling.lastChild.firstChild.appendChild(node);	






}
//alert("annonce ajouté aux favoris");


*/

}






function insertAfter( newElement, referenceElement ) {

var parent = referenceElement.parentNode;

var nextSibling = referenceElement.nextSibling;

if ( nextSibling) {

parent.insertBefore(newElement, nextSibling);

} else {

parent.appendChild(newElement);

}

} 














function file(fichier)
{
	if(window.XMLHttpRequest) // FIREFOX
		xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject) // IE
		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else return(false);
	xhr_object.open("GET", fichier, false);
	xhr_object.send(null);
	if(xhr_object.readyState == 4) return(xhr_object.responseText);
	else return(false);
}
	
	
	
	
	
	
	
	
function toDOM(HTMLstring){
var d = document.createElement('div');
d.innerHTML = HTMLstring;
var docFrag = document.createDocumentFragment();

while (d.firstChild) {
docFrag.appendChild(d.firstChild)
};

return docFrag;
	
}












	var w3c = document.getElementById && !document.all;
	var ie = document.all;



