home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 November / PCWorld_2000-11_cd.bin / Software / Vyzkuste / pagetut / pgtut440.exe / pagetutor / other / titlepic.js < prev    next >
Text File  |  2000-07-20  |  3KB  |  53 lines

  1. /*  Titlepic generation equipment (random images at top of lessons)
  2. ===================================================================*/
  3. function getTitlePic(tutorial,lesson)
  4. {
  5.    thisPic = getRandom(13); // Number of pics available. Make sure the number here matches the quantity available below! There's no error checking. 
  6.    //thisPic = 13; //testing                                                     WIDTH  HEIGHT
  7.         if (thisPic == 1)  { titlepicInfo = new Array("titlepic01.gif", "left",  "150", "292"); }
  8.    else if (thisPic == 2)  { titlepicInfo = new Array("titlepic02.gif", "right", "201", "155"); }
  9.    else if (thisPic == 3)  { titlepicInfo = new Array("titlepic03.gif", "left",  "187", "246"); }
  10.    else if (thisPic == 4)  { titlepicInfo = new Array("titlepic04.gif", "right", "230", "212"); }
  11.    else if (thisPic == 5)  { titlepicInfo = new Array("titlepic05.gif", "left",  "228", "193"); }
  12.    else if (thisPic == 6)  { titlepicInfo = new Array("titlepic06.gif", "right", "273", "181"); }
  13.    else if (thisPic == 7)  { titlepicInfo = new Array("titlepic07.gif", "left",  "195", "211"); }
  14.    else if (thisPic == 8)  { titlepicInfo = new Array("titlepic08.gif", "right", "215", "219"); }
  15.    else if (thisPic == 9)  { titlepicInfo = new Array("titlepic09.gif", "right", "172", "266"); }
  16.    else if (thisPic == 10) { titlepicInfo = new Array("titlepic10.gif", "right", "174", "216"); }
  17.    else if (thisPic == 11) { titlepicInfo = new Array("titlepic11.gif", "left",  "198", "196"); }
  18.    else if (thisPic == 12) { titlepicInfo = new Array("titlepic12.gif", "right", "202", "214"); }
  19.    else if (thisPic == 13) { titlepicInfo = new Array("titlepic13.gif", "right", "210", "144"); }
  20.  
  21.    // Lesson 1 is always the pointing teacher
  22.    if(lesson == "Lesson 1") { titlepicInfo = new Array("titlepic00.gif", "left",  "277", "229"); }
  23.  
  24.    titlepicName   = titlepicInfo[0];
  25.    titlepicSide   = titlepicInfo[1];
  26.    titlepicWidth  = titlepicInfo[2];
  27.    titlepicHeight = titlepicInfo[3];
  28.  
  29.    if(tutorial == "So, you want to make a Web Page!")
  30.    { textSizeLine1 = "4"; textSizeLine2 = "6"; } else
  31.    { textSizeLine1 = "6"; textSizeLine2 = "4"; }
  32.  
  33.    if (titlepicSide == "left")
  34.    {
  35.       tpline1 = "<CENTER><TABLE BORDER=\"0\"><TR>";
  36.       tpline2 = "<TD><IMG SRC=\"../other/titlepics/" + titlepicName + "\" WIDTH=\"" + titlepicWidth + "\" HEIGHT=\"" + titlepicHeight + "\" HSPACE = \"20\"></TD>";
  37.       tpline3 = "<TD><FONT SIZE=\"" + textSizeLine1 + "\" FACE=\"arial,helvetica\"><NOBR>" + tutorial + "</NOBR></FONT><BR>";
  38.       tpline4 = "    <FONT SIZE=\"" + textSizeLine2 + "\" FACE=\"arial,helvetica\">\ \;" + lesson + "</FONT></TD>";
  39.       tpline5 = "</TR></TABLE></CENTER>";
  40.    }
  41.    else // we assume it's right
  42.    {
  43.       tpline1 = "<CENTER><TABLE BORDER=\"0\"><TR>";
  44.       tpline2 = "<TD><FONT SIZE=\"" + textSizeLine1 + "\" FACE=\"arial,helvetica\"><NOBR>" + tutorial + "</NOBR></FONT><BR>";
  45.       tpline3 = "    <FONT SIZE=\"" + textSizeLine2 + "\" FACE=\"arial,helvetica\">\ \;" + lesson + "</FONT></TD>";
  46.       tpline4 = "<TD><IMG SRC=\"../other/titlepics/" + titlepicName + "\" WIDTH=\"" + titlepicWidth + "\" HEIGHT=\"" + titlepicHeight + "\" HSPACE = \"20\"></TD>";
  47.       tpline5 = "</TR></TABLE></CENTER>";
  48.    }
  49.       tpline6 = "<HR>";
  50.  
  51.    return tpline1 + tpline2 + tpline3 + tpline4 + tpline5 + tpline6;
  52. }
  53.