/*

 Copyright 2001-2002 Free Software Foundation, Inc.
 Written by Alex Malyshev <alexript@mail.ru>.

 This file is part of Labirint Office Database System.

 Labirint Office Database System is free software; you can
 redistribute it and/or modify it under the terms of the GNU General
 Public License as published by the Free Software Foundation; either
 version 2, or (at your option) any later version.

 Labirint Office Database System is distributed in the hope that it
 will be useful, but WITHOUT ANY WARRANTY; without even the implied
 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 the GNU General Public License for more details.

 You should have received a copy of the GNU General Public License along with
 Labirint Office Database System; see the file COPYING.  If not, write
 to the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
 MA 02111-1307, USA.

*/


function openNewWindow(title,content,w,h)
{
    if(!w)
    {
        w=500;
    }

    if(!h)
    {
        h=300;
    }

    var my_text='<html>\n\
<head>\n\
  <meta http-equiv="Content-Type" content="my_text/html; charset=windows-1251">\n\
  <meta http-equiv="Expires" content="-1d">\n\
  <meta http-equiv="Author" content="Alex Malyshev (alexript@alexript.spb.ru) (c)2001, 2002, 2003 GPL">\n\
  <style>\n\
BODY\n\
	{\n\
	scrollbar-face-color: #CCCCCC; scrollbar-shadow-color: #999999;\n\
	scrollbar-highlight-color: #999999; scrollbar-3dlight-color: #999999;\n\
	scrollbar-darkshadow-color: #999999; scrollbar-track-color: #999999;\n\
	scrollbar-arrow-color: #666666;\n\
	font-family: Verdana, Arial, Helvetica, sans-serif;\n\
	font-size: 14px;\n\
	font-weight: normal;\n\
        background-color:#ececec;\n\
}\n\
font {\n\
	font-family: Verdana, Arial, Helvetica, sans-serif;\n\
	font-size: 10px;\n\
	font-weight: normal;\n\
}\n\
a {\n\
	font-family: Times, Arial, Helvetica, sans-serif;\n\
	font-size: 14px;\n\
	font-weight: bold;\n\
	color: #000000\n\
  line-height:130%;\n\
  margin-bottom:0.5em;\n\
  margin-top:0;\n\
\n\
}\n\
\n\
b {\n\
	font-family: Times, Helvetica, sans-serif;\n\
	font-size: 14px;\n\
	font-weight: bold\n\
  line-height:130%;\n\
  margin-bottom:0.5em;\n\
  margin-top:0;\n\
\n\
}\n\
h1 {\n\
	font-family: Verdana, Arial, Helvetica, sans-serif;\n\
	font-size: 14px;\n\
	font-weight: bold;\n\
	color: #333333\n\
}\n\
tr {\n\
	font-family: Arial, Helvetica, sans-serif;\n\
	font-size: 11px;\n\
	font-weight: normal;\n\
	color: #000000\n\
}\n\
td {\n\
	font-family: Times, Helvetica, sans-serif;\n\
	font-size: 14px;\n\
  line-height:130%;\n\
  margin-bottom:0.5em;\n\
  margin-top:0;\n\
	font-weight: normal;\n\
	color: #000000\n\
}\n\
\n\
input {  font-family: Verdana, Arial, Helvetica, sans-serif;\n\
           font-size: 10px;\n\
           font-weight: bold;\n\
           color: #000000;\n\
\n\
}\n\
\n\
select {  font-family: Arial, Helvetica, sans-serif;\n\
           font-size: 12px;\n\
           font-weight: bold;\n\
           color: #000000;\n\
           background-color: #FFFFFF;\n\
}\n\
.button-submit\n\
{\n\
  font-family: Verdana, Arial, Helvetica, sans-serif;\n\
  font-size: 11px;\n\
  color: rgb(0,0,0);\n\
  background: rgb(236,236,236);\n\
  border-style: solid;\n\
  border-color: rgb(0,0,0);\n\
  border-width: 1px;\n\
  text-decoration: none;\n\
  font-weight: normal;\n\
  text-transform: lowercase;\n\
  }\n\
\n\
  </style>\n\
  ';
    my_text += '<title>' + title + '</title></head>\n';
    my_text += '<body><table border=0 width=100% height=100%><tr><td height=' + (h-50) + 'px valign=top>\n' + content;

    my_text += '\n</td></tr><tr><td align=center height=20px valign=middle><input type=submit value="&nbsp;&nbsp;закрыть окно&nbsp;&nbsp;" onclick=\"self.close();\" class=\"button-submit\"></td></tr></table>\n';


    my_text += '</body></html>\n\r\n';


    var x=(self.outerWidth-w)/2+self.screenX;
    var y=(self.outerHeight-h)/2+self.screenY;


    var win=window.open('','newWin','resizable=yes,alwaysRaised=no,location=no,menubar=no,scrollbars=yes,titlebar=no,toolbar=no,width=' + w +', height=' + h + ', screenX=' + x + ', screenY=' +y);
    win.document.write(my_text);
    return true;

}
