function browser()
{
    var _info = navigator.userAgent;
    var _ns = false;
    var _ns6 = false;
    var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
    var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) || (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) || (_info.indexOf("IRIX") > 0)));
    var _ns6 = ( (_ns == true) && ( _info.indexOf("Mozilla/5") >= 0) );    
}

function si_stat( text )
{
	text = '<b>' + text + '</b>';

	if ( !document.layers && !document.all ) return;
	if ( document.layers )
	{
		document.layers.stat.document.write( text );
		document.layers.stat.document.close();
	}
	else if ( document.all )
		stat.innerHTML=text;
}

function check()
{
   var ilosc = document.forms[0].length - 1;
   var start = true;

   for ( i = ilosc ; i != -1 ; --i )
      if ( document.forms[0].elements[i].type == "checkbox" && start )
      {
         var ustaw = document.forms[0].elements[i].checked;
         start = false;
      }
      else
      {
         document.forms[0].elements[i].checked = ustaw;
      }
}

function okno( theURL )
{
   _width = 800;
   _height = 600;

   _top = (screen.height-_height)/2;
   _left = (screen.width-_width)/2;

   window.open( theURL, "Show","width="+_width+",height="+_height+",alwaysRaised=yes,dependent=yes,top="+_top+",left="+_left );
}

function show()
{
   var args = show.arguments;
   var theURL = args[0];
   var pos = ( args.length == 2 ) ? args[1] : 0;

   _width = 640;
   _height = 480;
   _top = (screen.height-_height)/2;
   _left = (screen.width-_width)/2;
   window.open( "show.php?id="+theURL+"&pos="+pos,"Show","width="+_width+",height="+_height+",alwaysRaised=yes,dependent=yes,top="+_top+",left="+_left );
}

function date()
{
   var args = date.arguments;
   var _form = args[0];
   var _input = args[1];
   var _width = args[2];
   var _height = args[3];
   var _date = args[4];
   
   _top = (screen.height-_height)/2;
   _left = (screen.width-_width)/2;
   window.open( "3mod/3date.php?form="+ _form + "&input=" + _input + "&width=" + _width + "&height=" + _height + "&date=" + _date, "Show","width="+_width+",height="+_height+",alwaysRaised=yes,dependent=yes,top="+_top+",left="+_left );
}

function advice()
{
   h = (screen.height-200)/2;
   w = (screen.width-300)/2;
   window.open( "advice.php","Advice","width=300,height=200,alwaysRaised=yes,dependent=yes,top="+h+",left="+w );
}

function order( ID )
{
   h = (screen.height-500)/2;
   w = (screen.width-480)/2;
   window.open( "order.php?order="+ID,"Order","width=480,height=500,alwaysRaised=yes,dependent=yes,top="+h+",left="+w );
}

function StatusBar(msgStr)
{
   self.status = msgStr;
} 
