// fonction qui permet de ne pas ouvrir une page si elle n'est pas dans la frame prévue pour elle
function verifierCadre() {
  if (top != self)
      top.location=self.location;
}

function verifierCadreOld() {
   if (top == self)
	{
	var chaine =new String(self.location);
	var decoupe = chaine.split('/');
	chaine = decoupe[decoupe.length - 1];
	top.location="index.htm?"+chaine;
	}
}

function verifierCadre2(rep) {
   if (top == self)
	{
	var chaine =new String(self.location);
	var decoupe = chaine.split('/');
	chaine = decoupe[decoupe.length - 1];
	top.location="../index.htm?"+rep+"/"+chaine;
	}
}

function changeEspace(chaine)
{
var i,j
i= chaine.indexOf("%20")
if ( i>=0)
{	chaine = chaine.substring(0,i)+" "+chaine.substring(i+3)
	chaine = changeEspace(chaine)
}
return chaine
}

function stat(){
doc = document; d = new Date(); res = screen.width+"x"+screen.height; c = screen.colorDepth;
src = 'http://www.dechorgnat.net/phpmyvisites/phpmyvisites.php?url='+escape(doc.location.pathname+doc.location.search); src += '&site=2&res='+res;
src += '&siteh='+doc.location.hostname+'&c='+c+'&h='+d.getHours()+'&m='+d.getMinutes()+'&s='+d.getSeconds();
doc.writeln('<img border="0" heigh=1 width=1 alt="Stats by phpMyVisites" src="'+src+'&ref='+escape(doc.referrer)+'" />');
}

function getParameter(nom)
{
        var i,k;
        nom+="=";

        i=location.search.indexOf(nom);
        if( i>=0 )
        {
                k=location.search.indexOf("=",i);
                i=location.search.indexOf("&",k);
                if( i<=0 ) i=location.search.length;
                return changeEspace(location.search.substring(k+1,i));
        }
        else return "";
}

function RandomBackground(images,btags)
{
/* Generation d'un tag body avec image de fond aleatoire
** si: start index
** i: current index
** ei: end index
** cc: current count
*/
 si=0;
 ci=0;
 cc=0;
 imageSet = new Array();
 ei = images.length;
  for (i=1;i<ei;i++) {
    if (images.charAt(i) == ' ' || images.charAt(i) == ',') {
      imageSet[cc] = images.substring(si,i);
      cc++;
      si=i+1;
      }
    }
  ind = Math.floor(Math.random() *cc);
  document.writeln("<body style='"+btags+" background-image: url(../images/bandeaux/"+imageSet[ind]+")'>");
}

function imgover(nom)
{
nom.src="../images/puce.gif"
return
}


function imgout(nom)
{
nom.src="../images/pucebleue.gif"
return
}

//
function OuvrirImage(nom , titre)
{ var lnom=nom;
var ltitre=titre;
var TexteStatus="Cliquez sur l\\\'image pour fermer la fenetre";
var win1 = window.open("","lnom", "nostatus,noscrollbars,noresizable,height=400,width=580");
   win1.document.open();
   win1.document.write('<HEAD><TITLE>'+ltitre+'</TITLE>');
   win1.document.write('<LINK REL=stylesheet TYPE=\"text/css\" TITLE=\"st-malo\" HREF=\"../stmalo.css\">');
   win1.document.write('</HEAD>');
   win1.document.write('<BODY background=\"../images/fondpap.gif\" onBlur=self.close() >');
   win1.document.write('<TABLE height=100% width=100%><TR><TD valign=\"middle\" align=\"center\">');
   win1.document.write('<A HREF=\"javascript:window.close()\"'+' onMouseOver=\"window.status=\''+TexteStatus+'\'; return true\">');
   win1.document.write('<IMG src=\"../'+lnom +'\" border=0 alt=\"Cliquer pour fermer\">');
   win1.document.write('</A>'+'</TD></TR><TR><TD><h3 align=center>'+ltitre+'</h3></TD></TR></TABLE></BODY>');
   win1.document.close();
   win1.status="Cliquez sur l\'image pour fermer la fenetre";
return;
}

//
function fermer() {
window.close()
}

function cacher_lien_mel(splitString) {
                document.write("<a href=\"mai");
                document.write("lto:");
                document.write(splitString);
                document.write("@dechor");
                document.write("gnat.net\">");
        }

function cacher_adr_mel(splitString) {
                document.write(splitString);
                document.write("@dechor");
                document.write("gnat.net");
        }

function cacher_adr_mel_formu(splitString) {
		document.write("<INPUT TYPE=\"HIDDEN\" NAME=\"email\" VALUE=\"");
                document.write(splitString);
                document.write("@dechor");
                document.write("gnat.net");
                document.write("\">");
        }



function updateImage(image,url,textalt){
  document[image].src = url ;
  document[image].alt = textalt ;
  document[image].title = textalt ;
  return;
}

function updateImage(image,url){
  document[image].src = url ;
  return;
}

function updateTexte(elementAchanger,texte){
  document.getElementById(elementAchanger).innerHTML = texte;
  return;
}