var id = "qTip";
var background = "#f2f2f2";
var border = "1px solid #5a5a5a";
var display = "none";
var font = "11px Tahoma";
var color = "#5a5a5a";
var marginX = -155; //distancia do mouse em x
var marginY = -10; //distancia do mouse em y
var opacity = 95; // 0 a 100
var padding = "2px 5px";
var position = "absolute";
var _x = -10;
var _y = -10;
//
function setPos(event) {
	if (document.all) {//IE
		_x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		_y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		_x += (window.event.clientX+marginX);
		_y += (window.event.clientY+marginY);
	} else {//Good Browsers
		_x = (event.pageX+marginX - 10);
		_y = (event.pageY+marginY - 10);
	}
}
//
function showTip(text) {
	var t = document.getElementById(id);
	t.style.display = "block";
	document.onmousemove = function(event) {
		setPos(event);
		t.innerHTML = text;
		t.style.left = _x+"px";
		t.style.top = _y+"px";
	}
}
//
function hideTip() {
	var t = document.getElementById(id).style;
	t.display = "none";
}
//
function tooltip() {
	var t = document.getElementById(id).style;
	t.background = background;
	t.border = border;
	t.display = display;
	t.font = font;
	t.color = color;
	t.opacity = opacity/100;
	t.filter = "alpha(opacity="+opacity+")";
	t.padding = padding;
	t.position = position;
	t.width = '150px';
	var links = document.getElementsByTagName("a");
	for (i=0; i<links.length; i++) {
		var title = links[i].getAttribute("alt");
		if (title) {
			links[i].setAttribute("tptitle", title);
			links[i].removeAttribute("alt");
			links[i].onmouseover = function() { showTip(this.getAttribute("tptitle")); }
			links[i].onmouseout = function() { hideTip(); }
		}

	}
	
	
}
