﻿jQuery(document).ready(function() {
var TopImages = ['images/tristar/top/01.jpg', 'images/tristar/top/02.jpg', 'images/tristar/top/03.jpg',
                          'images/tristar/top/04.jpg', 'images/tristar/top/05.jpg', 'images/tristar/top/06.jpg',
                          'images/tristar/top/07.jpg', 'images/tristar/top/08.jpg', 'images/tristar/top/09.jpg',
                          'images/tristar/top/10.jpg'];
    var TopRndNum = Math.floor(Math.random() * TopImages.length);

    var SmallImages = ['images/tristar/small/01.jpg', 'images/tristar/small/02.jpg', 'images/tristar/small/03.jpg',
                           'images/tristar/small/04.jpg', 'images/tristar/small/05.jpg', 'images/tristar/small/06.jpg',
                           'images/tristar/small/07.jpg', 'images/tristar/small/08.jpg', 'images/tristar/small/09.jpg',
                           'images/tristar/small/10.jpg', 'images/tristar/small/11.jpg', 'images/tristar/small/12.jpg',
                           'images/tristar/small/13.jpg', 'images/tristar/small/14.jpg', 'images/tristar/small/15.jpg'];
    var SmallRndNum = Math.floor(Math.random() * SmallImages.length);
    var SmallRndNum2 = Math.floor(Math.random() * SmallImages.length);

    var LargeImages = ['images/tristar/large/01.jpg', 'images/tristar/large/02.jpg', 'images/tristar/large/03.jpg',
                           'images/tristar/large/04.jpg', 'images/tristar/large/05.jpg', 'images/tristar/large/06.jpg',
                           'images/tristar/large/07.jpg', 'images/tristar/large/08.jpg', 'images/tristar/large/09.jpg',
                           'images/tristar/large/10.jpg', 'images/tristar/large/11.jpg', 'images/tristar/large/12.jpg',
                           'images/tristar/large/13.jpg', 'images/tristar/large/14.jpg', 'images/tristar/large/15.jpg',
                           'images/tristar/large/16.jpg', 'images/tristar/large/17.jpg', 'images/tristar/large/18.jpg',
                           'images/tristar/large/19.jpg', 'images/tristar/large/20.jpg', 'images/tristar/large/21.jpg'];
    var LargeRndNum = Math.floor(Math.random() * LargeImages.length);

    while (SmallRndNum == SmallRndNum2)
    { SmallRndNum2 = Math.floor(Math.random() * SmallImages.length); }

    jQuery(".ti1").attr({ src: TopImages[TopRndNum] });
    jQuery(".si1").attr({ src: SmallImages[SmallRndNum] });
    jQuery(".si2").attr({ src: SmallImages[SmallRndNum2] });
    jQuery(".li1").attr({ src: LargeImages[LargeRndNum] });
});