var IE = document.all?true:false

if (!IE) {
   document.captureEvents(Event.MOUSEMOVE);
   document.onmousemove=mousePos;
   var netX, netY;
}

function posX() {
	if (IE) {
	   tempX=document.body.scrollLeft + event.clientX;
	}
	if (tempX<0) {
	   tempX=0;
	}
	return tempX;
}

function posY(e) {
	if (IE) {
	    tempY = event.clientY + document.body.scrollTop;
	}
	if (tempY<0) {
	   tempY=0;
	}
	return tempY;
}

function mousePos(e) {
	netX=e.pageX;
	netY=e.pageY;
}

function popPokaz(pX, pY, src) {
	if (IE) {
	   document.all.pop.style.visibility='visible';
	   document.all.pop.innerHTML=src;
	   document.all.pop.style.left=posX()+pX+"px";
	   document.all.pop.style.top=posY()+pY+"px";
	}
	else {
		 document.getElementById("pop").style.visibility='visible';
		 document.getElementById("pop").style.left=netX+pX+"px";
		 document.getElementById("pop").style.top=netY+pY+"px";
		 document.getElementById("pop").innerHTML=src;
	}
}

function popPrzesun(pX, pY) {
	if (IE) {
	   document.all.pop.style.left=posX()+pX+"px";
	   document.all.pop.style.top=posY()+pY+"px";
	}
	else {
		 document.getElementById("pop").style.left=netX+pX+"px";
		 document.getElementById("pop").style.top=netY+pY+"px";
	}
}

function popZamknij() {
	if (IE) {
	   document.all.pop.innerHTML='';
	   document.all.pop.style.visibility='hidden';
	}
	else {
		 document.getElementById("pop").style.visibility='hidden';
		 document.getElementById("pop").innerHTML='';
	}
}

function popKom(tresc,co) {
	text='<table width=280 nowrap cellspacing=0 cellpadding=0 cellpadding=0 border=0><tr><td colspan=3 bgcolor=#FC2767 height=1></td></tr>';
	text+='<tr><td width=1 bgcolor=#FC2767></td><td style="background-color: #C30E45; font-size:12px;" align=center><div style="margin:5px;font-family:verdana;font-size:11px; color:#ffffff;">'+tresc+'</div></td><td width=1 bgcolor=#FC2767></td><td width=1 rowspan=1 bgcolor=#FC2767></td></tr>';
	text+='<tr><td width=1 bgcolor=#FC2767></td><td style="background-color:#ffffff; font-size:12px;" align=center><div style="margin:5px; font-family:verdana;font-size:11px; color:#ff0000;">'+co+'</div></td><td width=1 bgcolor=#FC2767></td><td width=1 rowspan=1 bgcolor=#FC2767></td></tr>';
	text+='<tr><td colspan=2 bgcolor=#FC2767 height=1></td></tr><tr><td colspan=4 height=1 bgcolor=#FC2767></td></tr></table>';
	popPokaz(5, 20, text);
}

function popLinkPrzesun() {
	popPrzesun(5, 20);
}

function popSrodekPrzesun() {
	popPrzesun(-90, 20);
}
