$(document).ready(function() {
	// Random quote rotation
	$("#next_quote").click(function () {
		var curQuote = $("#quotes span").text();
		$("#quotes").load("quotes.php", function(responseText, textStatus, XMLHttpRequest) {
			var newQuote = $(responseText).text();
			if (curQuote == newQuote) {
				// got the same quote, trigger the rotation again
				// (loop will continue until a unique quote is loaded)
				$("#next_quote").triggerHandler("click");
			}
		});
	});

	// Random image rotation
	$("#next_image").click(function(){
		$("#rand_image").attr("src", "randBenImage.php?"+rand(10000));
	});
	$("#rand_image").click(function() {
		$("#next_image").triggerHandler("click");
	});
});