window.onresize = function() {
	PiedDePage() ;
}

function high(which2)
{
	theobject=which2
	highlighting=setInterval("highlightit(theobject)",50)
}

function low(which2)
{
	clearInterval(highlighting)
	which2.filters.alpha.opacity=60
}

function highlightit(cur2)
{
	if (cur2.filters.alpha.opacity<100)	cur2.filters.alpha.opacity+=5
	else if (window.highlighting)		clearInterval(highlighting)
}

function OuvreFenetre(url, largeur, hauteur)
{
        // -- Dimensions du browser (taille et modification)--
        win_opt = "width=" + largeur ;
        win_opt += ",height=" + hauteur ;
        win_opt += ",Resizable=0" ;
        win_opt += ",Left=200" ;
        win_opt += ",Top=100" ;
        // -- Outils du browser --
        win_opt += ",Menubar=0";
        win_opt += ",Toolbar=0";
        win_opt += ",Location=0";
        win_opt += ",Directories=0";
        win_opt += ",Status=1";
        // -- divers options --
        win_opt += ",Scrollbars=2";
        win_opt += ",Copyhistory=0";

        fenetre = window.open(url, 'supp', win_opt);
}

function cacher(laLayer)
{
  var NS = (navigator.appName == 'Netscape');

	if (NS){
		document.layers[laLayer].visibility='hide';
	}

	if (!NS){
		document.all[laLayer].style.visibility='hidden';
	}
}

function montrer_haut(laLayer,x,y,e)
{
  var NS = (navigator.appName == 'Netscape');

	if (NS){
		var mouseX = e.pageX+x;
		var mouseY = e.pageY+y;
		document.layers[laLayer].top=mouseY;
		document.layers[laLayer].left=mouseX;
		document.layers[laLayer].visibility='show';
	}

	if (!NS){
		var mouseX = event.clientX+document.body.scrollLeft+x+40;
		var mouseY = event.clientY+document.body.scrollTop+y+60;
		document.all[laLayer].style.top=mouseY;
		if (mouseX>450)
			{
			document.all[laLayer].style.left=450;
			}
		else
			{
			document.all[laLayer].style.left=mouseX;
			}
		document.all[laLayer].style.visibility='visible';
	}
}

function montrer(laLayer,x,y,e)
{
  var NS = (navigator.appName == 'Netscape');

	if (NS){
		for (var i = 0; i < document.layers.length; i++){
			document.layers[i].visibility='hide';
		}
		var mouseX = e.pageX+x;
		var mouseY = e.pageY+y;
		document.layers[laLayer].top=mouseY;
		document.layers[laLayer].left=mouseX;
		document.layers[laLayer].visibility='show';
	}
	if (!NS){
		var mouseX = event.clientX+document.body.scrollLeft+x;
		var mouseY = event.clientY+document.body.scrollTop+y;
		document.all[laLayer].style.top=mouseY;
		document.all[laLayer].style.left=mouseX;
		document.all[laLayer].style.visibility='visible';
	}
}
function ListeDeroul(Formulaire)
// redirection automatique apres choix dans une liste déroulante
{
document.forms[Formulaire].submit()
}

function fenetre(nom, url, largeur, hauteur)
{
        // -- Dimensions du browser (taille et modification)--
        win_opt = "width=" + largeur ;
        win_opt += ",height=" + hauteur ;
        win_opt += ",Resizable=0" ;
        win_opt += ",Left=200" ;
        win_opt += ",Top=100" ;
        // -- Outils du browser --
        win_opt += ",Menubar=1";
        win_opt += ",Toolbar=1";
        win_opt += ",Location=0";
        win_opt += ",Directories=0";
        win_opt += ",Status=1";
        // -- divers options --
        win_opt += ",Scrollbars=2";
        win_opt += ",Copyhistory=0";

        window.open(url, nom, win_opt);
}

function fenetre_visible(nom, url, largeur, hauteur)
{
        // -- Dimensions du browser (taille et modification)--
        win_opt = "width=" + largeur ;
        win_opt += ",height=" + hauteur ;
        win_opt += ",Resizable=0" ;
        win_opt += ",Left=200" ;
        win_opt += ",Top=100" ;
        // -- Outils du browser --
        win_opt += ",Menubar=yes";
        win_opt += ",Toolbar=1";
        win_opt += ",Location=yes";
        win_opt += ",Directories=0";
        win_opt += ",Status=1";
        // -- divers options --
        win_opt += ",Scrollbars=2";
        win_opt += ",Copyhistory=0";

        nom=window.open(url, "toto", win_opt);
  	nom.document.close();
	nom.focus();
//	nom.reload();
}

