//Ustawia treść strony
function setSpacers()
{
	w=(x=(document.body.clientWidth-360)/2)<300?300:x;
	document.all.spacerLeft.style.width=w;
	document.all.spacerRight.style.width=w;
	h=(document.body.clientHeight-145);
	document.all.tdOfItems.style.height=h;
}
//Wstawia małe menu
function maleMenuLeft(file)
{
	switch(file)
	{	case "conowego.html":
			document.write("<a class=a1 href=index.html>START</a> |");
			break;
		default:
			document.write("<a class=a1 href=conowego.html>CO NOWEGO</a> |");
			break;
	}
}
function maleMenuRight(file)
{
	switch(file)
	{	case "onas.html":
			document.write("<a class=a1 href=index.html>START</a> | <a class=a1 href=polecamy.html>POLECAMY</a> | <a class=a1 href=kontakt.html>KONTAKT</a>");
			break;
		case "polecamy.html":
			document.write("<a class=a1 href=onas.html>O NAS</a> | <a class=a1 href=index.html>START</a> | <a class=a1 href=kontakt.html>KONTAKT</a>");
			break;
		case "kontakt.html":
			document.write("<a class=a1 href=onas.html>O NAS</a> | <a class=a1 href=polecamy.html>POLECAMY</a> | <a class=a1 href=index.html>START</a>");
			break;
		default:
			document.write("<a class=a1 href=onas.html>O NAS</a> | <a class=a1 href=polecamy.html>POLECAMY</a> | <a class=a1 href=kontakt.html>KONTAKT</a>");
			break;
	}
}
//Wstawia duże menu
function duzeMenuLeft(file)
{
	switch(file)
	{	case "podroze.html":
			document.write(".: <a href=index.html>START</a> . <a href=flora.html>FLORA</a> . <a href=fauna.html>FAUNA</a> . ");
			break;
		case "flora.html":
			document.write(".: <a href=podroze.html>PODRÓŻE</a> . <a href=index.html>START</a> . <a href=fauna.html>FAUNA</a> .");
			break;
		case "fauna.html":
			document.write(".: <a href=podroze.html>PODRÓŻE</a> . <a href=flora.html>FLORA</a> . <a href=index.html>START</a> .");
			break;
		default:
			document.write(".: <a href=podroze.html>PODRÓŻE</a> . <a href=flora.html>FLORA</a> . <a href=fauna.html>FAUNA</a> .");
			break;
	}
}

function duzeMenuRight(file)
{
	switch(file)
	{	case "rozne.html":
			document.write(". <a href=index.html>START</a> :.");
			break;
		default:
			document.write(". <a href=rozne.html>RÓŻNE</a> :.");
			break;
	}
}
//Tworzy element listy
function createItem(src,desc,icon,title,eventDate,addDate)
{
	this.src=src;
	this.desc=desc;
	this.icon=icon;
	this.title=title;
	this.eventDate=eventDate;
	this.addDate=addDate;
}
//Pobiera nazwę widocznej warstwy
function getVisibleDiv(divId,prefix)
{
	var divs, name;
	divs=document.all[divId].getElementsByTagName("div");
	for(i=0;i<divs.length;i++){
		if (divs[i].id.substr(0,prefix.length)==prefix){
			if (divs[i].style.visibility=="visible"){
				name=divs[i].id;
			}
		}
	}
	return(name);
}
//Wyświetla określoną warstwę (arg0 - div nadrzędny, arg1 - div do wyświetlenia, arg2 - triger funkcji slide, arg3 - obraz do funk. slide, arg4 - delta, arg5 - numer iteracji)
function showDiv()
{
	var divName;
	if(arguments.length>2)rState[arguments[5]]=0;
	divName=getVisibleDiv(arguments[0],"");
	if(document.all[divName])document.all[divName].style.visibility="hidden";
	if(arguments[2])slideDown(arguments[1],arguments[3],arguments[4],arguments[5]);
	else document.all[arguments[1]].style.visibility="visible";
}
//Obsługa paseka postępu
function ImageLoaded(delta,elId)
{
	d=parseFloat(document.all.procent.innerHTML)+parseFloat(delta);
	document.all.procent.innerHTML=d;
	if (d<0.5)d=0.5;
	document.all[elId].width=Math.round(d);
	if (document.all[elId].clientWidth==document.all['preload'].clientWidth)
	{	document.all['progresbar'].style.visibility="hidden";
		document.all['page1'].style.visibility="visible";
		if(document.all['slideShow'])document.all['slideShow'].style.visibility="visible";
		document.body.style.cursor="default";
	}
}