//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.


// VAriables globales //
var clicked_name=""
var obj_name=null;



function mouseOUT(td_obj){

//if (clicked_name != td_obj.id)
 td_obj.style.background='#CCCCCC'; 
}

//_______________________________________________________________________________________________________

function mouseOVER(td_obj){
td_obj.style.background='#F0F0F0';
}


//_______________________________________________________________________________________________________
function putCLICK(td_obj){
// on eteind tous les sous menu rouges
//for (var k=0;k<document.all.length;k++){
	//	var w = document.all[k].id;
var t_body = document.getElementsByTagName("TBODY");
//var current_t_body = t_body.getElementById(current_menu); 
for (k=0;k<t_body.length;k++){
var t_id = t_body[k].getElementsByTagName("A");
    for (t=0;t<t_id.length;t++){
	  var w=t_id[t].id;
	  	
		  var p= w.indexOf("href");
		        if (p!=-1){
		         document.getElementById(w).style.color="#333333";
		        }else{
				var p2= w.indexOf("__1");
				    if (p2!=-1){
				     document.getElementById(w).style.color="#333333";// on eteint les menus
				    }
				
				}
		
		}//fin du for t		
	}// fin du for k
/////

//var ww = "document.all."+td_obj.id+"__1.style.color=\"#E87400\"";
var ww = "document.getElementById(\""+td_obj.id+"__1\").style.color=\"#009ee0\"";
eval(ww);// on allume le menu cliqué
	
eteintbtnframe('index');
if (obj_name != null){
 obj_name.style.background='#CCCCCC';
 }
  clicked_name=td_obj.id;
  obj_name=td_obj;
  pos_cookie(td_obj.id);
  
}

//_______________________________________________________________________________________________________




function eteintbtnframe(nom_frame){
color_index="#CCCCCC";
color="#CCCCCC";
if (nom_frame=="index")
  color = color_index;
nb = window.parent.frames.length;
            for (var i=0;i<nb;i++){
			
           			   if(window.parent.frames[i].name==nom_frame){
			 			 if(window.parent.frames[i].clicked_name!=""){
							 nav_name = navigator.appName.toString();
							 var n = nav_name.toLowerCase().indexOf("netscape");
							if (n==-1){			
			  					for (j=0;j<window.parent.frames[i].document.all.length;j++){
					//alert(window.top.frames[i].document.all[j].id+"    "+window.top.frames[i].clicked_name);
										   if(window.parent.frames[i].document.all[j].id!=""){
																if(window.parent.frames[i].document.all[j].id==window.parent.frames[i].clicked_name){
																		window.parent.frames[i].clicked_name="";
																		window.parent.frames[i].obj_name=null;
																		//window.parent.frames[i].document.all[j].style.background='#BDD5EC';
																		window.parent.frames[i].document.all[j].style.background=color;
																		
																}
											}
								}
							}else{
							// pour netscape
										if(parseInt(navigator.appVersion) > 4){
											 window.parent.frames[i].document.getElementById(window.parent.frames[i].clicked_name).style.background=color; 
											 window.parent.frames[i].clicked_name="";
											 window.parent.frames[i].obj_name=null;
										}
							}// fin du else
						}
              		 }
            }
}

//_______________________________________________________________________________________________________


function pos_cookie(id)
{
document.cookie='index='+id+'#;path=/';
}

//_______________________________________________________________________________________________________


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 maj_cookie(){
cook = document.cookie;
var p = cook.indexOf("index=");
var p2 = cook.indexOf("#",p);
var value = cook.substring(p+6,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){
				clicked_name=value;
				document.all[i].style.background='#CCCCCC';
				obj_name=document.all[i];
			}
		}
 }else{
 			if(parseInt(navigator.appVersion) > 4){
				 document.getElementById(value).style.background='#CCCCCC';
				 obj_name=document.getElementById(value);
				 clicked_name=value;
			}
 }	
}
}



//_______________________________________________________________________________________________________


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);
}
//_______________________________________________________________________________________________________

function putOriginalColor(){
// on eteind les menus et sous menu
   //for (var k=0;k<document.all.length;k++){
   // var w = document.all[k].id;
var t_body = document.getElementsByTagName("TBODY");

for (k=0;k<t_body.length;k++){
var t_id = t_body[k].getElementsByTagName("A");
    for (t=0;t<t_id.length;t++){
	  var w=t_id[t].id;
    var p= w.indexOf("href");
	var p2= w.indexOf("__1");
	  if((p!=-1)||(p2!=-1)){
       document.getElementById(w).style.color="#333333";// on eteint les menus et/ou sous-menu
	  }
   }//fin for t
 }// fin for k
}// fin func








