/**
 * Write guestbook tabs.
 * <p>
 * @param  active  active tab, or <0 for "Add comments"
 */
function writeTabs( active )
{  document.write( "<center>" );
   document.write( "<table width='100%' cellpadding='0' cellspacing='0'>" );
   document.write( "<tr class='tab'>" );
   document.write( "<td>&nbsp;&nbsp;</td>" );
   var firstTab = 2005;
   var lastTab = 2009;
   for( var i = firstTab; ( i <= lastTab ); i++ )
   {  if( i == active )
      {  document.write( "<td class='tab active'" );
         document.write( "title='Comments for " + i + "'>&nbsp;" + i + "&nbsp;</td>" );
      }
      else
      {  document.write( "<td class='tab up'" );
         document.write( "onmouseover='this.className=\"tab over\";' onmousedown='this.className=\"tab down\";' " ); 
         document.write( "onmouseout='this.className=\"tab up\";' " );
         var j = i % 100;
         var s = ( j < 10 ) ? "0" + j : "" + j;
         document.write( "title='Comments for " + i + "'>&nbsp;<a class='tab' target='comments' href='book" + s + ".html'>" + i + "</a>&nbsp;</td>" );
      }
      document.write( "<td>&nbsp;</td>" );
   }
   if( active < 0 )
   {  document.write( "<td class='tab active'" );
      document.write( "title='Add comments'>&nbsp;Add&nbsp;comments&nbsp;</td>" );
   }
   else
   {  document.write( "<td class='tab up'" );
      document.write( "onmouseover='this.className=\"tab over\";' onmousedown='this.className=\"tab down\";' " ); 
      document.write( "onmouseout='this.className=\"tab up\";' " );
      document.write( "title='Add comments'>&nbsp;<a class='tab' target='comments' href='add.html'>Add&nbsp;comments</a>&nbsp;</td>" );
   }
   document.write( "<td width='100%'>&nbsp;</td>" );
   document.write( "</tr>" );
   document.write( "<tr><td colspan='" + ( 3 + 2 * ( lastTab - firstTab + 1 )) + "'><div class='tab'>&nbsp;</div></td></tr>" );
   document.write( "</table>" );
   document.write( "</center>" );
}