function precharger(){
	i1 = new Image;
    i1.src = "images/bouton_accueil_on.gif";
    i2 = new Image;
    i2.src = "images/bouton_cv_on.gif";
	i3=new Image;
	i3.src = "images/bouton_ref_on.gif";
	i4 = new Image;
    i4.src = "images/bouton_contact_on";

}

function color_cell(nom_cell,col){
	var elem;
    if(document.all){window.document.all(nom_cell).style.background= col;}
    else if (document.getElementById){
        elem=document.getElementById(nom_cell);
    	elem.style.background=col;
    }
}

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
}

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 trim(inputString)
{
	if (typeof inputString != "string") { return inputString; }
	var retValue = inputString;
	var ch = retValue.substring(0, 1);
	while (ch == " ") { // Check for spaces at the beginning of the string
		retValue = retValue.substring(1, retValue.length);
		ch = retValue.substring(0, 1);
	}
	ch = retValue.substring(retValue.length-1, retValue.length);
	while (ch == " ") { // Check for spaces at the end of the string
		retValue = retValue.substring(0, retValue.length-1);
		ch = retValue.substring(retValue.length-1, retValue.length);
	}
	while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
		retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
	}
	return retValue; // Return the trimmed string back to the user
}

/** Confirmation d'une action **/
function confirmation(url,endmsg) {
	res = confirm(endmsg);
	if(res) document.location.href = url;
}
