onload = function()
{
        var start_num = document.getElementById("start_num").value;
        var end_num = document.getElementById("end_num").value;

        document.getElementById("loadingbar").style.display = 'none';

        var thumbs = [];
        var thumbs2 = [];

        for (i = start_num; i <= end_num; i++) {
                thumbs.push(''+i);
                thumbs2.push(''+i);
        }
        

        var offsets = [];

        //WORKS
        for (i = 0; i <= end_num-start_num+1; i++) {
                random = Math.floor(Math.random() * thumbs.length);
                setTimeout('Effect.Appear("'+thumbs[random]+'", { to: 1.0, duration: 0.5 })',300*i);

                do {
                        rand = (Math.floor((Math.random() * 5)+1)*300);
                        newoff = (250*i)+rand + 100;
                } while (offsets.indexOf(newoff) != -1)
                offsets.push(newoff);
                setTimeout('document.getElementById("'+thumbs[random]+'").src = "thumbs/'+thumbs[random]+'.jpg"',newoff);

                thumbs.splice(random,1);
                
                /*
                Don't need this (fades in the nav numbers)
                if (i == end_num-start_num+1) {
                        setTimeout('Effect.Appear("nav", { to: 1.0, duration: 0.3 })',newoff);
                }
                */
        }
        
        //NEW
        /* for (i = 0; i < 20; i++) {
                random = Math.floor(Math.random() * thumbs2.length);
                setTimeout('document.getElementById("'+thumbs2[random]+'").src = "thumbs/'+thumbs2[random]+'color.jpg"',(100*i)+2400);
                thumbs2.splice(random,1);
        } */
}
