var	posx=0, posy=0, absposy, ramka, ramkawidth=400, ramkaheight=45, newpage=false
var DOM=(document.getElementById) ? true : false;
var NS4 = (document.layers) ? true : false;
var IE=(document.all) ? true : false;
var IEDOM=DOM&&IE;
var NSDOM=DOM&&(!IE);
var OPERA=(navigator.userAgent.search(/Opera/) !=-1) 

index='spis.htm';
text0='1_0.htm';
text1='1_1.htm';
text2='1_2.htm';
text3='1_3.htm';
text4='1_4.htm';
text5='1_5.htm';
text6='1_6.htm';
text7='1_7.htm';
text8='1_8.htm';

function init() 
{
if (NSDOM)
{
	window.textFrame.document.body.innerHTML="";
	document.getElementById('textFrame').style.border='0';
	document.getElementById('textFrame').style.height='0px';
	document.getElementById('textFrame').style.visibility='hidden';
	document.getElementById('przypis').innerHTML="";
}
if (NS4||NSDOM)
{
 	document.captureEvents(Event.MOUSEMOVE);
  	document.onmousemove=mousetrackNS4;
}

}
function mousetrackNS4(e)
{
	posx = e.pageX; posy=e.pageY;
	absposy= posy-window.pageYOffset;
}

function initFrame()
{
if (DOM&&newpage)
{
	newpage=false;
	document.getElementById('textLayer').innerHTML=window.textFrame.document.body.innerHTML;	


	window.textFrame.document.body.innerHTML=" ";
	document.getElementById('textFrame').style.border='0';
	document.getElementById('textFrame').style.height='0px';
	document.getElementById('textFrame').style.visibility='hidden';
}

}

function loadPage(url)
{
scrollTo(0,0);
if (DOM) 
{
	window.document.getElementById('textLayer').innerHTML="Pobieranie dokumentu...";
	window.document.getElementById('textFrame').src = url+'?'+Math.random(); 
	newpage=true;
}
else
{
	window.document.location='/bezdogmatu/index.php?id='+url;
}
}

function hideLink(string)
{
	window.top.status=string;
}

function  position_IE()
{
if (IEDOM) 
	{
		posx=window.event.x + document.body.scrollLeft; 
		posy=window.event.y + document.body.scrollTop;
		absposy=window.event.y;
	}
}

function helpOn(string)
{
	setTimeout('hideLink("przypis")',10);

	position_IE();
	ramkaleft=posx-280;
	ramkatop=posy-(ramkaheight+40);
	if (absposy<(ramkaheight+35)) ramkatop=posy+40;		
	if (NS4)
	{
		ramka=document.layers['przypis'];
		ramka.resizeTo(ramkawidth,ramkaheight);
	    ramka.document.open();
		ramka.document.write(string);
		ramka.document.close();
		ramka.left=ramkaleft;
		ramka.top=ramkatop;
		ramka.borderWidth=1;
		ramka.backgroundColor="#999999";	
		ramka.visibility="show";
	}
	else if(DOM)
	{
 		ramka= document.getElementById('przypis');
		ramka.innerHTML=string;
		ramka=ramka.style;	
		ramka.left=ramkaleft;
		ramka.top=ramkatop;
		ramka.backgroundColor="#eeeeee";
		ramka.borderStyle="solid";	
		ramka.borderWidth="1px";
		setTimeout("ramka.visibility='visible'",1);
	}
		return true;
}

function helpOff()
 {
 	setTimeout('hideLink(" ")',10);
	if (ramka)
	{
 	if (NS4)
 	ramka.visibility="hide";
	else if (DOM)
	{
	setTimeout("ramka.visibility='hidden'",1);
	}
	}
		return true;
 } 
 
function gotoLabel(label)
{
	helpOff();
	if (OPERA)
	{
	document.location=label;
	return false; 
	}
	else
	return true;
}
