﻿
var topMenu = null; 
function fOpenMenuTab(activator) {

    var allUL = $A("ul", "LvvA");
    
    var i = 0;
    for (i = 0; i < allUL.length; i++)
        allUL[i].style.display = "none";
    var ul = $A("ul", "*", activator);
    
    ul = ul[0];
    ul.style.display = "block";
    //window.status = ul.offsetHeight;
    //fStartWatch(ul, ul.offsetHeight);
   // ul.style.display = "none";
}

function fCloseMenuTab(activator) {

    var e = window.event;
    if (e != null) 
    {
       // var toElementName = e.toElement.nodeName;
        var uLElement = e.toElement;
        if (uLElement == null) {
            activator.style.display = "none";
            return;
        }
        if (uLElement.className == "LvvA" || uLElement.className == "first") return; 
       if (topMenu == null) 
        {
            topMenu = 1;
           // window.status = toElementName
        }
        
    }
    //var ul = $A("ul", "*", activator);
    //ul = ul[0];
    activator.style.display = "none";
}

function fCheckCloseMenuTab(e, activator)
{
    fCloseMenuTab($A("ul", "*", activator)[0]);
}

function fStartWatch(obj , height) {
    var tmr = TimerManager.MakeNew();
    tmr.Initialize(fCreateMenuAnimation, 3, 60, fStopMenuAnimation, { div: obj, Height: height, Tmr: tmr }, true);
}

function fCreateMenuAnimation(res) {

}

function fStopMenuAnimation(res) {
    window.status = res.Tmr.Id;
    res.div.style.display = "block";

}
