// **********************************************************
// * all coding created by aegis kleais of team lazarus.    *
// * copyright 2002.  all rights reserved.  reuse only with *
// * express written consent.                               *
// **********************************************************

defaultStatus = ":: ultima v : lazarus ::";

function defStat() {
	defstat = ":: ultima v : lazarus ::";
	if (window.status != defstat) {
		window.status == defstat;
	}
}

IId = setInterval('defStat()',1000);

var youSee = "";
var charName = "";
var charJob = "";
var charJoin = "";
var charSpecial = "";
var charResponse = "";
var charBye = "";
var promptValue = 0;
	
function makeActive(){
	document.forms[0].enterLaz.disabled = false;
}

function doChat(person){

	// aegis kleais
	if (person == 'aegis') {
		youSee = "You see a young and seedy man with tattoos on each arm, a unique style of facial hair, and look of mischief in his eyes. \"Can I be of help?\".";
		charName = "\"Aegis Kleais be my name.  And ask not for me to pronounce it, as I\'m sure thou canst get it right.\"";
		charJob = "\"I created the html by which thou art granted an audience with me.\" He chuckles, and then says \"Might I take my leave now?\"";
		charJoin = "\"I think not, Avatar.  Twould be poor character indeed, to traverse with the likes of ye.\" He snickers.";
		charSpecial = "html";
		charResponse = "\"Aye, the site is grand, is she not?  I worked many a night to finish her and I must say that I am pleased with the end product.\"";
		charBye = "\"Good riddance.  Off with ye, knave, lest I strike thee down with my halberd.\"";
	}
	// shadow of light 
	if (person == 'sol') {
		youSee = "You see a mighty dragon. Intelligent eyes gleam from a black-scaled head and her wings shimmer like liquid silver. She shifts her position to face you.";
		charName = "I am Shadow of Light Dragon.";
		charJob = "I put words into the mouths of mortals. I believe thou wouldst call it \"dialogue\"";
		charJoin = "\"Thou wishest me to join thee? Unfortunately, the Avatar never had a draconic companion. I wouldn\'t want to cause inaccuracies to the plot.\" She winks.";
		charSpecial = "dialogue";
		charResponse = "\"That would involve someone speaking of wondrous and interesting matters to thee, and thou replying - as always - in sentences of one word.\"";
		charBye = "Virtue be with thee, Avatar.";
	}
	// firetalon
	if (person == 'firetalon') {
		youSee = "You see a young woman muttering to herself.";
		charName = "\"Friends call me FT. Thou canst call me Firetalon.\"";
		charJob = "\"Using staplers to do bad things to small animals, fomenting chaos and unrest... Oh yes. And writing dialogue.\"";
		charJoin = "\"I\'ll leave the virtuous voyages to thee, Avatar. I enjoy being Eevil™ far too much.\"";
		charSpecial = "eevil";
		charResponse = "\"Aye, eevil,\" she nods. \"Diet evil. Same great taste; less calories.\"";
		charBye = "FT waves.";
	}
	// hacki 
	if (person == 'hacki') {
		youSee = "You see a cheerful young man. He seems surprised and says \"Greetings, stranger.\"";
		charName = "\"I am called Hacki.\"";
		charJob = "\"Art thou, by any chance, from Austria, Germany, or Switzerland? Great, because my job is to translate the whole game into German!\"";
		charJoin = "\"Thou art having too many party members. I prefer smaller groups of people.\"";
		charSpecial = "german";
		charResponse = "\"Ja, genau. Deutsch.\" He smiles.";
		charBye = "\"Goodbye. Fare thee well.\"";
	}
		// tiberius 
	if (person == 'tiberius') {
		youSee = "You see a young man who looks to be rather sleep deprived.";
		charName = "\"Ian \'Tiberius\' Frazier, at thy service,\" he says with a slightly comical bow.";
		charJob = "\"\'Tis my unlikely fare to keep this band of talented rogues from killing each other.\"";
		charJoin = "\"I cannot,\" he shakes his head wistfully, \"I have my duties here to see to first.\"";
		charSpecial = "rogues";
		charResponse = "\"Aye, thou dost understand how artists can be.\" He winks at you.";
		charBye = "\"Walk in Virtue, Avatar, and may thy journeys be safe!\"";
	}
		// wheezle 
	if (person == 'wheezle') {
		youSee = "The man before you is hooded, clad in bloodred robes embroidered with arcane symbols. \"I do not recognize thee, who art thou?\"";
		charName = "The man reaches out and pulls back its hood, revealing a man in the early 40\´s. \“My name is Wheezle\”, he says with a friendly smile.";
		charJob = "\"Translations into german.\" Strange words appear in your mind : \"Ich spuere, dass Ihr ein Wesen mit außergewoehnlichen Faehigkeiten seid!\"";
		charJoin = "\"No, I\´m on the quest for the dictionary, which I hope to find in the Lycaeum. And I have to fulfill my destiny without help from others.\"";
		charSpecial = "dictionary";
		charResponse = "\"Yes, the cat ate the old one.\"";
		charBye = "\"Fare thee well and remember: Stay on the Path of Virtue!\" Wheezle says at your departure and vanishes before your eyes.";
	}
		// risen 
	if (person == 'risen') {
		youSee = "You see a tall man, with heavy bags under his eyes.";
		charName = "\"My true name is known to none but myself, but you may call me Risen.\"";
		charJob = "He shrugs \"Through a force known as the Code, I weave the laws of nature\"";
		charJoin = "\"I am afraid my work does not allow me the luxury of idle quests\"";
		charSpecial = "code";
		charResponse = "\"A force deeper than even magic, it binds all things together.\"";
		charBye = "\"May the Virtues guide your path Avatar.\"";
	}	
	
	finishChat();
	
}

