//init switcher
	//window.onload=setStyle();
//End
/*--- roll over --*/
function roll(){
	Tlink=getElementsByClassName("roll"); 
  for(i=0;i<Tlink.length;i++){		
    Tlink[i].onmouseover=change;
		Tlink[i].onfocus=change;
    Tlink[i].onmouseout=reset;
		Tlink[i].onblur=reset;                       
  }	
}
function change(){
 		SrcOld=this.firstChild.getAttribute("src");
		SrcNew=SrcOld.substring(0,(SrcOld.length)-4)+"2"+".gif";
    this.firstChild.setAttribute("src",SrcNew);
}
function reset(){
 		SrcOld=this.firstChild.getAttribute("src");
		SrcNew=SrcOld.substring(0,(SrcOld.length)-5)+".gif";
    this.firstChild.setAttribute("src",SrcNew);
}
function setUp(lien,elm){
  target=getElementsByClassName("scene","div");
  for(i=0;i<target.length;i++){
    target[i].style.zIndex=0;
  }
  setTitle(" onglet actif");       
  setLien(lien," onglet actif"); 
  document.getElementById(elm).style.zIndex=6;
}
function setUp2(lien,elm){
  target=getElementsByClassName("sceneR","div");
  for(i=0;i<target.length;i++){
    target[i].style.zIndex=0;
  } 
  document.getElementById(elm).style.zIndex=7;
}
function setDemo(){
  target=getElementsByClassName("scene","div");
  for(i=0;i<target.length;i++){
    target[i].style.position="absolute";
  }
  document.getElementById("navScene").style.position="absolute";
  target=getElementsByClassName("Ademo","a");
  for(i=0;i<target.length;i++){
    target[i].style.display="block";
  }      
}
function setRef(){
  target=getElementsByClassName("sceneR","div");
  for(i=0;i<target.length;i++){
    target[i].style.position="absolute";
    target[i].style.zIndex=0; 
  }
  document.getElementById("sc1").style.zIndex=7;    
}
function setTitle(chaine){
  if(target=document.getElementById("nactive")){
    oldTitle=target.getAttribute("title");   
    stop=oldTitle.length-chaine.length;    
    newTitle=oldTitle.substr(0,stop);
    target.setAttribute("title",newTitle);
  }
}
function setLien(lien,chaine){
  if(target=document.getElementById("nactive")){
    target.removeAttribute("id");
    target.removeAttribute("class");
  }
  lien.setAttribute("id","nactive");
  lien.setAttribute("class","nactive");  
  txt=lien.getAttribute("title")+chaine;
  lien.setAttribute("title",txt);
}
function setFixe(){
	document.getElementById("wrap3").style.position="fixed";
	document.getElementById("wrap3").style.top="180px";
	document.getElementById("LNofixe").style.display="block";
	document.getElementById("Lfixe").style.display="none";     
  EcrireCookie("style", "fixed");  
}
function setnoFixe(){
	document.getElementById("wrap3").style.position="absolute";
	document.getElementById("wrap3").style.top="127px";
	document.getElementById("LNofixe").style.display="none";
	document.getElementById("Lfixe").style.display="block";  
  EcrireCookie("style", "libre");      
}
function setStyle(){
	roll();
	sTest=LireCookie("style");
  if(sTest=="fixed")setFixe();
  if(sTest=="libre")setnoFixe();
}
/*--- Technique --*/
function EcrireCookie(nom, valeur){
	var argv=EcrireCookie.arguments;
	var argc=EcrireCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=nom+"="+escape(valeur)+
	((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
	((path==null) ? "" : ("; path="+path))+
	((domain==null) ? "" : ("; domain="+domain))+
	((secure==true) ? "; secure" : "");
}
function LireCookie(nom){
	var arg=nom+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen){
		var j=i+alen;
		if (document.cookie.substring(i, j)==arg) return getCookieVal(j);
		i=document.cookie.indexOf(" ",i)+1;
		if (i==0) break;
	}
	return null;
}
function getCookieVal(offset){
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1) endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
function getElementsByClassName(className, tag, elm){
	var testClass = new RegExp("(^|s)" + className + "(s|$)");
	var tag = tag || "*";
	var elm = elm || document;
	var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);
	var returnElements = [];
	var current;
	var length = elements.length;
	for(var i=0; i<length; i++){
		current = elements[i ];
		if(testClass.test(current.className)){
			returnElements.push(current);
		}
	}
	return returnElements;
}