// JavaScript Document
// Ashley Engelund
// Copyright (c) 2008  All Rights Reserved
//
// DESC:  lots of HARDCODED stuff here (sorry)
//   this will rotate thru a list of images for an image with id = "ae_rotator"
//  you'll have to hard code the file names, alt tags, and hrefs here.
//
//   This does NOT check to see if the files actually exist or anything.  If they're not there,
//    you'll get unexpected results.  too bad for you.
//
// DEPENDENCIES <must be loaded before this file>: MM_swapImage(), MM_findObj, MM_preloadImages()
//
// TBD:  links, alt text
//

/*
1. 2007-1-elkbull-crop---
2. #13 100_560 ---
3.  #24  100_sharp===
4.  #17 IMG_0171---
5.  #19  100_606x  ---
6   #12  Brad's 2008 Loco Buck
7.  #23 Chick's 2008 Loco Bull  
8.  #1  Tony's 2008 Loco Bull
9.  #6  Tim's 2008 Loco Bull
10. Loco Mountain Ranch webpage last photo "Bob's 2007 Loco Bull" 
11. Guffey webpage page 2 "Dave's 2007 Loco Bull
12. Hatton webpage page 2 "Ken's 2007 Loco Bull 
*/


// Comma separated list of images to rotate

var ae_rotatorImages = new Array('assets/pics/rotators/2007-1-ElkBull-crop2-frontImage.jpg',
	'assets/pics/rotators/2008-11-13-100_0560-200h.jpg',
	'assets/pics/rotators/2008-11-24-100_0562-sharpx250.jpg',
	'assets/pics/rotators/2009-11-Pete-6by6-Bull-Elk-Loco-14-lc-200h.jpg',
	'assets/pics/rotators/2008-11-19-NYIronMen-100_0606-200h.jpg',
	'assets/pics/rotators/2008-11-12-Brad2-c200h.jpg',
	'assets/pics/rotators/2008-11-23-100_0609-x250w.jpg',
	'assets/pics/rotators/2008-11-01-DSC01569-crophard-200h.jpg',
	'assets/pics/rotators/2008-11-6-last086-crop2-x250.jpg',
	'assets/pics/rotators/2009-11-Bob-Elk-Bull-Loco-3-lc-200h.jpg',
	'assets/pics/rotators/2009-11-Gust-Bull-Dave-Buck-15-lc-200h.jpg',
	'assets/pics/rotators/15-2007KensLocoElkBull6x6-x250w.jpg');


// delay in milliseconds between image swaps 1000 = 1 second
var delay = 4000;
var counter = 0;

function preloadImages(){
  for(var i=0;i<ae_rotatorImages.length;i++){
    MM_preloadImages(ae_rotatorImages[i]);
  }
}


function showNextImage(){
  if(counter == (ae_rotatorImages.length)){
    counter = 0;
  }
  MM_swapImage('ae_rotator', '', ae_rotatorImages[counter++]);
  setTimeout('showNextImage()', delay);
}

//function showNextImage(){
//  var argv = showNextImage.arguments;
//	var pStr = showNextImage.arguments[0];
//	alert("showNextImage pStr= " + pStr);
//	var fullFileName;
//  if(counter == (ae_rotatorImages.length)){
//    counter = 0;
//  }
//	fullFileName = pStr + "/" + ae_rotatorImages[counter++];
//	MM_swapImage('ae_rotator', '', fullFileName);
//	alert("setTimeout: showNextImage("+pathStr+"), " + delay);
//	setTimeout("showNextImage('"+pStr+"')", delay);

//}