// ============================================================================
//    PURPOSE:             Подпрограммы основной страницы сайта ЦДРМ
//
//    FUNCTIONAL AREA:     
//    NAME:                MF.js
//    VERSION:             1.0
//    AUTHORS:             Sasha
//    DESIGN REFERENCE:    
//    MODIFICATION:        14.02.2006 - (version 1.0)
//                         
// ============================================================================
// =================================================================== INCLUDES
// =================================================================== SYNOPSIS
// ================================================================== CONSTANTS
// ================================================================== VARIABLES
// ================================================================== FUNCTIONS

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)


   //var left = (screen.width - 835)/2;
   //var wnd=window.open(url , "","left="+left+",top=10,width=835,height=660,directories=no,menubar=no,status=yes,resizable=yes,scrollbars=yes,toolbar=no");
   //popup(url , "","left="+left+",top=10,directories=no,menubar=no,status=yes,resizable=yes,scrollbars=yes,toolbar=no", '680', '660');


}

function openPrintVersion(url)
{
   var w = 680;
   var h = 500;
   popup(
         url,
         'printVerWindow',
         'resizable=0,location=0,status=0,scrollbars=1',
         w,
         h,
         menubar=1,
         toolbar=1
        );
}

function openPhotos(url) 
{
   var w = 680;
   var h = 650;
   popup(
         url,
         'printVerWindow',
         'resizable=0,location=0,status=0,scrollbars=1',
         w,
         h,
         menubar=0,
         toolbar=0
        );
}


