//tooltip
var offsetxpoint = 8; //Customize x offset of tooltip
var offsetypoint = 15; //Customize y offset of tooltip
var ie=document.all;
var ns6=document.getElementById && !document.all;
var enabletip=false;
function ietruebody(){
	if (document.documentElement && document.documentElement.clientHeight){
	// Explorer 6 Strict Mode{
		return document.documentElement;
	} else if (document.body){ // other Explorers
		return document.body;
	}


	return document.documentElement;
}
function showTip(thetext){
	var objeto = getElmById("tooltip");
	if(!objeto) return;
	var content='<table border="0" cellspacing="0" cellpadding="0">'+
			'<tr><td width="1" height="1"><img src="images/cuadro.gif" width="1" height="1" /></td><td class="css_tabla3" width="9" height="1"></td><td class="css_tabla3" height="1"></td><td class="css_tabla3" width="9" height="1"></td><td width="1" height="1"><img src="images/cuadro.gif" width="1" height="1" /></td></tr>'+
			'<tr><td class="css_tabla3" width="1"></td><td class="css_tabla3" width="9">&nbsp;</td><td class="css_tabla3"><font class="texto1">'+thetext+'</font></td><td class="css_tabla3" width="9">&nbsp;</td><td class="css_tabla3" width="1"></td></tr>'+
			'<tr><td width="1" height="1"><img src="images/cuadro.gif" width="1" height="1" /></td><td class="css_tabla3" width="9" height="1"></td><td class="css_tabla3" height="1"></td><td class="css_tabla3" width="9" height="1"></td><td width="1" height="1"><img src="images/cuadro.gif" width="1" height="1" /></td></tr>'+
		'</table>';
	objeto.innerHTML=content;
	enabletip=true;
	return false;
}
function positiontip(e){
	var elm = document.getElementById("tooltip");
	if (enabletip){
		var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft-offsetxpoint+7;//event.x+ietruebody().scrollLeft;
		var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop-offsetypoint+7;//event.y+ietruebody().scrollTop;
		
		var rightedge=ie? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20;
		var bottomedge=ie? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20;

		var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

		if (rightedge<elm.offsetWidth){
			elm.style.left=ie? ietruebody().scrollLeft+event.clientX-elm.offsetWidth+"px" : window.pageXOffset+e.clientX-elm.offsetWidth+"px";
		} else if (curX<leftedge){
			elm.style.left="-5px";
		} else {
			elm.style.left=curX+offsetxpoint+"px";
		}

		if (bottomedge<elm.offsetHeight){
			elm.style.top=ie? ietruebody().scrollTop+event.clientY-elm.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-elm.offsetHeight-offsetypoint+"px";
		}else{
			elm.style.top=curY+offsetypoint+"px";
			elm.style.visibility="visible";
		}
	}
}
function hideTip(){
	var elm = document.getElementById("tooltip");
	enabletip=false;
	elm.style.visibility="hidden";
	elm.style.left="-1000px";
	elm.style.backgroundColor="";
	elm.style.width="";
}

document.onmousemove = positiontip;