﻿function getBodyScrollTop()
{
  return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}

function getBodyScrollLeft()
{
  return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
}	
function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}
	
function getDocumentHeight()
{
	return (document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;
}

function getDocumentWidth()
{
	return (document.body.scrollWidth > document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth;
}    
	var value = 0;	
	
    function setOpacity(picture) {
		document.getElementById("podskazka").style.zIndex = "10000";
		document.documentElement.style.overflow = "hidden";		
       value += .9;
       var testObj = document.getElementById('test');    
       testObj.style.width = document.getElementById("bodys").offsetWidth + 'px';
       testObj.style.height = document.getElementById("bodys").offsetHeight + 'px';
       testObj.style.width = getDocumentWidth() + 'px';
       testObj.style.height = getDocumentHeight() + 'px';
       testObj.style.display = "block";
       testObj.style.opacity = value/10;
       testObj.style.filter = 'alpha(opacity=' + value*10 + ')';
       myTimeout = setTimeout("setOpacity()", 1);
       
       if ((value/10) >= .5) {
          clearTimeout(myTimeout);
       }
	   
	   if(value>=5){
		document.getElementById('podskazka').style.display = "block";
	   }      
    }	

    function removeOpacity() {
       value -= .9;
       var testObj = document.getElementById('test');
       
       myTimeout2 = setTimeout("removeOpacity()", 1);
       testObj.style.opacity = value/10;
       testObj.style.filter = 'alpha(opacity=' + value*10 + ')';
       
       if ((value/10) <= 0) {
          testObj.style.display = "none";
          clearTimeout(myTimeout2);
       }
      document.getElementById('podskazka').style.display = "none";
	  document.documentElement.style.overflow = "auto";
    }

	function showscrol(){
		document.documentElement.style.overflow = "auto";
	}
		
