if (!is_ie) {
   document.captureEvents(Event.MOUSEMOVE);
   document.onmousemove = mousePos;
}

function mouseX()
{
	if (is_ie)
	{
	   tempX = document.body.scrollLeft + window.event.clientX;
	}
	if (tempX < 0)
	{
	   tempX=0;
	}

	return tempX;
}

function mouseY() {
	if (is_ie)
	{
	    tempY = document.body.scrollTop + window.event.clientY;
	}
	if (tempY < 0)
	{
	   tempY=0;
	}

	return tempY;
}

function mousePos(e)
{
	netX = e.pageX;
	netY = e.pageY;
}

var netX, netY;
var zawartosc_dymka = "";
var dx = 0;
var dy = 0;
var createId = 0;
var destroyId = 0;

function zrob_dymek()
{
	if (is_ie)
	{
	   document.all.dymek.style.visibility = 'visible';
	   document.all.dymek.innerHTML= zawartosc_dymka;
	   document.all.dymek.style.left = netX + dx + "px";
	   document.all.dymek.style.top = netY + dy + "px";
	}
	else
	{
		 document.getElementById("dymek").style.visibility = 'visible';
		 document.getElementById("dymek").style.left = netX + dx + "px";
		 document.getElementById("dymek").style.top = netY+ dy + "px";
		 document.getElementById("dymek").innerHTML = zawartosc_dymka;
	}
}

function przesun_dymek()
{
	if (is_ie)
	{
	   document.all.dymek.style.left = mouseX() + dx + "px";
	   document.all.dymek.style.top = mouseY() + dy + "px";
	}
	else
	{
		 document.getElementById("dymek").style.left = netX + dx + "px";
		 document.getElementById("dymek").style.top = netY + dy + "px";
	}
}

function usun_dymek()
{
	if (is_ie)
	{
		document.all.dymek.innerHTML = '';
		document.all.dymek.style.visibility = 'hidden';
	}
	else
	{
		 document.getElementById("dymek").style.visibility = 'hidden';
		 document.getElementById("dymek").innerHTML = '';
	}
	
	window.clearTimeout(createId);
	createId = 0;
	window.clearTimeout(destroyId);
	destroyId = 0;
}

function pokaz_dymek(str, create, destroy)
{
	zawartosc_dymka ='<TABLE CELLSPACING="0" CELLPADDING="5" BORDER="0" BGCOLOR="#F6F7F0">';
	zawartosc_dymka +='<TR><TD ALIGN="left" VALIGN="top"  STYLE="border: solid #000000 1px; font-family: Tahoma; font-weight: normal; font-style: normal; font-size: 11px; font-variant: normal; font-stretch: normal; color: #000000;">'+str+'</TD></TR>';
	zawartosc_dymka +='</TABLE>';
	
	if (is_ie)
	{
		netX = mouseX();
		netY = mouseY();
	}

	dx = 10;
	dy = 10;

	window.clearTimeout(createId);
	createId = window.setTimeout('zrob_dymek()', create);

	window.clearTimeout(destroyId);
	destroyId = window.setTimeout('usun_dymek()', destroy);
}

function pokaz_dymekl(str, create, destroy, offset, bgcolor)
{
	zawartosc_dymka ='<TABLE CELLSPACING="0" CELLPADDING="5" BORDER="0" BGCOLOR="'+bgcolor+'">';
	zawartosc_dymka +='<TR><TD ALIGN="left" VALIGN="top"  STYLE="border: solid #000000 1px; font-family: Tahoma; font-weight: normal; font-style: normal; font-size: 11px; font-variant: normal; font-stretch: normal; color: #000000;">'+str+'</TD></TR>';
	zawartosc_dymka +='</TABLE>';
	
	if (is_ie)
	{
		netX = mouseX();
		netY = mouseY();
	}

	dx = (10-offset);
	dy = 10;

	window.clearTimeout(createId);
	createId = window.setTimeout('zrob_dymek()', create);

	window.clearTimeout(destroyId);
	destroyId = window.setTimeout('usun_dymek()', destroy);
}
