/* misza@best.net.pl */
function newWin(nazwa,szer,wys) {
odlewa=(screen.width-szer)/2;
odgory=(screen.height-wys)/2;
szer = szer+28;
wys = wys+28; 	
config='left='+odlewa+',top='+odgory+',width='+szer+',height='+wys+',innerheight='+wys+',innerwidth='+szer+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no';
cel=window.open('','okno',config)
cel.document.write('<HTML><HEAD>');
cel.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">');
cel.document.write('<TITLE>STANISŁAW SIDORCZUK - Zakład Kamieniarski - KAMSID</title>');
cel.document.write('</HEAD>');
cel.document.write('<body leftmargin=10 topmargin=10 marginheight=10 marginwidth=10>');
cel.document.write('<DIV align=center><a href=# onclick="javascript:self.close();"><img src='+nazwa+' alt="Kliknij aby zamknąć okno" style="border: 1px solid #000;" align=center></a></div>');
cel.document.write('</body></html>');
cel.focus();
}

/* POKAZYWANIE POPUP /////////////////////////////////////////////////////////////////////////////  */
var pop, IE=document.all?true:false;

if(!IE) {
	document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove=mousePos;
	var netX, netY;
}

function init() {
	if(IE) pop=document.all.pop; else pop=document.getElementById("pop");
	b=document.body;
}

function mousePos(e) {
	netX=e.pageX;
	netY=e.pageY;
}

function MoveToPop(pX, pY) {
	init();
	if(pop.style.visibility!='visible') return;
	if(IE) {myszX=event.clientX; myszY=event.clientY;}
		else {myszX=netX-b.scrollLeft; myszY=netY-b.scrollTop;}

	tempX=myszX+pX;
	if(tempX<0) tempX=0;
	tmp=b.clientWidth-myszX-pX-pop.offsetWidth-20;
	if(tmp<0) {tempX+=tmp; if(tempX<0) tempX=0;}
	pop.style.left=b.scrollLeft+tempX+"px";

	tempY=myszY+pY;
	if(tempY<0) tempY=0;
	tmp=b.clientHeight-myszY-pY-pop.offsetHeight-15;
	if(tmp<0) {
		tmp=myszY-15-pop.offsetHeight;
		if(tmp>=0) tempY=tmp;
	}
	pop.style.top=b.scrollTop+tempY+"px";
}

function popPokaz(pX, pY, src) {
	init();
	pop.style.visibility='visible';
	pop.innerHTML=src;
	MoveToPop(pX,pY);
}

function ClosePop() {
	init();
	pop.style.visibility='hidden';
	pop.innerHTML='';
	pop.style.left=0;
	pop.style.top=0;
}

function ShowPop(tresc) {
	if(IE) {
		text=''+tresc+'';
	} else {
		text=''+tresc+'';
	}
	popPokaz(5,20,text);
}

function MovePop() {
	MoveToPop(5,20);
}
