function openBryceWindow(docName)
{
	myWindow=window.open(docName,"myWindow","width=200,height=400,scrollbars=yes,menubar=no,toolbar=no,resizable=yes");
}

function storiesNav(dirPrefix)
{
	document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "stories/lota.htm\">Legend of the Ancients</a><br>\n");
	document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>\n");
	document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "stories/fotk.htm\">Fall of Tymor Keep</a><br>\n");
	document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"8\" alt=\"\"><br>\n");
}

function worldNav(dirPrefix)
{
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "3realms.htm\">The Realms of Tarias</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "characters/index.html\">Noteworthy Characters</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "races/index.html\">Races of the Realm</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "races/elderdragons.htm\">The Elder Dragons</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "classes/tarian_mystics.htm\">Tarian Mystics</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "pantheon/index.html\">Tarian Pantheon</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "chronicles/index.html\">Campaign Chronicles</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"8\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "dm_corner/index.html\">Dungeon Master's Q&amp;A</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"8\" alt=\"\"><br>");
}

function resourceNav(dirPrefix)
{
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "chargen/index.html\">Online Char. Generator</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "adnd_tools/dm_resources.htm\">DM & Player Resources</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "items/index.html\">Tarian Items Archive</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "spells/index.html\">Tarian Spells Archive</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "maps/index.html\">Maps Archive</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "items/index_3e.html\">3E Items Archive</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "maps/index.html\">3E Maps Archive</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"8\" alt=\"\"><br>");
}

function galleryNav(dirPrefix)
{
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "galleries/brycelandscapes1.htm\">Day Landscapes</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "galleries/brycelandscapes2.htm\">Night Landscapes</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "galleries/bryceequipment1.htm\">Equipment</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "galleries/brycemisc1.htm\">Seaonal/Misc</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "galleries/characters1.htm\">Characters I</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "galleries/characters2.htm\">Characters II</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"8\" alt=\"\"><br>");
}

function aboutNav(dirPrefix)
{
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "awards.htm\">Site Awards</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "credits.htm\">Credits &amp; Thanks</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "fonts.htm\">Fonts Archive</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
  document.write("<a class=\"NavBar\" href=\"" + dirPrefix + "viewing_tips.htm\">Viewing Tips</a><br>");
  document.write("<img src=\"" + dirPrefix + "images/blank.gif\" width=\"4\" height=\"4\" alt=\"\"><br>");
}

function getCookie(byname)
{ 
// "byname" is the name of the cookie to retrieve

  byname = byname + "=";
  nlen = byname.length;
  fromN = document.cookie.indexOf(byname) + 0;
  if (fromN != -1)
  {
    fromN += nlen;
    toN = document.cookie.indexOf(";",fromN) + 0;
    if (toN == -1)
    {
      toN = document.cookie.length;
    }
    return unescape(document.cookie.substring(fromN,toN));
  }
  return null;
}

function setCookie(name,value,time)
{

// "name" is the name of the cookie to be stored
// "value" is the value to store in the cookie
// "time" is the date & time that the cookie expires

  exp = new Date();
  if ((name == null) || (value == null)) return false;
  if (time == null) time = 365*86400000;
  exp.setTime(exp.getTime() + time);
  document.cookie = escape(name) + "=" + escape(value) + "; " + "expires=" + exp.toGMTString();
  return true;
}

function ToggleSound(musicObj, imgObj)
{
  SndToggle = "" + getCookie("SndToggle");
  if (SndToggle == "On")
  {
    SndToggle = "Off";
    imgObj.src = "/images/pause.gif";
    musicObj.Stop();
  }
  else
  {
    SndToggle = "On";
    imgObj.src = "/images/play.gif";
  }
  setCookie("SndToggle", SndToggle, null);
}

function CheckSound(musicObj, imgObj)
{
  SndToggle = "" + getCookie("SndToggle");
  if ((SndToggle != "On") || (SndToggle == null))
  {
    imgObj.src = "/images/pause.gif";
    musicObj.Stop();
  }
}