function finishChat() {

	if (promptValue == 0){
		x = prompt(youSee,'');
	}
	if (promptValue == 1){
		x = prompt(charName,'');
	}
	if (promptValue == 2){
		x = prompt(charJob,'');
	}
	if (promptValue == 3){
		x = prompt(charJoin,'');
	}
	if (promptValue == 4){
		x = prompt(charResponse,'');
	}
	if (promptValue == 5){
		x = prompt("\"That, I cannot help thee with.\"",'');
	}
	
	// check and set x
	y = 0;
	if (!x) { 
		getOut();
	}
	if (x == "bye" || x == "Bye" || x == "BYE") { 
		y = 1;
		getOut();
	}
	if (x && (x == "name" || x == "Name" || x == "NAME")) {
		y = 1;
		promptValue=1;
		finishChat();
	}
	if (x && (x == "job" || x == "Job" || x == "JOB")) {
		y = 1;
		promptValue=2;
		finishChat();
	}
	if (x && (x == "join" || x == "Join" || x == "JOIN")) {
		y = 1; 
		promptValue=3;
		finishChat();
	}
	if (x && (x == charSpecial)) {
		y = 1;
		promptValue=4;
		finishChat();
	}
	if (x && (y != 1)) {
		promptValue=5;
		finishChat();
	}
}

function getOut(){
	alert(charBye);
}

function gameStat(){
	document.write("9.2");
}

function openMusic(){
	var musicWin = window.open("music_player.asp","musicWin",config="left=5,top=5,xscreen=5,yscreen=5,height=150,width=370");
}

function spellAlert(spellVal){
	// circle 1 spells
	if (spellVal == 'c1s1') { alert("CURE \n(an nox) \n\n Negates poison on a character.\n(GI - GA)"); }
	if (spellVal == 'c1s2') { alert("AWAKEN \n(an zu) \n\n Awakens a sleeping character.\n(GI - GA)"); }
	if (spellVal == 'c1s3') { alert("HEAL \n(mani) \n\n Heals a character.\n(GI - SI)"); }
	if (spellVal == 'c1s4') { alert("MAGIC MISSILE \n(grav por) \n\n Fires a magic missile.\n(A - P)"); }
	if (spellVal == 'c1s5') { alert("LIGHT \n(in lor) \n\n Creates a magical light.\n(A)"); }
	if (spellVal == 'c1s6') { alert("CREATE FOOD \n(in mani ylem) \n\n Creates 1 piece of foor per character.\n(GI)"); }
	
	// circle 2 spells
	if (spellVal == 'c2s1') { alert("CONJURE \n(kal xen) \n\n Summons a rat, spider, bat or python for the party.\n(SI - MA)"); }
	if (spellVal == 'c2s2') { alert("REPEL UNDEAD \n(an xen corp) \n\n Repels all low-level undead creatures in the area.\n(GA - A)"); }
	if (spellVal == 'c2s3') { alert("UNTRAP \n(an jux) \n\n Disarms a trapped chest.\n(A - MO)"); }
	if (spellVal == 'c2s4') { alert("LOCATE \n(in wis) \n\n Locates a caster\'s longitude and latitude.\n(N)"); }
	if (spellVal == 'c2s5') { alert("TEMPEST \n(rel hur) \n\n Summons or dispels a storm.\n(A - MO)"); }

	// circle 3 spells
	if (spellVal == 'c3s1') { alert("SLEEP FIELD \n(in zu grav) \n\n Creates a sleep field.\n(GI - SI - P)"); }
	if (spellVal == 'c3s2') { alert("FIRE FIELD \n(in flam grav) \n\n Creates a fire field.\n(P - A - SI)"); }
	if (spellVal == 'c3s3') { alert("POISON FIELD \n(in nox grav) \n\n Creates a poison field.\n(N - SI - P)"); }
	if (spellVal == 'c3s4') { alert("FIREBALL \n(vas flam) \n\n Throws a fireball.\n(A - P)"); }
	if (spellVal == 'c3s5') { alert("BLINK \n(in por) \n\n Transports the party to a visual point.\n(SI - MO)"); }
	if (spellVal == 'c3s6') { alert("GREAT LIGHT \n(vas lor) \n\n Creates a magical light for a greater period of time.\n(A - M)"); }
	
	// circle 4 spells
	if (spellVal == 'c4s1') { alert("PROTECTION FIELD \n(in sanct) \n\n Protects all party members.\n(A - GI - GA)"); }
	if (spellVal == 'c4s2') { alert("ENERGY FIELD \n(in sanct grav) \n\n Creates an impenetrable field.\n(MA - SI - P)"); }
	if (spellVal == 'c4s3') { alert("DISPEL FIELD \n(an grav) \n\n Dispels a magical field (poison, sleep, fire or energy).\n(P - A)"); }
	if (spellVal == 'c4s4') { alert("DESCEND \n(des por) \n\n Teleports the party one level down in a dungeon.\n(MO - SI)"); }
	if (spellVal == 'c4s5') { alert("ASCEND \n(uus por) \n\n Teleports the party one level up in a dungeon.\n(MO - SI)"); }
	if (spellVal == 'c4s6') { alert("REVEAL \n(wis quas) \n\n Reveals all enchanted or invisible creatures or items in the area.\n(SI - N)"); }
	
	// circle 5 spells
	if (spellVal == 'c5s1') { alert("SLEEP WIND \n(in zu) \n\n Puts all creatures in a semi-circle arc in front of the caster to sleep.\n(GI - N - SI)"); }
	if (spellVal == 'c5s2') { alert("GREAT HEAL \n(vas mani) \n\n Restores 1 party member\'s health to full.\n(GI - SI - MA)"); }
	if (spellVal == 'c5s3') { alert("INSECT SWARM \n(kal bet xen) \n\n Summons 1-4 insect swarms.\n(MO - SI - A)"); }
	if (spellVal == 'c5s4') { alert("MAGIC UNLOCK \n(in ex por) \n\n Unlocks one magical lock.\n(A - MO)"); }
	if (spellVal == 'c5s5') { alert("QUICKNESS \n(rel tym) \n\n Allows caster to move quickly for a short time.\n(A - MA - MO)"); }
	
	// circle 6 spells
	if (spellVal == 'c6s1') { alert("NEGATE MAGIC \n(an ort) \n\n Negates all magic in the area.\n(GA - MA - A)"); }
	if (spellVal == 'c6s2') { alert("CHARM \n(an xen ex) \n\n Charms a creature and puts it under player control.\n(P - N - SI)"); }
	if (spellVal == 'c6s3') { alert("TREMOR \n(in vas por ylem) \n\n Causes an earthquake which damages all enemies in the area.\n(MO - A - MA)"); }
	if (spellVal == 'c6s4') { alert("CONFUSE \n(quas an wis) \n\n Causes all enemies in the area to hallucinate and attack each other.\n(MA - N)"); }
	if (spellVal == 'c6s5') { alert("WIZARD EYE \n(por ort wis) \n\n Lets caster see through magical moving eye.\n(MA - A)"); }
	
	// circle 7 spells
	if (spellVal == 'c7s1') { alert("POISON WIND \n(in nox hur) \n\n Poisons all creatures in a semi-circle in front of the caster.\n(GI - GA)"); }
	if (spellVal == 'c7s2') { alert("KILL \n(xen corp) \n\n Throws a death bolt capable of killing most enemies in one hit.\n(P - N)"); }
	if (spellVal == 'c7s3') { alert("PEER \n(vas wis ylem) \n\n Lets caster use peering gem to see local area.\n(N - MA)"); }
	if (spellVal == 'c7s4') { alert("CAUSE FEAR \n(in quas corp) \n\n Makes enemies flee.\n(N - MA - GA)"); }
	if (spellVal == 'c7s5') { alert("CLONE \n(in quas xen) \n\n Makes a magical dupicate of a character.\n(A - SI - MO - GI - N - MA)"); }
	if (spellVal == 'c7s6') { alert("INVISIBILITY \n(sanct lor) \n\n Caster becomes invisible.\n(MA - N - MO)"); }
	
	// circle 8 spells
	if (spellVal == 'c8s1') { alert("RESURRECT \n(in mani corp) \n\n Resurrects one deceased party member.\n(GA - GI - SI - A - MO - MA)"); }
	if (spellVal == 'c8s2') { alert("TIME STOP \n(an tym) \n\n Freezes time for everyone but the caster.\n(MA - GA - MO)"); }
	if (spellVal == 'c8s3') { alert("GATE TRAVEL \n(vas rel por) \n\n Teleports the party to a moongate.\n(A - P - MA)"); }
	if (spellVal == 'c8s4') { alert("FLAME WIND \n(in flam hur) \n\n Sends forth a wall of flames.\n(A - MO - MA)"); }
	if (spellVal == 'c8s5') { alert("DEATH WAVE \n(in vas grav por) \n\n Sends forth a wall of death, killing most enemies in its wake.\n(MA - N - A)"); }
	if (spellVal == 'c8s6') { alert("SUMMON DAEMON \n(kal xen corp) \n\n Summons a daemon to fight for the party.\n(MA - GA = MO - SI)"); }
}

