var standardStyle = "<body bgcolor='000000' text='#000000' link='#1D213B' vlink='#1F2754'>"
var cssLink = "<link href='qp.css' rel='stylesheet'>"

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

}

function writeMenu() {
  document.write('<p class="fixedmenu"><img src="floatmenu.gif" border="0" /></p>');
}

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) {
  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>')
}



function writeHeader() {
  document.write('<table cellpadding="0" cellspacing="0" border="0" >');
  document.write('<tr><td width="761" height="64" colspan="3">');
  document.write('<img name="menubar" usemap="#menubar" src="top.png" border="0" width="761" height="64" />');
  document.write('<map name="menubar">');
  document.write('<area shape="rect" coords="135,28,176,48" href="main.htm">');
  document.write('<area shape="rect" coords="180,28,224,48" href="news.htm">');
  document.write('<area shape="rect" coords="229,28,282,48" href="books.htm">');
  document.write('<area shape="rect" coords="287,28,376,48" href="ch-index.htm">');
  document.write('<area shape="rect" coords="382,28,463,48" href="questions.htm">');
  document.write('<area shape="rect" coords="469,28,534,48" href="features.htm">');
  document.write('<area shape="rect" coords="538,28,595,48" href="author.htm">');
  document.write('<area shape="rect" coords="599,28,629,48" href="http://www.michaelowencarroll.com/shs">');
  document.write('</map></td></tr>');
  document.write('<tr><td background="midleft.png" width="41" height="50" valign="top"><img src="topleft.png" width="41" height="99" /></td>');
  document.write('<td width="679" background="mid.png" rowspan="2">');
}


function writeFooter() {
  document.write('</td>');
  document.write('<td width="41" height="50" valign="top" background="midright.png"><img src="topright.png" width="41" height="99" /></td>');
  document.write('<tr><td width="41" height="50" valign="bottom" background="midleft.png"><img src="botleft.png" width="41" height="104" /></td>');
  document.write('<td width="41" height="50" valign="bottom" background="midright.png"><img src="botright.png" width="41" height="104" /></td></tr>');
  document.write('<tr><td width="761" colspan="3"><a href="#"><img src="bot');
  if (Math.floor(Math.random() * 20) == 0) {
    document.write('2');
  }
  document.write('.png" border="0" width="761" height="68" /></a><td></tr>');
  document.write('</table>');
}

function writeHeaderOLD() {
  document.write('<table cellpadding="0" cellspacing="0" border="0">');
  document.write('<tr><td width="700" height="65" colspan="3">');
  document.write('<img name="menubar" usemap="#menubar" src="top.gif" border="0" width="700" height="65" />');
  document.write('<map name="menubar">');
  document.write('<area shape="rect" coords="078,21,121,37" href="main.htm">');
  document.write('<area shape="rect" coords="122,21,164,37" href="news.htm">');
  document.write('<area shape="rect" coords="165,21,210,37" href="books.htm">');

  r = Math.floor(Math.random() * 4);
  switch (r)
  {
  case 1:
    document.write('<area shape="rect" coords="211,21,285,37" href="ch-index2.htm">');
    break;
  case 2:
    document.write('<area shape="rect" coords="211,21,285,37" href="ch-index3.htm">');
    break;
  default:
    document.write('<area shape="rect" coords="211,21,285,37" href="ch-index.htm">');
  }

  document.write('<area shape="rect" coords="286,21,353,37" href="questions.htm">');
  document.write('<area shape="rect" coords="354,21,415,37" href="features.htm">');
  document.write('<area shape="rect" coords="416,21,469,37" href="author.htm">');
  document.write('<area shape="rect" coords="470,21,501,37" href="http://www.iol.ie/~carrollm/shs">');
  document.write('</map></td></tr>');
  document.write('<tr><td background="leftmid.gif" width="55" height="130" valign="top"><img src="lefttop.gif" width="55" height="130" /></td>');
  document.write('<td width="590" background="mid.gif" rowspan="2">');
  document.write('<center>');
  r = Math.floor(Math.random() * 4);
  switch (r)
  {
  case 0:
    document.write('<a href="coll1.htm"><img src="shbanner468x60-a.jpg" border="0" width="468" height="60" /></a>');
    break
  case 1:
    document.write('<a href="coll1.htm"><img src="shbanner468x60-b.jpg" border="0" width="468" height="60" /></a>');
    break
  case 2:
    document.write('<a href="coll1.htm"><img src="shbanner468x60-c.jpg" border="0" width="468" height="60" /></a>');
    break
  default:
    document.write('<a target="0" href="http://www.iol.ie/~carrollm/shs"><img src="shsbanner.jpg" border="0" width="468" height="60" /></a>');
  }
  document.write('<br /><hr /></center>');
}


