function update_results ()
{
	var expires = 10 * 365 * 24; // 10 years
	var path = "/";
	var results = new Cookie(document, "crossroads_results", expires, path);
	var page = location.href.slice(location.href.lastIndexOf("/") + 1);
	var key = new Object();

	key.chapter_01 = "a";
	key.chapter_02 = "b";
	key.chapter_03 = "a";
	key.chapter_04 = "b";
	key.chapter_05 = "b";
	key.chapter_06 = "b";
	key.chapter_07 = "a";
	key.chapter_08 = "a";
	key.chapter_09 = "a";
	key.chapter_10 = "a";
	key.chapter_11 = "b";
	key.chapter_12 = "b";
	key.chapter_13 = "b";

	if (page == "introduction.html") {
		results.chapter_01 = "";
		results.chapter_02 = "";
		results.chapter_03 = "";
		results.chapter_04 = "";
		results.chapter_05 = "";
		results.chapter_06 = "";
		results.chapter_07 = "";
		results.chapter_08 = "";
		results.chapter_09 = "";
		results.chapter_10 = "";
		results.chapter_11 = "";
		results.chapter_12 = "";
		results.chapter_13 = "";
	
		results.store();
	} else if (page == "conclusion.html") {
		var ncorrect = 0;
		var chapter;
		var txt;
		var node;
		var div;
		var p;
		
		results.load();
		
		for (var i = 1; i <= 13; i++) {
			chapter = i < 10 ? "chapter_0" + i : "chapter_" + i;
			if (results[chapter] == key[chapter]) ncorrect++;
		}

		div = element("lincolnstext")

		while (div.childNodes.length > 0) {
			div.removeChild(div.firstChild);
		}

		txt = "You agreed with my decisions " + ncorrect + " time" + (ncorrect == 1 ? "" : "s") + ".";

		node = document.createTextNode(txt);
		p = document.createElement("p");
		p.appendChild(node);
		div.appendChild(p);

		if (ncorrect >= 11) {
	      	txt = "Congratulations! You and I see eye to eye on the issues. Perhaps you should think about a career in politics.";
		} else if (ncorrect >= 7) {
			txt = "Good job. You and I agree on most of the issues.  It's okay to disagree sometimes as that assures a full and open discussion of different points of view.";
		} else {
			txt = "Hmmm, you and I appear to see things very differently but that's okay because oftentimes there is no clearly correct answer to a problem. Keep on thinking for yourself!";
		}
		
		node = document.createTextNode(txt);
		p = document.createElement("p");
		p.appendChild(node);
		div.appendChild(p);
	} else if (page.length == "chapter_XX.html".length) {
		var chapter = page.substr(0, "chapter_XX".length);
	
		results.load();
		results[chapter] = "";
		results.store();
	} else {
		var chapter = page.substr(0, "chapter_XX".length);
		var choice = page.substr("chapter_XX_".length, 1);
		
		results.load();
		results[chapter] = choice;
		results.store();
	}
}
