var online_tooltip=function(){
	var id = 'ot';
	var top = 10;
	var left = 10;
	var maxw = 250;
	var speed = 10;
	var timer = 10;
	var endalpha = 90;
	var alpha = 10;
	var ot,c,h;
	var ie = document.all ? true : false;
	return{
		show:function(v,w){
			if(ot == null){
				ot = document.createElement('div');
				ot.setAttribute('id',id);
				c = document.createElement('div');
				c.setAttribute('id',id + 'cont');
				ot.appendChild(c);
				document.body.appendChild(ot);
				ot.style.opacity = 0;
				ot.style.filter = 'alpha(opacity=0)';
				document.onmousemove = this.pos;
			}
			ot.style.display = 'block';
			c.innerHTML = v;
			ot.style.width = w ? w + 'px' : 'auto';
			if(!w && ie){
				ot.style.width = ot.offsetWidth;
			}
			if(ot.offsetWidth > maxw){ot.style.width = maxw + 'px'}
			h = parseInt(ot.offsetHeight) + top;
			clearInterval(ot.timer);
			ot.timer = setInterval(function(){online_tooltip.fade(1)},timer);
		},
		pos:function(e){
			var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY;
			var l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX;
			ot.style.top = (u - h) + 'px';
			ot.style.left = (l + left) + 'px';
		},
		fade:function(d){
			var a = alpha;
			if((a != endalpha && d == 1) || (a != 0 && d == -1)){
				var i = speed;
				if(endalpha - a < speed && d == 1){
					i = endalpha - a;
				}else if(alpha < speed && d == -1){
					i = a;
				}
				alpha = a + (i * d);
				ot.style.opacity = alpha * .01;
				ot.style.filter = 'alpha(opacity=' + alpha + ')';
			}else{
				clearInterval(ot.timer);
				if(d == -1){ot.style.display = 'none'}
			}
		},
		hide:function(){
			clearInterval(ot.timer);
			ot.timer = setInterval(function(){online_tooltip.fade(-1)},timer);
		}
	};
}();
