/*  Titlepic generation equipment (random images at top of lessons)
===================================================================*/
function getTitlePic(tutorial,lesson)
{
   thisPic = getRandom(13); // Number of pics available. Make sure the number here matches the quantity available below! There's no error checking. 
   //thisPic = 13; //testing                                                     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"); }
   else if (thisPic == 9)  { titlepicInfo = new Array("titlepic09.gif", "right", "172", "266"); }
   else if (thisPic == 10) { titlepicInfo = new Array("titlepic10.gif", "right", "174", "216"); }
   else if (thisPic == 11) { titlepicInfo = new Array("titlepic11.gif", "left",  "198", "196"); }
   else if (thisPic == 12) { titlepicInfo = new Array("titlepic12.gif", "right", "202", "214"); }
   else if (thisPic == 13) { titlepicInfo = new Array("titlepic13.gif", "right", "210", "144"); }

   // 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=\"../other/titlepics/" + 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=\"../other/titlepics/" + titlepicName + "\" WIDTH=\"" + titlepicWidth + "\" HEIGHT=\"" + titlepicHeight + "\" HSPACE = \"20\"></TD>";
      tpline5 = "</TR></TABLE></CENTER>";
   }
      tpline6 = "<HR>";

   return tpline1 + tpline2 + tpline3 + tpline4 + tpline5 + tpline6;
}
