// Vitaly Eremenko
// create  13.11.2004
// update  12.09.2007 
// JavaScript
//================|

var g_nImg = 0;
var g_sLang = "Rus"; // Eng
var g_sPath = "..";
var g_sPageName = "";
var g_sPageTo = "";
var g_sSection = "";
var g_nMenuPos = 1;
//----Menu Buttons:--------
var g_bMenuInit = false;
var g_bTabInit = false;
var g_ncMenu = 10;
// Button Visible Names
var g_arMenu = new Array(g_ncMenu);
// Table Inner Names
var g_arTabName = new Array(g_ncMenu);
// Menu Code Tables: 0=Hide, 1=Visible
var g_arTabSet = new Array(g_ncMenu);

var g_sPhone = "(972)524-325-856";
var g_sMenuCookie = "VitMenuBin"; // =ind 0...7
//=========================

function InitMenuParams()
{
//  debugger;
  g_arMenu[0] = "Магазин&nbsp;косметики";
  g_arMenu[1] = "Арт-галерея";
  g_arMenu[2] = "Для&nbsp;пользователя";
  g_arMenu[3] = "е-Бизнес";
  g_arMenu[4] = "?&nbsp;Инфо";
  g_arMenu[5] = "Контакт";
  g_arMenu[6] = "Витраж-на-Заказ";
  g_arMenu[7] = "Краски&nbsp;витражные";
  g_arMenu[8] = "Витраж-Сувенир";
  g_arMenu[9] = "Компьютеры";

  g_arTabName[0] = "Shop";
  g_arTabName[1] = "Art";
  g_arTabName[2] = "Client";
  g_arTabName[3] = "Biz";
  g_arTabName[4] = "Info";
  g_arTabName[5] = "Contact";
  g_arTabName[6] = "Vitrag";
  g_arTabName[7] = "ArtShop";
  g_arTabName[8] = "VitShop";
  g_arTabName[9] = "PC";
  g_bMenuInit = true;
}
//===========================

function InitMenuCodes()
{
   var ni = 0;
   for (ni=0; ni<g_ncMenu; ni++)
   {
      g_arTabSet[ni] = 0;
   }
   g_bTabInit = true;
}
//***************
// OLD Interface - Compatibility with Web-Pages:
function  Vit_LogoSiteRu(i_sPath)
{
//   debugger;
   g_sLang = "Rus";
   g_sPath = i_sPath;
   Vit_PageLogo();
}
//==================

function SetPageTo(i_sTargetURL)
{
  g_sPageTo = i_sTargetURL;
}
//==================

function Vit_SiteTitleRu(i_sPath, i_sTitle)
{
//   debugger;
   g_sLang = "Rus";
   g_sPath = i_sPath;
   var sTitle = "Искусственные витражи и краски для хобби<br>" + i_sTitle;
   DrawLogo(sTitle);
}
//==================

function  Vit_MenuBarRu(i_sPath, i_sPageName, i_sPageTo, i_sMenuSection)
{
//   debugger;
   g_sLang = "Rus";
   g_sPath = i_sPath;
   g_sPageName = i_sPageName;
   g_sPageTo = i_sPageTo;
   g_sSection = i_sMenuSection;
   Vit_LeftMenuBar();
}
//==================

function Vit_VitrajSignature()
{
//  document.writeln('Виталий Еременко.<br>');
//  document.writeln('Mobile phone: +(972) 524-325-856 (14-20 GMT)<br>');
//  document.writeln('<FONT COLOR=#600000 STYLE="background-color: #FFFF80;">'
//    + '<B>www.Violtan.com</B></FONT><br>');
}
//*****************
// NEW interface:
function  Vit_PageLogo()
{
//   debugger;
   if (! g_bMenuInit)
     InitMenuParams();
   if (! g_bTabInit)
     InitMenuCodes();
   DrawLogo("Искусственные витражи и краски для хобби");
}
//===========================

function  Vit_LeftMenuBar()
{
//   debugger;
   if (! g_bMenuInit)
      InitMenuParams();
   if (! g_bTabInit)
      InitMenuCodes();

  MenuSelectLang();
  FindInfoForm();
  MainMenu();

  LeftArtshop();
  LeftArtGallery();
  LeftBiz();
  LeftUser();
  LeftContact();
}
//================

