function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function infobulle(corps,event){

var couleur_fond = 'black';
var couleur_texte = 'white';
var couleur_bordure = 'gray';
var type_bordure = 'solid'; //(solid dashed dotted double)
var taille_bordure = '1px'; //px

var posx = 0;
var posy = 0;
	 e = e || event;

	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}

x=posx;
y=posy;
//x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.body.scrollLeft;
//y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y+document.body.scrollTop;

document.getElementById("infobulle").style.color = couleur_texte;
document.getElementById("infobulle").style.backgroundColor = couleur_fond;
document.getElementById("infobulle").style.borderColor = couleur_bordure;
document.getElementById("infobulle").style.borderStyle = type_bordure;
document.getElementById("infobulle").style.borderWidth = taille_bordure;
document.getElementById("infobulle").innerHTML = corps;
document.getElementById("infobulle").style.visibility = "visible";
document.getElementById("infobulle").style.left = x+10+"px";
document.getElementById("infobulle").style.top = y +20+"px"; 

}
function infobulle_cache(){
document.getElementById("infobulle").style.visibility = "hidden";
}

function PopupCentrer(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);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
var showMode = 'table-cell';

// However, IE5 at least does not render table cells correctly
// using the style 'table-cell', but does when the style 'block'
// is used, so handle this

if (document.all) showMode='block';

// This is the function that actually does the manipulation

function changeDisplay(btn,nom_col,form,val){
	// Next find all the table cells by using the DOM function
		// getElementsByName passing in the constructed name of
		// the cells, derived from the checkbox name
	
		cells = document.getElementsByName('t'+nom_col);
	
		// Once the cells and checkbox object has been retrieved
		// the show hide choice is simply whether the checkbox is
		// checked or clear
	
		
if(val=="")//on regarde la valeur du bouton
		{
		// First isolate the checkbox by name using the
		// name of the form and the name of the checkbox
	
		btn   = document.forms[form].elements[btn];
		mode = btn.checked ? showMode : 'none';
	
	
		// Apply the style to the CSS display property for the cells
		for(j = 0; j < cells.length; j++) cells[j].style.display = mode;
	}
else//on regarde la valeur indiqué (0,1 ou -1 pour inverser
	{
		if(val==-1)
			{
			
			for(j = 0; j < cells.length; j++) {
				if(cells[j].style.display=="none")
					{
					cells[j].style.display = showMode;
					}
				else
					{
					cells[j].style.display = "none";	
					}
				}
			}
		else
			{
			mode = (val==1) ? showMode : 'none';
			for(j = 0; j < cells.length; j++) cells[j].style.display = mode;	
			}
		
	}
}

 function emptyField(text) {
     if (text.value == text.defaultValue) {
         text.value = "";
     }
 }
 
  function  reInitField(text) {
     if (text.value == "") {
         text.value = text.defaultValue;
     }
 }
 
 function ajouterFavoris(urlAddress,pageName) {
    if (document.all) {
        window.external.AddFavorite(urlAddress,pageName);
    }
    else if (window.sidebar) {
        window.sidebar.addPanel(pageName, urlAddress, "");
    }
    else {
        alert("Sorry but your navigator can't use this function.");
    }
 }
 
 function fullScreen(theURL) {
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto');
 }
 
