var expiration = new Date();
expiration.setTime(expiration.getTime() + 600000);

window.onload = function() {
	var nav_id = Get_Cookie('nav');
	if(nav_id) {
		document.getElementById(nav_id).style.display="block";
	}
	//mooInit();
}

function Get_Cookie(name) {
	var start = document.cookie.indexOf(name+"=");
	var len = start+name.length+1;
	if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
	if (start == -1) return null;
	var end = document.cookie.indexOf(";",len);
	if (end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len,end));
}

function refresh()
{
	window.location.reload( false );
}

function Set_Cookie(name,value,expires,path,domain,secure) {
	document.cookie = name + "=" +escape(value) +
	( (expires) ? ";expires=" + expiration.toGMTString() : "") +
	( (path) ? ";path=" + path : "") +
	( (domain) ? ";domain=" + domain : "") +
	( (secure) ? ";secure" : "");
}

function Delete_Cookie( name, path, domain ) {
	if ( Get_Cookie( name ) ) document.cookie = name + "=" +
	( ( path ) ? ";path=" + path : "") +
	( ( domain ) ? ";domain=" + domain : "" ) +
	";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}


function Write_menu(menu_id) {	
	if(Get_Cookie('menu' + menu_id)) {
		Delete_Cookie('menu' + menu_id, "index.html", "");
		refresh(true);
		//document.getElementById('menu' + menu_id).style.visibility = "hidden";
		document.getElementById('menu' + menu_id).className = "hidde_menu";
		//var element = document.getElementById('menu' + menu_id);
		//element.style.display = (element.style.display == "none") ? "block" : "none";
	
	
	} else {
		Set_Cookie('menu' + menu_id, menu_id, "","index.html");
		refresh(true);
		//document.getElementById('menu' + menu_id).style.visibility = "visible";
		document.getElementById('menu' + menu_id).className = "visible_menu";
		//var element = document.getElementById('menu' + menu_id);
		//element.style.display = (element.style.display == "none") ? "block" : "none";
	}
}

function expandCollapse() {
	for (var i=0; i<expandCollapse.arguments.length; i++) {
		var element = document.getElementById(expandCollapse.arguments[i]);
		element.style.display = (element.style.display == "none") ? "block" : "none";
	}
}
function popupcentree(page,largeur,hauteur,options)
{
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

<!--//--><![CDATA[//><!--

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
//if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]>

function setEntete() {
    if (document.getElementById) {
        var windowHeight=getWindowHeight();
        if (windowHeight>0) {
            var contentHeight=
            document.getElementById('content').offsetHeight;
            var enteteElement=document.getElementById('navigation');
            var enteteHeight=enteteElement.offsetHeight;
        if ((contentHeight-enteteHeight)>=0) {
            enteteElement.style.position='relative';
            enteteElement.style.height=
            (contentHeight)+'px';
        }
        else {
            enteteElement.style.position='static';
        }
       }
      }
}

function getWindowHeight() {
    var windowHeight=0;
    if (typeof(window.innerHeight)=='number') {
        windowHeight=window.innerHeight;
    }
    else {
     if (document.documentElement&&
       document.documentElement.clientHeight) {
         windowHeight = document.documentElement.clientHeight;
    }
    else {
     if (document.body&&document.body.clientHeight) {
         windowHeight=document.body.clientHeight;
      }
     }
    }
    return windowHeight;
}

  function show_menu(id) {
  		write_nav(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 hide_menu(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";
		} } 
		
function write_nav(id){
	if(id != '') {
		Delete_Cookie('nav', "index.html", "");
		Set_Cookie('nav', id, "","index.html");
	}
}
function show(id)
{
	el = document.getElementById(id);
	if (el.style.display == 'none')	{
		el.style.display = '';
		el = document.getElementById(id);
	} else {
		el.style.display = 'none';
		el = document.getElementById(id);
	}
}

function show_article(id) {
	var sfEls = document.getElementById(id).getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].style.display="block";
	}
}

if (document.selection)
{
function correctPNG()
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}

window.attachEvent("onload", correctPNG);
}