function Vit_MenuSiteTop(i_nPos)
{
  var sLinkHomeEn = "<A HREF='" + g_sPath + "/index.php' CLASS=ButtonText>Home Page</A>";
  var sLinkHomeRu = "<A HREF='" + g_sPath + "/index_ru.php' CLASS=ButtonText>Главная</A>";
  var sLinkMap = "<A HREF='" + g_sPath + "/site_map_ru.htm' CLASS=ButtonText>Карта Сайта</A>";
  var sLinkMail = "<A HREF='" + g_sPath + "/web_mail/usermail_ru.php' CLASS=ButtonText>Пишите нам</A>";

  var sLinkPaints = "<A HREF='" + g_sPath + "/artshop2/index.php' CLASS=ButtonText>Магазин красок</A>";
  var sLinkUser = "<A HREF='" + g_sPath + "/board/readmsg_board_ru.php' CLASS=ButtonText>Посетитель</A>";
  var sLinkBiz = "<A HREF='" + g_sPath + "/firmgal/index.php?Lang=Rus' CLASS=ButtonText>eБизнес</A>";
  var sLinkInfo = "<A HREF='" + g_sPath + "/articles/index_ru.html' CLASS=ButtonText>? Инфо&Заметки</A>";
  var sLinkContact = "<A HREF='" + g_sPath + "/links/index.php?Lang=Rus' CLASS=ButtonText>Контакт</A>";
  var sArtGal = "<A HREF='" + g_sPath + "/artgallery/index.php?Lang=Rus&Oper=ShowImgList&Field=0&View=0&Artist=0' CLASS=ButtonText>Арт-Галерея</A>";

  var anPosType = new Array(20);
  var ni = 0;
  var nMaxBtn = 20;

  for (ni=0; ni<nMaxBtn; ni++)
  {
    anPosType[ni] = "BACKGROUND='"  + g_sPath + "/menu/BUTTON_GRADIENT10.JPG'";
  }
 
  if (0 <= i_nPos && i_nPos < nMaxBtn)
    anPosType[i_nPos] = "BACKGROUND='"  + g_sPath + "/menu/BUTTON_GRADIENT10D.JPG'";

  document.writeln("<TABLE ID=MainMenu CELLPADDING=5 CELLSPACING=10 BORDER=0 STYLE='font-size: 14px; font-weight: bold; '>"); 
  document.writeln("<TR>");
  document.writeln("<TD " + anPosType[1] + ">" + sLinkHomeRu + "</TD>");
   document.writeln(
    "<TD " + anPosType[6] + ">" + sLinkPaints + "</TD>" +
    "<TD " + anPosType[12] + ">" + sArtGal + "</TD>"); // +
  document.writeln("</TR><TR>");
  document.writeln("<TD " + anPosType[9] + ">" + sLinkBiz + "</TD>" +
    "<TD " + anPosType[11] + ">" + sLinkUser + "</TD>" +
    "<TD " + anPosType[8] + ">" + sLinkContact + "</TD>");
  document.writeln("</TR>");
  document.writeln("</TABLE>");
}

//******************

function SetLang(i_sLang)
{
  g_sLang = i_sLang; // new String(i_sLang);
}
//==============

function SetPagePath(i_sPathToRoot)
{
  g_sPath = i_sPathToRoot;
}
//==============

function SetMenuName(i_sName)
{
  g_sSection = i_sName;
}
//==============

function SetPageName(i_sPageName)
{
  g_sPageName = i_sPageName;
}
//==============

function SetDocTitle(i_sTitle)
{
   document.title = i_sTitle;
}
//==============

function ChangePageRef(i_sPageURL)
{
  window.location.href = i_sPageURL;
}
//*********************

function MenuSelectLang()
{
  var sEnSEL = "";
  var sRuSEL = "SELECTED";
  var sDIS = "";
  if (g_sPageTo == "")
     sDIS = "DISABLED";

  document.writeln('<FORM NAME="SetLang" ID="SetLang" STYLE="margin: 0; " >');
  document.writeln('<SELECT ID="Language" ' + sDIS
    + ' onChange=" ChangePageRef(g_sPageTo); " SIZE=2> ');
  document.writeln("<OPTION " + sEnSEL + ">English");
  document.writeln("<OPTION " + sRuSEL + ">Русский");
  document.writeln("</SELECT>");
  document.writeln("</FORM><br>");
}
//******************

function Vit_WebMailToUs()
{
  document.writeln('<A HREF="http://www.violtan.com/client/webmail_ru.htm">Пишите Нам</A><br>');
}
//================|

