//TRINPsite, 56.06.2-66.20.3, JS/TopPart.js at TRINP = www.trinp.org

function cond_showPicTC(T) { if (BodyObjsT) showPicTC(T) }

function Write_TopPart(S)
{
 var I=-1; var poemC=""; var poemS="";
 var VersDateS="";
 var URL_S="";
 var BgColS="";
 var URLColS=' color="#800080" face="Times New Roman"';
 var reasonT=false;
 var PicTC_T=true;  // false if no picture in the (top) center wanted
 docDateS="" // global var

 VersDateS=S.substring(0,5);
 if (VersDateS<"59011") BodyObjsT=true;  // for use in cond_showPicTC(T)
  else { if (BodyObjsT) { TodayF(); if (wNow<4) reasonT=true } }

 if (VersDateS>"56240")
 { docDateS=S.substring(6,21); URL_S=S.substring(22);
   if (URL_S.indexOf("ShijianF.HTM")>-1) PicTC_T=false;
     // for a full-page presentation on one A4, with frame bars and texts
   if (URL_S.indexOf(".HTM")==-1)
     { BgColS=" bgcolor=\"#800080\" background=\"\"";
       URLColS=" color=\"#00ff00\"";
       I=URL_S.indexOf("Valu/")
     }
    else
     { if (URL_S.indexOf("Poet/ComP/")>-1) 
        { I=URL_S.indexOf("/Au/");
          if (I>0) { poemC=URL_S.charAt(I-1); poemS=URL_S.substring(I+4,I+9) }
        }
     }
document.write('<table width="600" cellpadding="0" cellspacing="0" border="0" id="FramSup">');
document.write(' <tr>');
document.write('  <td width="222" align="left" valign="bottom">');
document.write('   <table cellpadding="0" cellspacing="0" border="0"><tr>');
document.write('    <td><small><strong class="FrameFont">&nbsp;</strong></small></td>');
document.write('    <td',BgColS,' align="left" class="FrameCell"><font',URLColS,'><small><strong class="FrameFont">');
document.write('     &nbsp;<a href="',PathS,'MainDoc.htm" class="FrameLink">TRINPsite</a>, ');
document.write('     <a href="',PathS,'Tong/ThL/Time.htm" class="FrameLink">',docDateS,'</a>&nbsp;')
document.write('    </strong></small></font></td>');
document.write('   </tr></table></td>');

   if (PicTC_T)
     {
document.write('  <td width="156" height="78" align="center" valign="top">');

      if (I<0)  // regular document
        {

         if (reasonT) document.write('<a href="',PathS,'Tong/ThL/Time/NewYearC.HTM"');
          else document.write('   <a href="',PathS,'Info/VLP/TopC',fileC,'.htm"');

document.write('    onmouseover="cond_showPicTC(true)"');
document.write('    onmouseout="cond_showPicTC(false)" class="PicLink">');

         if (reasonT) document.write('<img src="',PathS,'Graf/VLP/Nian61.gif"');
          else document.write('    <img src="',PathS,'Graf/VLP/IniTopC',fileC,'.gif"');

document.write('      width="156" height="78" border="0" alt=">=<" /></a></td>');
        }

       else  // document with special center top picture and/or structure
        {

        if (I==0)  // value document
          {
document.write('   <a href="',PathS,'Game/Cube/TRNPCVar.HTM"');
document.write('    onmouseover="cond_showPicTC(true)"');
document.write('    onmouseout="cond_showPicTC(false)" class="PicLink">');
document.write('    <img src="',PathS,'Game/Cube/Stil/TopC_TRP.gif"');
document.write('      width="156" height="78" border="0" alt="TRINP Cube" /></a></td>');
          }
         else
          {
document.write('   <table bgcolor="#ffffff" border="0"><tr><td align="center">');
document.write('    <table bgcolor="#404040" border="0"><tr><td align="center">');
document.write('     <table bgcolor="#fffff0" background="',PathS,'Graf/Bkgr/CatArrDU.gif" border="0">');
document.write('      <tr>');
 
           if ((poemC=="3") || (poemC=="4"))
           {
document.write('       <td align="center"><a href="',poemS,'Tr.htm">');
document.write('         <img src="../../../../Graf/Icon/CatButtn.gif"');
document.write('          width="31" height="31" alt="[MOTION POEM #',poemC,']" border="0" /></a><br />');
document.write('        <font size="-2" color="#404040"><b>TRAILER</b></font><br /></td>');
           }

document.write('      </tr>');
document.write('     </table>');
document.write('    </td></tr></table>');
document.write('   </td></tr></table></td>');
          }    
        }
     }
    else
document.write('  <td width="156"></td>');  // nothing in top center

document.write('  <td width="222" align="right" valign="bottom">');
document.write('   <table cellpadding="0" cellspacing="0" border="0"><tr>');
document.write('    <td',BgColS,' align="right" class="FrameCell"><font',URLColS,'><small><strong');
document.write('     class="FrameFont">&nbsp;',URL_S,'&nbsp;</strong></small></font></td>');
document.write('    <td><small><strong class="FrameFont">&nbsp;</strong></small></td>');
document.write('   </tr></table></td>');
document.write(' </tr>');
document.write('</table>');

 }

 docDateS=docDateS.substring(8,10)+docDateS.substring(11,13)+docDateS.substring(14);
  // date of last change(s) made (without dots) in document
}

TopParT=true  // checks whether contents have been transferred
              // (on-line) and scripts (can be) executed

//Copyright 56-66 aSWW, M.Vincent van Mechelen, DNI Foundation
