Nowe=null;

function Otworz(w,s,src)
{
	if (Nowe!=null)
	{
		Nowe.close();
		Nowe=null;
	}
	Nowe=window.open("", "","toolbar=no,menubar=no,location=no,personalbar=no,scrollbars=no,status=no,directories=no,resizable=no,height="+w+",width="+s);
	Nowe.document.write("<HTML><HEAD><STYLE>BODY{margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;}</STYLE><title></title></HEAD><BODY><img onClick='window.close();' src="+src+" /></BODY></HTML>");
	Nowe.focus();
}
 
var menuTO = new Array;

function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
} 
function showMenu(obj,name){
	for( var i in menuTO ){
		clearTimeout(menuTO[i]);
		if (d = document.getElementById( i ) ) d.style.visibility='hidden';
	}
	x = getposOffset(obj,'left');
	y = getposOffset(obj,'top');
	if (d = document.getElementById( name ) ){
		d.style.visibility = 'visible';
		d.style.top = y+15;
		d.style.left = x;
	}
}

function hideMenu(num){
	if (d = document.getElementById( num ) ){
		menuTO[num] = setTimeout( "d.style.visibility='hidden'",200 );
	}
}

function stophideMenu(num){
	clearTimeout(menuTO[num]);
}

