/**
 * @author Rafał Oleśkowicz
 */
function zaciemnij(warstwa)
{
	//document.getElementById(warstwa).style.display="block";
	//document.getElementById(warstwa).style.height=document.body.scrollHeight+"px";
	warstwaon(warstwa);
	
	for(i=10;i<60;i+=10)
	{
		setTimeout("ustawprzezroczystosc("+i+",'"+warstwa+"')",i*5);	
	}
	setTimeout("pokazzdjecie()",i*5);
}
//-----------------------------------------------------------------------------------------------------
function rozjasnij(warstwa)
{
	schowajzdjecie();
	for(i=50,j=0;i>=0;i-=10,j+=10)
	{
		setTimeout("ustawprzezroczystosc("+i+",'"+warstwa+"')",j*5);
	}
	setTimeout("warstwaof('"+warstwa+"')",j*5);
}
//-----------------------------------------------------------------------------------------------------
function ustawprzezroczystosc(i,warstwa)
{
	try
	{
		document.getElementById(warstwa).style.opacity=i/100;
	}
	catch(error)
	{};
	try
	{
		document.getElementById(warstwa).style.filter="alpha(opacity="+i+")";
	}
	catch(error)
	{};
	try
	{
		//document.getElementById(warstwa).style="moz-opacity:"+(i/100);
	}
	catch(error)
	{};
}
//-----------------------------------------------------------------------------------------------------
function warstwaof(warstwa)
{
	document.getElementById(warstwa).style.display="none";
	document.getElementById(warstwa).style.height="1px";
}
//-----------------------------------------------------------------------------------------------------
function warstwaon(warstwa)
{
	document.getElementById(warstwa).style.display="block";
	
	if(document.body.scrollHeight>wysokoscstrony())
		document.getElementById(warstwa).style.height=document.body.scrollHeight+"px";
	else
		document.getElementById(warstwa).style.height=wysokoscstrony()+"px";
}
//-----------------------------------------------------------------------------------------------------
function szerokoscstrony()
{
	if( typeof( window.innerWidth ) == 'number' )
		myWidth=window.innerWidth;
	else
		if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
			myWidth=document.documentElement.clientWidth; 
		else
			if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
			        myWidth=document.body.clientWidth;
	return myWidth;
}
//-----------------------------------------------------------------------------------------------------
function pokazzdjecie()
{
	document.getElementById('warstwawyswietlacza').style.display="block";
}
//-----------------------------------------------------------------------------------------------------
function schowajzdjecie()
{
	document.getElementById('warstwawyswietlacza').style.display="none";	
}
//-----------------------------------------------------------------------------------------------------
function ustawzdjeciedowyswietlenia(zdj,tytul)
{
  var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body;
	var dsoctop=document.all? iebody.scrollTop : pageYOffset;
	var wysokosc=wysokoscstrony()-50;
	document.getElementById('warstwawyswietlacza').style.margin=dsoctop+'px 0px 0px 0px';
	document.getElementById('warstwawyswietlacza').innerHTML="<div><img src='"+zdj+"' id='o1' alt='zdjęcie' style='border:1px solid white;margin-top:10px;'/></div>";
}
//-----------------------------------------------------------------------------------------------------
function wysokoscstrony()
{
	if( typeof( window.innerWidth ) == 'number' )
		myHeight = window.innerHeight;
	else
		if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
			myHeight = document.documentElement.clientHeight;
		else
			if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
			        myHeight = document.body.clientHeight;
	return myHeight;
}
//-----------------------------------------------------------------------------------------------------
function odstepgorny()
{
  var scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' )
  {
    //Netscape compliant
    scrOfY = window.pageYOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
  {
    //DOM compliant
    scrOfY = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
  {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
  }
  return scrOfY;
}
