window.onload = function () {
    content = ID('content');
}

red = 0;
blue = 1;
green = 2;
yellow = 3;

function slide_to(location)
{
    var current = get_left(content);
    var shift = Math.abs(location - current) / 10;
    slide(location * (-600), current, 1);
    return false;
}

function get_left(node)
{
    return node.style.left ? parseInt(node.style.left) : 0;
}

function slide(location, start, shift)
{
    var current = get_left(content);
    if ((start <= current && current < location) || (start >= current && current > location)) {
//        var shift = delay ? 100 / delay: 10;
        shift *= 1.2;
        content.style.left = current + parseFloat(shift * (start < location ? 1 : -1)) + 'px';
//        if (delay) {
//            delay -= 1;
//        }
        setTimeout(function () {slide(location, start, shift)}, 0);
    } else {
        content.style.left = location + 'px';
    }
}