//-- Popup

function PopUp(popupid, v)
{
	this.popup = document.getElementById(popupid);
	this.element = document.getElementById(v);
	this.delay = 500;
	this.sticky = !true;
	
	this.element.onmousemove = this.mouseMove;
	this.element.onmouseout = this.mouseOut;
	this.element.popup = this;
	
	this.visible = false;
	this.loading = false;
	
	this.hidePopup();
}

PopUp.prototype.hidePopup = function()
{
	this.visible = false;
	
	this.popup.style.visibility = "hidden";
	this.popup.style.position = "absolute";
	this.popup.style.left = "-3000px";
	this.popup.style.top = "-3000px";
}

PopUp.prototype.showPopup = function(x, y)
{
	if(this.loading || this.visible)
	{
		this.popup.style.visibility = "visible";
		this.popup.style.position = "absolute";
		this.popup.style.left = (x+9)+"px";
		this.popup.style.top = (y+9)+"px";
		this.visible = true;
	}
}

PopUp.prototype.mouseOut = function()
{
	var this_ = this.popup;
	this_.hidePopup();
}

PopUp.prototype.mouseMove = function(event)
{
	if(!event)
		event = window.event;
	var this_ = this.popup;
	var pos = getOffsetP(this_.element);
	var pos2 = getOffset(this_.element);
	if(!this_.visible)
		{
			this_.loading = true;
				this_.showPopup(event.clientX-pos2.left+pos.left, event.clientY-pos2.top+pos.top);
		}
	else if(!this_.sticky)
	{
		this_.showPopup(event.clientX-pos2.left+pos.left, event.clientY-pos2.top+pos.top);
	}
}