function goToURL(obj, id)
{
  if (obj.value != "" && typeof(obj) != "string")
  {
    location.href = obj.value;
  }
  else if (obj == "dozadu")
  {
    var zoznam = document.getElementById(id);
    if (zoznam.selectedIndex == 0 || zoznam.selectedIndex == 1)
    {
      location.href = zoznam.options[zoznam.length-1].value;
    }
    else
    {
      location.href = zoznam.options[zoznam.selectedIndex-1].value;
    }
  }
  else if (obj == "dopredu")
  {
    var zoznam = document.getElementById(id);
    if (zoznam.selectedIndex == zoznam.length-1)
    {
      location.href = zoznam.options[1].value;
    }
    else
    {
      location.href = zoznam.options[zoznam.selectedIndex+1].value;
    }
  }
}

function genBack()
{
  var tmp = window.history.length;
  if (tmp < 2)
    self.close();
  else
    history.back();
}

function initInfoPopupDiv()
{
 document.write('<div id="infoPopupDiv" class="infoDiv" style="display: none; position: absolute; left: 0px; z-index:2;">&nbsp;<\/div>');
 document.write('<iframe id="infoPopupDivIframe" src="\/components\/iframe_blank.jsp" style="z-index:+1;position:absolute;display:none;width:250px;height:20px;border:0px;" scrolling="no" frameborder="0"><\/iframe>');
}

/* common */
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);
}

// menim zalozky pri vyhladavani

/*function changeClass(obj)
{
	divobj = document.getElementById('box1');
	
	if(divobj.oldClass == null)
	{
		divobj.oldClass = divobj.className;
	}
	
	divobj.className = obj.id;
}*/

function show(id,width) {
	var el = document.getElementById(id);
	el.style.display = "block";
}
function hide(id) {
	var el = document.getElementById(id);
	el.style.display = "none";
}