// Rotating Logo Script by Sam Hampton-Smith
// www.hampton-smith.com

// Change/Add images below to include them in the set that rotates
	var theimages= new Array("styles/header1.jpg","styles/header2.jpg","styles/header3.jpg","styles/header4.jpg");
	var timetoshow = 10000; // Time in milliseconds you want the images static for - 10000 = 10 seconds
	var timetofade = 2000; // Time in milliseconds you want the images to fade over - 2000 = 2 seconds
	
// Do not change below this line	
	var counter = 0;
	$(function() {
		// Set list of images to be cycled through
		$('#logo h1').css("opacity","0");
		setTimeout("setUp()",timetoshow);
	});
	function changeIt(image1){
		if($('#logo h1').css('opacity')==1){
			$('#logo').css({backgroundImage:"url("+image1+")"});
			$('#logo h1').animate({opacity:0},timetofade);
		} else {
			$('#logo h1').css({backgroundImage:"url("+image1+")"});
			$('#logo h1').animate({opacity:1},timetofade);
		}	
		setTimeout("setUp()",timetoshow);
	}
	function setUp(){
		if (counter<=theimages.length-1) {
			image1 = theimages[counter];
			if (counter<theimages.length-1) {counter++;} else { counter = 0}
		} else {
			image1 = theimages[0];
			counter=1;
		}
		changeIt(image1);
	}
