/*
	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','002B','003C','004C','005D','006D','007E','008B','009F','010D','011D','012D','013E','014E','015E','016G','017C','018D','019D','020C','021B','022D','023D','024C','025C','026C','027C','028C','029D','030C','031C','032C','033D','034D','035D','036C','037D','038C','039C','040C','041C','042C','043C','044D','045C','046C','047C','048C','049C','050C','051C','052C','053C','054C','055C','056C','057E','058D','059C','060C','061C','062C','063D','064D','065D','066D','067C','068C','069D','070D','071C','072C','073C','074D','075C','076C','077D','078C','079D','080C','081C','082C','083C','084C','085D','086C','087C','088D','089D','090C','091C','092C','093D','094C','095D','096D','097C','098C','099D','100D','101C','102C','103C','104C','105C','106D','107C','108C','109C','110C','111C','112C','113C','114C','115C','116C','117D','118C','119D','120C','121C','122C','123C','124D','125C','126D','127C','128E','129E');

function ouvrepz(nompz){
	fermepz();
	t = base[Math.abs(nompz)].charAt(3);
	dimpz1(t);dimpz2(t);
	nompz = "./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 = 580;fenh = 308;fent = 226;	return;};
	if(t == 'C') {fenw = 608;fenh = 368;fent = 166;	return;};
	if(t == 'D') {fenw = 520;fenh = 488;fent = 0;	return;};
	if(t == 'E') {fenw = 520;fenh = 326;fent = 208;	return;};
	if(t == 'F') {fenw = 485;fenh = 489;fent = 0;	return;};
	if(t == 'G') {fenw = 520;fenh = 406;fent = 80;	return;};
}

function dimpz2(t){
	if(screen.width >= 1024) {
		if(t == 'A') {fent = 364;	return;};
		if(t == 'B') {fent = 318;	return;};
		if(t == 'C') {fent =  0;	return;};
		if(t == 'D') {fent = 160;	return;};
		if(t == 'E') {fent = 220;	return;};
		if(t == 'F') {fent = 160;	return;};
		if(t == 'G') {fent = 220;	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=0,left=0');
	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 droits(e) {
//return;
	if (document.layers && (e.which == 3 || e.which == 2)) {
		alert("Copyright © PuZzLeS - 2001/2005");
		return false;
		}
	else if (document.all && (event.button == 2 || event.button == 3)) {
		alert("Copyright © PuZzLeS - 2001/2005");
		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;
