// uses Suckerfish dropdowns, http://www.htmldog.com/articles/suckerfish/
// * former source was modified as needed *

sfActive = function()
{
 var tmp = document.getElementById("maminaMenu");
 if (tmp == null) return;
	var sfEls = document.getElementById("maminaMenu").getElementsByTagName("a");
	for (var i=0; i<sfEls.length; i++)
  {
		sfEls[i].onmousedown=function()
    {
		  var tmp = getParent(this, "LI");
		  tmpCN = tmp.className;
		  if (tmpCN.indexOf("sfactive") != -1) // odstran pozadie...
		  {
        if (tmpCN.indexOf("Open") == -1) // ...iba ak
        {
          tmp.className=tmp.className.replace(new RegExp(" sfactive\\b"), "");
        }
      }
      else
      {
  			tmp.className += " sfactive";
  			tmpCN = tmp.className;
  			if (tmpCN.indexOf("hasChild") != -1 && tmpCN.indexOf("ulLiLevel2") == -1)
  			{
          this.href = "javascript:;";
        }
      }
		}
	}
}


if (window.attachEvent)
  window.attachEvent("onload", sfActive);
else
  window.onload = sfActive;
/* Suckerfish dropdowns end */

function printPage()
{
   var options = "menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes,width=630,height=460;"
   url = top.location.href;
   if (url.indexOf("#")>0) url = url.substring(0, url.indexOf("#"));
   if (url.indexOf("?")>0) url = url + "&print=yes";
   else url = url + "?print=yes";
   printWindow=window.open(url,"_blank",options);
}

function printPageEn()
{
   var options = "menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes,width=630,height=460;"
   url = top.location.href;
   if (url.indexOf("#")>0) url = url.substring(0, url.indexOf("#"));
   if (url.indexOf("?")>0) url = url + "&print=yes&eng=yes";
   else url = url + "?print=yes&eng=yes";
   printWindow=window.open(url,"_blank",options);
}

function popup(url, width, height)
{
      var options = "toolbar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height+";"
      popupWindow=window.open(url,"_blank",options);
}

function wjPopup(url, width, height)
{
      var options = "toolbar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height+";"
      popupWindow=window.open(url,"_blank",options);
}

function ClearLogin()
{
document.getElementById("meno").value="";
}

function ClearPass()
{
document.getElementById("heslo").value="";
}


//**************************************** any jscripts

var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var enableanchorlink=0 //Enable or disable the anchor link when clicked on? (1=e, 0=d)
var hidemenu_onclick=1 //hide menu when user clicks within menu? (1=yes, 0=no)

/////No further editting needed

var ie5=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden){
if (ie5||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function dropdownmenu(obj, e, dropmenuID){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
if (typeof dropmenuobj!="undefined") //hide previous menu
dropmenuobj.style.visibility="hidden"
clearhidemenu()
if (ie5||ns6){
obj.onmouseout=delayhidemenu
dropmenuobj=document.getElementById(dropmenuID)
if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
dropmenuobj.onmouseover=clearhidemenu
dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
showhide(dropmenuobj.style, e, "visible", "hidden")
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-15+"px"
dropmenuobj.style.top="25px"
}
return clickreturnvalue()
}

function clickreturnvalue(){
if ((ie5||ns6) && !enableanchorlink) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie5&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}


function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}

// poslovencenie datepickeru
jQuery(function(a){a.datepicker.regional.sk={closeText:"Zavrieť",prevText:"&#x3c;Predchádzajúci",nextText:"Nasledujúci&#x3e;",currentText:"Dnes",monthNames:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","Máj","Jún","Júl","Aug","Sep","Okt","Nov","Dec"],dayNames:["Nedel'a","Pondelok","Utorok","Streda","Štvrtok","Piatok","Sobota"],dayNamesShort:["Ned","Pon","Uto","Str","Štv","Pia","Sob"],dayNamesMin:["Ne","Po","Ut","St","Št","Pia","So"],dateFormat:"mm-dd-yy",firstDay:0,isRTL:false};a.datepicker.setDefaults(a.datepicker.regional.sk)});