function MM_showHideLayers()
{ //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null)
	{
	v=args[i+2];
    	if (obj.style)
		{
		obj=obj.style;
		v=(v=='show')?'visible':(v='hide')?'hidden':v;
		}
    	obj.visibility=v;
	}
}

function MM_findObj(n, d)
{ //v3.0
var p,i,x;
if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length)
	{
    	d=parent.frames[n.substring(p+1)].document;
	n=n.substring(0,p);
	}
if(!(x=d[n])&&d.all) x=d.all[n];
for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
return x;
}

// faire défiler le menu vers le haut
function setVariables(defil, band, centr)
{
y = "document.body.scrollTop";
z = "document.body.clientWidth";
iH = "document.body.clientHeight";

xyz = 500;
innerY = eval(iH) - 150;
ystart = eval(y);
YposMenu = menu.style.pixelTop;
if ((band=="oui"))
       	{
        YposMenu =YposMenu + Bandeau.height;
        }
}
movey = 0;
ydiff = 0;
ystart = 0;

function checkLocation(defil, band, centr)
{
if (band=='oui') HauteurLimite = document.body.offsetHeight -110 - menuhaut.height - Bandeau.height
else HauteurLimite = document.body.offsetHeight -110 - menuhaut.height;

if (document.test.height < HauteurLimite) nav.height = HauteurLimite
else nav.height = document.test.height;

if ((defil=="oui"))
       	{
	yy = eval(y);
	ydiff = ystart - yy;
	if ((ydiff < (-1)) || (ydiff > (1))) movey = Math.round(ydiff / 10), ystart -= movey;
	Ymenu = YposMenu - yy;
        }
else
	{
        Ymenu = YposMenu;
        }

zz = eval(z);
zdiff = zz-754;
zdiff = Math.round(zdiff  / 2)
if (zdiff <16) zdiff=16;
if (Ymenu <0) Ymenu = 0;
eval("menu.style.pixelTop=" + (ystart + Ymenu));
if (centr=='oui') eval("menu.style.pixelLeft=" + (zdiff));
setTimeout("checkLocation('" + defil + "','" + band + "','" + centr + "')", 20);

if (document.getElementById("Liste"))
	{
        document.getElementById("Liste").height = HauteurLimite-80;
	laliste = document.getElementById("Liste")
	limage = laliste.document.images[1];
//status = limage.height + " + " + document.test.height;
//        document.Liste.height = document.Liste.test2.height;
        }
}

function PiedDePage() {

HauteurContenu = document.getElementById("contenu").offsetHeight;
HauteurMenuG = document.getElementById("menuG").offsetHeight;
HauteurMenuD = document.getElementById("menuD").offsetHeight;
//HauteurPage = document.getElementById("page").offsetHeight;
HauteurPied = document.getElementById("pied").offsetHeight + 10;
PositionMenuG = document.getElementById("menuG").offsetTop;

TailleG = PositionMenuG + HauteurMenuG;
TailleD = PositionMenuG + HauteurMenuD;
TailleContenu = PositionMenuG + HauteurContenu;
//TaillePage = PositionMenuG + HauteurPage;

// objectif : le pied de page doit être en dessous du contenu et des menus...
// et le plus bas possible de la page
// calcul de la position basse maxi des trois
PlusGrande = Math.max(TailleG,TailleD);
PlusGrande = Math.max(PlusGrande,TailleContenu);
//PlusGrande = Math.max(PlusGrande,TaillePage);

// quelle est la hauteur maxi de la page possible ?
if ((document.all)) 	var hauteur=document.body.clientHeight;		// IE 
if ((document.getElementById || document.layers)&&(!document.all)) 
	{
	var hauteur=window.innerHeight;	// NS 
	}

// donner cette valeur à la hauteur de 'page' pour faire descendre le pied
if (PlusGrande+HauteurPied<hauteur)		PlusGrande=hauteur-HauteurPied;
document.getElementById("page").style.height = PlusGrande;

// redimensionner la fenêtre (ça ne marche pas sur ie, mais moz en a besoin pour faire disparaitre le scrol)
//window.innerHeight = PlusGrande+HauteurPied+5;		
}

function montre(id) {
	if (document.getElementById) {
		document.getElementById(id).style.display="block";
	} else if (document.all) {
		document.all[id].style.display="block";
	} else if (document.layers) {
		document.layers[id].display="block";
	}
 } 

function cache(id) {
	if (document.getElementById) {
		document.getElementById(id).style.display="none";
	} else if (document.all) {
		document.all[id].style.display="none";
	} else if (document.layers) {
		document.layers[id].display="none";
	}
} 
