
var globalID;
function showclose(pid){
	if (globalID!=null){
		document.getElementById(globalID).style.display = 'none';
	}
	if (document.getElementById(pid).style.display == 'none') {
		if(pid == globalID){ globalID =null; return;}
		document.getElementById(pid).style.display = 'block';
		globalID = pid;
	} else {
		document.getElementById(pid).style.display = 'none';
	}
}

function pop(url,windowName,windowTitle,closeOnClick,width,height,t){
	if(!url)return
	function readSize(){if(t.complete)showPopup(t.width,t.height);else setTimeout(readSize,1e2)}
	function showPopup(w,h){with(window.open('',windowName||'','width='+(width||w)+',height='+(height||h)).document){open();write('<html><head><title>'+(windowTitle||'')+'</title></head><body style="margin:0;padding:0"><img src="'+url+'" style="display:block'+(closeOnClick?';cursor: pointer" onclick="self.close()" title="Zamknij okno"':'"')+'></body></html>');close()}}
	if(!width||!height)t=new Image(),t.src=url,readSize()
	else showPopup(width,height)
}

function submitform()
{
	if(document.myform.onsubmit())
	{
	document.myform.submit();
	}
}

var globalSearchID;
function showSearch(pid){
	if (globalSearchID!=null){
		document.getElementById(globalSearchID).style.display = 'none';
	}
	if (document.getElementById(pid).style.display == 'none') {
		if(pid == globalSearchID){ globalSearchID =null; return;}
		document.getElementById(pid).style.display = 'block';
		globalSearchID = pid;
	} else {
		document.getElementById(pid).style.display = 'none';
	}
}


var globalCommentAdd;
function showCommentAdd(pid){
	if (globalCommentAdd!=null){
		document.getElementById(globalCommentAdd).style.display = 'none';
	}
	if (document.getElementById(pid).style.display == 'none') {
		if(pid == globalCommentAdd){ globalCommentAdd =null; return;}
		document.getElementById(pid).style.display = 'block';
		globalCommentAdd = pid;
	} else {
		document.getElementById(pid).style.display = 'none';
	}
}


var globalCommentShow;
function showCommentShow(pid){
	if (globalCommentShow!=null){
		document.getElementById(globalCommentShow).style.display = 'none';
	}
	if (document.getElementById(pid).style.display == 'none') {
		if(pid == globalCommentShow){ globalCommentShow =null; return;}
		document.getElementById(pid).style.display = 'block';
		globalCommentShow = pid;
	} else {
		document.getElementById(pid).style.display = 'none';
	}
}

