/******************************************* Fonctions lancées au chargement *******************************************/

function initPrimary() {
   if (arguments.callee.done) return;
   arguments.callee.done = true;
   if (_timer) {
      clearInterval(_timer);
      _timer = null;
   }
  // Liste des fonctions à exécuter
  //geo();
  hide();
}

/******************************************* Menu *******************************************/

/*function hide(){
    var sMenu = document.getElementsByTagName('UL');
    for (var i=0; i<sMenu.length; i++){
        if(sMenu[i].className == "affiche") {
            sMenu[i].className = "nonAffiche";
            sMenu[i].parentNode.firstChild.className = '';
		}
    }
    if(document.getElementById('actif'))
    {
    	document.getElementById('actif').childNodes[2].style.display = 'block';
    }
    
}*/
function hide(){
	var sMenu = document.getElementsByTagName('UL');
	for (var i=0; i<sMenu.length; i++){
		if(sMenu[i].className == "affiche") {
			sMenu[i].className = "nonAffiche";
			sMenu[i].parentNode.firstChild.className = '';
		}
		if(sMenu[i].className == "affiche ok") {
			sMenu[i].className = 'affiche';
			sMenu[i].parentNode.firstChild.className = 'actif';
		}
	}
}

function menu(id){
    var sMenu = document.getElementById(id);
    if(sMenu.className == 'affiche')
        var hideOnly = true;
        
    hide();
    
    if(!hideOnly) {
        sMenu.className = 'affiche';
        sMenu.parentNode.firstChild.className = 'actif';
    } else {
        sMenu.parentNode.firstChild.className = '';
    }
}

function eclairer_onglet(id_onglet)
{
		document.getElementById('onglet_en').style.background = "";
		document.getElementById('onglet_es').style.background = "";
		document.getElementById('onglet_it').style.background = "";
		document.getElementById('onglet_fr').style.background = "";
		document.getElementById(id_onglet).style.background = "#C9D0E6";
	
}

/******************************************* Gestion des animations Flash *******************************************/

function loadFlash(url, largeur, hauteur, tag, id){
   var flash;
   var endTag;
 
   // Crée l'id si défini
   if(id != "")
      id = " id=\""+id+"\"";
 
   // Crée la balise si définie
   if(tag != ""){
      endTag = "</"+tag+">";
      tag = "<"+tag+id+">";
   }
 
   flash = tag+"<object type='application/x-shockwave-flash' data='"+url+"' width='"+largeur+"' height='"+hauteur+"'>";
   flash += "<param name='movie' value='"+url+"' \/>";
   flash += "<param name='menu' value='false' \/>";
   flash += "<param name='wmode' value='opaque' \/>";
   flash += "<param name='scalemode' value='noborder' \/>";
   flash += "<p>Veuillez télécharger le <a href='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=French'>plugin Flash<\/a> pour voir l'animation.<\/p>";
   flash += "<\/object>"+endTag;
   document.write(flash);
}

/******************************************* Préchargement *******************************************/

if (document.addEventListener) {
   document.addEventListener("DOMContentLoaded", initPrimary, false);
}
/*@cc_on @*/
/*@if (@_win32)
   document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
   var script = document.getElementById("__ie_onload");
   script.onreadystatechange = function() {
      if (this.readyState == "complete") {
         initPrimary();
      }
   };
/*@end @*/
 
if (/WebKit/i.test(navigator.userAgent)) {
   var _timer = setInterval(function() {
      if (/loaded|complete/.test(document.readyState)) {
         initPrimary();
      }
   }, 10);
}
 
window.onload = function () {
  initPrimary();
}; 