function animate(element, property, from, to, duration) {
    var begin = +new Date; // 開始時間
    var timer = setInterval(function() {
        var time = new Date - begin; // 経過時間
        var pos; // 現在の値の割合
        var now; // 現在の値

        if (time > duration) {
            clearInterval(timer);
            now = to;
        }
        else {
            pos = time / duration;
            now = pos * (to - from) + from;
        }
        element.style[property] = now + "px";
    }, 10);
}

animate(circle, 'left', 0, 500, 1000);