function openPop(file,title,width,height){
	
	// set filename
	var winFile = file;

	// set width - add 44 for side boundaries
	var oldWidth = (width - 0);
	var winWidth = ((width - 0) + (44 - 0));

	// set height - add 80 for top and bottom boundaries
	var oldHeight = (height - 0);
	var sideHeight = ((height - 0) + (40 - 0))
	var winHeight = ((height - 0) + (80 - 0));

	// set title
	var winTitle = title;

	// open new window
	var tapestryWin = window.open("","tapWindow","width=" + winWidth + ",height=" + winHeight+",top=0,left=0,screenX=0,screenY=0,scrollbar=yes");

	// write open window contents
	tapestryWin.document.write("<html><head></head><title>:: ultima v Lazarus ::</title>\n");
	tapestryWin.document.write("<link rel='stylesheet' href='uvl.css' type='text/css'>\n");
	tapestryWin.document.write("<body bgcolor='#8B6A2E' text='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>\n");
	tapestryWin.document.write("<table width='" + winWidth + "' border='0' cellspacing='0' cellpadding='0'>\n");
	tapestryWin.document.write("  <tr>\n");
	tapestryWin.document.write("    <td width='22' height='20'><img src='images/frame_top_left.gif' width='22' height='20'></td>\n");
	tapestryWin.document.write("    <td background='images/frame_top.gif'>&nbsp;</td>\n");
	tapestryWin.document.write("    <td width='22'><img src='images/frame_top_right.gif' width='22' height='20'></td>\n");
	tapestryWin.document.write("  </tr>\n");
	tapestryWin.document.write("  <tr>\n");
	tapestryWin.document.write("    <td background='images/frame_left.gif' height='" + sideHeight +"'>&nbsp;</td>\n");
	tapestryWin.document.write("    <td align='left' valign='top'>\n");
	tapestryWin.document.write("      <table width='326' border='0' cellspacing='0' cellpadding='0' height='40'>\n");
	tapestryWin.document.write("        <tr>\n");
	tapestryWin.document.write("          <td background='images/wooden_bar.gif' align='left' valign='top'><span class='newsTitle'>\n");
	tapestryWin.document.write("            <font face='Verdana, Arial, Helvetica, sans-serif'>&nbsp;<font size='1'><b><font color='#FFFFFF'>\"" + winTitle + "\" \n");
	tapestryWin.document.write("			 <br>&nbsp;&nbsp;<a href='javascript:window.close();' class='whiteLink'>CLOSE WINDOW</a>\n");
	tapestryWin.document.write("            </font></b></font></font></span></td>\n");
	tapestryWin.document.write("        </tr>\n");
	tapestryWin.document.write("      </table>\n");
	tapestryWin.document.write("      <img src='" + winFile + "' width='" + oldWidth + "' height='" + oldHeight + "'></td>\n");
	tapestryWin.document.write("    <td background='images/frame_right.gif'>&nbsp;</td>\n");
	tapestryWin.document.write(" </tr>\n");
	tapestryWin.document.write("  <tr>\n");
	tapestryWin.document.write("    <td height='20'><img src='images/frame_bot_left.gif' width='22' height='20'></td>\n");
	tapestryWin.document.write("    <td background='images/frame_bottom.gif'>&nbsp;</td>\n");
	tapestryWin.document.write("    <td><img src='images/frame_bot_right.gif' width='22' height='20'></td>\n");
	tapestryWin.document.write("  </tr>\n");
	tapestryWin.document.write("</table>\n");
	tapestryWin.document.write("</body>\n");
	tapestryWin.document.write("</html>");

}

