var dy2 = 20;           // Pixels to move for each time interval
var t = 10;            // Time interval (in milliseconds)
var mIntrvl;           // Identifier for setInterval and clearInterval
var topStop2 = -600;    // Top position for hidden div
var bottomStop2 = 140;  // Bottom position for hidden div

function show2() {
    // Clear mIntrvl if already set.
    if (mIntrvl) {
        clearInterval(mIntrvl);
    }
    // Start the div moving in.
    mIntrvl = setInterval(move_down2, t);
    
}
function hide2() {
    // Clear mIntrvl if already set.
    if (mIntrvl) {
        clearInterval(mIntrvl);
    }
    // Start moving it out.
    mIntrvl = setInterval(move_up2, t);
}
function move_down2() {
    var win = document.getElementById('hidden_div-nav');
    // Old top property without the "px".
    var old = parseInt(win.style.top);
    // If we're done moving down, stop calling this function.
    if (old >= bottomStop2) {
        win.style.top = bottomStop2 + 'px';
        clearInterval(mIntrvl);
        mIntrvl = null;
        return;
    }
    // Move the div/window down.
    win.style.top = old + dy2 + 'px';
}
function move_up2() {
    var win = document.getElementById('hidden_div-nav');
    // Old top property without the "px".
    var old = parseInt(win.style.top);
    // If we're done moving up, stop calling this function.
    if (old <= topStop2) {
        win.style.top = topStop2 + 'px';
        clearInterval(mIntrvl);
        mIntvl = null;
        return;
    }
    // Move the div/window up.
    win.style.top = old - dy2 + 'px';
}
