      function getElementPosition(element){
            var x=0;
            var y=0;
            while (element!=null){
            x+=element.offsetLeft-element.scrollLeft;
            y+=element.offsetTop-element.scrollTop;
            element=element.offsetParent;
            }
            return {x:x,y:y};
      }

      function getElement(id){
//            if (document.all) return document.all[id];
            if (document.getElementById(id)) return document.getElementById(id);
            if (document.getElementsByTagName(id)[0]) return document.getElementsByTagName(id)[0];
            return null;
      }

      function findElement(id){
            // Get the element by its id
            element = getElement(id);
            // make sure that the element was found
            if (! element) return;
            // get the object that will contain the x,y coordinates
            return position = getElementPosition(element);
      }

      function umistiDIV(idecko,idbutton) {
        var pozice=findElement(idbutton);
        if (pozice) {
          document.getElementById(idecko).style.top=(pozice.y-160)+'px';
        } else {
          document.getElementById(idecko).style.top='200px';
        }
      }

      function obrazek_velky(obr,x,y,xx) {
        if (obr.style.width==xx+'px') {
          obr.style.width=x+'px';
          obr.style.height=y+'px';
          /*document.getElementById('side').style.display='none';*/
        } else {
          obr.style.width=xx+'px';
          yn=y/x*xx;
          obr.style.height=yn+'px';
          /*document.getElementById('side').style.display='block';*/
        }
      }

  function zobrazSkryj2(idecko,idbutton){
    el=document.getElementById(idecko).style;
    el.display=(el.display == 'block')?'none':'block';
    umistiDIV(idecko,idbutton)
  }
