//The following content is Copyright ©2005 Advanced Data Network.
//Please contact Advanced Data Network by e-mail at adn@adnsa.com if you want to use a part or the whole of it.

function specialEscape(myChaine){
// codage pour safari
var HexCode = new Array("22","26","3C","3E","A0","A1","A2","A3","A4","A5",
			"A6","A7","A8","A9","AA","AB","AC","AD","AE","AF",
			"B0","B1","B2","B3","B4","B5","B6","B7","B8","B9",
			"BA","BB","BC","BD","BE","BF","C0","C1","C2","C3",
			"C4","C5","C6","C7","C8","C9","CA","CB","CC","CD",
			"CE","CF","D0","D1","D2","D3","D4","D5","D6","D7",
			"D8","D9","DA","DB","DC","DD","DE","DF","E0","E1",
			"E2","E3","E4","E5","E6","E7","E8","E9","EA","EB",
			"EC","ED","EE","EF","F0","F1","F2","F3","F4","F5",
			"F6","F7","F8","F9","FA","FB","FC","FD","FE","FF");

var hex_array = new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");
var newChaine = "";
     for (i=0;i<myChaine.length;i++){
       var code = myChaine.charCodeAt(i);// code decimal
       var hex = hex_array[parseInt(code/16)]+""+hex_array[code%16];// code hexadecimal
	   var found = false;
	    for (h = 0; h< HexCode.length;h++){
		  if (hex == HexCode[h]){
		   newChaine+="%"+hex;
		   found=true;
		   break;
		  }		  
		}// fin for h
	  if (!found)
	   newChaine+=myChaine.charAt(i);	
     }
return newChaine;
}





function initColor(){
    document.getElementById("dan").style.color="#333333";
	document.getElementById("pro").style.color="#333333";
	document.getElementById("fic").style.color="#333333";
document.cookie='head=#;path=/';
}


function posecolor(id){
initColor();
eval("document.getElementById(\""+id+"\").style.color='#009ee0'");
pos_cookie(id);
}


function pos_cookie(id)
{
//destroy_cookie('head');
document.cookie='head='+id+'#;path=/';
//document.cookie='head=#;path=/';
}


function maj_cookie(){
cook = document.cookie;
var p = cook.indexOf("head=");
var p2 = cook.indexOf("#",p);
var value = cook.substring(p+5,p2);
if (value!=""){
nav_name = navigator.appName.toString();
var n = nav_name.toLowerCase().indexOf("netscape");
if (n==-1){
		for (i=0;i<document.all.length;i++){
 			if(document.all[i].id==value){
				document.all[i].style.color='#009ee0';
				obj_name=document.all[i];
			}
		}
 }else{
 			if(parseInt(navigator.appVersion) > 4){
				 document.getElementById(value).style.color='#009ee0';
				 obj_name=document.getElementById(value);
			}
 }	
}
}


function destroy_cookie(nom_cookie)
{
cookies=document.cookie;
pos=cookies.indexOf(nom_cookie);
	if (pos!=-1)
	{
	
	pos1=cookies.indexOf("=",pos);
	pos2=cookies.indexOf("#",pos1);
	nom_b=cookies.substring(pos1+1,pos2);
	}
	ladate=new Date(71,10,02);
	document.cookie=nom_cookie+"=;expires="+ladate.toGMTString();
}

function Centrer(page,name,largeur,hauteur,options) {
  var haut=(screen.height-hauteur)/2;
  var gauche=(screen.width-largeur)/2;
  window.open(page,name,"top="+haut+",left="+gauche+",width="+largeur+",height="+hauteur+","+options);
}


