var is_quicklink_tx_show = false;
var div_quicklink_tx = document.getElementById("quicklink_tx");
var div_quicklink_tx_in = document.getElementById("quicklink_tx_in");
var stepms = 10;
var div_simple_topbar = document.getElementById("simple_topbar");
var div_outerheight=div_quicklink_tx_in.offsetHeight;
div_quicklink_tx_in.style.top = -div_outerheight+"px";
div_quicklink_tx_in.style.height = div_outerheight+"px";
function quicklink_tx_show(){
    quicklink_tx_stepshow();
    setTheCookie("openTopBar",1,1);
    div_simple_topbar.style.display="none";
}
function quicklink_tx_stepshow(){
    var curHeight = parseInt(div_quicklink_tx.offsetHeight);
    if(curHeight>=div_outerheight){
        is_quicklink_tx_show = true;
    }else{
        var newHeight = parseInt(curHeight + 4);
        var newInTop = parseInt(div_quicklink_tx_in.style.top)+4;
        if(newHeight>=div_outerheight)
        {
            div_quicklink_tx.style.height = div_outerheight + "px";
            div_quicklink_tx_in.style.top = "0px";
        }
        else
        {
            div_quicklink_tx.style.height = newHeight + "px";
            div_quicklink_tx_in.style.top = newInTop + "px";
        }
        window.setTimeout(quicklink_tx_stepshow,stepms);
    }
}
function quicklink_tx_hide(){
    if(is_quicklink_tx_show){
        quicklink_tx_stephide()
    }else{
        window.setTimeout(quicklink_tx_stephide,1200);
    }
    setTheCookie("openTopBar",0,1);
    div_simple_topbar.style.display="";
}
function quicklink_tx_stephide(){
    var curHeight = parseInt(div_quicklink_tx.style.height);
    if(curHeight<=0){
        is_quicklink_tx_show = false;
    }else{
        try{
            var newHeight = parseInt(curHeight - 4);
            var newInTop = parseInt(div_quicklink_tx_in.style.top)-4;
            if(newHeight<=0)
            {
                div_quicklink_tx.style.height = "0px";
                div_quicklink_tx_in.style.top = (newInTop-8) + "px";
            }
            else
            {
                div_quicklink_tx.style.height = newHeight + "px";
                div_quicklink_tx_in.style.top = newInTop + "px";
            }
            window.setTimeout(quicklink_tx_stephide,stepms);
        } catch(e) {}
    }
}
var topBarStatus=getTheCookie("openTopBar");
if(topBarStatus==1)
{
    if(window.addEventListener){
        window.addEventListener("load",quicklink_tx_show,false);
    }else{
        window.attachEvent("onload",quicklink_tx_show);
    }
}