function prechargerNav()
{
	i1 = new Image;
	i1.src = "images/rub1_bis.jpg";
	i2 = new Image;
	i2.src = "images/rub2_bis.jpg";
	i3 = new Image;
	i3.src = "images/rub3_bis.jpg";
	i4 = new Image;
	i4.src = "images/rub4_bis.jpg";
	i5 = new Image;
	i5.src = "images/rub5_bis.jpg";
	i6 = new Image;
	i6.src = "images/rub6_bis.jpg";
	i7 = new Image;
	i7.src = "images/rub7_bis.jpg";	
	i8 = new Image;
	i8.src = "images/rub8_bis.jpg";
	i9 = new Image;
	i9.src = "images/rub9_bis.jpg";	
	i10 = new Image;
	i10.src = "images/rub10_bis.jpg";	
}

function montre_calque(nom_calque)
{
	if(document.all){eval('document.all.'+nom_calque).style.visibility='visible';}                     //Internet Explorer
	else if (document.layers){eval('document.'+nom_calque).visibility='show';}                         //Netscape 4.5 et 4.7
	else if (document.getElementById){document.getElementById(nom_calque).style.visibility='visible';} //Netscape 6
}

function cache_calque(nom_calque)
{
	if(document.all){eval('document.all.'+nom_calque).style.visibility='hidden';}                     //Internet Explorer
	else if (document.layers){eval('document.'+nom_calque).visibility='hidden';}                      //Netscape 4.5 et 4.7
	else if (document.getElementById){document.getElementById(nom_calque).style.visibility='hidden';} //Netscape 6
}

//Ouverture d'une pop up
function ouvreFenetre(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

function confirmation(URL,MSG)
{
	if(confirm(MSG))
	{
		document.location.href=URL;
	}
}

function insertion(FormName, InputName, repdeb, repfin) {
  var input = document.forms[FormName].elements[InputName];
  input.focus();
  /* pour l'Explorer Internet */
  if(typeof document.selection != 'undefined') {
    /* Insertion du code de formatage */
    var range = document.selection.createRange();
    var insText = range.text;
    range.text = repdeb + insText + repfin;
    /* Ajustement de la position du curseur */
    range = document.selection.createRange();
    if (insText.length == 0) {
      range.move('character', -repfin.length);
    } else {
      range.moveStart('character', repdeb.length + insText.length + repfin.length);
    }
    range.select();
  }
  /* pour navigateurs plus récents basés sur Gecko*/
  else if(typeof input.selectionStart != 'undefined')
  {
    /* Insertion du code de formatage */
    var start = input.selectionStart;
    var end = input.selectionEnd;
    var insText = input.value.substring(start, end);
    input.value = input.value.substr(0, start) + repdeb + insText + repfin + input.value.substr(end);
    /* Ajustement de la position du curseur */
    var pos;
    if (insText.length == 0) {
      pos = start + repdeb.length;
    } else {
      pos = start + repdeb.length + insText.length + repfin.length;
    }
    input.selectionStart = pos;
    input.selectionEnd = pos;
  }
  /* pour les autres navigateurs */
  else
  {
    /* requête de la position d'insertion */
    var pos;
    var re = new RegExp('^[0-9]{0,3}$');
    while(!re.test(pos)) {
      pos = prompt("Insertion à la position (0.." + input.value.length + "):", "0");
    }
    if(pos > input.value.length) {
      pos = input.value.length;
    }
    /* Insertion du code de formatage */
    var insText = prompt("Veuillez entrer le texte à formater:");
    input.value = input.value.substr(0, pos) + repdeb + insText + repfin + input.value.substr(pos);
  }
}

function confirmate(MSG)
{
	if(confirm(MSG))
	{
		return true;
	}
}

function moveSelected(from, to) {
	from = document.getElementById(from);
	to = document.getElementById(to);
	len = from.options.length - 1;
	for (i = len; i >= 0; i--) {
		if (from.options[i].selected) {
			to.options[to.options.length] = new Option(from.options[i].text,from.options[i].value);
			from.options[i] = null;
		}
	}
	return true;
}

function SelectAll(to)
{
	to = document.getElementById(to);
	len = to.options.length - 1;
	for (i = len; i >= 0; i--) {
		to.options[i].selected = true;
	}
}