<!--
var url_ajax="http://www.histoire-erotique.org/";
//var url_ajax="http://localhost/histoire-erotique.org/";

function affichage(div,texte) { document.getElementById(div).innerHTML=texte; }

function file(fichier) {
  if(window.XMLHttpRequest) { xhr_object=new XMLHttpRequest(); } // FIREFOX
  else if(window.ActiveXObject) { xhr_object=new ActiveXObject("Microsoft.XMLHTTP"); } // IE
  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 valid_filtres() {
  document.location.href=url_ajax+"1-"+document.filtres.lieu[document.filtres.lieu.selectedIndex].value+"-"+document.filtres.theme[document.filtres.theme.selectedIndex].value+"-"+document.filtres.persos[document.filtres.persos.selectedIndex].value+"-"+document.filtres.type[document.filtres.type.selectedIndex].value+"-1.html";
  return false;
}

function recherche_rapide(filtre) {
  if(texte=file(url_ajax+'ajax_filtre.php?filtre='+filtre)) { document.getElementById("aff_filtre").innerHTML=texte; }
}

function fin_recherche() { affichage('aff_filtre', ''); }

function aff_div(a) {
  if(document.getElementById(a).style.display=="none") { document.getElementById(a).style.display="block"; }
  else { document.getElementById(a).style.display="none"; }
}

function aide_note() {
  var left=(screen.availWidth-360)/2; top=(screen.availHeight-160)/2;
  document.getElementById("aide_note").style.left=left; document.getElementById("aide_note").style.top=top;
  document.getElementById("ombre_note").style.left=left+5; document.getElementById("ombre_note").style.top=top+5;
  if(document.getElementById("aide_note").style.display!="block") { document.getElementById("aide_note").style.display="block"; document.getElementById("ombre_note").style.display="block"; }
  else { document.getElementById("aide_note").style.display="none"; document.getElementById("ombre_note").style.display="none"; }
}

function attrib_note(radio,id) {
  var la_note=0;
  for(i=0;i<radio.length;i++) {
    if(radio[i].checked) { la_note=radio[i].value; }
  }
  if(texte=file(url_ajax+"note.php?id="+id+"&new_note="+la_note)) { affichage("note",texte); }
  else { alert("La note n\'a pas pu être prise en compte pour des raison techniques, merci de le signaler au webmaster."); }
}

function maj_pub(id_pub) { file(url_ajax+"pub.php?id_pub="+id_pub); }

function participate(f, id) {
  var la_note=0;
  var arg='';
  if(f.n) {
    for(i=0;i<f.n.length;i++) {
      if(f.n[i].checked) { la_note=f.n[i].value; }
    }
    arg+="&new_note="+la_note;
  }
  if(f.texte.value!="") { arg+="&texte="+f.texte.value; }
  if(f.nom.value!="") { arg+="&nom="+f.nom.value; }
  if(f.email.value!="") { arg+="&email="+f.email.value; }
  if(f.site.value!="") { arg+="&site="+f.site.value; }
  if(texte=file(url_ajax+"note.php?id="+id+arg)) { affichage("note",texte); }
  else { alert("Un disfonctionnement technique a eu lieu, merci de le signaler au webmaster."); }
}

function ScanCookie(variable) {
  cook=document.cookie;
  variable+="=";
  place=cook.indexOf(variable,0);
  if(place <= -1) { return("0"); }
  else {
    end=cook.indexOf(";",place)
    if(end <= -1) { return(unescape(cook.substring(place+variable.length,cook.length))); }
    else { return(unescape(cook.substring(place+variable.length,end))); }
  }
}

function CreationCookie(nom, valeur, duree) {
  var dateExp=new Date();
  var aujourdhui=new Date();
  dateExp.setTime(aujourdhui.getTime()+duree);
  document.cookie=nom+'='+escape(valeur)+'; expires='+dateExp.toGMTString();
}

function disclaimer() {
  if(ScanCookie("disclaimerok")==0) {
    affichage('disclaimer-cadre', file(url_ajax+'disclaimer.php'));
    document.getElementById('disclaimer').style.display="block";
  }
}

function disclaimerok() {
  var la_duree=24*3600*30000;
  CreationCookie('disclaimerok', 'oui', la_duree)
  document.getElementById('disclaimer').style.display="none";
}

function ajax(id, type, text) {
  if(texte=file(url_ajax+'ajax.php?action='+type+'&id='+id+'&'+text)) { return(texte); }
}

function AjouterFavoris(url, titre) {
  if(navigator.appName!='Microsoft Internet Explorer') { window.sidebar.addPanel(titre, url, ""); }
  else { window.external.AddFavorite(titre, url); }
}

function compteurs() {
  affichage('compteur1', '<'+'script type="text/javascript" src="http://statstools.porn.fr/public/live_appelcompteur.js.php?id_site=510&w=29724&n=25&t=2556"><'+'/script>');
  affichage('compteur2', '<'+'script type="text/javascript" src="http://services.x-traceur.com/current_marqueur/htcl.php?13162"><'+'/script>');
}
-->