/**
Requires jQuery.
Modifies a div called quotePanel.
You should define css for 
	div.quoteText
	div.quoteAuthor

**/

var data;
function loadQuotes()
{
/*
	$.getJSON("http://eduware.com/api/quotes/quotedata.php?callback=123",function (data)
	  {
		console.log(data);
		quotes = data["quotes"];
		var t = setInterval("loadRandomQuote()",9000)
		loadRandomQuote();
	  });
*/	  
	  /*
	$.ajax({
  url: "http://localhost/quotes/quotedata.php?callback=123",
  dataType: 'json',
  data: data,
  success: function(data) {
    console.log(data);
  },
  error: function(XMLHttpRequest, textStatus, errorThrown) {
    console.log(textStatus, errorThrown);
  }
});*/
	quotes = [];
	quotes[0] = {"quote":"&ldquo;I retired in 2003 but still promote the Wizard whenever I work with colleagues. Most of the people I have contact with today use the wizard and love it.&rdquo;",
					"speaker":"&mdash; John Kuzma"};
	quotes[1] = {"quote":"&ldquo;This is simply fantastic. Thank you for making this.&rdquo;",
					"speaker":"&mdash; Jennifer Kokiadis"};
	quotes[2] = {"quote":"&ldquo;I really like the PDF format used for saving the tests. The program is easy to use, and because it is web-based, I can easily access the program in school or at home.&rdquo;",
					"speaker":"&mdash; Harry Clark"};
	quotes[3] = {"quote":"&ldquo;This is the perfect solution for what I have been trying to do on my own computer but am far from being as complete as your program.&rdquo;",
					"speaker":"&mdash; Christopher Rumpolo"};
	quotes[4] = {"quote":"&ldquo;I truly value the utilities offered on this website. It makes practicing for<br/>Regents and test practice much easier and enjoyable.&rdquo;",
					"speaker":"&mdash; Sanjay Ramsewak"};
	quotes[5] = {"quote":"&ldquo;I love web based solutions. I also really appreciate the affordability of the service.&rdquo;",
					"speaker":"&mdash; Lisa Blank"};				
	quotes[6] = {"quote":"&ldquo;I have used the Wizard software for many, many years. The program has questions with a variety of knowledge based skills in addition to critical thinking skills!&rdquo;",
					"speaker":"&mdash; Maria Aparicio"};
	quotes[7] = {"quote":"&ldquo;I have been using Wizard for years now and absolutely love the technology. I am very computer literate and use a wide variety of technology in my classes.&rdquo;",
					"speaker":"&mdash; Trish Auletta"};
	quotes[8] = {"quote":"&ldquo;I think the online version is so convenient and easy to use. Having access to all of your exams from virtually any computer is extremely handy.&rdquo;",
					"speaker":"&mdash; Matt Schildknecht"};
	quotes[9] = {"quote":"&ldquo;A subscription is only $40- and it is the best thing I have ever spent money on for my classroom because it made my life much easier.&rdquo;",
					"speaker":"&mdash; Susan DeMartino"};
	quotes[10] = {"quote":"&ldquo;I love the cloud. It's great not having to install software<br/>and to be able to have you guys save exams.&rdquo;",
					"speaker":"&mdash; Kristin Darlington"};
	quotes[11] = {"quote":"&ldquo;Our teachers love this software program.&rdquo;",
	"speaker":"&mdash; Diane Metz from Sweet Home CSD"};
	/*quotes[8] = {"quote":"&ldquo;I would like to personally thank the owner of the company for taking the time to call me to discuss some of my concerns. It was an unexpected, yet appreciated, gesture. One that shows commitment to the customer and dedication to a product.&rdquo;",
					"speaker":"&mdash; Dan Baxt"}; */
	var t = setInterval("loadRandomQuote()",15000)
	loadRandomQuote();



}

function loadRandomQuote()
{
	$("#quotePanel").slideToggle('fast');
	var oldStr = $('#quotePanel').html();
	setTimeout("changeQuoteContent()",500);
		
}

function changeQuoteContent()
{
	var index = Math.floor(Math.random() * quotes.length);
	var selectedQuote = quotes[index];
	
	$('#quotePanel').html(
	"<div class='quoteText'>" + selectedQuote["quote"] + "</div>" +
	"<div class='quoteAuthor'>" + selectedQuote["speaker"] + "</div>"
	);
	$("#quotePanel").slideToggle('slow');
	
}

