// menu deroulant compatibilité IE
function sfHover() {
    if (document.getElementById("first_level")!=undefined)
    {
        var sfEls = document.getElementById("first_level").getElementsByTagName("LI");
    	for (var i=0; i<sfEls.length; i++) {
    	   sfEls[i].onmouseover=function() {
    	       this.className+=" sfhover";
    	   }
    	   sfEls[i].onmouseout=function() {
    	       this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
    	   }
        }
    }
}

// liens externes en popup
function popup4out() {
    var links = document.getElementsByTagName('a');
    for (var i=0; i<links.length; i++)
    {
        // url vers autre domaine ou vers une ressource
        if ( (links[i].href.indexOf('http://', 0) == 0 && links[i].href.indexOf(location.hostname, 7) == -1) || links[i].className.indexOf('LinkFile') != -1)
        {
            // passe en popup
            links[i].onclick = function() {
                window.open(this.href, '_blank'); return false;
            }
        }
    }
}

// chargement des actions
if (window.addEventListener) {
    // methode W3C
    window.addEventListener('load', popup4out, true)
    if (navigator.Name=='Netscape')
      window.addEventListener('load', sfHover);
} else if (window.attachEvent) {
    // methode Microsoft
    window.attachEvent('onload', sfHover);
    window.attachEvent('onload', popup4out)
}

/* désactive le flicker des images en background sur IE */
try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}

