/*------------------------------------------------------------------------------
//  Warning : This computer program is protected by copying law and international treaties.
//  unauthorized reproduction program or any portion of it will be prosecuted to the maximum extent possible under law .
//  Forbidding : Redistribution of this code, whole or in part, as source code  or in binary form, alone or 
//  as part of a larger distribution or product, is forbidden for any commercial or for-profit or Non-commercial
//  use without the author's explicit written permission.
//  Author : email:redhotsoft@hotmail.com ,location: taiwan cellphone:0919910435
//  <script language="javascript" src="..\App_Js\rightsrcmenu.js"></script>
-----------------------------------------------------------------------------*/
function moveToRight() {
    var scrollTop, scrollBottom, offsetSize;
    if (isNS4) {
        scrollTop = scroll.top;
        scrollBottom = windows.pageoffsetSize + 40;
    } else if (isDOM) {
        scrollTop = parseInt(scroll.style.top, 10);
        scrollBottom = document.body.scrollTop + 40;
    }
    
    var nextTime = 500; 
    if (scrollTop != scrollBottom) {
        offsetSize = Math.ceil(Math.abs(scrollBottom - scrollTop) / 20);
        offsetSize = (scrollBottom > scrollTop) ? offsetSize : -offsetSize;
        if (isNS4) {
            scroll.top += offsetSize;
        } else if (isDOM) {
            scroll.style.top = parseInt(scroll.style.top, 10) + offsetSize;
        }
        nextTime = 10;
    }
    setTimeout("moveToRight()", nextTime);
}

var isDOM = (document.getElementById ? true : false); 
var isNS4 = (document.layers ? true : false);
var scroll;
function initRightMenu() {
    if (isNS4) {
        scroll = document["rightmenu"];
        scroll.top = top.pageoffsetSize + 50;
        scroll.visibility = "visible";
        moveToRight();
    } else if (isDOM) {
        scroll = document.getElementById("rightmenu");
        scroll.style.top = document.body.scrollTop + 50;
        scroll.style.visibility = "visible";
        alert
        moveToRight();
    }
}