var glSizeEX;
var glPreviwX;
var glPreviwY;

function window_open(link, x, y)
  {
   window.open(link, "New", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes" );
   return 0; 
  }

function OneImage9 ( Path , PathLoc , Image , SizeX , SizeY , SizeXB , SizeYB , Comment , Align , Part , Mode )
  { var SizeXAllowed;
    var lSize;

   lSize = ( ( SizeX > 0 ) && ( SizeY > 0 ) );
   if ( lSize )
     { SizeXAllowed = glSizeEX * Part;
       if ( SizeXAllowed < SizeX ) 
         { SizeY = SizeY * ( SizeXAllowed / SizeX );
           SizeX = SizeXAllowed;
         };
     };

   document.write ('<table class="bodytextT" align=');
   document.write ('\'');
   document.write (Align);
   document.write ('\'');
   if ( Comment.charAt(1) != "-" ) document.write (' border=1'); else document.write (' border=0');
   document.write (' rules=all leftmargin=0 cellpadding=5 cellspacing=0>');
   document.write ('<tr align=middle>');
   document.write ('<td>');
   document.write ('<img src=');
   document.write ('\'');
   document.write (Path);
   document.write ('/');
   if ( PathLoc != "" )
     { document.write (PathLoc);
       document.write ('/');
     };
   document.write (Image);
   document.write ('-M.JPG');
   document.write ('\'');
   if ( lSize )
     { document.write (' width=');
       document.write ('\'');
       document.write (SizeX);
       document.write ('\'');
       document.write (' height=');
       document.write ('\'');
       document.write (SizeY);
       document.write ('\'');
     };
   if ( Mode == 1 )
     { document.write (' OnClick=');
       document.write ('\"');
       document.write ('window_open(');
       document.write ('\'');
    // document.write ('../../Show.htm?');
       document.write ('Show9.htm?');
       document.write (Path);
       document.write ('/');
       if ( PathLoc != "" )
         { document.write (PathLoc);
           document.write ('/');
         };
       document.write (Image);
       document.write ('-B.JPG');
       document.write ('&');
       document.write (CountName);
       document.write ('&');
       document.write (SizeXB.toString());
       document.write ('&');
       document.write (SizeYB.toString());
       document.write ('&');
       document.write ('\'');
       document.write (',0,0)');
       document.write ('\" ');
       document.write ('style=');
       document.write ('\"');
       document.write ('cursor:hand');
       document.write ('\"');
     };
   document.write ('>');
   document.write ('</td>');
   document.write ('</tr>');
   if ( Comment.charAt(0) != "-" )
      { document.write ('<tr align=middle>');
        document.write ('<td>');
        document.write ('<font class=subtext>');
        document.write (Comment);
        document.write ('</font>');
        document.write ('</td>');
        document.write ('</tr>');
      };
   document.write ('</table>');
   return 0;
  }

function ManyImages99 ( Path , NumInRow , NumBR, Rat , ObjImg , Align , NStart , NStop )
  { var DefB = 1;
    var arIMG = ObjImg.IMG;
    var arTXT = ObjImg.TXT;
    var arKXM = ObjImg.KXM;
    var arKYM = ObjImg.KYM;
    var arKXB = ObjImg.KXB;
    var arKYB = ObjImg.KYB;
 // var NumInRow;
    var NumRow;
    var Num;
 // var SizeX;
 // var SIZEY;
    var i;
    var j;
    var k;    
    var l;
    var XM;
    var YM;
    var XB;
    var YB;

 // NumInRow = 3;
    Flag = 1;
    k = NStart; 

    Num = NStop - NStart + 1;
    NumRow = Math.floor ( Num / NumInRow );
 
    document.write ('<table class="bodytextT" border=0 rules=none leftmargin=0 cellpadding=5 cellspacing=0 width=100%>');
     for ( i = 0 ; i < NumRow ; i ++ )
      { document.write ('<tr align=middle>');
        for ( j = 0 ; j < NumInRow ; j ++ )
           { document.write ('<td>');

             if ( arKXM != undefined )
               { if ( arKXM [ k ] != undefined )
                  XM = arKXM [ k ];
                    else XM = arKXM [ 0 ];
               } else XM = 300;
             if ( arKYM != undefined )
               { if ( arKYM [ k ] != undefined )
                  YM = arKYM [ k ];
                    else YM = arKYM [ 0 ];
               } else YM = 225;
             if ( arKXB != undefined )
               { if ( arKXB [ k ] != undefined )
                  XB = arKXB [ k ];
                    else XB = arKXB [ 0 ];
              } else XB = 800;
            if ( arKYB != undefined )
              { if ( arKYB [ k ] != undefined )
                  YB = arKYB [ k ];
                    else YB = arKYB [ 0 ];
              } else YB = 600;
             OneImage9 ( arIMG[0] , Path , arIMG[k] , XM , YM , XB , YB , arTXT[k] , Align , Rat , 1 );
             k ++ ;
             document.write ('</td>');
           };
      };
    document.write ('</table>');

    document.write ('<table class="bodytextT" border=0 rules=none leftmargin=0 cellpadding=5 cellspacing=0 width=100%>');
    document.write ('<tr align=middle>');
    for ( ; k <= NStop ; k ++ )
      { document.write ('<td>');

        if ( arKXM != undefined )
          { if ( arKXM [ k ] != undefined )
              XM = arKXM [ k ];
                else XM = arKXM [ 0 ];
          } else XM = 300;
        if ( arKYM != undefined )
          { if ( arKYM [ k ] != undefined )
              YM = arKYM [ k ];
                else YM = arKYM [ 0 ];
          } else YM = 225;
        if ( arKXB != undefined )
          { if ( arKXB [ k ] != undefined )
              XB = arKXB [ k ];
                else XB = arKXB [ 0 ];
          } else XB = 800;
        if ( arKYB != undefined )
          { if ( arKYB [ k ] != undefined )
              YB = arKYB [ k ];
                else YB = arKYB [ 0 ];
          } else YB = 600;

        OneImage9 ( arIMG[0] , Path , arIMG[k] , XM , YM , XB , YB , arTXT[k] , Align , Rat , 1 );
        document.write ('</td>');
      };
    document.write ('</tr>');
    document.write ('</table>');
    return 0;
  }

function PartBeg9 ( CurNum , TotNum )
  { var i;
    document.write ( '<table class="bodytextT" border=1 rules=none frame=vsides leftmargin=0 cellpadding=5 cellspacing=0 width=100%' );
    document.write ( '<tr>' );
  //document.write ( '<td colspan=2>' );
  //document.write ( '<hr>' );
  //document.write ( '</td>' );
  //document.write ( '</tr>' );
  //document.write ( '<tr>' );
    document.write ( '<td valign=middle>' );
    if (  arIMGH [ CurNum ].charAt(0) != "-" )
     { //document.write ( '<td width=25%>' );
       document.write ( '<table align=right>' );
       document.write ( '<tr>' );
       document.write ( '<td>' );
       document.write ( '<img src=\"' );
       document.write ( IMDIR + "/" + arIMGH [ CurNum ] );
       document.write ( '\" align=right hspace=20 vspace=5' );
       document.write ( '</td>' );
       document.write ( '</tr>' );
       document.write ( '<tr>' );
       document.write ( '<td align=center>' );
       if (  arTXTH [ CurNum ].charAt(0) != "-" )
         { document.write ( '<hr>' );
           document.write ('<font class=subtext>');
           document.write ( arTXTH [ CurNum ] );
           document.write ('</font>');
         };
       document.write ( '</td>' );
       document.write ( '</tr>' );
       document.write ( '</table>' );
    // document.write ( '</td>' );
     };
    document.write ( '<br><br>' );
    document.write ( '<a name=\"Part' );
    document.write ( CurNum );
    document.write ( '\">' );
    document.write ( '<center>' );
    document.write ( '<font style="font-size:150%" color=black><b><u>' );
    document.write ( NamePart [ CurNum ] );
    document.write ( '<br>' );
    document.write ( '<br>' );
    document.write ( '</u></b></font>' );
    document.write ( '<b>' );
    document.write ( DescrPartBrief [ CurNum ] );
    document.write ( '</b>' );
    document.write ( '<br>' );
    document.write ( '<br>' );
    for ( i = 1 ; i <= TotNum ; i ++ )
       { document.write ( ( i != 1 ) && ( i % 3 == 1 ) ? '<br>' : ( ( i != 1 ) ? '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' : '' ) );
         // document.write ( '<br>' );
         document.write ( '<a href =\"#Part' );
         document.write ( i );
         document.write ( '\">To ' );
         document.write ( NamePart [ i ] );
         document.write ( '</a>' );
       };
    document.write ( '<br>' );
    document.write ( '</center>' );
    document.write ( '<br>' );
    document.write ( DescrPartFull [ CurNum ] );
 // document.write ( '<br>' );
 // document.write ( '<br>' );
 // document.write ( '<br>' );
 // document.write ( '</center>' );
    document.write ( '</td>' );
    document.write ( '</tr>' );
    document.write ( '<tr>' );
    document.write ( '<td>' );
 // document.write ( '<td colspan=2>' );
 // document.write ( '<hr>' );
  }

function PartBeg99 ( CurNum , TotNum )
  { var i;

    glSizeEX  = document.body.clientWidth;
    var PreX;
    PreX = glSizeEX / 4;
    glPreviwX = ( PreX <= 300 ) ? PreX : 300;
    glPreviwY = glPreviwX / 1.334;

    TableEmpty9 ( );

    document.write ( '<table class="bodytextT" border=1 rules=none frame=vsides leftmargin=0 cellpadding=5 cellspacing=0 width=100%' );
    document.write ( '<tr>' );
  //document.write ( '<td colspan=2>' );
  //document.write ( '<hr>' );
  //document.write ( '</td>' );
  //document.write ( '</tr>' );
  //document.write ( '<tr>' );
    document.write ( '<td valign=middle>' );
    if (  Head [ CurNum ].charAt(0) != "#" )
     { //document.write ( '<td width=25%>' );
       document.write ( '<table align=right>' );
       document.write ( '<tr>' );
       document.write ( '<td>' );
       document.write ( '<img src=\"' );
       document.write ( IMDIR );
       document.write ( "/" );
       document.write ( DirPart [ CurNum ] );
       document.write ( '/Head.JPG" align=right hright="200", width="200" hspace=20 vspace=5' );
       document.write ( '</td>' );
       document.write ( '</tr>' );
       document.write ( '<tr>' );
       document.write ( '<td align=center>' );
       if (  Head [ CurNum ].charAt(0) != "-" )
         { document.write ( '<hr>' );
           document.write ('<font class=subtext>');
           document.write ( Head [ CurNum ] );
           document.write ('</font>');
         };
       document.write ( '</td>' );
       document.write ( '</tr>' );
       document.write ( '</table>' );
    // document.write ( '</td>' );
     };
    document.write ( '<br><br>' );
    document.write ( '<a name=\"Part' );
    document.write ( CurNum );
    document.write ( '\">' );
    document.write ( '<center>' );
    document.write ( '<font style="font-size:150%" color=black><b><u>' );
    document.write ( NamePart [ CurNum ] );
    document.write ( '<br>' );
    document.write ( '<br>' );
    document.write ( '</u></b></font>' );
    document.write ( '<b>' );
    document.write ( DescrPartBrief [ CurNum ] );
    document.write ( '</b>' );
    document.write ( '<br>' );
    document.write ( '<br>' );
    for ( i = 1 ; i <= TotNum ; i ++ )
       { document.write ( ( i != 1 ) && ( i % 3 == 1 ) ? '<br>' : ( ( i != 1 ) ? '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' : '' ) );
         // document.write ( '<br>' );
         document.write ( '<a href =\"#Part' );
         document.write ( i );
         document.write ( '\">To ' );
         document.write ( NamePart [ i ] );
         document.write ( '</a>' );
       };
  //for ( i = 1 ; i <= TotNum ; i ++ )
  //   { document.write ( "<input id='To" );
  //     document.write ( NamePart [ i ] );
  //     document.write ( "' type='button' value='" );
  //     document.write ( NamePart [ i ] );
  //     document.write ( "' OnClick=javascript:document.location.href='" );
  //     document.write ( "Part");
  //     document.write ( NamePart [ i ] );
  //     document.write ( ".htm'>" );
  //     document.write ( "</input>" );
  //     document.write ( "&nbsp;&nbsp;" );
  //   };
    document.write ( '<br>' );
    document.write ( '</center>' );
    document.write ( '<br>' );
    document.write ( DescrPartFull [ CurNum ] );
 // document.write ( '<br>' );
 // document.write ( '<br>' );
 // document.write ( '<br>' );
 // document.write ( '</center>' );
    document.write ( '</td>' );
    document.write ( '</tr>' );
    document.write ( '<tr>' );
    document.write ( '<td>' );
 // document.write ( '<td colspan=2>' );
 // document.write ( '<hr>' );
    return 0;
  }

function PartEnd9 ( )
  { document.write ( '</td>' );
    document.write ( '</tr>' );
    document.write ( '</table>' );
    TableEmpty9 ();
    return 0;
  }

function PartEnd99 ( )
  { document.write ( '</td>' );
    document.write ( '</tr>' );
    document.write ( '</table>' );
    return 0;
  }

function HeadDescr9 ( TotNum )
  { var i;
   document.write ( '<p align="justify">' );
   document.write ( '<font style="font-size:100%" color=black>' );
 //document.write ( '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' );
 //document.write ( '<br>' );
   for ( i = 1 ; i <= TotNum ; i ++ )
      { document.write ( '<a href=\"#Part' );
        document.write ( i );
        document.write ( '\"><b><u>' );
        document.write ( NamePart [ i ] );
        document.write ( ' :</u></b></a> ' );
        document.write ( DescrPartBrief [ i ] );
        document.write ( '<br>' );
//      document.write ( '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' );
//      document.write ( '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' );
      };
   document.write ( '</font>' );
// document.write ( '</p>' );
  }

function TableEmpty9 ( )
  { // document.write ('<table class="bodytextT" border=1 rules=none frame=above leftmargin=0 cellpadding=5 cellspacing=0 width=100%>');
    document.write ('<table class="bodytextT" border=1 rules=none frame=above width=100%>');
    document.write ('<tr><td></td></tr>');
    document.write ('</table>');
    return 0;
  }


function TableEmpty99 ( )
  { // document.write ('<table class="bodytextT" border=1 rules=none frame=above leftmargin=0 cellpadding=5 cellspacing=0 width=100%>');
    document.write ('<table class="bodytextT" border=1 rules=none frame=above width=100%>');
    document.write ('<tr><td></td></tr>');
    document.write ('</table>');
    return 0;
  }

//var glSizeEX;
//var glPreviwX;
//var glPreviwY;
//function InitN ( )
//  { glSizeEX  = document.body.clientWidth;
//    var PreX;
//   PreX = glSizeEX / 4;
//    glPreviwX = ( PreX <= 300 ) ? PreX : 300;
//    glPreviwY = glPreviwX / 1.334;
//    return 0;
//  }

