<!--
// Example:
// randomImage(['0.gif',50,50,'1.gif',25,25,'2.gif',50,25]); 

// * Dependencies * 
// this function requires the following snippet:
// JavaScript/Randomizers/randomNumber

function randomImage(imgArr)
{
  var imgSrc, imgW, imgH, r;
  r = randomNumber(imgArr.length / 3)-1;
  
  imgSrc = imgArr[r * 4];
  imgW = imgArr[(r * 4)+1];
  imgH = imgArr[(r * 4)+2];

  document.write('<IMG SRC='+imgSrc+' WIDTH='+imgW+' HEIGHT='+imgH+'>');
}
function randomNumber(limit){
  return Math.floor(Math.random()*limit);
}

// Example:
// simplePreload( '01.gif', '02.gif' ); 
function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}
// * Dependencies * 
// this function requires the following snippets:
// JavaScript/images/switchImage
//
// BODY Example:
// <body onLoad="mySlideShow1.play(); mySlideShow2.play();">
// <img src="originalImage1.gif" name="slide1">
// <img src="originalImage2.gif" name="slide2">
//
// SCRIPT Example:
// var mySlideList1 = ['image1.gif', 'image2.gif', 'image3.gif'];
// var mySlideShow1 = new SlideShow(mySlideList1, 'slide1', 3000, "mySlideShow1");
// var mySlideList2 = ['image4.gif', 'image5.gif', 'image6.gif'];
// var mySlideShow2 = new SlideShow(mySlideList2, 'slide2', 1000, "mySlideShow2");
function SlideShow(slideList, image, speed, name)          
{
  this.slideList = slideList;
  this.image = image;
  this.speed = speed;
  this.name = name;
  this.current = randomNumber(slideList.length);
  this.timer = 0;
}
SlideShow.prototype.play = SlideShow_play;  
function SlideShow_play()       
{
  with(this)
  {
    if(current++ == slideList.length-1) current = 0;
    switchImage(image, slideList[current]);
    clearTimeout(timer);
    timer = setTimeout(name+'.play()', speed);
  }
}
function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}
// -->
<!-- List of images for header -->
var hdrSlideList = ['/images/smallcroppedhousewithFeathering.jpg', '/images/smallcroppedfireflameswithfeathering.jpg', '/images/kids_at_lemonade_standwithFeather.gif'];
var hdrSlideShow = new SlideShow(hdrSlideList, 'hdrImage', 2000, "hdrSlideShow");

<!--
AdImages = new Array ('ads/gsm_375_honeywell.gif')
AdUrl = new Array("www.honeywell.com/security/hsc")
thisAd = Math.floor(Math.random()*AdImages.length)

function rotate() {
	if (document.images) {
		if (document.ad1.complete && document.ad2.complete) {
  			thisAd = (thisAd+1)%AdImages.length;
			document.ad1.src=AdImages[thisAd]
			document.ad2.src=AdImages[(thisAd+1)%AdImages.length]
		}
		setTimeout("rotate()",14000)
	}
}

function newLocation(AdNum) {
	document.location.href = "http://" + AdUrl[(thisAd+AdNum)%AdImages.length]
}
-->
