function toggle( targetId ){
  if (document.getElementById){
  target = document.getElementById( targetId );
  if (target.style.display == "") {  target.style.display = "none"; }
  if (target.style.display == "none"){
    target.style.display = "block";
  } else {
    target.style.display = "none";
  }
  }
  return true;
}



function prevedInt (a) {
  a = parseInt(a);
  if (isNaN(a)) { a = 0; }
  return a;
}

function prictiJedna (hodnota) {
  document.getElementById(hodnota).value =  prevedInt(document.getElementById(hodnota).value) + 1;
}

function odectiJedna (hodnota) {
  if (prevedInt(document.getElementById(hodnota).value) > 0) {
    document.getElementById(hodnota).value =  prevedInt(document.getElementById(hodnota).value) - 1;
  }
}


//DetectImageSize function
   function DetectImageSize(picName,picTitle) {
      picURL=picName.src
      newWindow=window.open(picURL,'newWin','toolbar=no, width='+picName.width+',height='+picName.height)
      newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body background="'+picURL+'" onclick="self.close(); return true;" style="cursor: pointer;cursor: hand;" title="Kliknutím zavřete"><\/body><\/html>')
      newWindow.resizeBy(picName.width-newWindow.document.body.clientWidth,picName.height-newWindow.document.body.clientHeight)
      newWindow.focus()
   } 
   
//OpenQT function
   function OpenQT(picURL,picTitle) {
      newWindow=window.open(picURL, picTitle,'toolbar=no, width=400, height=316')
      newWindow.focus()
   }    
   
//OpenImage function
   function OpenImage(picURL,picTitle) {
      newWindow=window.open(picURL,'newWin','toolbar=no, width=770,height=570')
      newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body background="'+picURL+'" onclick="self.close(); return true;" style="cursor: pointer;cursor: hand;" title="Kliknutím zavřete"><\/body><\/html>')
      newWindow.focus()
   }   
   
function gGetElementById(s) {
  var o = (document.getElementById ? document.getElementById(s) : document.all[s]);
  return o == null ? false : o;
}

function zipUnzip(blockID, imageID) {
var obj = gGetElementById(blockID);
var img = gGetElementById(imageID)
if (obj != null) {
if (obj.style.display=='block'){
obj.style.display='none';
img.src='/images/zipped_triangle.gif';
}
else {
obj.style.display='block';
img.src='/images/unzipped_triangle.gif';
}
}
}


