var randNum;
var quotes = new Array();
var attribution = new Array();
var images = new Array();
function handleAjaxQuotes() {
	var counter = 0;
	jQuery.ajax({
		type: "GET",
		url: "/xml/student-quotes.xml",
		dataType: "xml",
		success: function(xml) {
			jQuery(xml).find("quote").each(function(){
				counter ++;
				quotes[counter] = jQuery(this).find("text").text();
				attribution[counter] = jQuery(this).find("attribution").text();
				images[counter] = jQuery(this).find("image").text();
			});
			randNum = Math.ceil(Math.random()*images.length-1);
			setQuotesPic();
		}
	});
}
function setQuotesPic() {
	jQuery("#student_pic").css("background-image", "url(/images/people/"+images[randNum]+")");
	jQuery("#quote").html(quotes[randNum]);
	jQuery("#attribution").html(attribution[randNum]);
}
