window.onload = function() {
	Hover("*", "li");
	Hover("*", "tr");
	Hover("projetsAccueil", "td");
	Hover("presentation_galerie_apercus", "span");
	
	var fontSizeBox = new FontSizeToolbox("fontsizebox", { grand: .9, normal: .8, petit: .7, class_petit: "petit", class_petit_actif: "petitActif", class_normal: "normal", class_normal_actif: "normalActif", class_grand: "grand", class_grand_actif: "grandActif" });
	
	Menus_ActiverMenu( "actif", ["menuGen", "menuSec", "menuFonc", "filtre", "filtre_realisations", "filtre_achievements"] );
	Menus_CreerMenuAccordeon( "actif", ["menuGen", "menuSec", "menuFonc"] );
	
	//new GalerieINO("presentation_galerie", "actif");
	new Vignettes("vignettes_realisations", true);
	
	genererImageEntete(4);
	
	//vide le champ courriel quand on clique dedans
	if (document.getElementById('txtCourriel')) {
	  document.getElementById('txtCourriel').onclick = function () { this.value = ''; };
  }
}


// Génère l'image aléatoire en page d'accueil
function genererImageEntete( imagesPossibles ) {
	if ( document.getElementById ) {
		var eDiv;
		
		if ( eDiv = document.getElementById("enteteAleatoire") ) {
			var idPhoto     = Math.ceil( Math.random() * imagesPossibles );
			var classe = "entete_" + idPhoto;
			eDiv.className = classe;
		}
	}
}




// Retourne le chemin racine du site
function getRootPath() {
	var rootPath = document.URL.substring(0, document.URL.lastIndexOf("/") + 1);
	
	if ( rootPath.indexOf("/fr/") != -1 )
	{
		rootPath = rootPath.substring(0, rootPath.indexOf("/fr/") + 1);
	}
	else if ( rootPath.indexOf("/en/") != -1 )
	{
		rootPath = rootPath.substring(0, rootPath.indexOf("/en/") + 1);
	}
	else
	{
		pos = 0;
		for(i = 0; i < 3; i++)
		{
			pos = rootPath.indexOf("/", pos)+1;
		}
		rootPath = rootPath.substring(0, pos);
	}
	
	return rootPath
}
