// create multidimensional array of top ten lists for script reference
var lists = new Array (
	boxOffice,				// category 0
	rentalsDVD,				// category 1
	rentalsVHS,				// category 2
	music,					// category 3
	bestsellersFiction,			// category 4
	bestsellersNonfiction,			// category 5
	videoGames,				// category 6
	emails					// category 7
);

// functions for writing html and various list contents
function writeDate() {
	document.write(topTenDate);
}

function writeList(category) {
	for (x=0;x<lists[category].length;x++) {
		document.writeln('<li>' + lists[category][x]);
	}
}

function writeSource(category) {
	document.write('<img src="/images/spacer.gif" width="10" height="1"><i>info from ' + sources[category] + '</i><br>');
}

function writeEmailIntro() {
	document.write(emailIntro);
}

function writeEmails(category) {
	for (x=0;x<lists[category].length;x=x+2) {
		document.write(lists[category][x] + '<p>');
		if (lists[category][x+1]) {
			document.write('<i>' + lists[category][x+1] + '</i><p>');
		}
	}
}
