// ============================================================================
//    PURPOSE:             Подпрограммы основной страницы сайта
//    AUTHORS:             Roman St.Zhavnis
//    MODIFICATION:        14.02.2006 - (version 1.0)
function popup(contentsURL, winName, winProps, width, height, menubar1, toolbar1)
{
   if (!winName) var winName = "_blank";
   var w = 600;
   var h = 400;
   var menubar = 0;
   var toolbar = 0;
   var menuBarHeight    = 0;
   var toolBarHeight    = 0;

   if (width)
      w = width;

   if (height)
      h = height;

   if (menubar1)
   {
      menubar        = 1;
      menuBarHeight  = 24;
   }

   if (toolbar1)
   {
      toolbar        = 1;
      toolBarHeight  = 24;
   }

   var left = (screen.width - w)/2;
   var top  = (screen.height - h)/2 - menuBarHeight - toolBarHeight;
   //alert(screen.height);
   //alert(top);

   if (left < 0)
   {
      //alert('left < 0');
      left = 10;
   };

   if (top < 0)
   {
      //alert('top < 0');
      top = 30;
   }

   var args = "left="+left+",top="+top+",width=" + w + ",height=" + h
      + ",menubar="+menubar+",toolbar="+toolbar+"," + winProps

   return window.open(contentsURL, winName, args)
}

function openVZoomWindow(url)
{
   var w = 600;
   var h = 504;
   popup(
         url,
         'zoomWindow',
         'resizable=0,location=0,status=0,scrollbars=0',
         w,
         h,
         menubar=0,
         toolbar=0
        );
}

function openHZoomWindow(url)
{
   var w = 600;
   var h = 336;
   popup(
         url,
         'zoomWindow',
         'resizable=0,location=0,status=0,scrollbars=0',
         w,
         h,
         menubar=0,
         toolbar=0
        );
}

function openMiniWindow(url)
{
   var w = 600;
   var h = 304;
   popup(
         url,
         'miniWindow',
         'resizable=0,location=0,status=0,scrollbars=0',
         w,
         h,
         menubar=0,
         toolbar=0
        );
}

function blank() {}

// Изменение цвета элемента на указаный
function ChangeColorById( eid, color)
{
  obj = document.getElementById( eid);
  obj.color = color;
}

// Изменение цвета фона элемента на указаный
function ChangeBColorById( eid, color)
{
  obj = document.getElementById( eid);
  obj.style.backgroundColor = color;
}
