//document.write("TEST TEST TEST<br><br>");

function BrocktonDialogue( inTitle, inSummary, inURL )
{
	this.title = inTitle;
	this.summary = inSummary;
	this.url = inURL;
}

var aryBrocktonDialogues = new Array();
var ai = 0;

aryBrocktonDialogues[ai++] = new BrocktonDialogue("Sean, Killing So Naturally", "The issue of occasion to murder speaks of reason; the issue of the heart speaks of no rationale at all-rather more of the human condition than of reason, I should say. But this will be easier to see by means of this story.", "brsean.asp");
aryBrocktonDialogues[ai++] = new BrocktonDialogue("Mother Teresa Leona", "Leona believed that there were many ways to God, and that charitable works are the ticket to arriving in heaven.", "momt.asp");
aryBrocktonDialogues[ai++] = new BrocktonDialogue("The Lofty Grosart", "Must all those who call themselves Christians understand the Bible?", "lofty.asp");
aryBrocktonDialogues[ai++] = new BrocktonDialogue("The Island of Nis", "Imposition of Christian tradition can only touch the body and not the soul.", "brniz.asp");
aryBrocktonDialogues[ai++] = new BrocktonDialogue("A Fly for Oscar", "Oscar Felton was dying. Everyone knew it. Oscar knew it better than anyone else. He would die and go to hell-that was unquestioned.", "oscar.asp");
aryBrocktonDialogues[ai++] = new BrocktonDialogue("The Elderly Mr. Phipp", "When the elderly Mr. Phipp lost his wife, he cried for the first time in seventy-plus years. Emotions were not Phipp's strong suit. He despised them.", "phipp.asp");
aryBrocktonDialogues[ai++] = new BrocktonDialogue("Miss Hockingfield's Waterloo", "She was worn out trying to make beautiful what nobody could 'get.", "hock.asp");

//document.write("TEST: " + aryBrocktonDialogues.length + "<br>");



function GetAllBrocktonDialogues()
{
	return aryBrocktonDialogues;
}

function GetRandomBrocktonDialogue()
{
	aryBrocktonDialogues.sort(function() {return 0.5 - Math.random()}) //Array elements now scrambled

	return aryBrocktonDialogues[0];
}

function PopulateRandomBrocktonDialogue()
{
	var raDiv = document.getElementById("randomBrocktonDialogue");

	var rbd = GetRandomBrocktonDialogue();

	var tmpStr = "<p><strong>" + rbd.title + "</strong></p>";
	tmpStr += "<p>" + rbd.summary + "</p>";
	tmpStr += "<p><a href=\"" + rbd.url + "\">Read the rest of this article</a> &nbsp; | &nbsp; <a href=\"javascript:PopulateRandomBrocktonDialogue()\">Read another</a></p>";

	raDiv.innerHTML = tmpStr;
}

