﻿    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(objId).style.visibility='visible';
        menuProducts = true;
    }

document.writeln("<div id=\"cbo-natrient-products\" onmouseout=\"menuProducts = false;InitializeTimer('cbo-natrient-products');\">");
document.writeln("<a href=\"http://www.ballisticenergy.com/\" onmouseover=\"showMenuProducts('cbo-natrient-products');\">Ballistic</a>");
document.writeln("<a href=\"http://www.natrient.com/SomaDream/\" onmouseover=\"showMenuProducts('cbo-natrient-products');\">SomaDream</a>");
document.writeln("<a href=\"http://www.natrient.com/NoHang/\" onmouseover=\"showMenuProducts('cbo-natrient-products');\">NoHang</a>");
document.writeln("<a href=\"http://www.sutramax.com\" onmouseover=\"showMenuProducts('cbo-natrient-products');\">SutraMax</a>");
document.writeln("</div>");
