// -----------------------------------------------------------------------------------
function BrowserCheck()
{

  var b = navigator.appName;
  if (b == "Netscape") this.b = "NS";
  else if (b == "Microsoft Internet Explorer") this.b = "IE";
  else this.b = b;

  this.v = parseInt(navigator.appVersion);
  this.NS = (this.b == "NS" && this.v>=4);
  this.NS4 = (this.b == "NS" && this.v == 4);
  this.NS5 = (this.b == "NS" && this.v == 5);
  this.NS6 = (this.b == "NS" && this.v == 6);
  this.IE = (this.b == "IE" && this.v>=4);
  this.IE4 = (navigator.userAgent.indexOf('MSIE 4')>0);
  this.IE5 = (navigator.userAgent.indexOf('MSIE 5')>0);
  if (this.IE5 || this.NS5) this.VER5 = true;
  if (this.IE4 || this.NS4) this.VER4 = true;
  this.OLD = (! this.VER5 && ! this.VER4) ? true : false;
  this.min = (this.NS||this.IE);

}
// -----------------------------------------------------------------------------------
function OpenWin(url,name,width,height,screenx,screeny,p1,p2,p3,p4,p5,p6,p7)
{

  var wf = "";	

 	wf = wf + "width=" + width;
 
 	wf = wf + ",height=" + height;
 
 	wf = wf + ",screenx=" + screenx;
     
 	wf = wf + ",screeny=" + screeny;
 
 	wf = wf + ",resizable=" + (p1 ? "yes" : "no");
 
 	wf = wf + ",scrollbars=" + (p2 ? "yes" : "no");
 
 	wf = wf + ",menubar=" + (p3 ? "yes" : "no");
 
 	wf = wf + ",toolbar=" + (p4 ? "yes" : "no");
 
 	wf = wf + ",directories=" + (p5 ? "yes" : "no");
 
 	wf = wf + ",location=" + (p6 ? "yes" : "no");
 
 	wf = wf + ",status=" + (p7 ? "yes" : "no");		

  return window.open(url,name,wf);

}
// -----------------------------------------------------------------------------------
function OpenCenterWin(url,name,width,height,p1,p2,p3,p4,p5,p6,p7)
{

  var mwin;

  var centerx = (screen.width/2)-(width/2);
  var centery = (screen.height/2)-(height/2);

  if (width > screen.width-10) { width = screen.width-10; p2 = 1; centerx = 0; }
  if (height > screen.height-50) { height = screen.height-50; p2 = 1; centery = 0; }

  mwin = OpenWin(url,name,width,height,centerx,centery,p1,p2,p3,p4,p5,p6,p7);
  mwin.moveTo(centerx,centery);
  
  return mwin;

}
// -----------------------------------------------------------------------------------
function OpenCenterWinNoRet(url,name,width,height,p1,p2,p3,p4,p5,p6,p7)
{

  OpenCenterWin(url,name,width,height,p1,p2,p3,p4,p5,p6,p7);

}
// -----------------------------------------------------------------------------------
function OpenMaxWinNoRet(url,name,p1,p2,p3,p4,p5,p6,p7)
{

  var mwin;

  var width = screen.width-10;
  var height = screen.height-50;

  mwin = OpenWin(url,name,width,height,0,0,p1,p2,p3,p4,p5,p6,p7);
  mwin.moveTo(0,0);

}
// -----------------------------------------------------------------------------------
function SubmitForm(cmd)
{

  window.document.form1.action = cmd;
  window.document.form1.submit();

}
// -----------------------------------------------------------------------------------
function WriteLayer(objtxt,text)
{

  // objtxt: <span id="objtxt" style="position:absolute"></span>

  if (!document.layers && !document.all) return;

  if (document.layers)
  {
    obj = eval('document.layers.'+objtxt);
    obj.document.write(text);
    obj.document.close();
  } else if (document.all)
  { 
    obj = eval(objtxt);
    obj.innerHTML = text;
  }

}
// -----------------------------------------------------------------------------------
function ShowArtImage(idobj,width,height)
{

  OpenCenterWinNoRet('./include/image.php?id='+idobj,'full_image',width,height,0,0,0,0,0,0,0);

}
// -----------------------------------------------------------------------------------
function SubmitOpenerForm(cmd)
{

  window.opener.document.form1.action = cmd;
  window.opener.document.form1.submit();

}
// ------------------------------------------------------------------------  
function FormReset()
{

  if (confirm('Opravdu smazat celý formulář?'))
  {
    window.form1.reset();
  }

}
// -----------------------------------------------------------------------------------
