var quotenum;

var quotes=[			 
	["<strong>Andrew Mitchell</strong> QC has extensive knowledge, unmatched experience and peerless courtroom presence.", "Chambers &amp; Partners 2009"], 
	["<strong>Kennedy Talbot</strong> has appeared in over 500 confiscation and asset forfeiture cases in the Crown Court, High Court, Court of Appeal, Divisional Court, House of Lords and Privy Council...", "Chambers &amp; Partners 2009"],
	["<strong>Ivan Pearce</strong> is a genius who is destined for great things.", "Chambers &amp; Partners 2009"],
	["<strong>Simon Taylor</strong> has an incisive mind and mature manner in court.", "Chambers &amp; Partners 2009"],
	["<strong>Keith Mitchell</strong> is one of the most popular barristers on the circuit right now. Recognised as being one of the main players specialising in VAT and fraud.", "Chambers &amp; Partners 2009"],
]
	


function formatQuote(quote, quoteauthor) {
	return '<div id="quotetext">' + quote + '</div><div id="quoteauthor">' + quoteauthor + '</div>';
}


function getQuoteIndex() {
	return Math.floor(Math.random()*5);
}


function doQuote() {	
	$("#quote").fadeOut("slow",showQuote);
}


function showQuote() {
	var oldquotenum = quotenum;
	while (quotenum == oldquotenum) {
		quotenum = getQuoteIndex();
	}	
	$("#quote").html(formatQuote(quotes[quotenum][0], quotes[quotenum][1]));
	$("#quote").fadeIn("slow");
}


$(document).ready(function(){
	showQuote();
	var t = setInterval(doQuote, 6000);
});
