// liens externes en popup
popup4out = function() {
    var links = document.getElementsByTagName('a');
    for (var i=0; i<links.length; i++)
    {
        // url avec autre domaine
        if ( links[i].href.indexOf('http://', 0) == 0 && links[i].href.indexOf(location.hostname, 7) == -1 )
        {
            // passe en popup
            links[i].onclick = function() {
                window.open(this.href, '_blank'); return false;
            }
        }
    }
}

sfHover = function() {
	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"), "");
		}
	}
}

// chargement des actions
if (window.addEventListener) {
    // methode W3C
    window.addEventListener('load', function() { popup4out(); }, true)
} else if (window.attachEvent) {
    // methode Microsoft
    window.attachEvent('onload', sfHover);
    window.attachEvent('onload', function() { popup4out(); })
}
