documentCookie = " ";var nextNum = 0;var selectedPath = 0;var linearPages = new Array("w_intro.html",					        "c_project.html",					        "g_hypernovel.html",					        "w_bagel1.html",	   					    "w_bagel2.html",					        "w_firstday.html",					        "g_dungeon.html",					        "w_women.html",					        "g_tom_jones.html",					        "c_who_al.html",					        "w_food.html",					        "c_kitchen.html",					        "g_food.html",					        "w_pantry.html",					        "g_pantry.html",					        "c_pantry.html",					        "w_love.html",						"c_rusty.html",						    "c_excess.html",					        "w_gun_beer.html",					        "w_pathmark.html",					        "g_pathmark.html",					        "c_pathmark.html",					        "g_zyban.html",					        "c_zyban.html",					        "w_zyban.html",					        "w_as_you_like.html",					        "g_as_you_like_it.html",					        "c_overview.html",					        "g_ficus.html");					        var gregPages = new Array("g_hypernovel.html",						  "g_tom_jones.html",						  "g_awake.html",						  "g_pathmark.html",						  "g_kitchen.html",						  "g_dungeon.html",						  "g_desk.html",						  "g_zyban.html",						  "g_food.html",						  "g_pantry.html",						  "g_as_you_like_it.html",						  "g_ficus.html");var waynePages = new Array("w_intro.html",	   					   "w_firstday.html",	   					   "w_bagel1.html",	   					   "w_bagel2.html",	   					   "w_women.html",	   					   "w_zyban.html",	   					   "w_pathmark.html",	   					   "w_food.html",	   					   "w_pantry.html",						   "w_love.html",	   					   "w_french_onion.html",	   					   "w_as_you_like.html",	   					   "w_gun_beer.html");var chuckPages = new Array("c_project.html",						   "c_overview.html",						   "c_who_al.html",						   "c_pathmark.html",						   "c_kitchen.html",						   "c_pantry.html",						   "c_rusty.html",						   "c_excess.html",						   "c_blair.html",						   "c_zyban.html");						   						   if(getCookie("next") != null) {	nextNum = parseInt(getCookie("next"));} else {	setCookie("next", 0);}if(getCookie("path") != null) {	selectedPath = parseInt(getCookie("path"));} else {	setCookie("path", 0);}function getRandomPage() {	var loc = document.location + "";	loc = loc.substring(loc.lastIndexOf("/") + 1, loc.length);	var who = Math.round(Math.random()*2);	nextNum = Math.round(Math.random()*100);	switch(who) {		case 0:			nextNum = nextNum % waynePages.length;			setCookie("next", nextNum);			if(loc == waynePages[nextNum]) {				return getRandomPage();			}			return waynePages[nextNum];		case 1:			nextNum = nextNum % gregPages.length;			setCookie("next", nextNum);			if(loc == gregPages[nextNum]) {				return getRandomPage();			}			return gregPages[nextNum];		case 2:			nextNum = nextNum % chuckPages.length;			setCookie("next", nextNum);			if(loc == chuckPages[nextNum]) {				return getRandomPage();			}			return chuckPages[nextNum];	}}function goNext() {	selectedPath = document.path.index.selectedIndex;	setCookie("path",selectedPath);	nextNum = (parseInt(nextNum) + 1);		switch(selectedPath) {		case 0:			nextNum = nextNum % linearPages.length;			setCookie("next", nextNum);			document.location = linearPages[nextNum];			break;		case 1:			nextNum = nextNum % waynePages.length;			setCookie("next", nextNum);			document.location = waynePages[nextNum];			break;		case 2:			nextNum = nextNum % gregPages.length;			setCookie("next", nextNum);			document.location = gregPages[nextNum];			break;		case 3:			nextNum = nextNum % chuckPages.length;			setCookie("next", nextNum);			document.location = chuckPages[nextNum];			break;		case 4:			document.location = getRandomPage();			break;	}}function writeForm() {	var lsel = "";	var wsel = "";	var gsel = "";	var csel = "";	var chsel = "";	switch(selectedPath) {		case 0:			lsel = " selected";			break;		case 1:			wsel = " selected";			break;		case 2:			gsel = " selected";			break;		case 3:			csel = " selected";			break;		case 4:			chsel = " selected";			break;	}	document.write("<form name = \"path\">");  	document.write("<select name=\"index\">");	document.write("<option" + lsel + ">Linear");	document.write("<option" + wsel + ">Wayne");	document.write("<option" + gsel + ">Greg");	document.write("<option" + csel + ">Chuck");	document.write("<option" + chsel + ">Chaos");    document.write("</select>");	document.write("</FORM>");}function setCookie(name, value) {	var expires = new Date();	expires.setTime(expires.getTime() + (1000 * 60 * 60 * 24));		document.cookie = name + "=" + escape(value) + "; path=/" + 		((expires ==  null) ? " " : "; expires=" +		expires.toGMTString());	documentCookie = document.cookie;}function getCookie(name) {	if (documentCookie == " ") {		documentCookie = document.cookie;	}  	var dc = documentCookie;	var cname = name + "=";	if (dc.length > 0) {		begin = dc.indexOf(cname);		if(begin != -1) {			begin += cname.length;			end = dc.indexOf(";", begin);			if (end == -1) 				end = dc.length;			return unescape(dc.substring(begin, end));				}		}	return null;}function delCookie(name) {	document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT"  + "; path=/";	documentCookie = document.cookie;}