function DrawLogo(i_sTextHtml)
{
  var sTagLogo = "<IMG SRC='" + g_sPath + "/menu/VIOLTAN_LOGO_RU_7B.JPG' HEIGHT=80 WIDTH=480 ALIGN=left ALT='Violtan.com: Краски для хобби и искусства' HSPACE=3 VSPACE=3 CLASS=imgframe BORDER=1 >";  

  document.writeln('<TABLE ID=tabLogo WIDTH=100% BORDER=0 CLASS=logo '
   + ' CELLPADDING=5 CELLSPACING=0 '
   + ' BACKGROUND=" ' + g_sPath + '/menu/LOGO_GRADIENT10.JPG" >');
  document.writeln('<TBODY VALIGN=top>');
  document.writeln('<TR HEIGHT=40><TD ROWSPAN=1 CLASS=DrawLogo ALIGN=center VALIGN=middle >');
    document.writeln('<A HREF="' + g_sPath + '/index.php">');
    document.writeln(sTagLogo + '</A>');
  document.writeln('</TD>'); 
  document.writeln('<TD ALIGN=center VALIGN=middle CLASS=inset BACKGROUND="' + g_sPath + '/menu/LOGO_BG_EV43_M.JPG ">');
    Vit_MenuSiteTop(g_nMenuPos);
  document.writeln('</TD><TD>&nbsp;</TD></TR>');
  document.writeln('</TBODY></TABLE>');
}
//=====================|

function SetTableHeader(i_sTabName, i_sPageSection, i_sTabTitle)
{
   if (i_sTabName == i_sPageSection)
  {
    document.writeln('<FONT COLOR=#006000 STYLE="background-color: #FFFF80;" ' +
      ' STYLE="background-color: #FFF080;"><B>'+i_sTabTitle+':</B></FONT>');
    document.writeln('<TABLE ID="tabMenu1" BORDER=1  CLASS="menusel" WIDTH=130 >');
  }
  else
  {
    document.writeln('<FONT COLOR=#006000><B>'+i_sTabTitle+':</B></FONT>');
    document.writeln('<TABLE ID="tabMenu1" BORDER=1  CLASS="menu"  WIDTH=130>');
  }
}
//====================

