function Word () {
	var argv = Word.arguments;
	var argc = argv.length;
	this.list = new Object;
	for (var i = 0; i < argc; i++)
		this.list[i] = argv[i];
	this.count = argc;
	this.toString = WordString;
	return this;
}

function WordString () {
	var i = Math.round((this.count - 1) * Math.random());
	return this.list[i];
}

var verb = new Word ("collapses", "founders", "smotes", "drains", "pales",
	   "sullies", "screams", "endures", "vexes", "swims", "spins",
	   "drowns", "pains");

var noun = new Word ("brain", "body", "coma", "mind", "head", "hospital",
	   "tumor", "medicine", "drugs", "pain", "lifelessness", "sleep",
	   "life", "dream", "agitation", "frustration", "death",
	   "memory", "anger", "tears", "depression",
	   "fear", "moan");

var adj = new Word ("foul", "broken", "gray", "tired", "aching",
	  "throbbing", "sharp", "terrible", "deadly", "baleful",
	  "dark", "hated", "cruel", "dreary", "unforgiving",
	  "painful", "horrible");

var xnoun = new Word ("life", "body", "mind", "head", "energy",
	   "recovery", "medicine", "struggle", "victory");

var xadj = new Word ("renewed", "whole", "light", "full", "lived",
	   "unsullied", "clean", "normal", "enabled");

function makepoem(div) {
	var lines = Math.round(4 * Math.random()) + 1;
	div.innerHTML = "";
	for (var i=0; i<lines; i++)
		div.innerHTML += adj + " " + noun + " " + verb + "<br>";
}

function makepoe(div) {
	var lines = Math.round(4 * Math.random()) + 1;
	div.innerHTML = "";
	for (var i=0; i<lines; i++) {
		div.innerHTML += xnoun + "&nbsp;";
		if (Math.round(2 * Math.random()) == 0)
			div.innerHTML += "is&nbsp;";
		div.innerHTML += xadj + "<br>";
	}
}
