The website I am working on is washtawimbashoes.com
It is for my brother, as a christmas present. He makes some pretty sweet duct tape shoes.

I am trying to write some JavaScript that will allow me to take the image on the front page, display it for say 10 seconds, then swap it out with another image, display that one for 2 seconds and repeat that continuously.

This is my first writing making a website and using JavaScript so I could use some help. Here was my first attempt:

<script type="text/javascript">
for (i=10;i<1000;i=i+1)
{
if (i%5==0)
{
document.write("<img class='aligncenter' src='pic.jpg'")
}
else if (i%7==0)
{
document.write("<img class='aligncenter' src='pic2.jpg'")
}
}
</script>

The hope here was that document.write would overwrite the current pic but instead, it just added it below. Is there a way to erase something that you just wrote or replace it?

Any tips would be great.

Thanks,

Rich