function UpValue(controlID, step)
{
    var textBox = document.getElementById(controlID);
    var i = parseInt(textBox.value);
    if (i > step - 1)
    {
        i = i-i%step+step;
    }
    else
    {
        i = step;
    }
    textBox.value = i;
}

function DownValue(controlID, step)
{
    var textBox = document.getElementById(controlID);
    var i = parseInt(textBox.value);
    if (i > step)
    {
        var rem = i%step
        if(rem != 0)
        {
            i = i-rem;
        }
        else
        {
            i-=step;
        }
    }
    else
    {
        i = step;
    }
    textBox.value = i;
}

function ValidateQty(controlID, step, warning)
{
    var textBox = document.getElementById(controlID);
    var i = parseInt(textBox.value);
    if (i%step != 0)
    {
        alert(warning);
        return false;
    }
    else
    {
        return true;
    }
}

function ValidateCheckedQty(controlID, checkID, step, warning)
{
    var checkbox = document.getElementById(checkID);
    if (checkbox.checked)
    {
        return ValidateQty(controlID, step, warning);
    }
    else
    {
        return true;
    }
}