//© Lionel Duval : fonctions javascript le Pagicien pour  IE4 ou + 
var charge = false;
var oldlientxt;
var oldlienimg;
var journal;

function init(){
	charge = true;
}

function survol(lson){
	if(charge){
		if (lson != ''){
			document.all.sonclic.src = lson;
		}
	}
}

function effacelien(){
	if (oldlientxt != null){oldlientxt.visibility = 'hidden';}
	if (oldlienimg != null){oldlienimg.visibility = 'hidden';}
}

function versjournal1(){
	document.URL = journal + "_pghtm/index.htm";
}
function versjournal2(){
	document.URL = journal + ".pghtm/index.htm";
}

function activelien(lpage,lson,limg,lvideo,ltxt,lquit,lexe,lplug){
if (charge){
	if (lplug != ''){document.URL = lplug;}

	if (lexe != 'rien'){
		if (lexe.substr(0,4)=='http'){
			window.open(lexe);
		} else {
			if (lexe.substr(0,3)=="../"){
				journal = lexe;
				test = new Image;
				test.onerror = versjournal1;
				test.onload = versjournal2;
				test.src = lexe +".pghtm/pagiht.gif";
				return;
			} else {
				document.URL = lexe;
			}
		}
	}

	if (lson != ''){
		document.all.sonclic.src = lson;
	}

	if (ltxt != null){
		ltxt.visibility = 'visible';
		ltxt.zIndex = '5';
		oldlientxt = ltxt;
	}

	if (limg != null){
		limg.visibility = 'visible';
		limg.zIndex = '5';
		oldlienimg = limg;
	}

	if (lvideo != ''){
		document.URL = lvideo;
	}

	if (lquit != 'non'){window.close();}
	if (lpage != 'rien'){if(lpage == 'retour'){window.history.go(-1);}else{document.URL = lpage;}}

}
}

function goanim(objet,lson){
if (charge){
	if (lson != ''){
		document.all.sonclic.src = lson;
	}
	anime(objet);
}}

function anime(objet){
	if (objet.stop ){
		objet.stop = false;
	} else {
		var qui = objet.monnom;
		objet.nb++;
		if (objet.nb > objet.nbimg){
			if (objet.loop != 0){objet.nb = 0;} else {objet.nb--;}
		}
		objet.ref.src = objet.img[objet.nb].src;
		setTimeout("anime("+qui+")" ,objet.tempo);
	}	
}

function raz(objet){
	objet.stop = true;
	objet.nb = 0;
	objet.ref.src = objet.img[0].src;
}