function MainMenu()
{
  SetTableHeader("Main", g_sSection,  "Главная");

  document.writeln('<TR><TD VALIGN=top>');
  document.writeln('<A HREF="' + g_sPath + '/index.php">Home Page</A>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "index")
    document.writeln('<B>&bull; Главная</B>');
  else
    document.writeln('<A HREF="' + g_sPath + '/index_ru.php">Главная</A>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "webmail")
    document.writeln('<A HREF="' + g_sPath + '/web_mail/usermail_ru.php"><B>&bull;Пишите нам</B></A>');
  else
    document.writeln('<A HREF="' + g_sPath + '/web_mail/usermail_ru.php">Пишите нам</A>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "site_map")
    document.writeln('<A HREF="' + g_sPath + '/site_map_ru.htm"><B>&bull; Карта Сайта</B></A>');
  else
    document.writeln('<A HREF="' + g_sPath + '/site_map_ru.htm">Карта Сайта</A>');
  document.writeln('</TD></TR></TABLE>');
}
//=====================|

function DrawButtonsBar()
{
  document.writeln("<FORM>");

 if (g_arTabName[9] == g_sSection)
   document.writeln("<INPUT TYPE=button NAME=btn9 VALUE=" + g_arMenu[9] + " BORDER=3 CLASS=button_down  OnClick='SetTabMenu(9, 0);'>");
 else
   document.writeln("<INPUT TYPE=button NAME=btn9 VALUE=" + g_arMenu[9] + " BORDER=3 CLASS=button_up     OnClick='SetTabMenu(9, 1);'>");

  if (g_arTabName[8] == g_sSection)
    document.writeln("<INPUT TYPE=button NAME=btn8 VALUE=" + g_arMenu[8] + " BORDER=3 CLASS=button_down  OnClick='SetTabMenu(8, 0);'>");
  else
    document.writeln("<INPUT TYPE=button NAME=btn8 VALUE=" + g_arMenu[8] + " BORDER=3 CLASS=button_up     OnClick='SetTabMenu(8, 1);'>");

  if (g_arTabName[6] == g_sSection)
    document.writeln("<INPUT TYPE=button NAME=btn6 VALUE=" + g_arMenu[6] + " BORDER=3 CLASS=button_down  OnClick='SetTabMenu(6, 0);'>");
  else
    document.writeln("<INPUT TYPE=button NAME=btn6 VALUE=" + g_arMenu[6] + " BORDER=3 CLASS=button_up     OnClick='SetTabMenu(6, 1);'>");

  if (g_arTabName[7] == g_sSection)
    document.writeln("<INPUT TYPE=button NAME=btn7 VALUE=" + g_arMenu[7] + " BORDER=3 CLASS=button_down  OnClick='SetTabMenu(7, 0);'>");
  else
    document.writeln("<INPUT TYPE=button NAME=btn7 VALUE=" + g_arMenu[7] + " BORDER=3 CLASS=button_up     OnClick='SetTabMenu(7, 1);'>");

  if (g_arTabName[0] == g_sSection)
    document.writeln("<INPUT TYPE=button NAME=btn0 VALUE=" + g_arMenu[0] + " BORDER=3 CLASS=button_down  OnClick='SetTabMenu(0, 0);'>");
  else
    document.writeln("<INPUT TYPE=button NAME=btn0 VALUE=" + g_arMenu[0] + " BORDER=3 CLASS=button_up     OnClick='SetTabMenu(0, 1);'>");

  if (g_arTabName[1] == g_sSection)
    document.writeln("<INPUT TYPE=button NAME=btn1 VALUE=" + g_arMenu[1] + " BORDER=3 CLASS=button_down  OnClick='SetTabMenu(1, 0);'>");
  else
    document.writeln("<INPUT TYPE=button NAME=btn1 VALUE=" + g_arMenu[1] + " BORDER=3 CLASS=button_up     OnClick='SetTabMenu(1, 1);'>");

  if (g_arTabName[2] == g_sSection)
    document.writeln("<INPUT TYPE=button NAME=btn2 VALUE=" + g_arMenu[2] + " BORDER=3 CLASS=button_down  OnClick='SetTabMenu(2, 0);'>");
  else
    document.writeln("<INPUT TYPE=button NAME=btn2 VALUE=" + g_arMenu[2] + " BORDER=3 CLASS=button_up     OnClick='SetTabMenu(2, 1);'>");

  if (g_arTabName[3] == g_sSection)
    document.writeln("<INPUT TYPE=button NAME=btn3 VALUE=" + g_arMenu[3] + " BORDER=3 CLASS=button_down OnClick='SetTabMenu(3, 0);'>");
  else
    document.writeln("<INPUT TYPE=button NAME=btn3 VALUE=" + g_arMenu[3] + " BORDER=3 CLASS=button_up OnClick='SetTabMenu(3, 1);'>");

  if (g_arTabName[4] == g_sSection)
    document.writeln("<INPUT TYPE=button NAME=btn4 VALUE=" + g_arMenu[4] + " BORDER=3 CLASS=button_down  OnClick='SetTabMenu(4, 0);'>");
  else
    document.writeln("<INPUT TYPE=button NAME=btn4 VALUE=" + g_arMenu[4] + " BORDER=3 CLASS=button_up      OnClick='SetTabMenu(4, 1);'>");

  if (g_arTabName[5] == g_sSection)
    document.writeln("<INPUT TYPE=button NAME=btn5 VALUE=" + g_arMenu[5] + " BORDER=3 CLASS=button_down  OnClick='SetTabMenu(5, 0);'>");
  else
    document.writeln("<INPUT TYPE=button NAME=btn5 VALUE=" + g_arMenu[5] + " BORDER=3 CLASS=button_up      OnClick='SetTabMenu(5, 1);'>");

  document.writeln("</FORM>");
}
//====================|

function SetTabMenu(i_nTab, i_nVal)
{
  g_arTabSet[i_nTab] = i_nVal;
  var sLink =  g_sPath;
  switch  (i_nTab)
  {
  case 0:
    sLink +=  ""; // /ecart/index.php?Lang=Rus";
    break;
  case 6:
    sLink +=  ""; // /vitragshop/index.php?Lang=Rus";
    break;
  case 7:
    sLink +=  "/artshop2/index.php";
    break;
  case 8:
    sLink +=  ""; // /vitshop/index.php?Lang=Rus";
    break;
  case 9:
    sLink +=  ""; // /PC/index.php?Lang=Rus";
    break;
  case 1:
    sLink +=  ""; // /vitraj/index.html";
    break;
  case 2:
    sLink +=  "/clients/loan_ru.htm";
    break;
  case 3:
    sLink +=  "/bizbase/pay_systems_ru.htm";
    break;
  case 4:
    sLink +=  "/links/useful_links_ru.htm";
    break;
  case 5:
    sLink +=  "/links/index.php?Lang=Rus";
    break;
  default:
    break;
  }

  if (sLink != g_sPath)
    window.location.href = sLink;
  else
    location.reload();
}
//===============

function  GetMenuCodeStr()
{
  var sTabCode = "";
  var ni = 0;
  for (ni=0; ni<g_ncMenu; ni++)
  {
     sTabCode += g_arTabSet[ni];
  }
  return sTabCode;
}
//===============

function  ParseMenuCodeStr()
{
   var sMenuCode = Vit_FindCookie(g_sMenuCookie);
   var ni = 0;
   for (ni=0; ni<g_ncMenu; ni++)
   {
      g_arTabSet[ni] = sMenuCode.charAt(ni);
   }
  return sMenuCode;
}
//===============

function  CheckCurMenuCode()
{
   var ni = 0;
   var niSet = -1;
   document.writeln("Menu: " + g_sSection); //***

   for (ni=0; ni<g_ncMenu; ni++)
   {
      if (g_sSection == g_arTabName[ni])
      {
        g_arTabSet[ni] = 2;
        niSet = ni;
        break;
      }
   }
  return niSet;
}
//===============

// See Frolov, v34, p.218
//   Max.cookie = 300, One cookie <= 4 Kb,
//   1 domen <= 20 cookie.
function Vit_AddCookie(i_sParamName, i_sParamValue, i_nDaysExpire)
//----------------------------------------------------------------
{
  var dtExpire = new Date();
  dtExpire.setTime(dtExpire.getTime() + i_nDaysExpire * 24 * 3600 * 1000); // msec
  //  debugger;
  var sDateExpire = dtExpire.toUTCString();
  var sCookie = i_sParamName + "=" + i_sParamValue + ";EXPIRES=" + sDateExpire + ";";
  document.cookie = sCookie;
}
//======================

// See Frolov, v34, p220
function Vit_FindCookie(i_sParamName)
//------------------------------------
{
  var ni = 0;
  var nStartPos = 0;
  var nEndPos = 0;
  var sCookieBuf = document.cookie;
  var nLen = sCookieBuf.length;
  if (nLen < 1) return "";

  for (ni=0; ni<nLen; ni++)
  {
    nStartPos = ni;
    nEndPos = nStartPos + i_sParamName.length;

    if (sCookieBuf.substring(nStartPos, nEndPos) == i_sParamName)
    {
      nStartPos = nEndPos + 1;
      nEndPos = document.cookie.indexOf(";", nStartPos);
      if (nEndPos < nStartPos)
        nEndPos = document.cookie.length;
      return document.cookie.substring(nStartPos, nEndPos);
      break;
    }
  }

  return "";
}
//====================
// See Frolov, v34, p.222
function Vit_DeleteCookie(i_sParamName)
//-------------------------------------
{
  var dtExpire = new Date();
  dtExpire.setTime(dtExpire.getTime() - 100);  // -1 msec before current time - autoremove cookie
  var sValue = Vit_FindCookie(i_sParamName);
  if (sValue.length < 1) return;  //  this param was not added to cookie
  document.cookie = i_sParamName + "=" + sValue + ";EXPIRES=" + dtExpire.toUTCString();
}
//==================

function  FindInfoForm()
{
   document.writeln('<FORM METHOD=post NAME=VitFindFormRu '
     +  ' ACTION=" ' + g_sPath + '/tools/find_in_website.php"> ');
   document.writeln('<INPUT TYPE=hidden VALUE=Rus NAME=sLang>');
   document.writeln('<INPUT TYPE=image SRC=" ' + g_sPath + '/images/FIND_ON_SITE_RU.JPG" '
    + ' onClick=submit ID=Image1 NAME=Image1> ');
  document.writeln('<INPUT TYPE=text NAME=txtFind SIZE=18> ');
  document.writeln('<A HREF=" ' + g_sPath + '/tools/extended_search_ru.htm"><B>Расширенный Поиск</B></A>' );
  document.writeln('</FORM>');
}
//================

function LeftArtshop()
{
  SetTableHeader("ArtShop", g_sSection,  "Краски Виолтан");
  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "ShopIndex") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/artshop2/index.php">Арт-магазин</A>');
  if (g_sPageName == "ShopIndex") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "FAQ") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/FAQ/index.php?Lang=RU">ЧАВО</A>');
  if (g_sPageName == "FAQ") document.writeln('</B>');
  document.writeln('</TD></TR>');
  document.writeln('</TABLE>');
}
//===============

function LeftBiz()
{
  SetTableHeader("Biz", g_sSection,  "Малый бизнес");

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "FirmGalIndex") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/firmgal/index.php?Lang=Rus">Арт-линки компаний и сайтов</A>');
  if (g_sPageName == "FirmGalIndex") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "FirmGalReg") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/firmgal/firmgal_get.php?Lang=Rus&Oper=AddUser&Field=-1">Добавьте Ваш арт-линк</A>');
  if (g_sPageName == "FirmGalReg") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "pay_systems") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/bizbase/pay_systems_ru.htm">Платежные системы</A>');
  if (g_sPageName == "pay_systems") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "Engines") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/marketing/search_engines.php?Lang=Rus">Поисковики и роботы</A>');
  if (g_sPageName == "Engines") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top BGCOLOR=#FFFF80>');
    document.writeln('<B>Бизнес-каталог:</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "ProdSubtypes") document.writeln('<B>');
    document.writeln('<A HREF="'+g_sPath+'/regcomp/show_products.php?Lang=Rus&Operation=ProdSubtypes">Типы продукции</A> (ВХОД)');
  if (g_sPageName == "ProdSubtypes") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "ShowProdSel") document.writeln('<B>');
    document.writeln('<A HREF="'+g_sPath+'/regcomp/show_products.php?Lang=Rus&Operation=ShowProdList&ProdType=00&Init=0">Продукция</A>');
  if (g_sPageName == "ShowProdSel") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD>');
  if (g_sPageName == "ShowProdReq") document.writeln('<B>');
    document.writeln('<A HREF="'+g_sPath+'/regcomp/show_products.php?Lang=Rus&Operation=ShowProdReq&ProdType=00&Init=0">Покупатели</A>');
  if (g_sPageName == "ShowProdReq") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "ShowFirm") document.writeln('<B>');
    document.writeln('<A HREF="'+g_sPath+'/regcomp/show_company.php?Lang=Rus&Operation=ShowFirms&Init=0">Компании</A>');
  if (g_sPageName == "ShowFirm") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD>');
  if (g_sPageName == "AddFirm") document.writeln('<B>');
    document.writeln('<A HREF="'+g_sPath+'/regcomp/add_firm_form.php?Lang=Rus">Добавьте Вашу фирму</A>');
  if (g_sPageName == "AddFirm") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('</TABLE>');
}
//===============