function writeFooterOLD() {
  document.write('</td>');
  document.write('<td width="55" height="130" valign="top" background="rightmid.gif"><img src="righttop.gif" width="55" height="130" /></td>');
  document.write('<tr><td width=55 height="53" valign="bottom" background="leftmid.gif"><img src="leftbot.gif" width="55" height="53" /></td>');
  document.write('<td width="55" height="53" valign="bottom" background="rightmid.gif"><img src="rightbot.gif" width="55" height="53" /></td></tr>');
  if (Math.floor(Math.random() * 2) == 0) {
    document.write('<tr><td width="700" colspan="3"><a href="#"><img src="bot.gif" border="0" width="700" height="65" /></a><td></tr>');
  } else {
    document.write('<tr><td width="700" colspan="3"><a href="#"><img src="bot2.gif" border="0" width="700" height="65" /></a><td></tr>');
  }
  document.write('</table>');
}


function writeHeader2() {
  document.write('<img name="menubar" usemap="#menubar" src="top2.png" border="0" />');
  document.write('<map name="menubar">');
  document.write('<area shape="rect" coords="095,28,136,48" href="main.htm">');
  document.write('<area shape="rect" coords="140,28,184,48" href="news.htm">');
  document.write('<area shape="rect" coords="189,28,242,48" href="books.htm">');

  r = Math.floor(Math.random() * 4);
  switch (r)
  {
  case 1:
    document.write('<area shape="rect" coords="247,28,336,48" href="ch-index2.htm">');
    break;
  case 2:
    document.write('<area shape="rect" coords="247,28,336,48" href="ch-index3.htm">');
    break;
  default:
    document.write('<area shape="rect" coords="247,28,336,48" href="ch-index.htm">');
  }

  document.write('<area shape="rect" coords="342,28,423,48" href="questions.htm">');
  document.write('<area shape="rect" coords="429,28,494,48" href="features.htm">');
  document.write('<area shape="rect" coords="498,28,555,48" href="author.htm">');
  document.write('<area shape="rect" coords="559,28,589,48" href="http://www.iol.ie/~carrollm/shs">');
  document.write('</map><br>');
}


function writeHeader2OLD() {
  document.write('<img name="menubar" usemap="#menubar" src="top2.gif" border="0" />');
  document.write('<map name="menubar">');
  document.write('<area shape="rect" coords="078,21,121,37" href="main.htm">');
  document.write('<area shape="rect" coords="122,21,164,37" href="news.htm">');
  document.write('<area shape="rect" coords="165,21,210,37" href="books.htm">');
  document.write('<area shape="rect" coords="211,21,285,37" href="ch-index.htm">');
  document.write('<area shape="rect" coords="286,21,353,37" href="questions.htm">');
  document.write('<area shape="rect" coords="354,21,415,37" href="features.htm">');
  document.write('<area shape="rect" coords="416,21,469,37" href="author.htm">');
  document.write('<area shape="rect" coords="470,21,501,37" href="http://www.iol.ie/~carrollm/shs">');
  document.write('</map><br>');
}

function writePowerCard(strength, intelligence, courage, speed, endurance, combat, power) {
  document.write('<table border="0" cellspacing="0" cellpadding="0" width="106" height="130" background="charfile.png" >');
  document.write('<tr><td valign=top>');
  document.write('<img src="blank.gif" height="15" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="3" /><img src="redbar.png" height="3" width="', strength,'" /><br />');
  document.write('<img src="blank.gif" height="15" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="3" /><img src="redbar.png" height="3" width="', intelligence,'" /><br />');
  document.write('<img src="blank.gif" height="15" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="3" /><img src="redbar.png" height="3" width="', courage,'" /><br />');
  document.write('<img src="blank.gif" height="15" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="3" /><img src="redbar.png" height="3" width="', speed,'" /><br />');
  document.write('<img src="blank.gif" height="15" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="3" /><img src="redbar.png" height="3" width="', endurance,'" /><br />');
  document.write('<img src="blank.gif" height="15" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="3" /><img src="redbar.png" height="3" width="', combat,'" /><br />');
  document.write('<img src="blank.gif" height="15" width="1" /><br />');
  document.write('<img src="blank.gif" height="1" width="3" /><img src="redbar.png" height="3" width="', power,'" /><br />');
  document.write('</table>');
}

