// most of these things were made up and screwed up by me
// (M@RTiN <martin@ne-e.net> - http://www.ne-e.net) - skryta reklama ;))

  var ne_nav=navigator.userAgent.toLowerCase();
  var ne_isMac=(ne_nav.indexOf("mac")!=-1);
  var ne_isOpera=(ne_nav.indexOf("opera")!=-1);
  var ne_isIE=(!ne_isMac && !ne_isOpera && ne_nav.indexOf("msie")!=-1);
  var ne_isN6=(ne_nav.indexOf("gecko")!=-1);

// encyklopedie
function ency(tid){
window.open('modules.php?name=Encyclopedia&op=content&tid='+tid,'SLOVNIK','width=400,height=300');
}

// titule z plkadla
var dotmod,timer;
var mstime=0;

function doTT(e,num){
 if(document.getElementById){
  elm=document.getElementById("tt"+num);
  if(document.all && !window.opera){x=event.clientX+document.body.scrollLeft-10;y=event.clientY+document.body.scrollTop+25;}else{x=e.pageX-10;y=e.pageY+25;}
  if(document.all && !window.opera){elm.style.pixelLeft=x;elm.style.pixelTop=y;}else{elm.style.left=x+"px";elm.style.top=y+"px";}
  dotmod=elm;
  timer=setTimeout('showTT()',mstime);
 }
}
function showTT(){dotmod.style.display='block';}
function hideTT(num){if(document.getElementById){elm=document.getElementById("tt"+num);elm.style.display="none";clearTimeout(timer);}}


// plkadlo

function popup(url, name, width, height){
settings=
"toolbar=no,location=no,directories=no,"+
"status=no,menubar=no,scrollbars=yes,"+
"resizable=yes,width="+width+",height="+height;
MyNewWindow=window.open(url,name,settings);
}

function x(){return true;}

function DoSmilie(addSmilie) {
var addSmilie;
var revisedMessage;
var currentMessage = document.form1.comment.value;
revisedMessage = currentMessage+addSmilie;
document.form1.comment.value=revisedMessage;
document.form1.comment.focus();
return;
}

//Drop-Down fenu functions
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function expand(listID)
{       if (listID.style.display=="none")
        {    listID.style.display="";    }
        else
        {    listID.style.display="none";}
        window.event.cancelBubble=true;}

function contract(listID)
{       if (listID.style.display=="show")
        {    listID.style.display="";    }
        else
        {    listID.style.display="none";}
        window.event.cancelBubble=true;}

//end Drop-Down fenu functions

function restrictinput(maxlength,e,placeholder){
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation()
}
}

function countlimit(maxlength,e,placeholder){
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft
}
}


function displaylimit(theform,thelimit){
var limit_text='<span class="pismomale cerny" id="'+theform.toString()+'">'+thelimit+'</span>'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true);
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true);
}
}


function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.3
else if (which2.filters)
which2.filters.alpha.opacity=30
}

function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}