
var add = 1;
var color = 0;
var TimeOut = new Object;
var TimeOut1 = new Object;
function change(obj)
{
    //var temp_color = parseInt(color,6.25);
    var temp = color.toString(16);
    switch(temp.length) 
    {
        case 1:
            temp = "#00"+temp;
    	    break;
        case 2:
            temp = "#0"+temp;
    	    break;
    	case 3:
    	    temp = "#"+temp;
        default:
    }
    if (color >= 2744) 
    {
        add = 0;
    }
    if (color <= 0) 
    {
        add = 1;
    }
    if (add == 1) 
    {
        color += 273;
    }
    else
    {
        color -= 273;
    }
    obj.style.background = temp;
    if (arguments.length>1)
    {
        ShowSub("over");
    }
    TimeOut = setTimeout(function(){change(obj);},100);
}
function stop_change(obj)
{
    clearTimeout(TimeOut);
    obj.style.background = "black";
    add = 1;
    color = 0;
    if (arguments.length>1)
    {
        StartHiding();
    }
}
function StartHiding()
{
    TimeOut1 = setTimeout("ShowSub()",2000);
}
function StopHiding()
{
    clearTimeout(TimeOut1);
    ShowSub("over")
}
function GetOffset(e)
{
    var off = new Object;
    var t = e.offsetTop;
    var l = e.offsetLeft;
    var w = e.offsetWidth;
    var h = e.offsetHeight-2;

    while(e=e.offsetParent)
    {
        t+=e.offsetTop;
        l+=e.offsetLeft;
    }
    off.top = t;
    off.left = l;
    off.width = w;
    off.height = h;
    return off;
}
function overLink(obj)
{
    var tempLeft = parseInt(obj.style.left,10);
    tempLeft -= 10;
    var tempTop = parseInt(obj.style.top,10);
    tempTop -= 2;
    obj.style.left = tempLeft;
    obj.style.top = tempTop;
}
function outLink(obj)
{
    var tempLeft = parseInt(obj.style.left,10);
    tempLeft += 10;
    var tempTop = parseInt(obj.style.top,10);
    tempTop += 2;
    obj.style.left = tempLeft;
    obj.style.top = tempTop;
}
blink_time = 0;
function blink()
{
    document.getElementById("here").style.display = (document.getElementById("here").style.display == "none")?"inline":"none";
    blink_time++;
    if (blink_time >= 10)
    {
        document.getElementById("here").style.display = "none";
        blink_time = 0;
    }
    else
    {
        setTimeout("blink()",500);
    }
}
function ShowSub(type)
{
    clearTimeout(TimeOut1);
    var Nav = new Object;
    Nav = document.getElementById("nav_sub").childNodes;
    var Hidden = new Array;
    var j=0;
    for(var i = 0;i<Nav.length;i++)
    {
        if (Nav[i].className == "hidden")
        {
            Hidden[j] = Nav[i];
            j++;
        }
    }
    for(var i=0;i<Hidden.length;i++)
    {
        if (type == "over") 
        {
            Hidden[i].style.display = "block";
        }
        else
        {
            Hidden[i].style.display = "none";
        }
    }
}

function GlowToNotice(TagId)
{
    change(document.getElementById(TagId));
    setTimeout(function(){stop_change(document.getElementById(TagId))},2500);
}

function ShowHidden(TagId)
{
    var obj = document.getElementById(TagId);
    obj.style.display = (obj.style.display == "" || obj.style.display == "none")?"block":"none";
}

