// JavaScript Document

// Création de la base de données des messages
var tableauMsg = new Array(6);
tableauMsg[0]="<H1>Bonjour et bienvenue sur http://www.stinloches.com </H1>";
tableauMsg[1]="<H1>Traitement de surface des métaux </H1>";
tableauMsg[2]="<H1>Une question, un besoin particulier : www.stinloches.com </H1>";
tableauMsg[3]="<H1>LA QUALITE </H1>";
tableauMsg[4]="<H1>LE SERVICE </H1>";
tableauMsg[5]="<H1>Ne cherchez plus, votre réponse  est ici ! </H1>";
// COMPLETER LA BASE ICI
/*
function disp(txt) { document.write(txt) }
function InitMsg() {
	this.nb_item=0;
	this.Add=AddMsg;
	this.Aff=AffMsg;
}
function AddMsg(txt) {
	var nb = this.nb_item;
	this[nb]=txt;
	this.nb_item++;
}
function AffMsg() {
	var nb = this.nb_item;
	var no=Math.round(Math.random(1)*(nb-1));
	disp("<BIG>"+this[no]+"</BIG>");
}
//function reload() {
	//window.location=document.location;
//}
*/
function chargerBody(){ //Exécuté au chargement de la page
chargerMsg(2000);
}

var heure, delai, compteur,v;
function chargerMsg(delai1) {
var delaiRechargeMsg = 1;

var hhmmss = " ", min, sec,adate;
delai = delai1;

adate = new Date()
hhmmss += adate.getHours();
min = adate.getMinutes();
if (min < 10) hhmmss += ":0" + min;
else hhmmss += ":" + min;
sec = adate.getSeconds();
if (sec < 10) hhmmss += ":0" + sec;
else hhmmss += ":" + sec;
hhmmss = " " + hhmmss;
sec = adate.getSeconds();

if(document.formPage.fois.value==0){
document.formPage.fois.value=1;
//nomForm.vi.value=sec;
v=0;
}

v = v + 1;
heure = setTimeout("chargerMsg(delai)",delai1);

if(v>delaiRechargeMsg){
var numMsg = Math.round(Math.random(1)*(tableauMsg.length-1));
document.getElementById('divMessage').innerHTML = '';
document.getElementById('divMessage').innerHTML += tableauMsg[numMsg];
}
}

