// Prototype doit être chargé
Event.observe(window, 'load', function() {

    // Show menu selon l'url de la page en cour;
    var path = window.location.href.replace(window.location.protocol + '//' + window.location.host, '');
    var fullpath = window.location.href;
    var menu_loc = '';
    var base_url = window.location.protocol + '//' + window.location.host;


    if (path != '/' && path != '') {
        // État du sous menu
        var as = $('sousmenu').getElementsByTagName('a');
        for(i = 0; i < as.length; i++) {
            // Url pareil
            if (as[i].href == fullpath) {
                $(as[i]).addClassName('selected');
            } // if
        } // for

        // État du menu principal
        var lis = $('menu').childElements();
        lis.each(function(node){
            var a = $(node).getElementsByTagName('a')[0];
            if (a) {
                menu_loc = a.href;
                //alert(a.href);
                // Hack pour afficher le menu CIFQ (/index.php) dans le répertoire /cifq/
                if (menu_loc == base_url + '/index.php') {
                    menu_loc = '/cifq/';
                }
                if (fullpath.indexOf(menu_loc) != -1 || menu_loc.indexOf(fullpath) != -1) {
                    $($(a).getElementsByTagName('img')[0]).setOpacity(0);
                    //alert(fullpath);
               } // if
            } // if
            //Element.hide(node);
        });
    } // if
}); // function


// Fix pour IE6 et moins seulement
sfHover = function() {
	var sfEls = document.getElementById("menu").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"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


function addbookmark(theUrlToBookMark)
{
    if (document.all) {
        window.external.AddFavorite(theUrlToBookMark,"CIFQ");
    } // if
} // if