function openFPPop(file){
	// set file name
	var winFile = file;
	
	// open file in a new window.
	var nonPopWin = window.open("","FPPopWin",config="width=780,scrolling=yes,left=0,top=0,xscreen=0,yscreen=0");
	nonPopWin.location.href = file;
}

function openNonPop(file){
	// set file name
	var winFile = file;
	
	// open file in a new window.
	var nonPopWin = window.open("","nonPopWin",config="left=0,top=0,xscreen=0,yscreen=0");
	nonPopWin.location.href = file;
}


var r1aChoice = "";
var r1bChoice = "";
var r1abChoice = "";
var r1cdChoice = "";
var r1abcdChoice = "";
var r1cChoice = "";
var r1dChoice = "";
var r2aChoice = "";
var r2bChoice = "";
var r3Choice = "";
var question = "";
var choiceA = "";
var choiceB = "";
var currentRound = "1a";
var selectA = "comp";
var selectB = "hone";

function questionMaker(a,b) {
	var virt1 = a;
	var virt2 = b;
	// this determines the form field values
	if ((virt1 == "comp" && virt2 == "hone") || (virt1 == "hone" && virt2 == "comp")) {
		question = "Entrusted to deliver an uncounted purse of gold, thou dost meet a poor beggar. Dost thou:";
		choiceA = "Show Compassion, giving the Beggar a coin, knowing it won\'t be missed?"; selectA = "comp";
		choiceB = "Deliver the gold, knowing the Trust in thee was well-placed?"; selectB = "hone";
	}
	
	if ((virt1 == "comp" && virt2 == "hono") || (virt1 == "hono" && virt2 == "comp")) {
		question = "Thou art sworn to uphold a Lord who participates in the forbidden torture of prisoners. Each night their cries of pain reach thee. Dost thou:";
		choiceA = "Show Compassion by reporting the deeds?"; selectA = "comp";
		choiceB = "Honor thy oath and ignore the deeds?"; selectB = "hono";
	}
	
	if ((virt1 == "comp" && virt2 == "humi") || (virt1 == "humi" && virt2 == "comp")) {
		question = "As one of the King\'s Guard, thy Captain has asked that one amongst you visit a hospital to cheer the children with tales of thy valiant deeds. Dost thou:";
		choiceA = "Show thy Compassion and play the braggart?"; selectA = "comp";
		choiceB = "Humbly let another go?"; selectB = "humi";
	}
	
	if ((virt1 == "comp" && virt2 == "just") || (virt1 == "just" && virt2 == "comp")) {
		question = "After 20 years thou hast found the slayer of thy best friends. The villain proves to be a man who provides the sole support for a young girl. Dost thou:";
		choiceA = "Spare him in Compassion for the girl?"; selectA = "comp";
		choiceB = "Slay him in the name of Justice?"; selectB = "just";
	}
	
	if ((virt1 == "comp" && virt2 == "sacr") || (virt1 == "sacr" && virt2 == "comp")) {
		question = "Thee and thy friends have been routed and ordered to retreat. In defiance of thy orders, dost thou:";
		choiceA = "Stop in Compassion to aid a wounded companion?"; selectA = "comp";
		choiceB = "Sacrifice thyself to slow the pursuing enemy, so others can escape?"; selectB = "sacr";
	}
	
	if ((virt1 == "comp" && virt2 == "spir") || (virt1 == "spir" && virt2 == "comp")) {
		question = "Thou hast been taught to preserve all life as sacred. A man lies fatally stung by a venomous serpent. He pleads for a merciful death. Dost thou:";
		choiceA = "Show Compassion and end his pain?"; selectA = "comp";
		choiceB = "Heed thy Spiritual beliefs and refuse?"; selectB = "spir";
	}
	
	if ((virt1 == "comp" && virt2 == "valo") || (virt1 == "valo" && virt2 == "comp")) {
		question = "Thou dost manage to disarm thy mortal enemy in a duel. He is at thy mercy. Dost thou:";
		choiceA = "Show Compassion by permitting him to yield?"; selectA = "comp";
		choiceB = "Slay him as expected of a Valiant duelist?"; selectB = "valo";
	}
	
	if ((virt1 == "hone" && virt2 == "hono") || (virt1 == "hono" && virt2 == "hone")) {
		question = "Thou art sworn to protect thy Lord at any cost, yet thou knowest he hast committed a crime. Authorities ask thee of the affair, dost thou:";
		choiceA = "Break thine oath by Honestly speaking?"; selectA = "hone";
		choiceB = "Uphold Honor by silently keeping thine oath?"; selectB = "hono";
	}
	
	if ((virt1 == "hone" && virt2 == "humi") || (virt1 == "humi" && virt2 == "hone")) {
		question = "Thy Lord mistakenly believes he slew a dragon. Thou hast proof that thy lance felled the beast. When asked, dost thou:";
		choiceA = "Honestly claim the kill and the prize?"; selectA = "hone";
		choiceB = "Humbly permit thy Lord his belief?"; selectB = "humi";
	}
	
	if ((virt1 == "hone" && virt2 == "just") || (virt1 == "just" && virt2 == "hone")) {
		question = "A merchant owes thy friend money, now long past due. Thou dost see the same merchant drop a purse of gold. Dost thou:";
		choiceA = "Honestly return the purse intact?"; selectA = "hone";
		choiceB = "Justly give a portion of the gold to thy friend first?"; selectB = "just";
	}
	
	if ((virt1 == "hone" && virt2 == "sacr") || (virt1 == "sacr" && virt2 == "hone")) {
		question = "Thee and thy friend are valiant but penniless warriors. Thou both go out to slay a mighty dragon. Thy friend thinks he slew it, thee did. When asked, dost thou:";
		choiceA = "Truthfully claim the gold?"; selectA = "hone";
		choiceB = "Allow thy friend the large reward?"; selectB = "sacr";
	}
	
	if ((virt1 == "hone" && virt2 == "spir") || (virt1 == "spir" && virt2 == "hone")) {
		question = "Thy friend seeks admittance to thy Spiritual order. Thou art asked to vouch for his purity of Spirit, of which thou art unsure. Dost thou:";
		choiceA = "Honestly express thy doubt?"; selectA = "hone";
		choiceB = "Vouch for him, hoping for his Spiritual improvement?"; selectB = "spir";
	}
	
	if ((virt1 == "hone" && virt2 == "valo") || (virt1 == "valo" && virt2 == "hone")) {
		question = "Thou hast been prohibited by thy absent Lord from joining thy friends in a close pitched battle. Dost thou:";
		choiceA = "Refrain, so thou may Honestly claim obedience?"; selectA = "hone";
		choiceB = "Show Valor, and aid thy comrades, knowing thou may deny it later?"; selectB = "valo";
	}
	
	if ((virt1 == "hono" && virt2 == "humi") || (virt1 == "humi" && virt2 == "hono")) {
		question = "Thou art at a crossroads in thy life. Dost thou:";
		choiceA = "Choose the Honorable life of a Paladin, striving for Truth and Courage?"; selectA= "hono";
		choiceB = "Choose the Humble life of a Shepherd, and a world of simplicity and peace?"; selectB = "humi";
	}

	if ((virt1 == "hono" && virt2 == "just") || (virt1 == "just" && virt2 == "hono")) {
		question = "Thou hast sworn to do thy Lord\'s bidding in all. He covets a piece of land and orders the owner removed. Dost thou:";
		choiceB = "Serve Justice, refusing to act, thus being disgraced?"; selectB = "just";
		choiceA = "Honor thine oath and unfairly evict the landowner?"; selectA= "hono";
	}
	
	if ((virt1 == "hono" && virt2 == "sacr") || (virt1 == "sacr" && virt2 == "hono")) {
		question = "Thou art a bounty hunter sworn to return an alleged murderer. After his capture, thou believest him to be innocent. Dost thou:";
		choiceB = "Sacrifice thy sizeable bounty for thy belief?"; selectB = "sacr";
		choiceA = "Honor thy oath to return him as thou hast promised?"; selectA= "hono";
	}
	
	if ((virt1 == "hono" && virt2 == "spir") || (virt1 == "spir" && virt2 == "hono")) {
		question = "In thy youth thou pledged to marry thy sweetheart. Now thou art on a sacred quest in distant lands. Thy sweetheart asks thee to keep thy vow. Dost thou:";
		choiceA = "Honor thy pledge to wed?"; selectA= "hono";
		choiceB = "Follow thy Spiritual crusade?"; selectB = "spir";
	}
	
	if ((virt1 == "hono" && virt2 == "valo") || (virt1 == "valo" && virt2 == "hono")) {
		question = "During battle thou art ordered to guard thy commander\'s empty tent. The battle goes poorly and thou dost yearn to aid thy fellows. Dost thou:";
		choiceB = "Valiantly enter the battle to aid thy companions?"; selectB = "valo";
		choiceA = "Honor thy post as guard?"; selectA= "hono";
	}
	
	if ((virt1 == "humi" && virt2 == "just") || (virt1 == "just" && virt2 == "humi")) {
		question = "Unwitnessed, thou hast slain a great dragon in self defense. A poor warrior claims the offered reward. Dost thou:";
		choiceB = "Justly step forward to claim the reward?"; selectB = "just";
		choiceA = "Humbly go about life, secure in thy self-esteem?"; selectA = "humi";
	}
	
	if ((virt1 == "humi" && virt2 == "sacr") || (virt1 == "sacr" && virt2 == "humi")) {
		question = "Thou art an elderly, wealthy eccentric. Thy end is near. Dost thou:";
		choiceB = "Donate all thy wealth to feed hundreds of starving children, and receive public adulation?"; selectB = "sacr";
		choiceA = "Humbly live out thy life, willing thy fortune to thy heirs?"; selectA = "humi";
	}
	
	if ((virt1 == "humi" && virt2 == "spir") || (virt1 == "spir" && virt2 == "humi")) {
		question = "Thy parents wish thee to become an apprentice. Two positions are available. Dost thou:";
		choiceB = "Become an acolyte in the Spiritual order?"; selectB = "spir";
		choiceA = "Become an assistant to a humble village cobbler?"; selectA = "humi";
	}
	
	if ((virt1 == "humi" && virt2 == "valo") || (virt1 == "valo" && virt2 == "humi")) {
		question = "Although a teacher of music, thou art a skillful wrestler. Thou hast been asked to fight in a local championship. Dost thou:";
		choiceB = "Accept the invitation and Valiantly fight to win?"; selectB = "valo";
		choiceA = "Humbly decline knowing thou art sure to win?"; selectA = "humi";
	}
	
	if ((virt1 == "just" && virt2 == "sacr") || (virt1 == "sacr" && virt2 == "just")) {
		question = "During a pitched battle, thou dost see a fellow desert his post, endangering many. As he flees, he is set upon by several enemies. Dost thou:";
		choiceA = "Justly let him fight alone?"; selectA = "just";
		choiceB = "Risk Sacrificing thine own life to aid him?"; selectB = "sacr";
	}
	
	if ((virt1 == "just" && virt2 == "spir") || (virt1 == "spir" && virt2 == "just")) {
		question = "Thou dost believe that virtue resides in all people. Thou dost see a rogue steal from thy Lord. Dost thou:";
		choiceA = "Call him to Justice?"; selectA = "just"; 
		choiceB = "Personally try to sway him back to the Spiritual path of good?"; selectB = "spir";
	}
	
	if ((virt1 == "just" && virt2 == "valo") || (virt1 == "valo" && virt2 == "just")) {
		question = "Thou hast been sent to secure a needed treaty with a distant Lord. Thy host is agreeable to the proposal but insults thy country at dinner. Dost thou:";
		choiceB = "Valiantly bear the slurs?"; selectB = "valo";
		choiceA = "Justly rise and demand an apology?"; selectA = "just";
	}
	
	if ((virt1 == "sacr" && virt2 == "spir") || (virt1 == "spir" && virt2 == "sacr")) {
		question = "Thou hast spent thy life in charitable and righteous work. Thine uncle the innkeeper lies ill and asks thee to take over his tavern. Dost thou:";
		choiceA = "Sacrifice thy life of purity to aid thy kin?"; selectA = "sacr";
		choiceB = "Decline & follow thy Spirit\'s call?"; selectB = "spir";
	}
	
	if ((virt1 == "sacr" && virt2 == "valo") || (virt1 == "valo" && virt2 == "sacr")) {
		question = "A mighty knight accosts thee and demands thy food. Dost thou:";
		choiceB = "Valiantly refuse and engage the knight?"; selectB = "valo";
		choiceA = "Sacrifice thy food unto the hungry knight?"; selectA = "sacr";
	}
	
	if ((virt1 == "spir" && virt2 == "valo") || (virt1 == "valo" && virt2 == "spir")) {
		question = "A local bully pushes for a fight. Dost thou:";
		choiceB = "Valiantly trounce the rogue?"; selectB = "valo";
		choiceA = "Decline, knowing in thy Spirit that no lasting good will come of it?"; selectA = "spir";
	}

	// set question and choices to form fields
	document.forms[0].question.value = question;
	document.forms[0].dispA.value = choiceA;
	document.forms[0].dispB.value = choiceB;

}

