var standardStyle = "<body bgcolor='000000' text='#ffffff' link='#8CACB4' vlink='#B4CFD6' {background-image:url('brawn-bg1.jpg');}>"
var cssLink = "<link href='qp.css' rel='stylesheet'>"

function writeStandardStyle() {
  document.write(standardStyle+cssLink);

}

function writeMenu(n) {
  document.write('<img name="menubar" usemap="#menubar" src="menu');
  switch(n) {
    case 1: document.write("news"); break;
    case 2: document.write("books"); break;
    case 3: document.write("chars"); break;
    case 4: document.write("quest"); break;
    case 5: document.write("feat"); break;
    case 6: document.write("author"); break;
    default : document.write("home")
  }
  document.write('.jpg" border="0" width="640" height="60" />');
  document.write('<map name="menubar">');
  document.write('<area shape="rect" coords="000,00,640,35" href="main.htm">');
  document.write('<area shape="rect" coords="000,35,077,60" href="news.htm">');
  document.write('<area shape="rect" coords="077,35,159,60" href="books.htm">');
  document.write('<area shape="rect" coords="159,35,304,60" href="ch-index.htm">');
  document.write('<area shape="rect" coords="304,35,429,60" href="questions.htm">');
  document.write('<area shape="rect" coords="429,35,543,60" href="features.htm">');
  document.write('<area shape="rect" coords="543,35,640,60" href="author.htm">');
  document.write('</map>');
}


function bookMenu(book, prev, next, n) {
  document.write('<center><img name="bookmenu" usemap="#bookmenu" src="'+book);
  document.write('title'+n+'.jpg" border="0" width="430" height="80" /></center>');
  document.write('<map name="bookmenu">');
  switch(n) {
    case 2: fn = "-det"; break;
    case 3: fn = "-rev"; break;
    case 4: fn = "-sam"; break;
    default : fn = "";
  }
  if (prev != "") { document.write('<area shape="rect" coords="000,00,040,50" href="'+prev+fn+'.htm">'); }
  if (n != 1 ) { document.write('<area shape="rect" coords="041,51,113,79" href="'+book+'.htm">'); }
  if (n != 2 ) { document.write('<area shape="rect" coords="114,51,200,79" href="'+book+'-det.htm">'); }
  if (n != 3 ) { document.write('<area shape="rect" coords="201,51,298,79" href="'+book+'-rev.htm">'); }
  if (n != 4 ) { document.write('<area shape="rect" coords="299,51,389,79" href="'+book+'-sam.htm">'); }
  if (next != "") { document.write('<area shape="rect" coords="390,00,430,50" href="'+next+fn+'.htm">'); }
  document.write('</map>');
}

function toggleDiv(a){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none"){
    e.style.display="block"
  } else {
    e.style.display="none"
  }
  return true;
}


function writeNumber(n) {
  st = ""+ n
  for (i = 0; i < st.length; i++) {
    code = st.charCodeAt(i)
    document.write('<img src="$0' + code + '.png" />')
  }
}

var myCounter = 0

function resetCounter(n) {
  myCounter = n
}

function writeCounter() {
  title3(""+myCounter);
  myCounter++
}

function writeDate(y, m, d) {
  document.write('<p align="center"><img src="hbar.png"></p>');
  title3(paddedNumber(y, 4)+"-"+paddedNumber(m, 2)+"-"+paddedNumber(d, 2));
}

function paddedNumber(n, width) {
  st = ""+ n
  while (st.length < width) {
    st = "0" + st
  }
  return st;
}

function title(st) {
//  document.write("<font face='Trebuchet MS' size="5"><b>"+st+"</b></font>")
  document.write('<font face="Trebuchet MS" size="4"><b>'+st+'</b></font>')
}

function title3(st) {
//  document.write("<font face='Trebuchet MS' size="3"><b>"+st+"</b></font>")
//  document.write('<font face="Trebuchet MS" size="3"><b>'+st+'</b></font>')
  document.write('<div class="title">'+st+'</div>')
}


function writePowerCard2(strength, intelligence, courage, speed, endurance, combat, power) {
  document.write('<table border="0" cellspacing="0" cellpadding="0" width="200" height="80" background="charfile2.png" >');
  document.write('<tr><td valign=top>');
  document.write('<img src="blank.gif" height="7" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="', 84+strength,'" /><img src="redbar.png" height="10" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="', 84+intelligence,'" /><img src="redbar.png" height="10" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="', 84+courage,'" /><img src="redbar.png" height="10" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="', 84+speed,'" /><img src="redbar.png" height="10" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="', 84+endurance,'" /><img src="redbar.png" height="10" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="', 84+combat,'" /><img src="redbar.png" height="10" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="', 84+power,'" /><img src="redbar.png" height="10" width="1" /><br />');
  document.write('</table>');
}



