jokebreak = 1;  // 1 = yes, there is a joke break
                // 0 = no, there is not a joke break



// determine depth ===============================
     if (DepthOfPage == 0) { depth = ""; }
else if (DepthOfPage == 1) { depth = "../"; }
else if (DepthOfPage == 2) { depth = "../../"; }
else if (DepthOfPage == 3) { depth = "../../../"; }
else if (DepthOfPage == 4) { depth = "../../../../"; }



// jokebreak line ===============================
if (jokebreak == 1)
{
   jokebreakline = "<A CLASS=\"noline\" HREF=\"http://junior.apk.net/~jbarta/bits/random2.html\" TARGET=\"_blank\" onMouseOver=\"top.status=\'Click here for a joke break!\'\;return true\" onMouseOut=\"top.status=\'\'\;return true\"><IMG SRC=\"" + depth + "tutor/other/jokesmile.gif\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\" ALT=\"Joke Break\" ALIGN=\"absmiddle\" HSPACE=\"2\"><FONT SIZE=\"-1\" FACE=\"arial,helvetica\" COLOR=\"#EEEEEE\"><I>Joke Break</I></FONT></A>\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;"
}
else
{
   jokebreakline = "\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;";
}



/*  Random number generator. If max=3 then function returns 1,2 or 3
===================================================================*/
function getRandom(max) {return (Math.floor(Math.random()*max))+1;}




/*  Titlepic generation equipment (random images at top of lessons)
===================================================================*/
function getTitlePic(tutorial,lesson)
{
   thisPic = getRandom(8); // Number being number of pics available.
                           // Make sure the number here matches the quantity available below!
                           // There's no error checking.                        WIDTH  HEIGHT
        if (thisPic == 1)  { titlepicInfo = new Array("titlepic01.gif", "left",  "150", "292"); }
   else if (thisPic == 2)  { titlepicInfo = new Array("titlepic02.gif", "right", "201", "155"); }
   else if (thisPic == 3)  { titlepicInfo = new Array("titlepic03.gif", "left",  "187", "246"); }
   else if (thisPic == 4)  { titlepicInfo = new Array("titlepic04.gif", "right", "230", "212"); }
   else if (thisPic == 5)  { titlepicInfo = new Array("titlepic05.gif", "left",  "228", "193"); }
   else if (thisPic == 6)  { titlepicInfo = new Array("titlepic06.gif", "right", "273", "181"); }
   else if (thisPic == 7)  { titlepicInfo = new Array("titlepic07.gif", "left",  "195", "211"); }
   else if (thisPic == 8)  { titlepicInfo = new Array("titlepic08.gif", "right", "215", "219"); }

   // Lesson 1 is always the pointing teacher
   if(lesson == "Lesson 1") { titlepicInfo = new Array("titlepic00.gif", "left",  "277", "229"); }

   titlepicName   = titlepicInfo[0];
   titlepicSide   = titlepicInfo[1];
   titlepicWidth  = titlepicInfo[2];
   titlepicHeight = titlepicInfo[3];

   if(tutorial == "So, you want to make a Web Page!")
   { textSizeLine1 = "4"; textSizeLine2 = "6"; } else
   { textSizeLine1 = "6"; textSizeLine2 = "4"; }

   if (titlepicSide == "left")
   {
      tpline1 = "<CENTER><TABLE BORDER=\"0\"><TR>";
      tpline2 = "<TD><IMG SRC=\"../makapage/pics/" + titlepicName + "\" WIDTH=\"" + titlepicWidth + "\" HEIGHT=\"" + titlepicHeight + "\" HSPACE = \"20\"></TD>";
      tpline3 = "<TD><FONT SIZE=\"" + textSizeLine1 + "\" FACE=\"arial,helvetica\"><NOBR>" + tutorial + "</NOBR></FONT><BR>";
      tpline4 = "    <FONT SIZE=\"" + textSizeLine2 + "\" FACE=\"arial,helvetica\">\&nbsp\;" + lesson + "</FONT></TD>";
      tpline5 = "</TR></TABLE></CENTER>";
   }
   else // we assume it's right
   {
      tpline1 = "<CENTER><TABLE BORDER=\"0\"><TR>";
      tpline2 = "<TD><FONT SIZE=\"" + textSizeLine1 + "\" FACE=\"arial,helvetica\"><NOBR>" + tutorial + "</NOBR></FONT><BR>";
      tpline3 = "    <FONT SIZE=\"" + textSizeLine2 + "\" FACE=\"arial,helvetica\">\&nbsp\;" + lesson + "</FONT></TD>";
      tpline4 = "<TD><IMG SRC=\"../makapage/pics/" + titlepicName + "\" WIDTH=\"" + titlepicWidth + "\" HEIGHT=\"" + titlepicHeight + "\" HSPACE = \"20\"></TD>";
      tpline5 = "</TR></TABLE></CENTER>";
   }
      tpline6 = "<HR>";

   return tpline1 + tpline2 + tpline3 + tpline4 + tpline5 + tpline6;
}




// Print version lines ===============================
PrintVersionLine =  "<A HREF=\"http://junior.apk.net/~jbarta/printversion/index.html\" CLASS=\"noline\"><FONT FACE=\"trebuchet ms,arial,helvetica\" COLOR=\"#FF3366\" SIZE=\"2\">Print version now available - Get the WebTutor book\!<BR>Lots of good stuff... Software discounts, Pre-release of Javascript Tutor, Free Clipart, etc.</FONT></A>";
PrintVersionLine2 = "<A HREF=\"http://junior.apk.net/~jbarta/printversion/index.html\" CLASS=\"noline\"><FONT FACE=\"verdana,arial,helvetica\"                     SIZE=\"2\"><B>Print version now available - Get the WebTutor book\!<BR>Lots of good stuff... Software discounts, Pre-release of Javascript Tutor, Free Clipart, etc.</B></FONT></A>"; // for the TOC
