var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
                parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;
var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.")) >= 0 ? 1 : 0;

var pwd ='ripaillons';
//Veiller à écrire un nombre de messages au moins égal au nombre de tentatives.
var NbTentatives=5;
var Compteur=0;
var TabMessages= new Array(
'Raté! rejoue encore une fois',
'Encore raté! veux-tu rejouer?',
'Ah, pas de chance, mais tu peux réessayer',
'Ooooh, sais-tu que tout n\'est pas le fruit du hasard?',
'zeroi slk ze sk zpero ksdfmlk!!!'
);

function VerifPWD() {
	if (document.form1.textfield2.value==pwd){
		window.location='../private.htm';
	} else {
		if (Compteur==NbTentatives) {
			window.location='index.htm';
		}else{
			alert(TabMessages[Compteur]);
			Compteur+=1;
		}
	}
}

function getWindowWidth() {
var ww = 0;
if (self.innerWidth)
	ww = self.innerWidth;
else if (document.documentElement && document.documentElement.clientWidth)
	ww = document.documentElement.clientWidth;
else if (document.body)
	ww = document.body.clientWidth;
return ww;
}//getWindowWidth()

function getWindowHeight() {
var wh = 0;
if (self.innerHeight)
	wh = self.innerHeight;
else if (document.documentElement && document.documentElement.clientHeight)
	wh = document.documentElement.clientHeight;
else if (document.body)
	wh = document.body.clientHeight;
return wh;
}//getWindowWidth()


//function getWindowWidth() {
//  if (isMinNS4)
//    return(window.innerWidth);
//  if (isMinIE4)
//    return(document.body.clientWidth);
//  return(-1);
//}

function getPageWidth() {
  if (isMinNS4)
    return(document.width);
  if (isMinIE4)
    return(document.body.scrollWidth);
  return(-1);
}

function PosTampon() {
	return(getWindowWidth()/2-150)
}
function PosToiMeme() {
	return(getWindowWidth()/2+220)
}

