//////////////////////////////////////////
// www.anarch.ru tools.js module        //
// (C) Copyright by Roman Gratchev 2000 //
//////////////////////////////////////////

var wwwName='WWW.ANARH.RU';
var dirName='/anarch/'
var mailName='anarh@anarh.ru';

// Вывод заголовка страницы
function putHeader() {
  document.writeln('<HEAD>');
  document.writeln('<TITLE>' + wwwName + '</TITLE>');
  document.writeln('<STYLE type="text/css">');
  document.writeln('	A:link		{ color:black;  }'); 
  document.writeln('	A:visited	{ color:black;  }');
  document.writeln('	A:hover		{ color:#bf1216;}');
  document.writeln('</STYLE>');
  document.writeln('</HEAD>');
  document.writeln('<BODY BACKGROUND="' + dirName + 'img/bg.gif"'
     + ' LINK="BLACK" ALINK="BLACK" VLINK="BLACK" '
     + '>');
  document.writeln('<CENTER>');
  document.writeln('<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>');
  document.writeln('<TR>');
  document.writeln('  <TD WIDTH=220></TD>');
  document.writeln('  <TD>');
  document.writeln('    <FONT SIZE=6><B>' + wwwName + '</B></FONT></B>');
  document.writeln('  </TD>');
  document.writeln('  <TD WIDTH=250 ALIGN="RIGHT"><IMG SRC="' +
    dirName + 'img/h.gif"></TD>');
  document.writeln('</TR>');
  document.writeln('</TABLE>');
  document.writeln('</CENTER>');
  document.writeln('<P ALIGN="CENTER">'
    + '<TABLE WIDTH=760 BORDER=0><TR><TD>');
}

// Вывод заголовка 2го уровня
function putTitle(licon, title, s) {
  icon = dirName + licon;
  document.writeln('<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>');
  document.writeln('<TR>');
  document.writeln('  <TD>');
  if (licon != '') {
    document.writeln('<IMG ALIGN="LEFT" SRC="' + icon + '">');
  }
  document.writeln('</TD>');
  document.writeln('  <TD WIDTH=600><CENTER><BR>');
  if (title != '') {
    document.writeln('    <IMG SRC="' + dirName + title + '"><BR>');
  }
  document.writeln('    <FONT SIZE=6>');
  document.writeln('    <B><I>' + s + '</I></B></FONT>');
  document.writeln('  </CENTER></TD>');
  document.writeln('</TR>');
  document.writeln('</TABLE>');
}

// Вывод заголовка пункта
function punktHeader(m1, m2, m3) {
  document.writeln('<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>');
  document.writeln('<TR>');
  document.writeln('  <TD>');
  mnuPunkt(m1, m2, m3);
  document.writeln('</TD>');
//  document.writeln('  <TD>td1</TD>');
  document.writeln('  <TD WIDTH=20>&nbsp;</TD>');
  document.writeln('</TR>');
  document.writeln('<TR>');
  document.writeln('  <TD>&nbsp;</TD>');
//  document.writeln('  <TD>td4</TD>');
  document.writeln('  <TD><B><FONT SIZE=3>');
}

// Вывод окончания пункта 
function punktFooter() {
  document.writeln('</FONT></B><BR><BR></TD>');
  document.writeln('</TR>');
  document.writeln('</TABLE>');
}

// Вывод окончания страницы
function putFooter() {
  document.writeln('</P>');
  document.writeln('<P ALIGN="RIGHT">' 
    + '<FONT SIZE=3 COLOR="#BF1216">'
    + '<B><I>Стань собой вместе с нами&nbsp;&nbsp;-&nbsp;&nbsp;</I></B>'
    + '<B><I><a href="mailto:' + mailName + '">'   + mailName + '</A></I></B></FONT></P>');
  document.writeln('</TD></TR></TABLE>');
  document.writeln('</BODY>');
  document.writeln('</HTML>');
}

// Вывод пункта
function punkt(s, lurl, f) {
  url = dirName + lurl;
  document.writeln('<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>'
    + '<TD ALIGN="LEFT" VALIGN="CENTER">');
  document.writeln('<FONT SIZE=3><B>');
  document.writeln('<A HREF="' + url + '">' + s);
  document.writeln('</A></B></FONT>');
  document.writeln('</TD>');
  if (f!=null) {
    document.writeln('<TD WIDTH=20>&nbsp;</TD><TD>');
    document.writeln('<IMG BORDER=0 ALIGN="baseline"' +
      '" SRC="' + dirName + f + '">');
    document.writeln('</TD>');
  }
  document.writeln('</TR></TABLE><BR>'); 
}

// Вывод открытки
function putOtkr(s) {
  document.writeln('<BR>');
  document.writeln('<TABLE  BORDER=1 CELLSPACING=2'
   + ' BORDERCOLOR="BLACK" CELLPADDING=2>');
  document.writeln('<TR>');
  document.writeln('<TD ALIGN="CENTER" COLSPAN=2><FONT SIZE=3><B>' +
    'Открытка от Горгулова</B></FONT><TD>');
 // document.writeln('<TD WIDTH=20>&nbsp;e</TD>');
  document.writeln('</TR>');
  document.writeln('<TR>');
  document.writeln('<TD ALIGN="CENTER" WIDTH=154><IMG BORDER=0 SRC="' + 
    dirName + 'img/gorg.gif"></TD>');
//  document.writeln('<TD WIDTH=40>&nbsp;</TD>');
  document.writeln('<TD WIDTH=360 VALIGN="TOP">' + 
    '<I><FONT SIZE=3>&nbsp;&nbsp;&nbsp;' + s 
    + '</FONT></I></TD>');
  document.writeln('</TR>');
  document.writeln('</TABLE>');
}

