//Menu Vertical Desplegat
function MenuVerticalDesplegat(idDiv) {
    this.Div = getObject(idDiv);
};

MenuVerticalDesplegat.prototype.MarcarElementsMenu = function(arrIds) {
    for (i = 0; i < arrIds.length; i++) {
        this.MarcarElementMenu(arrIds[i]);
    }    
};

MenuVerticalDesplegat.prototype.MarcarElementMenu = function(sId) {
    oElement = getObject(sId);
    
    if (oElement) {
        oTitol = getChildObjectNoText(oElement, 0);
        
        if (oTitol.tagName == "A") {
            oTitol = getChildObjectNoText(oTitol, 0);
        }

        if (oTitol) {
            oTitol.className = oTitol.className + "marcat";
        }
    }

};

//Privat
if (!document.all) { emulateEventHandlers(["click", "mousemove", "keypress", "keyup", "keydown", "mouseover", "mouseout", "mouseup", "mousedown", "focus", "resize"]); }
function emulateEventHandlers(eventNames) { for (var i = 0; i < eventNames.length; i++) { document.addEventListener(eventNames[i], function (e) {window.event = e;}, true); } }
function attachObjEvent(obj, sEvent, sFunction) { if (!document.all) { obj.addEventListener(sEvent, sFunction, false); } else { obj.attachEvent("on" + sEvent, sFunction); } }
function getObject(sId) { return document.getElementById(sId); }
function getChildObjectNoText(oObject, iIndex) { var iCont = 0; for (var i = 0; i < oObject.childNodes.length; i++) { if (oObject.childNodes[i].tagName != null) { if (iCont == iIndex) { return oObject.childNodes[i]; } else { iCont++; } } } return false; }
function checkObject(oObject) { if (oObject && (typeof(oObject) == "object")) { return true; } return false; }
