// Library page operations

// presents title; append word library if missing
function lInsertTitle()
{
   document.write('<strong><font face="' + cGeneralFont + '" size="6" color= "#000066">' + lTitle + '</font></strong>');
   document.write('<br><font face="' + cGeneralFont + '" size="3">' + lDesc + '</font>');
}

// standard header style on the library page
function toLibraryHeader(text)
{
   return '<span style="font-family: ' + cGeneralFont + '; font-size: 14px; font-weight: bold; text-decoration: underline;">' + text + '</span>';
}

// normal text style on the library page
function toLibraryNormal(text)
{
   return '<font face="' + cGeneralFont + '" size="2">' + text + '</font>';
}

// inserts page items 
function lInsertItems()
{ 
   if (HasInstance(lTitles) && HasInstance(lDescs) && (lDescs.length == lTitles.length))
   {
      document.write('<table border="0" cellpadding="0" cellspacing="16">');
      for (i = 0; i < lTitles.length; i ++)
      {
         document.write('<tr><td>');
         document.write('<a href="' + lUrls[i] + '" src="images/book.gif">');
         document.write('<img src="images/book.gif" border="0" alt="Click book to open"></a>');
         document.write('</td>');
         document.write('<td style="cursor: pointer;" onclick="window.location.href=\'' + lUrls[i] + '\'">' + toLibraryHeader(lTitles[i]) + '<br>');
         document.write(toLibraryNormal(lDescs[i]));
         document.write('</td></tr>');
      }
      document.write('</table>');
   }
}

// presents footer
function lInsertFooter()
{
   document.write(toFooter(lPublished));
}
