<!--
/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// image file names go in these arrays odd
randImgObj.set1 = new Array("8ebe675145c52d73e4b139b657226ef8.jpg", "d307d11e497d74d16968977dbe29290e.jpg", "14f9416ef1e8b0caf27a834c724803de.jpg", "700b0dfb08331938a5b54bb5d6ea913f.jpg", "4649a2e57536bed79dfc1dfce97c1cc4.jpg", "bc073590b4a83a8c582d58489ff2b883.jpg", "9e56608b97258468971b907086402b32.jpg", "374f8b008c64dd43bd0da5512cf41eb9.jpg", "54bce4c52840c81be48c070cbd03763e.jpg", "c5e4f091df390683c2d1f31ede863ba9.jpg", "b5ac56610745ad237197ec4d321dcc53.jpg", "2c818567c904a15bcb5d444d1c508539.jpg", "8885870c3bb0b0cf5ded8070a09acffd.jpg", "ff4e96fb57a3e15ca8c30bba3879c553.jpg", "fd0f30a860c1cf6def617ee532d74df7.jpg", "3c26c886038d1c842e56a290bbc1839b.jpg", "dc8533fb57232f1fbc013e67a98c7afd.jpg", "5829302ddc610f82c48e3de2fef2aa84.jpg", "1fcb06ca3dd69cbab9e7edb364dd07f2.jpg", "d08270a04bc3ad519d83af6304d10805.jpg", "407a258552a6c44919229be5bf52ab38.jpg", "3c049ff42a61d3169b3ca4cc5c7cf6dd.jpg", "3c3a5a6b6728c79d7114d92f4280c2e9.jpg", "96b3b2f0ce52c85c3901c22908477e53.jpg", "ea668a1ab438f03c499e49747e53211a.jpg", "0c9bbf70e962d9180a1d3b135bdb4c0a.jpg", "a9ef96cd21c8f19847efdc818474f0ec.jpg", "dd656901229a0c39ee6bc8e7ef76031c.jpg", "753a1eda4ee81529ec8df9062f374c9e.jpg", "3705fa801043c8efc646ce14a530a5de.jpg", "4186c00724672f6cb8984018d1bca2c9.jpg");

// for the second set of rotating images quotes
randImgObj.set2 = new Array("quote_01.jpg", "quote_02.jpg", "quote_03.jpg", "quote_04.jpg", "quote_05.jpg", "quote_06.jpg", "quote_07.jpg", "quote_08.jpg", "quote_09.jpg", "quote_10.jpg");

// for the second set of rotating images funny
randImgObj.set3 = new Array("funny_01.jpg", "funny_02.jpg", "funny_03.jpg", "funny_04.jpg", "funny_05.jpg");

// If all the images you wish to display are in the same location, you can specify the path here 
randImgObj.imagesPath = "images/tees/";

// No need to edit code below this line 
/////////////////////////////////////////////////////////////////////
Array.prototype.shuffle = function() { 
  var i, temp, i1, i2;
  for (i=0; i<this.length; i++) { 
    i1 = Math.floor( Math.random() * this.length );
    i2 = Math.floor( Math.random() * this.length );
    temp = this[i1];
    this[i1] = this[i2];
    this[i2] = temp;
  }
}

randImgObjs = []; // holds all random rotating image objects defined
// constructor 
function randImgObj(s) {
  this.speed=s; this.ctr=0; this.timer=0;  
  this.index = randImgObjs.length; randImgObjs[this.index] = this;
  this.animString = "randImgObjs[" + this.index + "]";
}

randImgObj.prototype = {
  addImages: function(ar) { // preloads images
    this.imgObj.imgs = [];
    for (var i=0; ar[i]; i++) {
      this.imgObj.imgs[i] = new Image();
      this.imgObj.imgs[i].src = randImgObj.imagesPath + ar[i];
    }
  },

  rotate: function() { // controls rotation
    var ctr = Math.floor( Math.random() * this.imgObj.imgs.length );
    if (ctr == this.ctr) ctr = (ctr > 0)? --ctr: ++ctr;
    this.ctr = ctr;
    if ( typeof this.imgObj.filters != "undefined" ) {
   		this.imgObj.style.filter = 'blendTrans(duration=1)';
      if (this.imgObj.filters.blendTrans) this.imgObj.filters.blendTrans.Apply();
    }
    this.imgObj.src = this.imgObj.imgs[this.ctr].src;
    if ( typeof this.imgObj.filters != "undefined" && this.imgObj.filters.blendTrans )
      this.imgObj.filters.blendTrans.Play();    
  }
}

// sets up rotation for all defined randImgObjs
randImgObj.start = function() {
  for (var i=0; i<randImgObjs.length; i++) 
    randImgObjs[i].timer = setInterval(randImgObjs[i].animString + ".rotate()", randImgObjs[i].speed);                     
}

randImgObj.setUpImg = function(imgAr, sp, w, h) {
  var rotator, img, imgStr = "";
  rotator = new randImgObj(sp);
  randImgObjs[randImgObjs.length-1].imgAr = imgAr;
  imgAr.shuffle();
  img = imgAr[ Math.floor( Math.random() * imgAr.length ) ]; 
  imgStr += '<img src="' + randImgObj.imagesPath + img + '" alt="" ';
  imgStr += 'name="img' + (randImgObjs.length-1) + '" width="' + w + '" height="' + h + '">';
  document.write(imgStr); 
}

function initRandRotation() {
  for (var i=0; randImgObjs[i]; i++) {
    var rotator = randImgObjs[i];
    rotator.imgObj = document.images["img" + i]; // get reference to the image object
    rotator.addImages(rotator.imgAr);
    rotator.rotate();
  }
  randImgObj.start();  
}
-->