﻿var timer = 5;

var img, count = 1;

function startSlideshow()
{
    var rightColumn = document.getElementById('right-column');
    var children = rightColumn.getElementsByTagName("img");
    img = children[0];
    
    if(photos.length == 1)
        img.src = photos[0];
    else
        window.setTimeout('cueNextSlide()', timer * 1000);
}
function cueNextSlide()
{
    var next = new Image();
    
    next.onload = function()
    {
        img.src = next.src;
        
        img.width = next.width;
        img.height = next.height;
        
        if(++count == photos.length){count = 0;}
        
        window.setTimeout('cueNextSlide()', timer * 1000);
    };
    
    next.src = photos[count];
}
Sys.Application.add_load(startSlideshow);