function doBlink() {
	var blink = document.all.tags("BLINK")
	for (var i=0; i<blink.length; i++)
		blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
}

function startBlink() {
	if (document.all)
		setInterval("doBlink()",400)
}
window.onload = startBlink;

function noaccent(chaine) {
  temp = chaine.replace(/[àâä]/gi,"a")
  temp = temp.replace(/[éèêë]/gi,"e")
  temp = temp.replace(/[îï]/gi,"i")
  temp = temp.replace(/[ôö]/gi,"o")
  temp = temp.replace(/[ùûü]/gi,"u")
  temp = temp.replace(/[ç]/gi,"c")
  return temp
}

function afficher(Element1)
{ 
if (document.getElementById) 
document.getElementById(Element1).style.display = "";
} 
function afficher2()
{ 
if (document.getElementById) 
this.document.getElementById.style.display = "";
} 
function masquer(Element1)
{ 
if (document.getElementById) 
document.getElementById(Element1).style.display = "none";
}


function afficher_masquer(Element){if (document.getElementById) document.getElementById(Element).style.display = '';}

function masqKalk(Element1)
{ 
if (document.getElementById) 
document.getElementById(Element1).style.visibility="hidden";
}

function afichKalk(element,content)
{ 
  if(content.length>2)
  {
  document.getElementById(element).style.visibility= 'visible';
  }
}