function LeftUser()
{
  SetTableHeader("Client", g_sSection,  "Для посетителя");

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "FAQ") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/FAQ/index.php?Lang=RU">ЧАВО</A>');
  if (g_sPageName == "FAQ") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
   if (g_sPageName == "MyIP")  document.writeln('<B>');
     document.writeln('<A HREF="' + g_sPath + '/clients/MyIP.php?Lang=Rus">Ваш IP в Интернете</A>');
   if (g_sPageName == "MyIP")  document.writeln('</B>');
   document.writeln('</TD></TR>');

   document.writeln('<TR><TD VALIGN=top>');
   if (g_sPageName == "index_biorh") document.writeln('<B>');
     document.writeln('<A HREF="' + g_sPath + '/clients/index_ru.html">Ваши Биоритмы</A>');
   if (g_sPageName == "index_biorh") document.writeln('</B>');
   document.writeln('</TD></TR>');

   //  <A HREF="tools/translit_ruslat_en.htm">Rewrite Russian text in Latin Chars</A><BR>
  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "transliter") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/tools/translit_ruslat_ru.htm">Русский текст латиницей</A>');
  if (g_sPageName == "transliter") document.writeln('</B>');
  document.writeln('</TD></TR>');
// <A HREF="tools/vit_keyrus_ru.htm">
  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "transliter") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/tools/vit_keyrus_ru.htm">Клавиатура с кириллицей</A>');
  if (g_sPageName == "transliter") document.writeln('</B>');
  document.writeln('</TD></TR></TABLE>');
}
//===============

