function affiche_div_fiche( fiche, id ) {
	var xhr_object = null; 
		 
		if(window.XMLHttpRequest) // Firefox 
		   xhr_object = new XMLHttpRequest(); 
		else if(window.ActiveXObject) // Internet Explorer 
		   xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
		else { // XMLHttpRequest non supporté par le navigateur 
		   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		   return; 
		} 
		
	 
		xhr_object.open("POST", "inc/PHP/affichage/"+fiche+".inc.php?id_article="+id, true); 
				
		xhr_object.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 		 
		xhr_object.onreadystatechange = function() { 
			content = document.getElementById('article_'+id); // DEFINITION ESPACE POUR AFFICHAGE DU RESULTAT
			//content.style.display='none';
			
		   if(xhr_object.readyState == 4) 
		   	{
				//alert(xhr_object.responseText);
			content.innerHTML = xhr_object.responseText; // ON AFFICHE LA REPONSE
			
			}
		} 
		 
		xhr_object.send(null); 
}



function afficher_alert (url) {
		
	var xhr_object = null; 
		 
		if(window.XMLHttpRequest) // Firefox 
		   xhr_object = new XMLHttpRequest(); 
		else if(window.ActiveXObject) // Internet Explorer 
		   xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
		else { // XMLHttpRequest non supporté par le navigateur 
		   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		   return; 
		} 
		
	 
		xhr_object.open("POST", "inc/PHP/alertes/"+url, true); 
				
		xhr_object.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 		 
		xhr_object.onreadystatechange = function() { 
		contfichedediee = document.getElementById('cont_alert'); 
		fichedediee = document.getElementById('text_alert'); 
			
		   if(xhr_object.readyState == 4) 
		   	{
			//alert(xhr_object.responseText);
			fichedediee.innerHTML = xhr_object.responseText; // ON AFFICHE LA REPONSE
			fichedediee.style.display='';
			contfichedediee.style.display='block';
			if(document.body.scrollTop<50)
				contfichedediee.style.top = 200+document.body.scrollTop+'px';
			else
				contfichedediee.style.top = 200+document.body.scrollTop+'px';
			}
		} 
		 
		xhr_object.send(null); 
	}
	
	

function fermer_alert (url) {
		contfichedediee = document.getElementById('cont_alert'); 
		fichedediee = document.getElementById('text_alert'); 
		
		//alert(xhr_object.responseText);
		fichedediee.innerHTML = ''; // ON AFFICHE LA REPONSE
		fichedediee.style.display='none';
		contfichedediee.style.display='none';
		}

function sleep (mili) {
    
    var start = new Date().getTime();
    while (new Date() < start + mili) {}
    return 0;
	}
	
var pause = true;

function affiche_prix(id_prix)
	{
	var pause=true;
	divencour=document.getElementById('prix1_'+id_prix);
		divencour.style.display='none';
	divencour=document.getElementById('prix2_'+id_prix);
		divencour.style.display='block';
	divencour=document.getElementById('prix3_'+id_prix);
		divencour.style.display='none';
	}


function masque_prix(id_prix)
	{
	if(pause=true)
		{
		divencour=document.getElementById('prix2_'+id_prix);
			divencour.style.display='none';
		divencour=document.getElementById('prix3_'+id_prix);
			divencour.style.display='none';
		divencour=document.getElementById('prix1_'+id_prix);
			divencour.style.display='block';
		}
	}


function ajouter_panier(id_prix,type_boutique,option)
	{	
	selectquantite = 	'quantite'+id_prix;
	var quantite = document.forms['boutique2'].elements[selectquantite].value;
		
	var xhr_object = null; 
		 
		if(window.XMLHttpRequest) // Firefox 
		   xhr_object = new XMLHttpRequest(); 
		else if(window.ActiveXObject) // Internet Explorer 
		   xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
		else { // XMLHttpRequest non supporté par le navigateur 
		   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		   //return; 
		} 
	 
		if(option)
		xhr_object.open("POST", "inc/PHP/affichage/panier_cold.inc.php?id_prix="+id_prix+"&type_boutique="+type_boutique+"&quantite="+quantite+"&option="+option, true);
		else
		xhr_object.open("POST", "inc/PHP/affichage/panier_cold.inc.php?id_prix="+id_prix+"&quantite="+quantite+"&type_boutique="+type_boutique, true);
		 
		xhr_object.onreadystatechange = function() { 
			var content = document.getElementById('nb_articles'); // DEFINITION ESPACE POUR AFFICHAGE DU RESULTAT
			content.innerHTML = "..."; // ON AFFICHE LA REPONSE
		   if(xhr_object.readyState == 4) 
		   	{
			content.innerHTML = xhr_object.responseText; // ON AFFICHE LA REPONSE
			//afficher_alert('ajout_panier_ok.html');
			}
			else
			content.innerHTML = "..."; // ON AFFICHE LA REPONSE
		} 
		 
		xhr_object.send(null); 
	}
	
	
function affiche_confirm(id_prix)
	{
		mili = 1500;
		var pause=false;
		sleep(750);
	
		divencour=document.getElementById('prix1_'+id_prix);
			divencour.style.display='none';
		divencour=document.getElementById('prix2_'+id_prix);
			divencour.style.display='none';
		divencour=document.getElementById('prix3_'+id_prix);
			divencour.style.display='block';
			    
	}

function affichier_panier(request)
	{	var xhr_object = null; 
		 
		if(window.XMLHttpRequest) // Firefox 
		   xhr_object = new XMLHttpRequest(); 
		else if(window.ActiveXObject) // Internet Explorer 
		   xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
		else { // XMLHttpRequest non supporté par le navigateur 
		   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		   //return; 
		} 
	 	if(request==null)
		xhr_object.open("POST", "inc/PHP/affichage/panier_cold.inc.php", true); 
		else
		xhr_object.open("POST", "inc/PHP/affichage/panier_cold.inc.php"+request, true); 
		 
		xhr_object.onreadystatechange = function() { 
			var content = document.getElementById('panier_cold'); // DEFINITION ESPACE POUR AFFICHAGE DU RESULTAT
			content.innerHTML = "chargement en cours..."; // ON AFFICHE LA REPONSE
		   if(xhr_object.readyState == 4) 
		   	{
			content.innerHTML = xhr_object.responseText; // ON AFFICHE LA REPONSE
			}
			else
			content.innerHTML = "chargement en cours..."; // ON AFFICHE LA REPONSE
		} 
		 
		xhr_object.send(null); 

	}

