function ajaxShow(idHotel, onglet) { // Création de l'objet XMLHttpRequest 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) { try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e1) { xhr = null; } } } else { // XMLHttpRequest non supporté par le navigateur alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); } //on définit l'appel de la fonction au retour serveur xhr.onreadystatechange = function() { if(xhr.readyState == 4 && xhr.status == 200) { // Nous remplacons le contenu du div iris par le retour de "ajax/ajaxiris.php" document.getElementById('contentContenu').innerHTML = xhr.responseText; } } // On appel le fichier xhr.open("POST",'ajax_hotel.php',true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send("id=" + idHotel + "&onglet=" + onglet); switch(onglet) { case "description" : document.getElementById('contentOnglets').innerHTML = '' + '' + '' + '' + '' + '' + '
Description
' + '' + '' + '' + '' + '' + '' + '
Location
'; break; case "localisation" : document.getElementById('contentOnglets').innerHTML = '' + '' + '' + '' + '' + '' + '
Description
' + '' + '' + '' + '' + '' + '' + '
Location
'; break; } } function showMaps(idHotel) { if (GBrowserIsCompatible()) { var latitude = 0; var longitude = 0; var htmlMarker = ""; // On recupere en Ajax la latitude et longitude // Création de l'objet XMLHttpRequest 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) { try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e1) { xhr = null; } } } else { // XMLHttpRequest non supporté par le navigateur alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); } //on définit l'appel de la fonction au retour serveur xhr.onreadystatechange = function() { if(xhr.readyState == 4 && xhr.status == 200) { latitude = xhr.responseText.substring(0,xhr.responseText.lastIndexOf("&")); longitude = xhr.responseText.substring(xhr.responseText.lastIndexOf("&") + 1); //alert(latitude + " et " + longitude); if(latitude != 0 && longitude != 0) { // Display the map, with some controls and set the initial location var map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(latitude,longitude),12); // Set up three markers with info windows var point = new GLatLng(latitude,longitude); var marker = new GMarker(point); map.addOverlay(marker); } } } // On appel le fichier xhr.open("POST",'ajax_latlng.php',true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send("id=" + idHotel); } // display a warning if the browser was not compatible else { alert("Sorry, your browser can not display the map of hotels. Please update."); } } function change_img(url,larg,haut) { document.getElementById('img_gd').src = 'inc_redim_image.php?img=' + url + '&width=' + larg + '&height=' + haut; } function defilement_banniere() { var so = new SWFObject("ImgDefil.swf", "Defilement images", "680", "60", "9", "#E0D9DB"); so.write("flashcontent"); }