var QuoteRotation = function(quotes) {
	var me = this;
	
	this.rotate = function() {
		if(me.show.length == me.quotes.length) {
			me.show = [ me.currentQuote ];
		}
		while($.inArray(me.currentQuote = Math.round(Math.random() * (me.quotes.length - 1)), me.show) >= 0)
			continue;
		me.show.push(me.currentQuote);
		me.testimonial.fadeOut(function() {
			me.quote.text(me.quotes[me.currentQuote].quote);
			me.attribution.text(me.quotes[me.currentQuote].attribution);
			me.testimonial.fadeIn();
		});
	}
	
	// Initialise the class
	me.show = [];
	me.quotes = quotes;
	me.testimonial = $('.testimonial');
	me.quote = $('.testimonial .inner p:first');
	me.attribution = $('.testimonial .inner .attribution');
	me.rotate();
	setInterval(me.rotate, 7000);
}

