var index = -1;

var pictures = new Array();
var quotes = new Array();
var attributions = new Array();

// This function updates the picture and quote by computing a rolling index
// between 0 and 2, then it updates the page with the approriate quote and
// picture from above
function update_page( direction ) {
	if( direction == 'next' ) {
		index = (index + 1) % 7;
	} else {
		index = (index - 1) % 7;
		if( index == -1 ) { index = 6; }
	}
	document.getElementById("quote_picture").src = pictures[ index ];
	document.getElementById("quote_text").innerHTML = quotes[ index ];
	document.getElementById("quote_attribution").innerHTML = attributions[ index ];
}