/* Informations relatives au navigateur */

var NS4 = (document.layers); // vous ai-je déjà dit que c'était une grosse bouse ?
var IE4 = (document.all);

/* Virer les frames disgracieuses */
// if (top.location != self.location) { top.location = self.location; }
// (désactivé dans la version de transition 8ème -> 9ème édition)

/* Gère le contour du haut */

function AffichePos()
{
	if (IE4)
	{
		document.all.contour.style.display = "none";
		document.all.navi.style.display = "block";
		setTimeout ("CachePos();", 2000);
	}
	
	if (NS4)
	{
		document.layers.contour.visibility = "HIDE";
		setTimeout ("CachePos();", 2000);
	}
}

function CachePos()

{
	if (IE4)
	{
		document.all.contour.style.display = 'block'; 
		document.all.navi.style.display = 'none';
	}
	
	if (NS4)
	{
		document.layers.contour.visibility = "SHOW";
	}
	
}

function alertImg()
{ alert("Oups! Erreur JavaScript !\nEssayez de recharger cette page, SVP."); }


function FaireContour(coul,root)
{
if (!coul) { coul = ''; }

	if (IE4) {
	document.write('<div id="contour" onMouseOver="AffichePos();" style="display:none;z-index:0;position:absolute;left:0;top:0;height:46">');
	document.write('<img onError="alertImg();" style="filter:Alpha(startX=0,startY=23,finishX=30,finishY=23,Opacity=100,FinishOpacity=20,Style=1);" height="100%" width="100%" src="' + root + 'images/contour' + coul +'.gif">');
	document.write('</div>');
	window.onresize=ms_contour_resize;
	window.onload=ms_contour_resize;
	}

	if (NS4) {
	document.write('<LAYER onMouseOver="AffichePos();" WIDTH="100%" HEIGHT="46" NAME="contour"><IMG onError="alertImg();" WIDTH="100%" HEIGHT="46" SRC="' + root + 'images/contour' + coul +'.gif"></LAYER>');
	contour=document.layers.contour;
	contour.top=0;
	contour.left=0;
	origWidth = innerWidth;
	window.onresize = ns_contour_resize;
	}
}


// MSIE 4
function ms_contour_resize()
{
	document.all.contour.style.width = document.body.clientWidth;
	document.all.contour.style.display = "block";
	if (document.all.navi) document.all.navi.style.display="none";
}


// NS 4
function ns_contour_resize()
{
	if ((innerWidth != origWidth)) // JE HAIS NETSCAPE !!!!
	{
		origWidth = innerWidth;
		// window.location.reload(); (Tant pis. Ca prenait trop de temps de tout recharger)
	    document.layers.contour.visibility = "HIDE" // A la place, on efface tout et on oublie.
	    document.layers.contour.top = -46
	}
}
