/* **********
        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(5);//make sure this is greater than or equal to the total number of testimonials
tlist[0] = '<img src="images/index_abbeybrooks_200812.jpg" border="0">';
tlist[1] = '<img src="images/index_dakodabrookes_200812.jpg" border="0">';
tlist[2] = '<img src="images/index_sadiewest_200812.jpg" border="0">';
tlist[3] = '<img src="images/index_stoya_200812.jpg" border="0">';
tlist[4] = '<img src="images/index_terapatrick_200812.jpg" border="0">';

var listtotal = 5; //change this to the total number of testimonials in the list == the last index for tlist[XX] + 1

if (listtotal <= 1)// number of testimonials on each page is 7
{
        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] = '';
                }
        }
}