    var secs;
    var timerID = null;
    var timerRunning = false;
    var delay = 100;

    function InitializeTimer(objId)
    {
        // Set the length of the timer, in seconds
        secs = 3;
        StopTheClock();
        StartTheTimer(objId);
    }

    function StopTheClock()
    {
        if(timerRunning)
            clearTimeout(timerID);
        timerRunning = false;
    }

    function StartTheTimer(objId)
    {
        if (secs==0)
        {
            StopTheClock();
            // Here's where you put something useful that's
            // supposed to happen after the allotted time.
            // For example, you could display a message:
            if(menuProducts)
            {
                document.getElementById(objId).style.visibility='visible';
            }
            else
            {
                document.getElementById(objId).style.visibility='hidden';
            }
        }
        else
        {
            //self.status = secs
            //document.getElementById('countdown').innerHTML = secs;
            secs = secs - 1;
            timerRunning = true;
            timerID = self.setTimeout("StartTheTimer('" +objId+ "')", delay);
        }
    }
    
    var menuProducts = false;
    function showMenuProducts(objId)
    {
        document.getElementById('menu-products-menu1').style.visibility="hidden";
        document.getElementById('menu-products-menu2').style.visibility="hidden";
        document.getElementById(objId).style.visibility='visible';
        menuProducts = true;
    }
