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(
		"\"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>"
		);
}

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

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 = Math.floor(Math.random()*quoteArray.length);
	quoteIndex = newQuoteIndex;
	if (quoteIndex == quoteArray.length)
		quoteIndex = 0;
	setTimeout('nextQuote(true)', 10000);
}

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