var min = 0x000000;
var color = min;
var max = 0x333333;
window.onload = setTimout(foo, 1);
function foo() {
color++;
if (color > max) {
color = min;
}
document.getElementById("1").style.backgroundColor = color;
alert(color);
}