var Xoffset=15;    // modify these values to ...
var Yoffset=15;    // change the popup position.
var yyy=-1000;
var maxWidth = 200;
var poptimeout = null

function popup(msg,bak,minusit,minusY)
{
	Event.observe(document, 'mousemove', get_mouse, false);
	//clear the popper timeout
	try{
		window.clearTimeout(poptimeout);
		poptimeout = window.setTimeout("killpopup()",3000);
	}
	catch(err){}

	var popperDIV = $('popperDIV');
	if (!popperDIV.visible())
	{
		if (typeof(minusit)!='undefined')
		{
			if (minusit<0)
			{
				Xoffset = minusit;
			}
		}
		else
			Xoffset = 15;
		if (typeof(minusY)!='undefined')
		{
			if (minusY<0)
			{
				Yoffset = minusY;
			}
		}
		else
			Yoffset = 15;
		if (typeof(bak)=='undefined')
		{
			bak = '#FCFCE2';
		}
		var content="<DIV STYLE=\"width:"+maxWidth+"px;font-family:tahoma;font-size:10px;text-align:left;background-color:"+bak+";\"><TABLE STYLE=\"width:"+maxWidth+"px;font-family:tahoma;font-size:10px;text-align:left;background-color:"+bak+";border: 1px solid #000000\"><TR><TD>"+msg+"</TD></TR></TABLE></DIV>";
		yyy=Yoffset;
		popperDIV.update(content);
		//new Effect.Appear(popperDIV,{duration:0.5});

	
	}
}

function get_mouse(e)
{

	var popperDIV = $('popperDIV');
	var x = Event.pointerX(e);
	var y = Event.pointerY(e);
	popperDIV.style.left=x+Xoffset;
	//+ 'px';
	popperDIV.style.top=y+yyy;
	if (!popperDIV.visible())
	{
		Element.show(popperDIV);
	}
	//+ 'px';
}

function killpopup()
{
	var popperDIV = $('popperDIV');
	yyy=-1000;
	//new Effect.Fade(popperDIV,{duration:2});
	Element.hide(popperDIV);
	Event.stopObserving(document, 'mousemove', get_mouse, false);
}

//Event.observe(document, 'mousemove', get_mouse, false);

