﻿function b2L(url,qui)
{

obj = alias.getElementById(qui);

// ON EFFACE LE CONTENU DU DUV
obj.innerHTML = "";
if(window.XMLHttpRequest) // FIREFOX
xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject) // IE
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
else
return(false);

// CONTROLE DE L'ETAT DE LA REQUETE
// CHAQUE CHANGEMENT D'ETAT AFFICHE UNE LIGNE DANS NOTRE DIV
xhr_object.onreadystatechange = function()
{
if(xhr_object.readyState == 1)
     //obj.innerHTML += "connexion établie<br />";
if(xhr_object.readyState == 2)
     //obj.innerHTML+= "requête reçue<br />";
if(xhr_object.readyState == 3)
     obj.innerHTML += "réponse en cours<br />";
if(xhr_object.readyState == 4)
{
     // ON CONTROLE LE STATUS (ERREUR 404, ETC)
if(xhr_object.status == 200){
//obj.innerHTML += "Fichier : " + xhr_object.responseText;
obj.innerHTML += xhr_object.responseText;

//Traitement de mise à jour du loading (hors images)
if(qui != 'arriere' &&  qui != 'image_produit_fond' && alias.getElementById(qui+'_lod')) alias.getElementById(qui+'_lod').value = 100;

if(qui == 'bloc_liste_produit') slider2();

}else{
obj.innerHTML +="Error code " + xhr_object.status;}
}
};

// ON APPELLE LA PAGE
xhr_object.open("GET", url, true);
xhr_object.send(null);
}

function OpenPopin(url){
alias.getElementById('table_popin').style.display = 'block';
b2L(url,'contenu_popin');

}

function ClosePopin(){
b2L('blank.htm','contenu_popin');
alias.getElementById('table_popin').style.display = 'none';

}

function fbs_click() {
u='http://www.melindagillet.com/facebook.php?time=12736840495&b='+location.href.replace(/&/g,'+');
t="Danseuse orientale, passionnée des danses d’Isadora Duncan, Melinda Gillet";

window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');

}
