/*
	Pas mal, non ? Ben si, dites-le !
	Tout imaginé avec mes cellules grises et écrit de mes blanches mains !

	Au fait... qu'est-ce qui vous manque à vous ?

	Mais vous êtes ici pour me féliciter ? C'est autre chose !
	N'hésitez pas, voici mon adresse : puzzles@puzzles-fr.com
	Alors, chiche, vous m'encouragez ?! Sympa !

	PS: si je ne reçois rien... que devrais-je conclure ? :-)))))

	Conception : novembre 1998 (par http://perso.wanadoo.fr/vagabond/)
	Actualisation et modifications : http://puzzles-fr.com/, décembre 2000, février 2001
*/
window.onerror = isErr;
function isErr(){return true;}

window.status="PuZzLeS, le site des puzzles et casse-tête";

var fenpuzzles = false;
var base = new initArray('000A','001A','002A','003B','004B','005D','006C','007F','008G','009H','010I','011B','012B','013B','014B','015B','016B','017B','018B','019C','020C','021C','022C','023B','024B','025C','026B','027C','028C','029B','030C','031J','032K','033L','034L','035B','036C','037B','038M','039M','040K','041B','042B','043B','044N','045O','046P','047Q','048O','049O','050R','051S','052T','053B','054C','055C','056C','057C','058C','059B','060O','061O','062C','063K','064S','065S','066C','067B','068C','069C','070B','071U','072B','073T','074C','075V','076T','077C','078B','079L','080O','081B','082J','083O','084C','085B','086C','087V','088C','089W','090W','091B','092V','093C','094C','095C','096C','097C','098R','099C','100I','101B','102J','103C','104B','105C','106B','107B','108V','109T','110C','111C','112C','113B','114K','115B','116C','117C','118C','119K','120K','121K','122C','123B','124K','125B','126B','127K','128C','129B','130K','131K','132C','133C','134T','135S','136T','137B','138C','139C','140H','141X','142K','143K','144C','145B','146B','147C','148C','149C','150C','151C','152B','153O','154C','155C','156C','157C','158C','159C','160B','161B','162B','163K','164C','165C','166B','167C','168C','169B','170U','171C','172V','173F','174B','175C','176K','177B','178T','179B','180C','181B','182C','183B','184B','185B','186C','187C','188B','189C','190R','191C','192C','193C','194C','195L','196C','197U','198C','199C','200B','201C','202C','203C','204C','205C','206C','207C','208O','209L','210L','211C','212C','213C','214B','215B','216B','217C','218B','219C','220B','221O','222C','223R','224C','225B','226O','227R','228C','229C','230B','231B','232C','233C','234C','235R','236B','237C','238C','239O','240R','241C','242C','243T','244C','245N','246B','247T','248K','249K','250B','251C','252C','253B','254K','255K','256K','257C','258K','259L','260B','261C','262B','263C','264C','265O','266C','267B','268K','269T','270C','271R','272Y','273R','274C','275C','276C','277B','278K','279C','280B','281C','282B','283C','284C','285K','286C','287T','288I','289C','290C','291B','292C','293B','294C','295C','296C','297C','298B','299K','300I','301C','302T','303C','304C','305B','306C','307B','308T','309C','310C','311B','312C','313C','314O','315B','316K','317K','318B','319C','320C','321C','322O','323K','324B','325K','326K','327B','328C','329C','330C','331C','332B','333R','334B','335B','336K','337B','338C','339V','340K','341V','342V','343T','344B','345C','346C','347B','348B','349C','350C','351K','352C','353O','354C','355B','356C','357C','358B','359C','360B','361B','362B','363V','364V','365B','366C','367K','368B','369B','370C','371B','372C','373T','374T','375T','376I','377C','378B','379T','380K','381K','382T','383C','384K','385O','386B','387K','388C','389B','390V','391K','392K','393K','394K','395K','396K','397B','398B','399C','400I','401K','402K','403B','404T','405C','406C','407C','408C','409T','410B','411K','412B','413C','414R','415K','416C','417C','418C','419Q','420T','421C','422B','423N','424K','425B','426K','427B','428K','429B','430K','431K','432K','433K','434B','435K','436C','437C','438K','439B','440C','441B','442K','443K','444C','445K','446K','447C','448C','449K','450B','451K','452K','453B','454C','455C','456K','457T','458C','459C','460K','461B','462K','463B','464V','465B','466B','467B','468C','469T','470T','471C','472C','473K','474K','475C','476B','477B','478C','479B','480K','481C','482B','483C','484C','485B','486K','487B','488C','489W','490K','491B','492C','493M','494M','495K','496K','497K','498B','499B','500C','501B','502C','503B','504B','505K','506B','507C','508O','509T','510C');

