﻿var curtabid = "";
var speed = 6;
var type = 0;
var tmhandle = 0;

function MoveLeft(tabid)
{
    curtabid = tabid;
    type = +1 * speed;

    window.clearInterval(tmhandle);
    tmhandle = window.setInterval("movepart()", 2);
}
function MoveRight(tabid)
{
    curtabid = tabid;
    type = -1 * speed;

    window.clearInterval(tmhandle);
    tmhandle = window.setInterval("movepart()", 2);
}
function endmove()
{
    type = 0;
    window.clearInterval(tmhandle);
}
function movepart()
{
    try
    {
        if(curtabid != "")
        {
            var tabi = document.getElementById(curtabid);
            if(tabi)
            {
                tabi.style.pixelLeft += type;
                if(tabi.style.pixelLeft < -680)
                {
                    tabi.style.pixelLeft = -680;
                }
                if(tabi.style.pixelLeft > 0)
                {
                    tabi.style.pixelLeft = 0;
                }
                tabi.style.marginLeft = tabi.style.pixelLeft;
            }
        }
    }
    catch(e)
    {
    }
}

