// WEB 2.0
function getXmlHttpRequest() {
	if (window.XMLHttpRequest)
		xhr = new XMLHttpRequest();
	else 
		if (window.ActiveXObject) {
			try {
				xhr = new ActiveXObject('Msxml2.XMLHTTP');
			}
			catch (e) {
				xhr = new ActiveXObject('Microsoft.XMLHTTP');
			}
		}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHttpRequest");
		xhr = false;
	}
}

function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}
function affiche(calque,global) {
	document.getElementById(calque).style.display = "block";
	changeOpac(30, global);
}
function efface(calque,global) {
	document.getElementById(calque).style.display = "none";
	changeOpac(100, global);
}

function asynch_fiche(id) {
var data     = null;
getXmlHttpRequest();
xhr.open('POST', 'fiche_biere.php', true);
xhr.onreadystatechange = function() {
        //Si la requête est terminée
        if ( xhr.readyState == 4 ) 
          //Si la réponse ne contient pas d'erreur
          if ( xhr.status == 200 ) 
				document.getElementById("fiche").innerHTML = xhr.responseText;
}
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
//On envoie la requête
data="id="+id;
xhr.send(data);
}


function aff_video(id) {
var data     = null;
affiche('videog','global2');
getXmlHttpRequest();
xhr.open('POST', 'include/video.php', true);
xhr.onreadystatechange = function() {
        //Si la requête est terminée
        if ( xhr.readyState == 4 ) 
          //Si la réponse ne contient pas d'erreur
          if ( xhr.status == 200 ) 
				document.getElementById("videog").innerHTML = xhr.responseText;
}
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
//On envoie la requête
data="id="+id;
xhr.send(data);
}

