//     ?-?? ?????????????? ???????? ????(?? ???????? ?? ????????)
//???????????????????????????????????????????????????????????????
function L_SET(Name, Param, Val)
{
  if(document.all) // IE
  {
    if(Val=='\'show\'') Val='\'visible\'';
    eval('document.all("'+Name+'").style.'+Param+'='+Val);
  }
  else                                           // NN
  {
    rrrr=eval('document.'+Name);
    eval('document.'+Name+'.'+Param+'='+Val);
  }
}

//     ?-?? ?????????? ???????? ????(?? ???????? ?? ????????)
//???????????????????????????????????????????????????????????????
function L_GET(Name, Param)
{ if(document.all) // IE
  {
    return eval('document.all("'+Name+'").style.'+Param);
  }
  else                                           // NN
  {
    return eval('document.'+Name+'.'+Param);
  }
}

var MenuHeight=180;

//     ?-?? ????????????? ??????? ???????. ????
//???????????????????????????????????????????????????????????????
function PosLayer()
{
  var Pause, up, to/*???? ?????????*/, from/*?????? ?????????*/, step/*??? ??????????*/;
  Pause=40;
  if(document.body) up=document.body.scrollTop;
  else              up=top.pageYOffset;
  if(isNaN(up)) return;
  if(window.innerHeight) WndH=window.innerHeight;
  else                   WndH=document.body.clientHeight;
  to=up+84;

  // ???????????? ?????????, ????? ???? ?? ???????? ?? ?????? ????????
  if(document.body)
  { // ????? ??? IE
    if(to+MenuHeight>=document.body.scrollHeight)
    {
      to=document.body.scrollHeight-MenuHeight;
    }
  }

  from=L_GET("layer", "top"); /**/ from=parseInt(from, 10);
  if(from!=to)
  {
    step = Math.ceil( Math.abs( to - from ) / 6 );
    if(to<from) step=-step;
    // ?????????? ?????????
    from=L_GET("layer", "top"); /**/ from=parseInt(from, 10);
    L_SET("layer", "top", from+step);
  }

  setTimeout ("PosLayer();", Pause);
}

var right=-765; right2=-720// ???????? ????? ???????????? ???????

//     ?-?? ?????????, ??? ?????? ?????????? ?????? "????? ? ????"
//???????????????????????????????????????????????????????????????
function SetOffsets(type)
{
  if(document.body && document.body.clientWidth) wWidth=document.body.clientWidth;
  else                                           wWidth=window.innerWidth;
  tWidth=770;
  if(wWidth<tWidth) wWidth=tWidth;
  dif=0; // ??? NN
  if(!document.body)
  {
    if(wWidth!=tWidth) dif=-8;
  }
  L_SET("layer", "visibility", '\'show\'');
  L_SET("layer", "left", (wWidth/2+tWidth/2)+right+dif);

//  L_SET("lay_index", "left", (wWidth/2-tWidth/2)+190+dif);
//  L_SET("lay_index", "visibility", '\'show\'');

  PosLayer();
}


//-------------------------------------------------------------
var globN=0;

function Invert(Layer,N)
{
  // ??????????? ?????????
  // from=L_GET("layer", "top"); /**/ from=parseInt(from, 10);
  // L_SET(Layer, "top", from+21+26*N);
  // ??????????? ?????????
  Str=L_GET(Layer, "visibility");
  if(Str!='hidden' && Str!='hide')
    L_SET(Layer, "visibility", '\'hidden\'');
  else
    L_SET(Layer, "visibility", '\'show\'');
}

//     ?-?? ????????? ???? ? ??????? ?????????
//???????????????????????????????????????????????????????????????
function OpenPicSpec(Href, Txt, Big)
{
  if(Big==1) { H=520; W=540; } // ??????? ???? ??? 510?510
  else       { H=379; W=399; } // ????????? ???? ??? 369?369
  Href="pic.php?pic="+Href;
  if(Txt) Href+="&txt="+Txt;
  open(Href, "SpecialWindow", "directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,alwaysRaised=yes,height="+H+",screenX=10,screenY=10,width="+W);
}


// ????????????????????????????? End of File ????????????????????????????????