function LeftContact()
{
  SetTableHeader("Contact", g_sSection,  "Инфо/Контакт");
  document.writeln('<TR><TD VALIGN=top>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "index_articles") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/articles/index_ru.html">Статьи на разные темы</A>');
  if (g_sPageName == "index_articles") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "index_stor") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/stories/index_ru.html">Заметки репатрианта</A>');
  if (g_sPageName == "index_stor") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "use_links")  document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/links/index.php?Lang=Rus&Oper=UsefulLinks&Categ=0">Полезные сайты</A>');
  if (g_sPageName == "use_links")  document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "links")  document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/links/index.php?Lang=Rus">Обмен ссылками</A>');
  if (g_sPageName == "links")  document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "our_brigade") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/contact/our_brigade_ru.htm">О нас</A>');
  if (g_sPageName == "our_brigade") document.writeln('</B>');

  document.writeln('</TD></TR>');
  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "BBoard") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/board/index_ru.php">Добавить сообщение на Доску</A>');
  if (g_sPageName == "BBoard") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "ViewBB") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/board/readmsg_board_ru.php">Заголовки сообщений</A>');
  if (g_sPageName == "ViewBB") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "FullMsgBB") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/board/readmsg_board_ru.php?Operat=ShowFullMsg">Сообщения на доске</A>');
  if (g_sPageName == "FullMsgBB") document.writeln('</B>');
  document.writeln('</TD></TR>');

	document.writeln('<TR><TD VALIGN=top>');
	if (g_sPageName == "loan") document.writeln('<B>');
		document.writeln('<A HREF="' + g_sPath + '/clients/loan_ru.htm">Калькулятор платежей по ссуде</A>');
	if (g_sPageName == "loan") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('</TABLE><br>');
}
//===============

