/*
 * www.estudio-max.com MSSM Site and Back Office
 * Copyright (c) 2006 eMaster
 * $Revision: 1.1 $
 * Modified: $Date: 2006/11/12 20:41:02 $
 *
 * File Authors:
 *    eMaster <estudiomax@gmail.com>
 */

function findObj(id) {
   if(document.all)
      return document.all[id];
   else
      return document.getElementById(id);
}

function printit(){

   h = findObj('header');
   if(!h) return;
   hea = h.innerHTML;

   bb = findObj('maintext');
   if(!bb) return;
   bod = bb.innerHTML;

   nwin = open('', '_print', 'height=600, resizable=yes, scrollbars=yes, width=700');
   if(!nwin) {
      alert('Хм... возможно ваш браузер заблокировал всплывающие окна. \r\nОтключите блокировку окон для этого сайта и повторите попытку.');
      return;
   }
   url = '';
   copyr = '&copy; 2006 Группа компаний INLINE Technologies.<br />Все права защищены.';
   nwin.document.write('<html>');
   nwin.document.write('<head><link rel=stylesheet type=text/css href="/bo/editor/style.css"></head>');
   nwin.document.write('<style type="text/css">body {margin: 20px;} #hed, #bott {clear: both; width: 100%; background: #EEE; padding: 5px;} #bott .le{float: left; width: 48%} #bott .ri{float: right; width: 48%; text-align: right;} #bott {height: 32px;} </style>');
   nwin.document.write('<body>');
   nwin.document.write('<div id="hed"><h1>' + hea + '</h1></div><br />');
   nwin.document.write(bod);
   nwin.document.write('<br /><div id="bott"><div class="le">' + url + '</div><div class="ri">' + copyr + '</div></div>');
   nwin.document.write('</body>');
   nwin.document.write('</html>');
   nwin.document.close();
   nwin.print();

}

function createFlash(Id, Url, Width, Height, Img, ImgW, ImgH, Alt) {
   obj = document.getElementById(Id);
   if (!obj || !Url || !Width || !Height) return;

   if (Img) {
      ImgW = ImgW || Width;
      ImgH = ImgH || Height;
      Alt = Alt || '';
      imgtag = '<img src="' + Img + '" width="' + ImgW + '" height="' + ImgH + '" alt="' + Alt + '" />';
   } else {
      imgtag = '';
   }

   obj.innerHTML ='<object type="application/x-shockwave-flash" data="' + Url + '" width="' + Width + '" height="' + Height + '">' +
      '<param name="movie" value="' + Url + '" />' + imgtag +
      '</object>';
}