function setQA(val1,val2) {
	var xx = val1;
	var yy = val2;
	// this sets the form fields with their values
	questionMaker(xx,yy);
}

function moveRound() {
	// moves test along
	if (currentRound == "3") { endTest(); }
	if (currentRound == "2b") { currentRound = "3"; }
	if (currentRound == "2a") { currentRound = "2b"; }
	if (currentRound == "1d") { currentRound = "2a"; }
	if (currentRound == "1c") { currentRound = "1d"; }
	if (currentRound == "1b") { currentRound = "1c"; }
	if (currentRound == "1a") { currentRound = "1b"; }
	
	// continues with questioning
	// question 1b
	if (currentRound == "1b") { setQA('hono','humi'); }
	
	// question 1c
	if (currentRound == "1c") { setQA('just','sacr'); }
	
	// question 1d
	if (currentRound == "1d") { setQA('spir','valo'); }
	
	// question 2a
	if (currentRound == "2a") { setQA(r1aChoice,r1bChoice); }
	
	// question 2b
	if (currentRound == "2b") { setQA(r1cChoice,r1dChoice); }
	
	// question 3
	if (currentRound == "3") { setQA(r2aChoice,r2bChoice); }

}

function endTest(){
	if (r3Choice == "comp") {
		alert("The Gypsy says, \"Thou hast chosen the virtue of Compassion.\nYe shall start thy journey as a Bard.\"");
		document.location.href="bol_virt_compassion.asp";
	}
	if (r3Choice == "hone") {
		alert("The Gypsy says, \"Thou hast chosen the virtue of Honesty.\nYe shall start thy journey as a Mage.\"");
		document.location.href="bol_virt_honesty.asp";
	}
	if (r3Choice == "hono") {
		alert("The Gypsy says, \"Thou hast chosen the virtue of Honor.\nYe shall start thy journey as a Paladin.\"");
		document.location.href="bol_virt_honor.asp";
	}
	if (r3Choice == "humi") {
		alert("The Gypsy says, \"Thou hast chosen the virtue of Humility.\nYe shall start thy journey as a Shepherd.\"");
		document.location.href="bol_virt_humility.asp";
	}
	if (r3Choice == "just") {
		alert("The Gypsy says, \"Thou hast chosen the virtue of Justice.\nYe shall start thy journey as a Druid.\"");
		document.location.href="bol_virt_justice.asp";
	}
	if (r3Choice == "sacr") {
		alert("The Gypsy says, \"Thou hast chosen the virtue of Sacrifice.\nYe shall start thy journey as a Tinker.\"");
		document.location.href="bol_virt_sacrifice.asp";
	}
	if (r3Choice == "spir") {
		alert("The Gypsy says, \"Thou hast chosen the virtue of Spirituality.\nYe shall start thy journey as a Ranger.\"");
		document.location.href="bol_virt_spirituality.asp";
	}
	if (r3Choice == "valo") {
		alert("The Gypsy says, \"Thou hast chosen the virtue of Valor.\nYe shall start thy journey as a Fighter.\"");
		document.location.href="bol_virt_valor.asp";
	}

}