function ouvrepz(nompz){
	fermepz();
	t = base[Math.abs(nompz)].charAt(3);
	dimpz1(t);dimpz2(t);
	nompz = "./Jeux/Puzzle" + nompz +"/pzpuzzle.html";
	fenp = window.open(nompz, 'Puzzle', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+fenw+',height='+fenh+',top='+fent+',left=0');
	fenpuzzles = true;
	type = t;
}

function dimpz1(t){
	if(t == 'A') {fenw = 628;fenh = 327;fent = 208;	return;};
	if(t == 'B') {fenw = 640;fenh = 393;fent = 142;	return;};
	if(t == 'C') {fenw = 634;fenh = 388;fent = 147;	return;};
	if(t == 'D') {fenw = 494;fenh = 416;fent = 100;	return;};
	if(t == 'E') {fenw = 650;fenh = 371;fent = 162;	return;};
	if(t == 'F') {fenw = 526;fenh = 560;fent = 0;	return;};
	if(t == 'G') {fenw = 526;fenh = 409;fent = 50;	return;};
	if(t == 'H') {fenw = 638;fenh = 406;fent = 0;	return;};
	if(t == 'I') {fenw = 722;fenh = 381;fent = 154;	return;};
	if(t == 'J') {fenw = 526;fenh = 461;fent = 50;	return;};
	if(t == 'K') {fenw = 608;fenh = 368;fent = 168;	return;};
	if(t == 'L') {fenw = 675;fenh = 451;fent = 84;	return;};
	if(t == 'M') {fenw = 526;fenh = 511;fent = 20;	return;};
	if(t == 'N') {fenw = 608;fenh = 368;fent = 168;	return;};
	if(t == 'O') {fenw = 634;fenh = 388;fent = 147;	return;};
	if(t == 'P') {fenw = 520;fenh = 398;fent = 0;	return;};
	if(t == 'Q') {fenw = 466;fenh = 394;fent = 100;	return;};
	if(t == 'R') {fenw = 640;fenh = 393;fent = 142;	return;};
	if(t == 'S') {fenw = 450;fenh = 491;fent = 0;	return;};
	if(t == 'T') {fenw = 485;fenh = 489;fent = 0;	return;};
	if(t == 'U') {fenw = 638;fenh = 406;fent = 0;	return;};
	if(t == 'V') {fenw = 520;fenh = 486;fent = 0;	return;};
	if(t == 'W') {fenw = 608;fenh = 490;fent = 0;	return;};
	if(t == 'X') {fenw = 492;fenh = 330;fent = 206;	return;};
	if(t == 'Y') {fenw = 526;fenh = 409;fent = 50;	return;};
	if(t == '#') {fenw = 512;fenh = 491;fent = 0;	return;};
	if(t == '1') {fenw = 675;fenh = 368;fent = 167;	return;};
}

