var fois=0

function twZero(_nbr) { return (_nbr < 10) ? '0' + _nbr : _nbr; }

Date.prototype.twHeure=function (_langage){
  // Script gratuit des Trucsweb
  // Sous licence Apache
  // Laisser cette remarque s.v.p.
  var sHeures = twZero(this.getHours());
  var sMinutes = twZero(this.getMinutes());
  var sSecondes = twZero(this.getSeconds());
  var sTemp = "";
  switch (_langage.toLowerCase()) {
    case "fr" : sTemp = sHeures + ':' + sMinutes + ':' + sSecondes; break;
    case "es" : sTemp = sHeures + '.' + sMinutes + ':' + sSecondes; break;
    default : sTemp = sHeures + ':' + sMinutes + ':' + sSecondes;
  }
  return sTemp;
}

function twAffHeure() {
  var dDate = new Date();
  document.getElementById("heure").innerHTML = dDate.twHeure('fr');
  oDelais = setTimeout("twAffHeure()",1000);
}


function DerniereMiseAJour()
{
date = document.lastModified;
jour = date.charAt(3)+date.charAt(4);
mois = date.charAt(0)+date.charAt(1);
an = date.charAt(6)+date.charAt(7)+date.charAt(8)+date.charAt(9);
document.write("Dernière mise à jour le ",jour,"/",mois,"/",an);
}

function AffichePhoto(adresseImage,titreFenetre,gWidth,gHeight)
{
newImage = new Image;
newImage.src = adresseImage;
if (navigator.appName == "Microsoft Internet Explorer" )
{ iLargeur = gWidth+10;
  iHauteur = gHeight+35;
}
else

{//*1.02
iLargeur = gWidth+10;
iHauteur = gHeight+62;
}
if ((screen.width > iLargeur) && (screen.height > iHauteur))
{ iPlaceHorizontale =  (screen.width - iLargeur)/2;
  iPlaceVerticale = (screen.height - iHauteur)/2;
}
else
{ iPlaceHorizontale = 0;
  iPlaceVerticale = 0;
}

if (titreFenetre=="undefined" || titreFenetre=="") { titreFenetre="Popup Image"};
html = '<HTML><HEAD><TITLE>'+titreFenetre+'</TITLE><meta http-equiv="Pragma" content="no-cache"></HEAD>'+
'<BODY leftmargin=0 marginwidth=0 topmargin=0 marginheigth=0 oncontextmenu="return false">'+
'<a href="#" onClick="window.close()" TITLE="Cliquez sur l\'image pour fermer cette fenêtre" ALT="Cliquez sur l\'image pour fermer cette fenêtre" />'+
'<IMG SRC="'+adresseImage+'" name="imageEnCours" border="0"';

html = html + ' onLoad="window.resizeTo('+iLargeur+','+iHauteur+');';
html = html + ' window.moveTo('+iPlaceHorizontale+','+iPlaceVerticale+')">';

html = html+'</a></BODY></HTML>';

if (fois == 1 ) ouvrirImage.close();
ouvrirImage = window.open('','_blank','width='+iLargeur+', height='+iHauteur+', toolbar=0, location=0, menubar=0, scrollbars=0, resizable=0, directories=0, status=0');
ouvrirImage.document.write(html);
fois=1;
}

function AgrandirImage(vignette,photo,pWidth,pHeight,title_fen)
{
document.write('<A HREF="javascript:AffichePhoto(\''+photo+'\',\''+title_fen+'\','+pWidth+','+pHeight+')"><IMG SRC="'+vignette+'" HSPACE=0 VSPACE=0 BORDER=0 TITLE="Cliquez sur l\'image pour l\'afficher en grand" ALT=Cliquez sur l\'image pour l\'afficher en grand" /></A>');
//Rappel : 'Nom de chaine' mais nombre (pas de ')
}

function addslashes(str) {
str=str.replace(/\'/g,'\'');
l=str.length;
l=l-1;
if (str.charAt(l)!='/'){str=str+'/';}
return str;
}

function showImage(dir,ext,nb){
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.
for (iloc = 0; iloc < nb; iloc++){
		jloc=iloc+1	
		theImages[iloc] = addslashes(dir)+jloc+'.'+ext}
// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
	}
var whichImage = Math.round(Math.random()*(p-1));

document.write('<img src="'+theImages[whichImage]+'">');
}