// Показ навигации
function putNavigate(nHome, nAll, nLeft, nRight) {
  var docName='';
  var rNumber='';
  var i, c;
  var s, s1='';

  putLine();

  document.writeln('<CENTER>');
  document.writeln('<TABLE BORDER=0 CELLSPACING=5 CELLPADDING=0><TR>');
//  document.writeln('<TD COLSPAN=2 WIDTH=20></TD>');
  if (nAll!='') {
    document.writeln('<TD VALIGN="CENTER">');
    document.writeln('<A HREF="' + dirName + 'index.html">');
    document.writeln('<IMG BORDER=0 SRC="' 
      + dirName + '/img/a.gif">');
    document.writeln('</A></TD>');
    document.writeln('<TD VALIGN="CENTER">');
    document.writeln('<A HREF="' + dirName + 'index.html">');
    document.writeln('<FONT SIZE=3><B><I>Главная страница</I></B></FONT>');
    document.writeln('</A></TD>');
    document.writeln('<TD WIDTH=20></TD>');
  }
  if (nAll!='' & nAll!=null) {
    document.writeln('<TD VALIGN="CENTER">');
    document.writeln('<A HREF="' + dirName + '/all.html">');
    document.writeln('<IMG BORDER=0 SRC="' 
      + dirName + '/img/aall.gif">');
    document.writeln('</A></TD>');
    document.writeln('<TD VALIGN="CENTER">');
    document.writeln('<A HREF="' + dirName + 'all.html">');
    document.writeln('<FONT SIZE=3><B><I>Всё</I></B></FONT>');
    document.writeln('</A></TD>');
    document.writeln('<TD WIDTH=20></TD>');
    // Вывод оглавления
    s='' + document.location;
    i=s.length;
    c=0;
    while (c<2 & i>0) {
      s1=s.substring(i - 1, i);
      if (s1=='/') 
        c++;
      if (c==0)
        docName=docName + s1;
      if (c==1 & s1!='/')
        rNumber=rNumber + s1;
      i--;
    }
    s='';
    for (i=docName.length; i>0; i--) {
      s=s + docName.substring(i - 1, i);
    }
    docName=s;
    s='';
    for (i=rNumber.length; i>0; i--) {
      s=s + rNumber.substring(i - 1, i);
    }
    rNumber=s;
    if (docName!='index.html') {
      document.writeln('<TD VALIGN="CENTER">');
      document.writeln('<A HREF="' + dirName + rNumber + '/index.html">');
      document.writeln('<IMG BORDER=0 SRC="' 
        + dirName + '/img/alist.gif">');
      document.writeln('</A></TD>');
      document.writeln('<TD VALIGN="CENTER">');
      document.writeln('<A HREF="' + dirName + rNumber + '/index.html">');
      document.writeln('<FONT SIZE=3><B><I>Оглавление</I></B></FONT>');
      document.writeln('</A></TD>');
      document.writeln('<TD WIDTH=20></TD>');
    }
 } 
 if (nLeft!='' & nLeft!=null) {
    document.writeln('<TD VALIGN="CENTER">');
    document.writeln('<A HREF="' + dirName + nLeft +'">');
    document.writeln('<IMG BORDER=0 SRC="' 
      + dirName + '/img/al.gif">');
    document.writeln('</A></TD>');
    document.writeln('<TD VALIGN="CENTER">');
    document.writeln('<A HREF="' + dirName + nLeft + '">');
    document.writeln('<FONT SIZE=3><B><I>Назад</I></B></FONT>');
    document.writeln('</A></TD>');
    document.writeln('<TD WIDTH=20></TD>');
 } 
 if (nRight!='' & nRight!=null) {
    document.writeln('<TD VALIGN="CENTER">');
    document.writeln('<A HREF="' + dirName + nRight +'">');
    document.writeln('<IMG BORDER=0 SRC="' 
      + dirName + '/img/ar.gif">');
    document.writeln('</A></TD>');
    document.writeln('<TD VALIGN="CENTER">');
    document.writeln('<A HREF="' + dirName + nRight + '">');
    document.writeln('<FONT SIZE=3><B><I>Вперёд</I></B></FONT>');
    document.writeln('</A></TD>');
    document.writeln('<TD WIDTH=20></TD>');
 } 
 document.writeln('</TR></TABLE>');
 putLine();
 document.writeln('</CENTER>');
}

function putLine() {
  document.writeln('<CENTER>');
  document.writeln('<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BACKGROUND="'
    + dirName + 'img/ln1.gif"><TR>');
  document.writeln('<TD HEIGHT=5 WIDTH=700');
  document.writeln('<IMG BORDER=0 SRC="' + dirName + 'img/b0.gif">');
  document.writeln('</TD>');
  document.writeln('</TR></TABLE>');
  document.writeln('</CENTER>');
}