/* **********
        Randomly rotate the images on the wlass.co.uk entrance 
		page. There are about 5 images and only 1 of them can 
		be displayed at a time. Selection is random.

********** */

var tlist = new Array(3);//make sure this is greater than or equal to the total number of pistures
tlist[0] = '<img src="images/homepage-banner.jpg" alt="Big Top 40 Shows" width="541" height="264" />';
tlist[1] = '<img src="images/homepage-banner2.jpg" alt="Big Top 40 Shows" width="541" height="264" />';
tlist[2] = '<img src="images/homepage-banner3.jpg" alt="Big Top 40 Shows" width="541" height="264" />';

var listtotal = 3; //change this to the total number of testimonials in the list == the last index for tlist[XX] + 1

if (listtotal <= 1)// number of items per page
{
        var dlist = new Array(listtotal);
        var looptop = listtotal;
        for (var i=0; i<looptop; i++)
        {
                dlist[i] = tlist[i];
        }
}
else
{
        var dlist =  new Array(1);
        var looptop = 1;
        for (var i=0; i<looptop; i++)
        {
                var listrnd = Math.floor(Math.random() * listtotal);
                if (tlist[listrnd].length < 1)
                {
                        i--;
                }
                else
                {
                        dlist[i] = tlist[listrnd];
                        tlist[listrnd] = '';
                }
        }
}