var counter=0;
var white = "#FFFFFF";
var red   = "#EA0000";
var green = "#00BF00";
var blue  = "#0000FF";

var c_arr = new Array(red, green, blue);
var box1;
var box2;
var box3;
function init() {

     box1 = document.getElementById("pixel1");
     box2 = document.getElementById("pixel2");
     box3 = document.getElementById("pixel3");
    setInterval("change_color()", 1000);


}

function change_color() {
    if (counter % 2 == 0) {
        box3.style.backgroundColor = white;
    } else {
        c_arr.push(c_arr[0]);
        c_arr.shift();
        box1.style.backgroundColor =  c_arr[2];
        box2.style.backgroundColor =  c_arr[1];
        box3.style.backgroundColor =  c_arr[0];
    }



    counter++;
    if (counter == 6) {
        counter = 0;
    }
    return true;
}

function jump(nr) {
    if (counter % 2 == 0) {
        box1.style.left = 80 + "px";
        box2.style.left = 90 + "px";
        box3.style.left = 100 + "px";
    } else {
        box1.style.left = 120 + "px";
        box2.style.left = 110 + "px";
        box3.style.left = 100 + "px";
    }
}