
var LastNewsFeature = 'NewsFeature1';
var LastNewsImg = 'NewsTab1';

var DefaultItem = 1;
var TimerIdArray = new Array();
var TimerIdCount = 0;

function ShowDefaultSubNav()
{   //show the default subnav, in one second (sets a timer)
    TimerIdArray[TimerIdCount++] = self.setTimeout("ShowSubNav(DefaultItem)", 1000);
}

function ClearTimeOuts()
{   //because of the <a> tags in the subnav div's, there are multiple "onmouseout" events that fire, and 
    //therefore, multiple timers are set. This keeps track of the potentially multiple "showdefaultsubnav"
    //functions that are waiting to fire off.
    for (var i=0; i < TimerIdCount; i++)
    {
        clearTimeout(TimerIdArray[i]);
    }
}

function ShowSubNav(item)
{   
    if (document.getElementById)
    {
        //first, get rid of any pending "showdefaultsubnav" functions that may be waiting to fire off.
        ClearTimeOuts();
        //now, grab all the <li> tags that are in the twnav div
        var NavLIs = document.getElementById('twnav').getElementsByTagName('ul')[0].getElementsByTagName('li');
        //now, loop through them.
        for (var i=0; i<NavLIs.length; i++)
        {   //if this is the item that was actually moused over...
            if (i == (item - 1)) 
            {   //then give it the highlighted style, and show its subnav div.
                NavLIs[i].className = 'on'; 
                eval("document.getElementById('SubNav" + item + "').style.display = 'inline';");
            } else {
                //check to see if the "off" style is silver or not.
                if (NavLIs[i].dir != 'ltr')
                {
                    NavLIs[i].className = '';
                } else {
                    NavLIs[i].className = 'slvr';
                }
                //and hide the associated subnav
                eval("document.getElementById('SubNav" + (i+1) + "').style.display = 'none';");
            }
        }
    }
}




function BlankOutSearchBox(objSearchText, strTextToClear)
{
    if (objSearchText.value == strTextToClear)
    {
        objSearchText.value = '';
    }
}
