
  
var popper = { 

	o : Object,							
	pop : Object,
	mouseX : 0,								
	mouseY : 0,															
	
	init : function() 
	{
		if ( !document.getElementById ||
			!document.createElement ||
			!document.getElementsByTagName )
		{
			return;
		}
	},
	
	grabMouse : function(e) {
		if ( document.captureEvents ) 
		{
			popper.mouseX = e.pageX;
			popper.mouseY = e.pageY;
		} else if ( window.event.clientX ) 
		{
			popper.mouseX = window.event.clientX+document.documentElement.scrollLeft;
			popper.mouseY = window.event.clientY+document.documentElement.scrollTop;
		}
	},
	
	popDestruct: function() {
		if ( window.tID ) {
			clearTimeout(tID);
		}
		if ( window.opacityID ) {
			clearTimeout(opacityID);
		}
		popper.pop.innerHTML = '';
		popper.pop.style.visibility = 'hidden';
	},
	
	popShow : function(e, filler, bColor, fColor, bdColor) {
		popper.o = this;
		popper.grabMouse(e);		
		var popX = Number(this.mouseX);
		var popY = Number(this.mouseY);
		var toppop = parseInt(popY+15);
		var leftpop = parseInt(popX+10);
		this.pop = document.createElement('div');
		this.pop.id = 'popper';
		this.pop.style.top = '0';
		this.pop.style.backgroundColor = bColor;
		this.pop.style.color = fColor;
		this.pop.style.borderColor = bdColor;
		this.pop.style.width = '250px';
		this.pop.style.visibility = 'hidden';
		document.getElementById('bf2online').appendChild(this.pop);
		this.pop.innerHTML = filler;
		if ( parseInt(document.documentElement.clientWidth+document.documentElement.scrollLeft) < parseInt(this.pop.offsetWidth+leftpop) ) {
			this.pop.style.left = parseInt(leftpop-(this.pop.offsetWidth+10))+'px';
		} else 
		{
			this.pop.style.left = leftpop+'px';
		}
		if ( parseInt(document.documentElement.clientHeight+document.documentElement.scrollTop) < parseInt(this.pop.offsetHeight+toppop) ) {
			this.pop.style.top = parseInt(toppop-(this.pop.offsetHeight+10))+'px';
		} else 
		{
			this.pop.style.top = toppop+'px';
		}
		this.pop.style.visibility = 'visible';
		this.pop.style.opacity = '.1';
		this.popFade(10);
	},
	
	popFade: function(alpha) 
	{
		var passed = parseInt(alpha);
		var newAlphaVal = parseInt(passed+10);
		if ( newAlphaVal < 90 ) 
		{
			this.pop.style.opacity = '.'+newAlphaVal;
			this.pop.style.filter = "alpha(opacity:"+newAlphaVal+")";
			opacityID = window.setTimeout("popper.popFade('"+newAlphaVal+"')",5);
		}
		else 
		{ 
			this.pop.style.opacity = '.90';
			this.pop.style.filter = "alpha(opacity:90)";
		}
	}
};
popper.init();
