// JavaScript Document
<!--     IMAGE CYCLER v2.0      --> 
<!--     by Angus Turnbull      --> 
<!--  http://www.twinhelix.com  --> 
<!--  Visit for more scripts!   --> 
 
function imgCycle(dir) { with (this)
{
 // Stop any exiting play function if this is called manually.
 stop();
 
 // Increment and mod by the image array length.
 currImg += dir;
 currImg = currImg % data.length;
 if (currImg < 0) currImg += data.length;
 
 // The image in question -- perhaps nested within its parent layer for NS4.
 var imgRef = parLyr.document.images[myName + 'Img'];
 
 // IE filters active?
 var f = imgRef.filters;
 if (f&&f.length&&f[0]) f[0].Apply();
 // Swap the image, and play the filter if applicable.
 imgRef.src = data[currImg].src;
 if (f&&f.length&&f[0]) f[0].Play();
}}
 
function imgPlay() { with (this)
{
 // Cycle one image forwards -- cycle() will stop an existing timeout if applied.
 cycle(1);
 timer = setTimeout(myName + '.play()', delay);
}}
 
function imgStop()
{
 // Clear the play timer to stop autocycling.
 clearTimeout(this.timer);
 this.timer = null;
}
 
function ImageCycle(myName, delay, parLyr)
{
 this.myName = myName;
 this.delay = delay;
 this.timer = 0;
 this.parLyr = (document.layers && parLyr ? eval(parLyr) : window);
 this.currImg = 0;
 
 this.data = new Array();
 for (var i = 3; i < arguments.length; i++)
 {
  // Preload images into an array before swapping.
  this.data[i - 3] = new Image();
  this.data[i - 3].src = arguments[i];
 }
 
 this.cycle = imgCycle;
 this.play = imgPlay;
 this.stop = imgStop;
}
 
var picRotate = new ImageCycle('picRotate', '3000', null,
 'content/Accessories01.jpg', 'content/Beds01.jpg', 'content/Beds02.jpg', 'content/Cables01.jpg', 'content/ClothesWashers01.jpg', 'content/ComputerParts01.jpg', 'content/ComputerParts01.jpg', 'content/DeepFreezers01.jpg', 'content/DishWashers01.jpg', 'content/Stoves01.jpg');
 
// Start onload, make sure any other functions are called as well...
var imgOldOL = window.onload;
window.onload = function()
{
 if (imgOldOL) imgOldOL();
 picRotate.play();
}
 
// And stop cycling in 20 seconds.
setTimeout('picRotate.stop()', 100000);
 
// End Hide -->
