// Create a bunch of off-screen images, and get them started 
// loading the images we're going to animate.
            
delay_time = 2000;
FILMLENGTH = 15;
images = new Array(FILMLENGTH);
path="http://www.pix43.com/images/livecam/live_animation_frame_";
var frame = 0;         // Keep track of what frame of the animation we're on.
var timeout_id = null; // This allows us to stop the animation.

for(var i = 0; i < FILMLENGTH; i++) {
    images[i] = new Image();                      // Create an Image object
    if (i<10) images[i].src = path + "0" + i + ".jpg";   // tell it what URL to load
 
    else images[i].src = path + i + ".jpg";             // tell it what URL to load
   }

function playVideo()  
{
    frame = (frame + 1) % FILMLENGTH;
    document.live_vid.src = images[frame].src;
    timeout_id = setTimeout("playVideo()", delay_time);         // display next frame later
}