var menuCur  = null;
var popupCur = null;
var uMargin  = 64;
var lMargin  = 160;
var pageCnt  = 0;
var menuType = null;

// zisti aky browser sa pouziva
isNS4 = (document.layers) ? 1 : 0;
isIE  = (document.all) ? 1 : 0;
isW3C = (document.getElementById && !document.all) ? 1 : 0;
isIE4Mac = ((navigator.appVersion.indexOf("Mac") != -1) && (document.all) && !(document.getElementById)) ? 1 : 0;


 function visible(what)
 {
  if (document.layers) {
    document.layers[what].visibility = 'show'; }
   else if (document.all) {
          document.all[what].style.visibility = 'visible'; }
         else if (document.getElementById) {
               document.getElementbyId(what).style.visibility = 'visible'; }
 }

 function invisible(what)
 {
  if (document.layers)
    { document.layers[what].visibility = 'hide'; }
   else if (document.all)
    { document.all[what].style.visibility = 'hidden'; }
   else if (document.getElementById)
    { document.getElementbyId(what).style.visibility = 'hidden'; }
 }


 function blocking(what)
 {
  if (document.layers)
    { visi = (document.layers[what].display == 'none')?'block':'none';
      document.layers[what].visibility = visible; }
   else if (document.all)
    { visi = (document.all[what].style.display == 'none')?'block':'none';
      document.all[what].style.visibility = visible; }
   else if (document.getElementById)
    { visi = (document.getElementById(what).style.display == 'none')?'block':'none';
      document.getElementbyId(what).style.visibility = visible; }
 }


function GetObject(obj) {
 var IE=(document.all)?1:0;
 var NS=(document.layers)?1:0;
 var DOM=(document.getElementById)?1:0;
 if (DOM) { myObject=document.getElementById(obj); }
  else if (IE) { myObject=eval('document.all.'+obj); }
	    else if (NS) { myObject=eval('document.layers.'+obj); }
 return myObject;
}

function showPage(name){
  //if (!isIE) return;
  ops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes'");
  window.open(name,pageCnt++,ops);
  return;  
}

function zvyrazni(which,color) {
 if (document.getElementById && document.createElement) {
  which.style.backgroundColor = color; }
}

function showPict(pict_id,ww,wh){
 if (isIE) { ww+=40; wh+=44; }
 var wt = ((screen.Height-wh)/2);
 var wl = ((screen.Width-ww)/2);
 picwin = window.open("show.php?pid="+pict_id, "Wnd", "width=200,height=300,toolbar=no,menubar=no,resizable=yes,location=no,scrollbars=yes,left=100,top=40");
}

function menuOn(e,text,stat){
// document.getElementById('marq').innerHTML = "<marquee scrollamout=20 scrolldelay=120>"+text+"</marquee>";
// document.getElementById('marq').style.pixelLeft = event.clientX+document.body.scrollLeft+10;
// document.getElementById('marq').style.pixelTop = event.clientY+document.body.scrollTop+10;
// GetObject('MARQ').innerHTML = '<MARQUEE behavior="scroll" align="center" direction="left" height="15" width="80%" scrollamount="20" scrolldelay="120">'+text+'"</MARQUEE>';
// GetObject('MARQ').display = 'inline';
}

function menuOff(text){
// GetObject('marq').display = "none";
}

function validate(){
 var id;
 id = substr(frm.findx,3);
 document.location = "pnu_exe.php?pnu="+id;
}

function testClick(){
 if (event.button==2) { alert("Další informace na info@prillinger.cz"); }
}

function getWnd(){
 var x = window.screen.Width; var y = window.screen.Height;
 var xx = x/100; xx_h = xx*45; xx_hh = x - xx_h;
 var yy = y/100; yy_h = yy*45; yy_hh = y - yy_h;
 result = window.open("user.php","PRILL","toolbar=no,top="+eval(yy_hh/2)+",left="+eval(xx_hh/2)+",location=no,directories=no,status=no,resizable=no,menubar=no,height=180,width="+eval(xx_h)+",scrollbars=yes");
}

function right(e) {
 if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) {
   return false; }
  else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
         alert("Zakazan stisk praveho tlacitka");
         return false;  }
  return true;
}
