// Javascript for home page image rotation.
// Script requires /js/jquery-1.2.6.min.js and /js/jquery.cycle.all.min.js

var arrImages = new Array();

// Set images to include in the rotator. Image on home page in the div#images is for people who do not have javascript enabled, and for graceful loading.  This image should be set to the same image as arrImages[0]
arrImages[0] = "images/home-image-1.jpg";
arrImages[1] = "images/home-image-2.jpg";
arrImages[2] = "images/home-image-3.jpg";
arrImages[3] = "images/home-image-4.jpg";
arrImages[4] = "images/home-image-5.jpg";
arrImages[5] = "images/home-image-6.jpg";
arrImages[6] = "images/home-image-7.jpg";
arrImages[7] = "images/home-image-8.jpg";
//arrImages[7] = "images/home-image-9.jpg";


// Set rotation speed - this is the amount of time spent on each image before it rotates (in seconds)
var rotationSpeed = 7;

// Set transition speed - this is the amount of time it takes to transition from one image to the next (in seconds)
var transitionSpeed = .5;

$(document).ready(function() {
	var images = "";
	
	// Load Images into div#images
	for (var i = 0; i < arrImages.length; i++) { images += '<img src="' + arrImages[i] + '" />'; }
	$('#images').html(images);
	
	// Add previous and next buttons
	$('#rotator').append('<img id="prev" alt="Previous" src="images/prev.gif" /><img id="next" alt="Next" src="images/next.gif" />');
	
	// Initialize image rotation and apply additional settings 
	$('#images').cycle({ 
		fx:     'scrollHorz', 
		speed:  transitionSpeed * 1000,
		timeout: rotationSpeed * 1000, 
		next:   '#next', 
		prev:   '#prev',
		cssBefore: { top:63, height:100, opacity:0 },
		animIn: { height: 227, opacity: 1, top: 0 }, 
		animOut: { top: 63, height: 100, opacity: 0 }
	});
	
	if ($.browser.msie && $.browser.version < 7) {
		$(".clientbox .fade").css("display", "none");
	}

});
