// onresize for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { 
		if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0);
		}
}

var lay_encours;	// holds id of currently visible layer
var lay_encoursbt;

function swapLayers(id,indice) {
  if (lay_encours) hideLayer(lay_encours,cur_indice);
  showLayer(id,indice);
  lay_encours = id;
  cur_indice = indice
}
 
function swapLayersbt(id,indice) {
  if (lay_encoursbt) hideLayerbt(lay_encoursbt,cur_indicebt);
  showLayerbt(id,indice);
  lay_encoursbt = id;
  cur_indicebt = indice
} 
 
function showLayer(id,indice) {
  var a=getElemRefs("tpvent"+indice);
  var span=getElemRefs("tpventspan"+indice);
  var lyr = getElemRefs(id);
		if(lyr&&lyr.css){lyr.css.visibility="visible";lyr.css.height="auto"}
		a.css.backgroundPosition="0% 75px";
		a.css.color="#FF0000";
		span.css.backgroundPosition="100% 0px";
		span.css.color="#FFFFFF";
		span.css.fontWeight="bold";
}
 
 
 function showLayerbt(id,indice) {
  var a=getElemRefs("categbt"+indice);
  var span=getElemRefs("categbtspan"+indice);
  var categbt = getElemRefs(id);
		if(categbt&&categbt.css){categbt.css.visibility="visible";categbt.css.height="auto"}
		a.css.backgroundPosition="0% 75px";
		a.css.color="#FF0000";
		span.css.backgroundPosition="100% 0px";
		span.css.color="#FFFFFF";
		span.css.fontWeight="bold";
}
 
function hideLayer(id,indice) {
  var a=getElemRefs("tpvent"+indice);
  var span=getElemRefs("tpventspan"+indice);
  var lyr = getElemRefs(id);
		if(lyr&&lyr.css){lyr.css.visibility="hidden";lyr.css.height="0"}
		a.css.backgroundPosition="0% 0px";
		a.css.color="#666666";
		span.css.backgroundPosition="100% 150px";
		span.css.color="#666666";
		span.css.fontWeight="normal";

}

function hideLayerbt(id,indice) {
  var a=getElemRefs("categbt"+indice);
  var span=getElemRefs("categbtspan"+indice);
  var categbt = getElemRefs(id);
		if(categbt&&categbt.css){categbt.css.visibility="hidden";categbt.css.height="0"}
		a.css.backgroundPosition="0% 0px";
		a.css.color="#666666";
		span.css.backgroundPosition="100% 150px";
		span.css.color="#666666";
		span.css.fontWeight="normal";

}


function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}



function afficheId(baliseId) 
  {
  if (document.getElementById && document.getElementById(baliseId) != null) 
    {
    document.getElementById(baliseId).style.visibility='visible';
    document.getElementById(baliseId).style.display='block';
    }
  }

function cacheId(baliseId) 
  {
  if (document.getElementById && document.getElementById(baliseId) != null) 
    {
    document.getElementById(baliseId).style.visibility='hidden';
    document.getElementById(baliseId).style.display='none';
    }
  }

//cacheId('contenu'); 
// si JavaScript est disponible, cache le contenu dès le 
// chargement de la page. Sans JavaScript, le contenu sera 
// affiché.