function LeftPC()
{
  SetTableHeader("PC", g_sSection,  "Нетания-ПК");
  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "ShopIndex") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/PC/index.php?Lang=Rus">ПК-магазин</A>');
  if (g_sPageName == "Index") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "ImgList")  document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/PC/eshop_cmd.php?Lang=Rus&Operation=ShowImgPage&Init=0">Каталог</A>');
  if (g_sPageName == "ImgList")  document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('</TABLE>');
}
//===============

function LeftVitragMG()
{
  SetTableHeader("Vitrag", g_sSection,  "Витражи и арт-мебель");
  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "ShopIndex") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/vitragshop/index.php?Lang=Rus">Вход в магазин</A>');
  if (g_sPageName == "Index") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "ImgList")  document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/vitragshop/eshop_cmd.php?Lang=Rus&Operation=ShowImgPage&Init=0">Весь каталог</A>');
  if (g_sPageName == "ImgList")  document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('</TD></TR></TABLE>');
}
//===============

function LeftVitragVit()
{
  SetTableHeader("VitShop", g_sSection,  "Витражи и картины");
  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "ShopIndex") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/vitshop/index.php?Lang=Rus">Вход в Магазин</A>');
  if (g_sPageName == "ShopIndex") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "ImgList")  document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/vitshop/eshop_cmd.php?Lang=Rus&Operation=ShowImgPage&Init=0">Каталог</A>');
  if (g_sPageName == "ImgList")  document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('</TABLE>');
}
//===============

function LeftInfo()
{
  SetTableHeader("Info", g_sSection,  "? Инфо");

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "index_info") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/articles/index_ru.html">Заметки</A>');
  if (g_sPageName == "index_info") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "index_mlm")  document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/articles/mlm_ru.htm">О сетевом маркетинге</A>');
  if (g_sPageName == "index_mlm")  document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('</TABLE>');
}
//===============

function LeftArtGallery()
{
  SetTableHeader("ArtGal", g_sSection,  "Арт-Галерея");

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "ArtIndex") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/artgallery/index.php?Lang=Rus">Арт-Каталог</A>');
  if (g_sPageName == "ArtIndex") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('<TR><TD VALIGN=top>');
  if (g_sPageName == "ArtNew") document.writeln('<B>');
    document.writeln('<A HREF="' + g_sPath + '/artgallery/index.php?Lang=Rus&Oper=ShowImgList&View=NEW&Artist=0&Field=0">Новые картины</A>');
  if (g_sPageName == "ArtIndex") document.writeln('</B>');
  document.writeln('</TD></TR>');

  document.writeln('</TABLE>');
}
//===============

