var newWindow

function newwin(nazwa, tytul, h, w) {
if  (!newWindow||newWindow.closed) {
hw=400
ww=400	
attr="scrollbars,"
var reg=/Gecko/
if (navigator.appName=='Netscape'&&navigator.userAgent.search(reg)==-1) { 
	/*alert("jestem netscape 4.x")*/
	attr=attr+"innerHeight="+hw+",innerWidth="+ww
	newWindow=window.open("", "", attr)

} else { /* dla innych niż Netscape*/
	if (navigator.userAgent.search(reg)!=-1) { 
		/*mozilla*/
		/*alert("jestem mozilla")*/
		attr=attr+"innerHeight="+hw+", innerWidth="+ww
		newWindow=window.open("", "", attr)
	} else {
		/*IE */
		/*alert("jestem IE")*/
		attr=attr+"width="+ww+",height="+hw
		newWindow=window.open("", "", attr)	
	}

} /* if (navigator.appName*/

} else {
	newWindow.focus()
}

co="<HTML><TITLE>"+tytul+"</TITLE><BODY BGCOLOR=#FFFFFF marginwidth='0' marginheight='0' leftmargin='0' topmargin='0'><IMG SRC='view/"+nazwa+"' HEIGHT="+h+" WIDTH="+w+" BORDER=0 ></BODY></HTML>"
newWindow.document.write(co)
newWindow.document.close()
}

var speed=4
var iens6=document.all||document.getElementById
var ns4=document.layers
var crossobj
var contentheight
var obj
var containerheight

function pocz() {
if (iens6){
	crossobj=document.getElementById? document.getElementById("content") : document.all.content
	contentheight=crossobj.offsetHeight
}
else if (ns4){
	crossobj=window.document.layers['okienko'].document.layers['nscontainer'].document.layers['nscontent']
	contentheight=crossobj.clip.height
}

if (iens6){
	obj=document.getElementById? document.getElementById("container") : document.all.container
	containerheight=obj.style.height
}
else if (ns4){
	obj=window.document.layers['okienko'].document.layers['nscontainer']
	containerheight=obj.clip.height
}
} //end pocz()


function movedown() {
x=parseInt(contentheight)*(-1)+parseInt(containerheight)+speed
if (window.moveupvar) clearTimeout(moveupvar)
if (iens6&&parseInt(crossobj.style.top)>=x)
crossobj.style.top=parseInt(crossobj.style.top)-speed
else if (ns4&&crossobj.top>=x) {
	crossobj.top-=speed
}
movedownvar=setTimeout("movedown()",100)
} //end movedown()


function moveup() {
if (window.movedownvar) clearTimeout(movedownvar)
if (iens6&&parseInt(crossobj.style.top)<=-speed)
crossobj.style.top=parseInt(crossobj.style.top)+speed
else if (ns4&&crossobj.top<=-speed)
crossobj.top+=speed
moveupvar=setTimeout("moveup()",100)
}

function stopscroll() {
if (window.moveupvar) clearTimeout(moveupvar)
if (window.movedownvar) clearTimeout(movedownvar)
}

function movetop() {
stopscroll()
if (iens6)
crossobj.style.top=0
else if (ns4)
crossobj.top=0
}

function movebottom() {
stopscroll()
if (iens6) {
	crossobj.style.top=-parseInt(contentheight)+parseInt(containerheight)
} else if (ns4) crossobj.top=-parseInt(contentheight)+parseInt(containerheight)
}

function getcontent_height() {
if (iens6)
contentheight=crossobj.offsetHeight
else if (ns4)
	window.document.layers['okienko'].document.layers['nscontainer'].document.layers['nscontent'].visibility="show"
}

function setMsg(msg) {
window.status=msg
return true
}


