var mydiv,mhlpid;
var oScript;
var BoolNasept = false;
var myInterval;
var Pocitadlo=1
var AllTop;
var myNasept;
var myx,myy,el;
function getPath(el)
   {
  //alert (el.tagName)
   if(el.tagName!='DIV') return false;
   myHref=el.getElementsByTagName('A')[0].href
   document.location.href=myHref
   }
   function swst(el,nr)
   {
   if(nr==1 && el.className=='inmenu')
      {
			el.style.backgroundColor='rgb(229,126,0)';
			}
			else
			{
			el.style.backgroundColor='';
			}
   }
   function GoVideo(nr)
    {
    myPATH= '/video.php?ID='+nr;
    //alert(myPATH)
    //return false
    self.name="togot";
    feath="scrollbars=yes,resizable=1,width=400,height=400,location=0,directories=0,toolbar=0,menubar=0,status=1,dependent=1"
    myM=window.open(myPATH,"OBRGAL",feath)
    if(myM)myM.focus();
    myM=!myM
    return myM
    }
   function GoOBR2(el)
    {
    myPATH= el.href
    //alert(myPATH)
    //return false
    self.name="togot";
    feath="scrollbars=yes,resizable=1,width=200,height=200,location=0,directories=0,toolbar=0,menubar=0,status=1,dependent=1"
    myM=window.open(myPATH,"OBRGAL",feath)
    if(myM)myM.focus();
    myM=!myM
    return myM
    }
    function GoOBR1(nr)
    {
    myPATH= '/image.php?ID='+nr;
    //alert(myPATH)
    //return false
    self.name="togot";
    feath="scrollbars=yes,resizable=1,width=200,height=200,location=0,directories=0,toolbar=0,menubar=0,status=1,dependent=1"
    myM=window.open(myPATH,"OBRGAL",feath)
    if(myM)myM.focus();
    myM=!myM
    return myM
    }
    function GoOBR(nr)
    {
    myPATH= '/image.php?ID='+nr;
    //alert(myPATH)
    //return false
    self.name="togot";
    feath="scrollbars=yes,resizable=1,width=200,height=200,location=0,directories=0,toolbar=0,menubar=0,status=1,dependent=1"
    myM=window.open(myPATH,"OBRGAL",feath)
    if(myM)myM.focus();
    myM=!myM
    return myM
    }
function setBorder(el,nr)
{
 if(nr==1)
   {
   el.style.borderColor="red";
   el.style.cursor="pointer";
   }
   else
   {
    el.style.borderColor="black";
    
   }
}
function clickDiv(el)
{
 if(el.tagName!='DIV')return false;
 myA= el.getElementsByTagName('A') 
 if(myA.length<1)return false;
 myPth=myA[0].href;
 location.href=myPth;
}
function setCookie(name, value, expire) {
   document.cookie = name + "=" + escape(value)
   + ((expire == null) ? ";expires=01 Jan 2050 00:00:00 GMT" : ("; expires=" + expire.toGMTString()))
   + ";site="+ location.hostname+";path=/;";
  /*  var ckname= name + "=" +value 
   + ((expire == null) ? ";expires=01 Jan 2050 00:00:00 GMT;" : ("; expires=" + expire.toGMTString()))
   + "path=/;";
   document.cookie = escape(ckname);*/
}
function setAkci(e,n)
{
myElement=e;
myid=e.value
path='/alff/lbr_tools/js_akce.php?ID='+myid+'&nname='+n;
var oScript = document.createElement('script');
  oScript.setAttribute('type','text/javascript');
  oScript.setAttribute('src',path);
  document.getElementsByTagName("BODY")[0].appendChild(oScript);
}
function getA(el)
{
var myA=el.getElementsByTagName("A")[0];
document.location.href=myA.href;
}
 function ShowY(ev)
  {
  BoolNasept=true  
  ZrusNasept();
  mydiv=document.getElementById('nasept')
    if(!window.addEventListener)
       {
       el=event.srcElement
       //if(el.tagName!='SUP' && el.tagName!='IMG')return false
               
       myy=event.clientY+document.documentElement.scrollTop;
       myx=event.clientX;
       mydiv.attachEvent("onmouseover", ukazNasept);
       mydiv.attachEvent("onmouseout", hideNasept);
       el.attachEvent("onmouseout", hideNasept);
       }
       else
       {
       mydiv.addEventListener("mouseover", ukazNasept, false);
       mydiv.addEventListener("mouseout", hideNasept, false);
       el=ev.target;
       //if(el.tagName!='SUP' && el.tagName!='IMG')return false;
       el.addEventListener("mouseout", hideNasept, false);
       myy=ev.pageY;
       myx=ev.pageX;
       }
       
       
       myx=myx+10;
       if(el.tagName=='IMG')
       {
       hval=parseInt(mydiv.style.height);
       wval=parseInt(mydiv.style.width);
       myy=myy-Math.round(hval/2);
       if(myx>660)myx=parseInt(myx-(wval-50));
       }
       mydiv.style.left=myx+'px';
       
       mydiv.style.top=myy+'px';
       mydiv.style.display='block';
       mydiv.style.zIndex='1000';
       return true;
  }
function hideNasept()
{
BoolNasept=false
}  
function ukazNasept()
  {
	BoolNasept=true
	}
function ZrusNasept()
{
 if(myInterval)
   {
	 window.clearTimeout(myInterval)
	 }
 if(!BoolNasept)
 {
 mydiv=document.getElementById('nasept')
 mydiv.style.display='none';
 return true
 }
 myInterval= window.setTimeout("ZrusNasept()",1000); // načasuje akci
return false; 
}
function setNasept(result)
{
document.getElementById('nasept').innerHTML=result;
return false;
}
function goThumbs(ev,myid)
{
myNasept=document.getElementById('nasept');
if(!myNasept)
   {
	 myNasept=document.createElement('div');
	 myNasept.setAttribute('id','nasept');
	 document.getElementsByTagName('body')[0].appendChild(myNasept);
	 }
myNasept.style.width='280px';
myNasept.style.height='250px';
var	path='/img_w.php?sz=250&ID='+myid
inner='<iframe src="'+path+'" id="frm1" style="width:280px;height:250px" frameborder="0" ></iframe>';
ShowY(ev);
setNasept(inner);
return false;
}