function dimpz2(t){
	if(screen.width >= 1024) {
		if(t == 'A') {fent = 358;	return;};
		if(t == 'B') {fent = 310;	return;};
		if(t == 'C') {fent = 314;	return;};
		if(t == 'D') {fent = 100;	return;};
		if(t == 'E') {fent = 332;	return;};
		if(t == 'F') {fent =  80;	return;};
		if(t == 'G') {fent = 100;	return;};
		if(t == 'H') {fent =   0;	return;};
		if(t == 'I') {fent = 322;	return;};
		if(t == 'J') {fent = 100;	return;};
		if(t == 'K') {fent =  0;	return;};
		if(t == 'L') {fent =  0;	return;};
		if(t == 'M') {fent = 100;	return;};
		if(t == 'N') {fent =  0;	return;};
		if(t == 'O') {fent = 315;	return;};
		if(t == 'P') {fent = 150;	return;};
		if(t == 'Q') {fent = 100;	return;};
		if(t == 'R') {fent = 310;	return;};
		if(t == 'S') {fent =  80;	return;};
		if(t == 'T') {fent = 160;	return;};
		if(t == 'U') {fent =   0;	return;};
		if(t == 'V') {fent = 160;	return;};
		if(t == 'W') {fent =  0;	return;};
//		if(t == 'X') {fent = 214;	return;}; identique à 640x480
		if(t == 'Y') {fent = 100;	return;};
		if(t == '#') {fent = 160;	return;};
		if(t == '1') {fent = 336;	return;};
	}
}

function fermepz(){
	if(fenpuzzles == true) fenp.close();
}

function scores(num){
	var w = 210;var h = 240;
	fen1 = window.open('./Scores/pzscores'+num+'.html', 'Scores', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width='+w+',height='+h+',top=150,left=155');
	fen1.window.focus();
}

function makeArray(xx) {
   this.length = xx;
   return this;
}

function initArray() {
   this.length = initArray.arguments.length;
   for (i = 0; i < this.length; i++)
	   this[i] = initArray.arguments[i];
}

function randnum(mini, maxi){
	var retval = -1;
	while (retval < mini) 
		retval = Math.round(Math.random() * maxi);
	return retval;
}

function clef () {
	now = new Date();
	return parseInt(Math.abs(Math.sin(now.getTime())) * 100);
}

function categories(){
	alert("Les catégories de joueurs :\n\n«Joueurs» :\nCas général de tous les joueurs qui homologuent des scores et n'entrent pas dans une des deux catégories ci-après. Ils participent aux Classements et aux Palmarès des «Stars» mais ont en propre leurs Classements et leurs Palmarès distincts qui leurs sont réservés.\n\n«Stars» :\nTous joueurs ayant atteint 100 records ou plus dans le Palmarès «Moindre coups» ou 50 dans un des deux autres. Ils ne prennent plus part aux Classements et Palmarès des «Joueurs».\n\n«Inactifs» :\nJoueurs n'ayant eu aucune activité depuis plus de 12 mois. Leurs scores sont conservés mais ne sont plus ni mentionnés, ni pris en compte dans les Classements et les Palmarès. Leur réintégration est automatique en cas de reprise des jeux.")
}

function affConseils(){
	if(document.all) document.all.conseils.style.visibility='visible'
	else document.conseils.visibility='show'
	l = (self.innerWidth ? self.innerWidth : document.body.clientWidth);l = (l/2)-220;
	if((navigator.appName=="Netscape") && (parseInt(navigator.appVersion) == 4))
		document.conseils.left = l;
	else	document.getElementById("conseils").style.left = l;
}

function fermeConseils(){
	if(document.all) document.all.conseils.style.visibility='hidden'
	else document.conseils.visibility='hide'
}

function droits(e) {
	if (document.layers && (e.which == 3 || e.which == 2)) {
		alert("Copyright © PuZzLeS - 2001/2007");
		return false;
		}
	else if (document.all) return false;
	else return true;
}

function p(){if(document.all) if(document.body.clientHeight>560) self.close();}

if (document.layers) {
	window.captureEvents(Event.MOUSEDOWN);
	document.onmousedown	= droits;
	window.onmousedown	= droits;
}
document.oncontextmenu	= droits;
document.onselectstart	= droits;
