var img_bord_degrade_width = 25; // Largeur de l'image servant au dégradé des bords.
var img_bord_degrade_path = "../images/degrad.gif"; // Ici le chemin vers l'image de dégradé pour les bords (ex : ../images/degrad.gif)
var bord_degrade_active = false; // Activation du dégradé bords ? (true ou false)

//var FuncOL = new Array(); // Tableau pour stocker les scripts à éxécuter au chargement de la page

// Fonction de stockage de scripts dans FuncOL ( usage : StkFunc(name_of_a_function); )
//function StkFunc(Obj) { 
//    FuncOL[FuncOL.length] = Obj; 
//} 

function ajoutBordsDegrades(){
	// Ajout bords dégradés gauche et droite 	
	if(bord_degrade_active){

		// Gestion décalage du positionnement absolu avec IE
		if(navigator.appName=="Microsoft Internet Explorer"){ 
			decalage_ie_g = 11;
			decalage_ie_d = 9;
		}
		else {
			decalage_ie_g = 0;
			decalage_ie_d = 0;
		}
		
		var bg = document.createElement('div');
		bg.style.position = 'absolute';
		bg.style.height = document.getElementById('Fond').offsetHeight+'px';
		bg.style.top = '0px';
		bg.style.left = document.getElementById('Fond').offsetLeft - img_bord_degrade_width + decalage_ie_g + 'px';
		bg.style.width = img_bord_degrade_width+'px';
		bg.style.backgroundImage = "url('"+img_bord_degrade_path+"')";
		bg.style.backgroundRepeat = "repeat-y";
		
		document.body.appendChild(bg);
		
		var bd = document.createElement('div');
		bd.style.position = 'absolute';
		bd.style.height = document.getElementById('Fond').offsetHeight+'px';
		bd.style.top = '0px';
		bd.style.left = document.getElementById('Fond').offsetLeft+document.getElementById('Fond').offsetWidth+decalage_ie_d+'px';
		bd.style.width = img_bord_degrade_width+'px';
		bd.style.backgroundImage = "url('"+img_bord_degrade_path+"')";
		bd.style.backgroundRepeat = "repeat-y";
		document.body.appendChild(bd);
	}
	
	document.body.style.overflowX = 'hidden'; // masquage de l'ascenseur
}/*ajoutBordsDegrades*/

//StkFunc(ajoutBordsDegrades);

// Execution des scripts stoqués dans FuncOL au chargement de la page 
//window.onload = function() { 
//    for(i=0; i<FuncOL.length; i++) 
//        {FuncOL[i]();} 
//}

// Script venant de la fonction addLoadEvent() dans le fichier lightbox.js
var oldonload = window.onload;
if (typeof window.onload != 'function'){
  window.onload = ajoutBordsDegrades;
} else {
window.onload = function(){
oldonload();
ajoutBordsDegrades();
}
}

