gQuoteFaders = new Object;
var kMaxOpacity = 0.99;
var bFirstQuote = true;

function QuoteFaderBegin( containerId, quoteTextId, quoteSourceId, newQuoteText, newQuoteSource, duration, interval )
{
	key = containerId;
	var fadeObject = new Object;
	gQuoteFaders[key] = fadeObject;
	
	fadeObject.fadeDuration = duration;
	fadeObject.fadeInterval = interval;
	fadeObject.opacityDelta = -interval/duration;
	fadeObject.newQuoteText = newQuoteText;
	fadeObject.newQuoteSource = newQuoteSource;
	fadeObject.container = document.getElementById(containerId);
	fadeObject.quoteText = document.getElementById(quoteTextId);
	fadeObject.quoteSource = document.getElementById(quoteSourceId);
	
	if ( bFirstQuote )
	{
		fadeObject.container.style.opacity = 0.0;
		bFirstQuote = false;
	}
	
	setTimeout('QuoteFaderStep("' + key + '")', fadeObject.fadeInterval);
}

function QuoteFaderStep( key )
{
	var fadeObject = gQuoteFaders[key];
	
	var newOpacity = parseFloat(fadeObject.container.style.opacity) + fadeObject.opacityDelta;
	var done = false;
	var pauseTime = 0;
	
	if ( newOpacity <= 0.0 && fadeObject.opacityDelta < 0.0 )
	{
		fadeObject.quoteText.innerHTML = fadeObject.newQuoteText;
		fadeObject.quoteSource.innerHTML = fadeObject.newQuoteSource;
		fadeObject.opacityDelta = -fadeObject.opacityDelta;
		newOpacity = 0.0;
		pauseTime = 800;
	}
	else if ( newOpacity >= kMaxOpacity && fadeObject.opacityDelta > 0.0 )
	{
		done = true;
		newOpacity = kMaxOpacity;
	}
	
	fadeObject.container.style.opacity = newOpacity;
	fadeObject.container.style.filter = "alpha(opacity=" + newOpacity * 100 + ")";
	
	if ( !done )
		setTimeout('QuoteFaderStep("' + key + '")', fadeObject.fadeInterval + pauseTime);
	else
		gQuoteFaders[key] = null;
}

quotes = [
	["The caliber of both presenters and attendees, combined with the professionalism of the ION team make this a key event to put on your calendar.", "Charles Manning, President/CEO, PLAYEXPERT" ],
	["The conference was a highly concentrated dose of experienced industry innovators, with a very high signal to noise ratio.", "Ron Meiners, The Multiverse Network"],
	["One of the best conferences I've attended.", "Chris Mahnken, Sandlot Games"],
	["I found the combination of sessions and attendees made this one of the most productive events of the year for us....", "Monty Sharma, VP Product Management & Marketing, Vivox"],
	["ION was the classiest, best-run game industry event I've been to this year... ION could be become the must-attend event for the online game industry.", "Alexander Macris, President & CEO, Themis Group"],
	["This is one of the very few events where I have made the most valuable business contacts.", "Grace Wong, Business Development Manager, NetDevil"],
	["Great networking experience &mdash; I've had more e-mail exchanges with attendees than for just about any previous conference....", "Jim Dunstan, Partner, Garvey Schubert Barer"],
	["The quality of speakers was outstanding, the location was great, and the food was amazing. I'm already looking forward to next year.", "Brian Robbins, Executive Producer, Fuel Industries, Inc."],
	["Great conference! Great speakers! Great fun! One of the best conferences I've attended in years.", "David Lakritz, President & CEO, Language Automation, Inc."],
	["The attendees and speakers were serious industry professionals, not wannabes. I'll be back.", "John Scott Tynes, Producer, Flying Lab Software"],
	["Top quality speakers - a great conference learning and sharing cutting-edge trends in the online gaming community.", "Dr. Markus Weichselbaum, CEO, TheBroth Pty Ltd"],
	["ION 2007 was a top-notch affair. I've never felt so at home and well cared for at a conference before. I learned a lot, and I'm planning to go again in 2008.", "Jess Lebow, Content Director, Flying Lab Software"],
	["I was extremely impressed with the quality of this conference, especially considering this was the first year. I can't wait to see what ION 2008 has to offer.", "James Evans, Research Engineer, Flashpoint Technology, Inc."],
	["The people were really interested in sharing knowledge. I didn't hear a cellphone ring during a lecture at all! I learned more at this conference than at any other.", "Ron Rivkin, VP, APD"],
	["I feel I have reduced my company's time to market by 12 months and avoided several pitfalls. I highly recommend ION and will attend with the REST of my staff next year.", "Chris Breckenridge, CTO, BrainStem Games"],
	["The quality of the conference, both sessions and networking opportunities, was far above other conferences.", "Alistair Hirst, CEO, Omni Interactive Audio"],
	["ION was a really great event &mdash; addressing the needs of a maturing online games industry better than any conference I have so far attended, either as attendee or sponsor.", "James Hursthouse, CEO, Online Game Services Inc"],
	["The lunches and receptions at ION were places where real discussions of new ideas and technologies were taking place....", "Nathaniel Bogan, Director of Research and Development, +7 Systems"],
	["ION 2007 was a great event for online game developers; however considering how well the first year's event went off, they will have trouble living up to my expectations for 2008!", "Erik Bethke, CEO, GoPets"],
	["The venue, the attendees, the speakers, and the hosts blended together to form the perfect show &mdash; intimate, intelligent and informative. I can't wait to get to ION 2008!", "Katie Postma, Community Director, Cartoon Network"],
	["Most of our biggest sales leads came from ION 2007. I attended about 15 conferences in 2007, and ION was by far the best in terms of business opportunity.", "Darius Kazemi, President, Orbus Gameworks"],
	["ION brings together game industry leaders to discuss disruptive technologies, business models and chart the directions for next level of growth.", "Karl Mehta, Founder & CEO, PLAYSPAN INC."],
];

lastUsedIndex = -1;

function RandomInt( range )
{
	return Math.floor(Math.random() * range);
}

function StartQuoteFader()
{
	var nextIndex;
	do
	{
		nextIndex = RandomInt(quotes.length);
	} while ( nextIndex == lastUsedIndex && quotes.length > 1 );
	
	var newQuoteText = quotes[nextIndex][0];
	var newQuoteSource = "- " + quotes[nextIndex][1];
	
	QuoteFaderBegin("quoteContainer", "frontQuoteText", "frontQuoteSource", newQuoteText, newQuoteSource, 1500, 40);
	lastUsedIndex = nextIndex;
	setTimeout('StartQuoteFader()', 10000);
}