function choseA(){
	// this sets values when the A choice is made
	if (currentRound == "1a") { r1aChoice = selectA; }
	if (currentRound == "1b") { r1bChoice = selectA; }
	if (currentRound == "1c") { r1cChoice = selectA; }
	if (currentRound == "1d") { r1dChoice = selectA; }
	if (currentRound == "2a") { r2aChoice = selectA; }
	if (currentRound == "2b") { r2bChoice = selectA; }
	if (currentRound == "3") { r3Choice = selectA; }
	moveRound();	
}

function choseB(){
	// this sets values when the B choice is made
	if (currentRound == "1a") { r1aChoice = selectB; }
	if (currentRound == "1b") { r1bChoice = selectB; }
	if (currentRound == "1c") { r1cChoice = selectB; }
	if (currentRound == "1d") { r1dChoice = selectB; }
	if (currentRound == "2a") { r2aChoice = selectB; }
	if (currentRound == "2b") { r2bChoice = selectB; }
	if (currentRound == "3") { r3Choice = selectB; }
	moveRound();
}

function MM_preloadImages() { //v3.0
  var d=document;
  if(d.images){
  	if(!d.MM_p) 
		d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
	for(i=0; i<a.length; i++)
    	if (a[i].indexOf("#")!=0){
			d.MM_p[j]=new Image;
			d.MM_p[j++].src=a[i];
		}
	}
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function rand(number) {
        return Math.ceil(rnd()*number);
};

function getFacts() {
	var pickedFact = "";
	
	//get a random number
	var x = rand(54);
	x = (x - 0);
	
	if (x == 1) { pickedFact = "UV:L is the oldest public DS Siegelet, starting on Sept 23, 2000."; }
	if (x == 2) { pickedFact = "UV:L\'s founder, Tiberius, was just 18 when he founded this Siegelet."; }
	if (x == 3) { pickedFact = "UV:L has been given personal blessings and approval by Richard Garriott himself."; }
	if (x == 4) { pickedFact = "Despite works like this website, our webmaster, Aegis Kleias, remains unemployed."; }
	if (x == 5) { pickedFact = "Our Dialogue writer, FireTalon has a pet stapler named 'Wilson'."; }
	if (x == 6) { pickedFact = "Shadow of Light Dragon once fed her brother an entire bowl of sugar."; }
	if (x == 7) { pickedFact = "Our lead 3D modeler, Eramus, is a high school youth pastor and wannabe graphic designer."; }
	if (x == 8) { pickedFact = "The Lazarus website totes in at a hefty 115 MB. (including current content.)"; }
	if (x == 9) { pickedFact = "UV:L will be available in English with translations into German and French."; }
	if (x == 10) { pickedFact = "UV:L is freeware.  Only Dungeon Siege and UV:WoD will be required to play."; }
	if (x == 11) { pickedFact = "Tiberius and several other Team Lazarus members have attended Purdue University."; }
	if (x == 12) { pickedFact = "FireTalon thinks Gorn is a hottie."; }
	if (x == 13) { pickedFact = "Thol, who resides in Serpent\'s Hold, is based on a character FireTalon knows in person."; }
	if (x == 14) { pickedFact = "Shadow of Light\'s first dialogue assignment was the Lycaeum."; }
	if (x == 15) { pickedFact = "Shadow of Light gives her eternal thanks to Arkandor Dragon, who told her of the Lazarus opening."; }
	if (x == 16) { pickedFact = "Shadow of Light is plotting in secret, with Terilem, to overthrow Tiberius."; }
	if (x == 17) { pickedFact = "Grandor has not finished U5:WoD, but is looking forward to doing so with UV:L."; }
	if (x == 18) { pickedFact = "Grandor gathered his first dialogue experience by working on the Ultima IX dialogue patch."; }
	if (x == 19) { pickedFact = "Grandor believes that without the Ultimas, his english would not have come as far as it has."; }
	if (x == 20) { pickedFact = "Aegis Kleais is addicted to Haribo™ GummiBears, Lenders™ Bagels and Snapple™ Peach Iced Tea."; }
	if (x == 21) { pickedFact = "The UV:L website was built entirely from Dreamweaver UltraDEV 4, Flash and PaintShop Pro 6."; }
	if (x == 22) { pickedFact = "Currently, Team Lazarus has a web account that allows unlimited diskspace and bandwidth."; }
	if (x == 23) { pickedFact = "Dialogue writer Maigo Dragon has attended one of Richard Garriott\'s famous halloween parties."; }
	if (x == 24) { pickedFact = "In real life, Tiberius keeps a collection of swords and armor."; }
	if (x == 25) { pickedFact = "UV:L will have even more NPCs than the original. (UV:WoD)"; }
	if (x == 26) { pickedFact = "Lazarus will replace the in-game interface with its own, dubbed the LazGUI."; }
	if (x == 27) { pickedFact = "The UV:L dialogue system will feature clickable keywords, similar to Ultima VII."; }
	if (x == 28) { pickedFact = "UV:L adds more depth and background story to characters like Blackthorn and Captain Johne."; }
	if (x == 29) { pickedFact = "In UV:L, you will be able to play as a female Avatar as well."; }
	if (x == 30) { pickedFact = "In Ultima mythos, a person reduced to ashes cannot be ressurected."; }
	if (x == 31) { pickedFact = "In the original U5, the player could find a magic axe hidden in a tree stump in Jhelom."; }
	if (x == 32) { pickedFact = "The classic Ultima character \'Smith\' makes his first appearance in Ultima IV."; }
	if (x == 33) { pickedFact = "The back story for Ultima V has been greatly fleshed out in Lazarus, adding new depth and detail."; }
	if (x == 34) { pickedFact = "As in the original U5, you'll be able to play the harpsichord in Lazarus."; }
	if (x == 35) { pickedFact = "Character creation utilizes the classic Ultima \'gypsy sequence\' for your favored Virtue."; }
	if (x == 36) { pickedFact = "Ultima V was the first Ultima to feature day and night schedules for all NPCs."; }
	if (x == 37) { pickedFact = "Lazarus will allow you to choose from 6 different portraits for the Avatar."; }
	if (x == 38) { pickedFact = "In the original U5, a certain kind of wish made in a wishing well had a chance of coming true."; }
	if (x == 39) { pickedFact = "Ultima V is the first Ultima to include the Avatar\'s pocketwatch."; }
	if (x == 40) { pickedFact = "In Ultima V, the Codex is no longer buried in the Abyss--but in a Shrine on the Isle of the Avatar."; }
	if (x == 41) { pickedFact = "In Lazarus, a vast Underworld sprawls beneath the surface of Britannia, awaiting your exploration."; }
	if (x == 42) { pickedFact = "In Lazarus (as in the original U5), Dungeon Doom is twice as large as any of the other seven dungeons."; }
	if (x == 43) { pickedFact = "One NPC in Ultima V is based on Conan the Barbarian, and another is based on a biblical character."; }
	if (x == 44) { pickedFact = "Sale or possession of white potions (piercing vision) is illegal in Britannia during the U5 era."; }
	if (x == 45) { pickedFact = "You start your adventure with the Avatar and two companions, but can grow your party as large as six."; }
	if (x == 46) { pickedFact = "The village of Vesper from U4 no longer exists by the U5 era."; }
	if (x == 47) { pickedFact = "Yes, we\'re sorry...Chuckles the Jester is still in the game."; }
	if (x == 48) { pickedFact = "Three secret spells not mentioned in the spellbook could be learned in the original U5."; }
	if (x == 49) { pickedFact = "As in the original U5, the player will be able to camp to restore lost health and mana in Lazarus."; }
	if (x == 50) { pickedFact = "The origins of the enemy in Ultima V stretch all the way back to the original Ultima game."; }
	if (x == 51) { pickedFact = "Each dungeon in Lazarus has a unique visual theme. Each is designed to feel real...and terrifying."; }
	if (x == 52) { pickedFact = "Lazarus will feature travel by moongate portals, which open only during certain phases of the twin moons."; }
	if (x == 53) { pickedFact = "The original U5 had two different endings.  Lazarus will have at least that many."; }
	if (x == 54) { pickedFact = "SoL has taken her geekiness to a new level and is currently making herself a cloak."; }
	if (x == 55) { pickedFact = "The Lazarus motto was written by Shadow of Light Dragon."; }
	if (x == 56) { pickedFact = "Elandryl is also working on the french translations of Serpent Isle and The Black Gate."; }
		
	return pickedFact;
}

function writeDays(){
	document.write("<font face='verdana' size='1' color='white'><b>LAZARUS FACTS</b><br>");
	var fact = getFacts();
	document.write("<font color='#CCCCCC'>" + fact + "</font></font>");
}

function round(number,X) {
    X = (!X ? 2 : X);
    return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}

var goal = 20000;
var visits = 14897;;
var vispercent = round((visits / goal),2);
var bpercent = round((vispercent * 100),2);
var bwidth = ((vispercent * 100)*2);
var bwidth2 = ((200-0) - (bwidth-0));


function wGoal(){
	// document.write("<div align='center'><font color='#FFFFFF'><b>" + visits + "/" + goal + "&nbsp;&nbsp;(" + bpercent + " %)</b></font><br>");
	// document.write("<img src='images/white_bar.gif' width='" + bwidth + "' height='20' vspace='2' align='absmiddle'>");
	// document.write("<img src='images/black_bar.gif' width='" + bwidth2 + "' height='20' vspace='2' align='absmiddle'></div>"); 
}

function motto(){
	// this is used to display the lazarus motto (news blurb)
	alert ("Falsehood robs thy mind of Sight.\nHate provoke thine heart to Fight.\nA Fearful soul e\'re poised for Flight.\nThe Shadows come to quench the Light.");
}
