



var Webmenu_DisplayFlag = 0;
var Webmenu_DisplayMenuId = "";

//function Webmenu_ShowMenu(ctrlId)
//{
////alert ("control=" + ctrlId)
//    if (Webmenu_DisplayMenuId != "")
//    {
//        Webmenu_HideMenu3();
//    }
//    //alert ("control=" + ctrlId)
//    var ctrl = document.getElementById(ctrlId);
//    //alert ("display=" + ctrl.style.display)
//    ctrl.style.display = "block";
//    Webmenu_DisplayFlag = 1;
//}


//function Webmenu_HideMenu(ctrlId)
//{
//   Webmenu_DisplayFlag = 0;
//   Webmenu_DisplayMenuId = ctrlId;
//   setTimeout("Webmenu_HideMenu2()",500)
//    
//}

function Webmenu_ShowMenu(p_cell, p_color, ctrlId, p_backImage)
{
//alert ("p_cell=" + p_cell)
    if (p_cell)
    {
        if (p_backImage == null || p_backImage == "" )
            p_cell.style.backgroundColor = p_color;
        else
        {
            url = "url('" + p_backImage + "')"
            //alert ("url=" + url)
            p_cell.style.backgroundImage = url; //"url(" + p_backImage + ")";
        }
    }
    if (Webmenu_DisplayMenuId != "")
    {
        Webmenu_HideMenu3();
    }
    //alert ("control=" + ctrlId)
    var ctrl = document.getElementById(ctrlId);
    //alert ("display=" + ctrl.style.display)
    ctrl.style.display = "block";
    Webmenu_DisplayFlag = 1;
}


function Webmenu_HideMenu(p_cell, p_color, ctrlId, p_backImage)
{
    if (p_cell)
    {
        if (p_backImage == null || p_backImage == "")
            p_cell.style.backgroundColor = p_color;
        else
             p_cell.style.backgroundImage = "url('" + p_backImage + "')";
    }
   Webmenu_DisplayFlag = 0;
   Webmenu_DisplayMenuId = ctrlId;
   setTimeout("Webmenu_HideMenu2()",500)
    
}

function Webmenu_HideMenu2()
{
    if (Webmenu_DisplayFlag == 0)
    {
        Webmenu_HideMenu3()
    }
}
function Webmenu_HideMenu3()
{
   
    //alert ("control=" + Webmenu_DisplayMenuId)
    if (Webmenu_DisplayMenuId != "")
    {
        var ctrl = document.getElementById(Webmenu_DisplayMenuId);
        //alert ("display=" + ctrl.style.display)
        ctrl.style.display = "none";
        Webmenu_DisplayMenuId = "";
    }
}

function Webmenu_NavigateTo(p_url)
{

    location.href = p_url;
}


function ChangeBackgroundImage(p_control, p_image)
{
//alert ("image=" +p_image)
    if (p_image != "")
        p_control.style.backgroundImage = "url('" + p_image + "')";
}


