﻿function spinnerAddCallback(id, amount) {
    var curValue = parseInt($(id).value);
    
    if (isNaN(curValue)) {
        curValue = 0;
    }
    
    curValue = curValue + amount;
    
    if (curValue < 0) {
        curValue = 0;
    }
    
    $(id).value = curValue;
}

function spinnerAdd (id, amount) {
    // small delay to help js threading along
    setTimeout("spinnerAddCallback('" + id + "'," + amount + ")", 2);
    
    //spinnerAddCallback(id, amount);
}