//Ustawia parametry okna
function setWindow()
{
window.onload=unselectable;
window.status=".: 4 Światy Jagody i Witka Brzozowskich :.";
}
//Blokada zaznaczania wszystkich obiektów na stronie
function unselectable()
{
for (i=0; i<document.all.length; i++)
 document.all[i].unselectable = 'on';
}

//Wstawia Copyright
function copyright()
{
	document.write(".: © Copyright 4swiaty.pl 2009 :.");
}
//Wyświetlenie komunikatu o prawach autorskich
function ShowMessage()
{
	alert(".: © Copyright www.4swiaty.pl :.");
}
function slideDown(showDiv,showImg,delta,runCode)
{
	if(!(rState[runCode]==0))setTimeout("slideDown('" + showDiv + "','" + showImg + "'," + delta +",'" + runCode + "')",1);
	else{
		if(delta>0)document.all[showImg].style.top=-document.all[showImg].clientHeight;
		else document.all[showImg].style.top=document.all[showImg].clientHeight;
		document.all[showDiv].style.visibility="visible";
		moveImg(showImg,delta,runCode);
	}
}

function moveImg(img,delta,runCode)
{
	imgTop=parseFloat(document.all[img].style.top)+delta;
	if(delta>0){
		if(imgTop<0){
			document.all[img].style.top=imgTop;
			setTimeout("moveImg('" + img + "'," + delta +",'" + runCode + "')",1);
		}
		else{
		 	document.all[img].style.top=0;
			rState[runCode]=1;
		}
	}
	else {
		if(imgTop>0){
			document.all[img].style.top=imgTop;
			setTimeout("moveImg('" + img + "'," + delta +",'" + runCode + "')",1);
		}
		else{
		 	document.all[img].style.top=0;
			rState[runCode]=1;
		}
	}
}
function reSlideDown(showDiv,showImg,delta,runCode)
{
	if(!(rState[runCode]==1))setTimeout("reSlideDown('" + showDiv + "','" + showImg + "'," + delta +",'" + runCode + "')",1);
	else {
		rState[runCode]=-1;
		reMoveImg(showDiv,showImg,delta,runCode);
	}
}
function reMoveImg(showDiv,img,delta,runCode)
{
	imgTop=parseFloat(document.all[img].style.top)+delta;
	if(delta<0){
		if(imgTop>-document.all[img].clientHeight){
			document.all[img].style.top=imgTop;
			setTimeout("reMoveImg('" + showDiv + "','" + img + "'," + delta +",'" + runCode + "')",1);
		}
		else{
		 	document.all[img].style.top=-document.all[img].clientHeight;
			document.all[showDiv].style.visibility="hidden";
			rState[runCode]=0;
		}
	}
	else {
		if(imgTop<document.all[img].clientHeight){
			document.all[img].style.top=imgTop;
			setTimeout("reMoveImg('" + showDiv + "','" + img + "'," + delta +",'" + runCode + "')",1);
		}
		else{
		 	document.all[img].style.top=document.all[img].clientHeight;
			document.all[showDiv].style.visibility="hidden";
			rState[runCode]=0;
		}
	}
}