﻿sfHover = function() {
    var sfEls = document.getElementById("mainlevel").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);

var aSection;
function SetCurrentMenu() {
    if (aSection) {
        aSection.className = "";
    }
    if (location.pathname.indexOf("/immobilier/") > -1) {
        aSection = document.getElementById("aImmobilier");
        aSection.className = "current";
    }
    else if (location.pathname.indexOf("/droits-personnes/") > -1) {
        aSection = document.getElementById("aDroitsPersonnes");
        aSection.className = "current";
    }
    else if (location.pathname.indexOf("/testaments-succession/") > -1) {
        aSection = document.getElementById("aTestaments");
        aSection.className = "current";
    }
    else if (location.pathname.indexOf("/droits-corporatif/") > -1) {
        aSection = document.getElementById("ctl00_aDroitsCorporatif");
        aSection.className = "current";
    }
    else if (location.pathname.indexOf("/conseillers-juridiques/") > -1) {
        aSection = document.getElementById("ctl00_aConseillers");
        aSection.className = "current";
    }
}
