    imgover_on=false;

	function init_imgover(imgsrc,imgw,imgh)
	{
	    var bordersize=11;
    	fromtop=getScrollTop();
		wh=winH();
		oh=getDocHeight();
		if (fromtop+2*bordersize+imgh>oh) oh=2*bordersize+imgh+fromtop;
	
		e=document.getElementById('ol');
		eio=document.getElementById('io');
		e.className='imgover';
		e.style.height=oh+'px';

		et=fromtop+(wh-imgh-(2*bordersize))/2;	// 2x border override
		if (et<fromtop) et=fromtop; // show whole vertical
		eio.className='imgover-img';
		eio.style.top=et+'px';
		eio.innerHTML='<img src="'+imgsrc+'" alt="" width="'+imgw+'" height="'+imgh+'" onclick="closeimgover()" id="iim" title="Klikem zavřít obrázek">';

		imgover_on=true;
	}
	
	function closeimgover()
	{
		e=document.getElementById('ol');
		eio=document.getElementById('io');
		e.className='imgover-hidden';
		eio.className='imgover-hidden';
		imgover_on=false;
		
//		if (isdisp=='back') reverse();
	}







function winH() {
   if (window.innerHeight)
      /* NN4 a kompatibilní prohlížeče */
      return window.innerHeight;
   else if
   (document.documentElement &&
   document.documentElement.clientHeight)
      /* MSIE6 v std. režimu - Opera a Mozilla
      již uspěly s window.innerHeight */
      return document.documentElement.clientHeight;
   else if
   (document.body && document.body.clientHeight)
      /* starší MSIE + MSIE6 v quirk režimu */
      return document.body.clientHeight;
   else
      return null;
}

function livebody()
{
return (document.compatMode=="CSS1Compat")
? document.documentElement
: document.body;
}


function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}


function getScrollTop(){
    if(typeof pageYOffset!= 'undefined'){
        //most browsers
        return pageYOffset;
    }
    else{
        var B= document.body; //IE 'quirks'
        var D= document.documentElement; //IE with doctype
        D= (D.clientHeight)? D: B;
        return D.scrollTop;
    }
}
