// routine pour insérer le code pour nous écrire (anti-spam)
function NousEcrire () {
   var qui = "contact"; var ou = "harrydico.net";
   document.write('<a href=\"mailto:' + qui + '@' + ou + '\">');
   document.write(qui + '@' + ou + '</a>');
}

// routine pour insérer le code ajouter aux favoris
function MesFavoris (repertoire) {
   nav=navigator.appName.substring(0,3)
   if (nav=="Mic")
     {url_java="http://harrydico.net/";
      if (repertoire.length > 3) {url_java = url_java + repertoire + "/";};
      document.write('Ajouter<BR><A HREF=# onClick="window.external.AddFavorite(url_java,             \'HarryDico-dictionnaires\');return(false);">aux&nbsp;favoris</A><BR>')}
    else {document.write('<A HREF=# onClick=alert("Appuyez&nbsp;sur&nbsp;\'Ctrl\'&nbsp;+&nbsp;\'D\'&nbsp;pour&nbsp;ajouter&nbsp;HarryDico&nbsp;à&nbsp;vos&nbsp;favoris&nbsp;!")>Ajoutez aux favoris</A><BR>')
    }
}

// routine pour écrire et lire des cookies
//
// SetCookie=fonction de base monCookie=idem avec paramètres "domain" et "expire"
// getCookieVal=fonction de base GetCookie=lecture d'un paramètre
//
// ici(abrev) incrémente le nombre de visite sur une page (I:Index i:index I_i=index du site)
// (T=pourTous P=propres C=communs B=bilingue A=atelier E=ecrire)
//

function SetCookie (name, value) {
	var argv=SetCookie.arguments;
	var argc=SetCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=name+"="+escape(value)+
		((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
		((path==null) ? "" : ("; path="+path))+
		((domain==null) ? "" : ("; domain="+domain))+
		((secure==true) ? "; secure" : "");
}

function monCookie (name, value) {
	var pathname=location.pathname;
	var myDomain=pathname.substring(0,pathname.lastIndexOf('/')) +'/';
	var date_exp = new Date();
	date_exp.setTime(date_exp.getTime()+(365*24*3600*1000));
	// Ici on définit une durée de vie de 365 jours
	SetCookie(name,value,date_exp,myDomain);
}

//  exemple : monCookie("prenom","Marc");
// enregistre la valeur Marc pour le paramètre prenom


function getCookieVal(offset) {
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1)
      		endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
	var arg=name+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen) {
		var j=i+alen;
		if (document.cookie.substring(i, j)==arg)
                        return getCookieVal (j);
                i=document.cookie.indexOf(" ",i)+1;
                        if (i==0) break;}
	return null;
}

function ici(abrev) {
	var nomb = GetCookie(abrev);
	if(nomb == null) { monCookie(abrev,'1');}
	else { nomb++; monCookie(abrev,nomb);}
}

// exemple : ici('I_i'); var nomb = GetCookie('I_i');
// document.write("<BR>nombre de visite de la page d'accueil du site ="+nomb);




function afficherPourtous(numero) {
    if (numero.length == 4 ) {

    this.fenetre = window.open("", "PotterPourTous", "width=575,height=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
    this.fenetre.focus(); this.fenetre.document.open();
    var chemin = '<IMG SRC="../pourtous/';
    var temp= '<HTML>\n<HEAD>\n<TITLE>HarryDico : popup du dictionnaire Potter pour tous</TITLE>\n'
    	temp= temp+'<script src="../noclic.js" type="text/javascript"></script>\n';
    	temp= temp+'<meta http-equiv="imagetoolbar" content="no">\n</HEAD>\n';
    	temp= temp+'<body OnLoad="compt=setTimeout('+"'self.close();'"+',20000)" \n';
    	temp= temp+'marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">\n' ;
    	temp= temp+'<TABLE WIDTH="575" BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR>\n'
		temp= temp+'\t<TD>'+chemin+'decor_haut.png" WIDTH="575" HEIGHT="65"></TD>';
		temp= temp+'</TR><TR>\n\t<TD><A HREF="javascript:window.close()">';
		temp= temp+chemin+'decor_gauche.png" WIDTH="20" HEIGHT="420" BORDER="0">';
		temp= temp+chemin+'img000.png" WIDTH="250" BORDER="0">';
		temp= temp+chemin+'centre.png" WIDTH="20" HEIGHT="420" BORDER="0">';
		temp= temp+'<IMG SRC="http://perso.wanadoo.fr/harrydico/gif/img'+numero+'.gif" WIDTH="260" BORDER="0">';
		temp= temp+chemin+'decor_droite.png" WIDTH="25" HEIGHT="420" BORDER="0"><BR>';
		temp= temp+chemin+'decor_bas.png" WIDTH="575" HEIGHT="20" BORDER="0"></A>';
		temp= temp+'</TD></TR>\n</TABLE>\n</BODY>\n</HTML>';
    this.fenetre.document.write(temp);
    this.fenetre.document.close();
} else {document.write("erreur de fenetre : numero="+numero);}
}




// No rightclick script v.2.5
// (c) 1998 barts1000
// barts1000@aol.com
// Don't delete this header!

	var message="      Ne copiez pas mon travail! \n             mettez plutôt des liens !\n Allez voir la page atelier depuis l'accueil\n    mon code HTML y est commenté ;-))\n\n          © 2003-2004 Harrydico";

// Don't edit below!

function click(e) {
	if (document.all) {
		if (event.button == 2) {
			alert(message);
			return false;
			}
		}
	if (document.layers) {
		if (e.which == 3) {
			alert(message);
			return false;
			}
		}
	}
if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
	}
document.onmousedown=click;