function montre(id) 
{
var d = document.getElementById(id);
	for (var i = 1; i<=50; i++) 
	{
		if (document.getElementById('REG'+i)) {document.getElementById('REG'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}


<!--INUTILE-->
function montre2(id) {
var d = document.getElementById('FICHE'+id);
var e = document.getElementById('TITREFICHE_A'+id);
var f = document.getElementById('TITREFICHE_B'+id);
	for (var i = 1; i<=10; i++) 
	{
		if (document.getElementById('FICHE'+i)) {document.getElementById('FICHE'+i).style.display='none';}
		if (document.getElementById('TITREFICHE_A'+i)) {document.getElementById('TITREFICHE_A'+i).style.display='';}
		if (document.getElementById('TITREFICHE_B'+i)) {document.getElementById('TITREFICHE_B'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
if (e) {e.style.display='none';}
if (f) {f.style.display='block';}
}

function montre3(id) {
var d = document.getElementById('FICHE'+id);
var e = document.getElementById('TITREFICHE_A'+id);
var f = document.getElementById('TITREFICHE_B'+id);
	for (var i = 1; i<=10; i++) 
	{
		if (document.getElementById('FICHE'+i)) {document.getElementById('FICHE'+i).style.display='none';}
		if (document.getElementById('TITREFICHE_A'+i)) {document.getElementById('TITREFICHE_A'+i).style.display='block';}
		if (document.getElementById('TITREFICHE_B'+i)) {document.getElementById('TITREFICHE_B'+i).style.display='none';}
	}
if (d) {d.style.display='none';}
if (e) {e.style.display='block';}
if (f) {f.style.display='none';}
}


var pPictures = ""
function popProfil(ID,PHOT,PSEU,DOMAINE,AGE,SEXE,RUBRIK,LELIEU) 
{
var W=screen.width*0.85
var H=screen.height
var URL="http://www.3d-rencontre.com/grand_profil.php?id="+ID+"&grandephot="+PHOT+"&pseudo="+PSEU+"&dom="+DOMAINE+"&age="+AGE+"&sexe="+SEXE+"&rubrik="+RUBRIK+"&lelieu="+LELIEU
var winconfig="width="+W+",height="+H+",scrollbars=1,resizable=1,toolbar=0,location=0,menubar=0,status=0,directories=0,top=0,left=0"
 
   if ( pPictures.focus) {pPictures.close();} 
   pPictures = window.open(URL,'',winconfig); 
   if ( self.focus ) pPictures.focus(); 
}

function popProfil2(ID,PHOT,PSEU,DOMAINE,AGE,SEXE,RUBRIK,LELIEU) 
{
var W=screen.width*0.75
var H=screen.height
var URL="http://www.3d-rencontre.com/grand_profil.php?id="+ID+"&grandephot="+PHOT+"&pseudo="+PSEU+"&dom="+DOMAINE+"&age="+AGE+"&sexe="+SEXE+"&rubrik="+RUBRIK+"&lelieu="+LELIEU
var winconfig="width="+W+",height="+H+",scrollbars=1,resizable=1,toolbar=0,location=0,menubar=0,status=0,directories=0,top=0,left=0"
 
   if ( pPictures.focus) {pPictures.close();} 
   pPictures = window.open(URL,'',winconfig); 
   if ( self.focus ) pPictures.focus(); 
}

function popAjout(RUBRIK,CATEG)
{
var W=screen.width*0.6
var H=screen.height*0.6
var URL="http://www.3d-rencontre.com/ajout.php?rubrik="+RUBRIK+"&categ="+CATEG
var winconfig="width="+W+",height="+H+",scrollbars=1,resizable=1,toolbar=0,location=0,menubar=0,status=0,directories=0,top=0,left=0"
 
   if ( pPictures.focus) {pPictures.close();} 
   pPictures = window.open(URL,'',winconfig); 
   if ( self.focus ) pPictures.focus(); 
}

function popComent(ID,LIEU)
{
var W=screen.width*0.6
var H=screen.height*1
LIEU=noaccent(LIEU)
//var URL="http://www.3d-rencontre.com/coment.php?lieu="+LIEU+"&fiche="+ID
var URL="http://www.3d-rencontre.com/fiche/"+LIEU+"/"+ID+".html"
var winconfig="width="+W+",height="+H+",scrollbars=1,resizable=1,toolbar=0,location=0,menubar=0,status=0,directories=0,top=0,left=0"
 
   if ( pPictures.focus) {pPictures.close();} 
   pPictures = window.open(URL,'',winconfig); 
   if ( self.focus ) pPictures.focus(); 
}



var fermer='<? echo"$FERMER";?>';
function VOIRFICHE(num) 
{ 
  if(fermer!=2)
  {
     // Booléen reconnaissant le navigateur
     isIE = (document.all) 
     isNN6 = (!isIE) && (document.getElementById)
     // Compatibilité : l'objet menu est détecté selon le navigateur
     if (isIE) menu = document.all['FICHE' + num];
     if (isNN6) menu = document.getElementById('FICHE' + num);
  
/////////////////////Pour fermer les menus deja ouverts/////////////////////
    if(fermer==1){for (var i = 1; i<=100; i++){if (i != num){if (document.getElementById('FICHE'+i)){document.getElementById('FICHE'+i).style.display='none';}}}}
//////////////////////////////////////////////////////////////////////////////


   // On ouvre ou ferme
    if (menu.style.display == "none"){menu.style.display = ""}else {menu.style.display = "none"}


  }//fin de if(fermer2!=0)
}

function ChClass(num,cla)
{
  if(document.getElementById('mydiv' + num)){document.getElementById('mydiv' + num).className = cla;}
}


var TEMPO = 2000; // Delai de mise en cache en millisecondes
var idTimeout = 0; // Identifiant permettant de récupérer l'indice du setTimeout
function search_endroit(what,content,rubrik,categ)
{
  if(content.length>2)
  {
  content=noaccent(content);
  document.getElementById(what).style.visibility= 'visible';
  document.getElementById(what).innerHTML = '<br><br><center><img src="../images/wait3d-Rencontre.gif"/></center>';
  
		if (idTimeout>0){clearTimeout(idTimeout);} 
		var F = function() {document.getElementById('DivResEndroit').innerHTML = file('../sortir/scriptSearchEndroit.php?ENDROIT='+content+'&RUBRIK='+rubrik+'&CATEG='+categ);}			
		idTimeout = setTimeout(F,TEMPO);
  }	
  else if(content.length==2)
  {
        if (idTimeout>0){clearTimeout(idTimeout);} 
		var G = function() 
		{
        document.getElementById(what).style.visibility= 'visible';
        document.getElementById(what).innerHTML = '<br><br><br><center><font color=#B300B3><h3>Veuillez taper 3 caracteres minimum</h3></font></center><br>';
		}
		idTimeout = setTimeout(G,TEMPO);
  }
  else{document.getElementById(what).style.visibility= 'hidden';}	
}

function NoEnter(event)
{
    if(!event && window.event) {event = window.event;}// Compatibilité IE / Firefox 
    if(event.keyCode == 13) {event.returnValue = false; event.cancelBubble = true;}// IE
    if(event.which == 13) {event.preventDefault(); event.stopPropagation();}// DOM
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
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 viewSearch(sex)
{
rs=document.formPRDV;
if(sex=="hommes"){var txtSearch="Rechercher les hommes";}
if(sex=="femmes"){var txtSearch="Rechercher les femmes";}
if(sex=="couples"){var txtSearch="Rechercher les couples";}
document.formPRDV.goSearch.value = txtSearch;
}

function WaitButon(){document.getElementById('Tbl_Buton').innerHTML = '<img src="http://www.3d-rencontre.com/images/wait.gif" width="82" height="12">';}

function WaitForSelect(ou){document.getElementById(ou).innerHTML = '<img src="http://www.3d-rencontre.com/images/wait.gif" width="82" height="12">';}

function Preview(pay,reg,dep,vil)
{
  if(pay==''){pay='france'}
  if(pay)
  {
  document.formPRDV.PAYS2.value = pay;
  WaitForSelect('Tbl_Reg');
  document.getElementById('Tbl_Reg').innerHTML = file('http://www.3d-rencontre.com/search/scriptReg.php?PP='+pay+'&RR='+reg+'&DD='+dep+'&VV='+vil); 
  }
  if(reg)
  {
  WaitForSelect('Tbl_Dep');
  document.getElementById('Tbl_Dep').innerHTML = file('http://www.3d-rencontre.com/search/scriptDep.php?PP='+pay+'&RR='+reg+'&DD='+dep+'&VV='+vil);
  }
  if(dep && dep!='na')
  {
  WaitForSelect('Tbl_Vil');
  document.getElementById('Tbl_Vil').innerHTML = file('http://www.3d-rencontre.com/search/scriptVil.php?PP='+pay+'&RR='+reg+'&DD='+dep+'&VV='+vil);
  }
}

function RegDepVil(pay,reg,dep,vil)
{
 if(pay==''){pay='france'}

 if(pay!='' && reg=='' && dep=='' && vil==''){var PRDV='P';}// Pays
 if(pay!='' && reg!='' && dep=='' && vil==''){var PRDV='PR';}// Pays Region
 if(pay!='' && reg!='' && dep!='' && vil==''){var PRDV='PRD';}// Pays Region Departement

  if(PRDV=='P')//Pays
  {
  document.formPRDV.PAYS2.value = pay;
  WaitForSelect('Tbl_Reg');
  document.getElementById('Tbl_Reg').innerHTML = file('http://www.3d-rencontre.com/search/scriptReg.php?PP='+pay+'&RR='+reg+'&DD='+dep+'&VV='+vil); 
  }
  if(PRDV=='PR')//Pays et Region
  {
  WaitForSelect('Tbl_Dep');
  document.getElementById('Tbl_Dep').innerHTML = file('http://www.3d-rencontre.com/search/scriptDep.php?PP='+pay+'&RR='+reg+'&DD='+dep+'&VV='+vil);
  }
  if(PRDV=='PRD')//Pays, Region et Departement ET REGION differente du DEPARTEMENT => Canada par exemple
  {
  WaitForSelect('Tbl_Vil');
  document.getElementById('Tbl_Vil').innerHTML = file('http://www.3d-rencontre.com/search/scriptVil.php?PP='+pay+'&RR='+reg+'&DD='+dep+'&VV='+vil);
  }
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////
  if(pay=='')
  {
  document.getElementById('Tbl_Reg').innerHTML = '';
  document.getElementById('Tbl_Dep').innerHTML = '';
  document.getElementById('Tbl_Vil').innerHTML = '';
  }
  if(reg=='')
  {
  document.getElementById('Tbl_Dep').innerHTML = '';
  document.getElementById('Tbl_Vil').innerHTML = '';
  }
  if(dep=='')
  {
  document.getElementById('Tbl_Vil').innerHTML = '';
  }
}
