var currentQuote = 0;
var quotes;

$(document).ready(function($) {
	initRollovers();
});

function initRollovers() {
	$(".rollover").hover(
		function() {
			this.src = this.src.replace("_off","_on");
		},
		function() {
			this.src = this.src.replace("_on","_off");
		}
	);
}
function startQuotesSlideshow() {
	$(".hidden").addClass("quoteCopy");
	$(".hidden").removeClass("hidden");
	quotes = $(".quoteCopy");
	$(".quoteCopy").hide();
	playQotesSlideshow();
}
function playQotesSlideshow() {
	if(currentQuote == 0) {
		changeQuote(quotes.length);
	}else if(currentQuote < quotes.length) {
		changeQuote(currentQuote);
	}	
}

function changeQuote(quoteNum) {
	$(quotes[quoteNum-1]).fadeOut("slow", showQuote);
}

function showQuote() {
	$(quotes[currentQuote]).fadeIn("slow");

	if(currentQuote < quotes.length -1 ){
		currentQuote++;
	}else {
		currentQuote = 0;
	}
	setTimeout("playQotesSlideshow()", 9000);
}