function fadeElement(element)
{
	$(element).fadeTo(1000, "0");
}

function unFadeElement(element)
{
	$(element).fadeTo(1000, "1");
}

if (null == quoteArray )
{
	// default quotes. can be overridden by creating an array called quoteArray before invoking this script
	var quoteArray = new Array(
		"\"I don’t know how I lived without it!\"<div class=\"testimony_author\">W. D. \"Butch\" Bazer, Operations Manager</div><div class=\"testimony_jobtitle\">Aries Marine - Liftboat Division</div>", 
		"\"Being able to communicate with any vessel at any time in any weather condition made my job a lot easier.\"<div class=\"testimony_author\">W. D. \"Butch\" Bazer, Operations Manager</div><div class=\"testimony_jobtitle\">Aries Marine - Liftboat Division</div>", 
		"\"I’ve been the cellular and the global communications route but nothing compares to the reliability of Boatracs.\"<div class=\"testimony_author\">W. D. \"Butch\" Bazer, Operations Manager</div><div class=\"testimony_jobtitle\">Aries Marine - Liftboat Division</div>", 
		"\"Boatracs has been the backbone of Florida Marine’s communications system within their fleet for the past 13+ years.\"<div class=\"testimony_author\">Don Carlton</div><div class=\"testimony_jobtitle\">CIO of Florida Marine Transporters, Inc.</div>", 
		"<div class=\"smallertext\">\"Florida Marine originally chose Boatracs as their preferred communications provider based on their reliability, durability, service and customer support.\"</div><div class=\"testimony_author\">Don Carlton</div><div class=\"testimony_jobtitle\">CIO of Florida Marine Transporters, Inc.</div>", 
		"\"With Boatracs you get instant messages and replies, regardless of vessel location or weather conditions.\"<div class=\"testimony_author\">Don Carlton</div><div class=\"testimony_jobtitle\">CIO of Florida Marine Transporters, Inc.</div>", 
		"\"[With Boatracs] we know where our vessels are located any time of the day with the near-real time position reporting features.\"<div class=\"testimony_author\">Don Carlton</div><div class=\"testimony_jobtitle\">CIO of Florida Marine Transporters, Inc.</div>", 
		"<div class=\"smallertext\">\"[With Boatracs] we have been able to streamline our dispatching functions, so that our vessels can be monitored from one location.  This has increased our efficiencies and eased the burden on our personnel.\"</div><div class=\"testimony_author\">Don Carlton</div><div class=\"testimony_jobtitle\">CIO of Florida Marine Transporters, Inc.</div>", 
		"<div class=\"smallertext\">\"Today, Boatracs still continues to deliver great service and reliable communications.  It would be unimaginable for us to operate without Boatracs.\"</div><div class=\"testimony_author\">Don Carlton</div><div class=\"testimony_jobtitle\">CIO of Florida Marine Transporters, Inc.</div>", 
		"<div class=\"smallertext\">\"Boatracs has been the backbone of our communications system within our fleet for the last five years. With Boatracs you get instant messages and replies, regardless of vessel location or weather conditions.\"</div><div class=\"testimony_author\">Steve Marcrum</div><div class=\"testimony_jobtitle\">Port Captain, Candy Fleet Corporation</div>",
		"\"With Boatracs, we know where our vessels are located any time of the day.\"<div class=\"testimony_author\">Steve Marcrum</div><div class=\"testimony_jobtitle\">Port Captain, Candy Fleet Corporation</div>",
		"\"Today, it would be unimaginable for us to operate without Boatracs.\"<div class=\"testimony_author\">Steve Marcrum</div><div class=\"testimony_jobtitle\">Port Captain, Candy Fleet Corporation</div>",
		"<div class=\"smallertext\">\"We selected Boatracs based on its superior record of product performance and reliability, and outstanding customer service and support.\"</div><div class=\"testimony_author\">Joseph Kadi</div><div class=\"testimony_jobtitle\">Senior Vice President of Operations, Omega Protein</div>",
		"<div class=\"smallertext\">\"Boatracs was able to implement the solution very quickly, responding to our schedule and business needs every step of the way.\"</div><div class=\"testimony_author\">Joseph Kadi</div><div class=\"testimony_jobtitle\">Senior Vice President of Operations, Omega Protein</div>"
		);
}

var quoteIndex = Math.floor(Math.random()*quoteArray.length)
var timeout = 10000;

function nextQuote(doFade)
{
	var divQuote = document.getElementById("divTextToFade");
	if (null == divQuote)
		return;
	fadeElement(divQuote);
	setTimeout('displayQuote()', 1000);
}

function displayQuote()
{
	var divQuote = document.getElementById("divTextToFade");
	if (null == divQuote)
		return;
	divQuote.innerHTML = quoteArray[quoteIndex];
	unFadeElement(divQuote);
	var newQuoteIndex = Math.floor(Math.random()*quoteArray.length);
	while (newQuoteIndex == quoteIndex || newQuoteIndex >= quoteArray.length)
		newQuoteIndex = Math.floor(Math.random()*quoteArray.length);
	quoteIndex = newQuoteIndex;
	setTimeout('nextQuote(true)', timeout);
}

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