function moveDiv()
{
    var div = $("divMenu"), yFrom = div.offsetTop, yTo =
        document.documentElement.scrollTop + 129, timeout = 100;
    if (yFrom != yTo)
    {
        div.style.top = yFrom + (yTo - yFrom) / 20+"px";
        timeout = 10;
    }
    setTimeout("moveDiv()", timeout);
}

function $(e)
{
    return document.getElementById(e);
}

function sh(e, i)
{
    if ($(i).style.display == "none")
    {
        $(i).style.display = "";
        e.src = "images/1.gif";
        setCookie(i.substr(2), 1);
    }
    else
    {
        $(i).style.display = "none";
        e.src = "images/2.gif";
        setCookie(i.substr(2), 0);
    }
}

function initMenu()
{
    var str = getCookie("Status"), img = $("nv1")
        .parentNode.getElementsByTagName("img");
    if (str == null)
    {
        if ($("nv1"))
        {
            var div = $("nv1").parentNode.getElementsByTagName("div"), str = "";
            for (var i = 0; i < div.length; i++)
            {
                div[i].style.display = "none";
                str += ",0";
            }
            document.cookie = "Status=" + str;
        }
    }
    else
    {
        str = str.split(",");
        for (var i = 1; i < str.length; i++)
        {
            $("nv" + i).style.display = str[i] == "1" ? "" : "none";
                //如果为none则为闭合状态
            img[i - 1].src = str[i] == "1" ? "images/1.gif" : "images/2.gif";
        }
    }
}

function getCookie(str)
{
    var arrStr = document.cookie.split("; ");
    for (var i = 0; i < arrStr.length; i++)
    {
        var temp = arrStr[i].split("=");
        if (temp[0] == "Status")
            return temp[1];
    }
}

function setCookie(s, v)
{
    var str = getCookie("Status").split(",");
    str[s] = v;
    str.toString();
    document.cookie = "Status=" + str;
}


function setTab03Syn(i)
{
    selectTab03Syn(i);
}

function selectTab03Syn(i)
{
    switch (i)
    {
        case 1:
            document.getElementById("slide_body1").style.display = "block";
            document.getElementById("slide_body2").style.display = "none";
            document.getElementById("slide_content1").style.color = "#f60";
            document.getElementById("slide_content2").style.color = "#0188e2";
            break;
        case 2:
            document.getElementById("slide_body1").style.display = "none";
            document.getElementById("slide_body2").style.display = "block";
            document.getElementById("slide_content1").style.color = "#0188e2";
            document.getElementById("slide_content2").style.color = "#f60";
            break;
    }
}
