function OpenImageOld(srcFile,popW,popH)
{
  pH = 22;
  pW = 18;
  if(navigator.appName.indexOf("Internet Explorer") != -1)
   { k = 2; }
  else
   { k = 4; }
  pWidth = popW + pW;
  pHeight = popH + pH;
  pLeft = ((screen.width - pWidth) / 2) - 20;
  pTop = ((screen.height - pHeight) / k);
  var win_opt= "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0";
  win_opt += ",resizable=0,copyhistory=0";
  win_opt += ",width=" + pWidth;
  win_opt += ",height=" + pHeight;
  win_opt += ",left=" + pLeft;
  win_opt += ",top=" + pTop;
  window.open(srcFile,"_blank",win_opt);
}

function OpenImage(srcFile,pWidth,pHeight,title)
{
  if(navigator.appName.indexOf("Internet Explorer") != -1)
    { k = 2; }
  else
    { k = 4; }
  if(title == null) 
    {title = "Фотографии";}
  pLeft = ((screen.width - pWidth) / 2) - 20;
  pTop = ((screen.height - pHeight) / k);
  var win_opt= "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0";
  win_opt += ",resizable=0,copyhistory=0";
  win_opt += ",width=" + pWidth;
  win_opt += ",height=" + pHeight;
  win_opt += ",left=" + pLeft;
  win_opt += ",top=" + pTop;
  id = window.open("","_blank",win_opt);
  id.focus();
  id.document.open();
  id.document.write("<html>\n");
  id.document.write("<head><title>",title,"</title></head>\n");
  id.document.write("<body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>\n");
  id.document.write("<img src=" + srcFile + " border=0 onclick=\"javascript:window.close();\">\n");
  id.document.write("</body>\n");
  id.document.write("</html>");
  id.document.close();               
}

var win = null;
function OpenFile(srcFile)
{
  if(navigator.appName.indexOf("Internet Explorer") != -1)
   { k = 1.5; }
  else
   { k = 2.5; }
  pWidth = screen.width / 3;
  pHeight = screen.height / 1.8;
  pLeft = ((screen.width - pWidth) / 2) - 20;
  pTop = ((screen.height - pHeight) / k);
  var win_opt= "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1";
  win_opt += ",resizable=1,copyhistory=0";
  win_opt += ",width=" + pWidth;
  win_opt += ",height=" + pHeight;
  win_opt += ",left=" + pLeft;
  win_opt += ",top=" + pTop;
  if (win != null)
   { win.close(); }
  win = window.open(srcFile, "_blank", win_opt);
}

function SetImg(Name,Img)
{
  document.images[Name].src=eval(Img + '.src');
}

function ShowLayer(Name)
{
  HideAllLayers();
  document.all[Name].style.visibility = 'visible';
}

function HideAllLayers()
{
  for (var i = 1; i <= 121; i++)
  {
    HideLayer("L" + i);
  }
}

function HideLayer(Name)
{
  document.all[Name].style.visibility = 'hidden';
}

function ShowABCLayer(Name)
{
  HideAllABCLayers();
  document.all[Name].style.visibility = 'visible';
}

function HideABCLayer(Name)
{
  document.all[Name].style.visibility = 'hidden';
}

function HideAllABCLayers()
{
  for (var i = 1; i <= 28; i++)
  {
    HideLayer("ABC_" + i);
  }
}


