I need to display a series of RGB colors inside my ASP.NET web page. I was hoping to accomplish this using an ASP Update Panel but the update has to take place in sequence without the user intervention, every 4 or 5 seconds.

My initial JavaScript code looks like this :

```
document.getElementById('div').style.backgroundColor = "rgb(0,0,255)";

```

Problem is getting the next RGB color combination to display.
I experimented with a wait 'loop' found here in another post :

```
wait(7000); //7 seconds in milliseconds

function wait(ms) {
            var start = new Date().getTime();
            var end = start;
            while (end < start + ms) {
                end = new Date().getTime();
            }
        }

```

Problem is that, it does not work. I tried with :

```
document.getElementById('fondRGB').style.backgroundColor = "rgb(0,0,255)";
wait(7000);
document.getElementById('fondRGB').style.backgroundColor = "rgb(128,128,128)";
wait(7000);  
document.getElementById('fondRGB').style.backgroundColor = "rgb(0,0,0)";

```

but only the very first rgb color is ever honored?