//													//
//			inicializacao das variaveis				//
//													//

var intOffsetX= -150;
var intOffsetY= 14;
var bolTip=false;

function fncLigarTip( strObjeto , strTitulo ) {

	if( document.getElementById( strObjeto ) ) {
		strValor = document.getElementById( strObjeto );
		strMensagem = strValor.value;
	}
	
	strTexto="";

	if( strTitulo ) {
		strTexto += "<div class='TooltipTitulo'>" + strTitulo + "</div>";
	}

	strTexto += "<div class='TooltipMensagem'>" + strMensagem + "</div>";
	
	//																//
	//			obtem a referencia para elementos html				//
	//																//
	
	tipElemento=document.getElementById("Tooltip");
	
	//												//
	//				modifica o conteudo				//
	//												//
	
	tipElemento.innerHTML=strTexto;
	
	//											//
	//			habilita o tooltip				//
	//											//
	
	bolTip=true;
	
	//											//
	//			retorno da funcao				//
	//											//
	
	return false;
}

//												//
//			reposiciona a tooltip				//
//												//

function fncPosicionarTip( objMouse ) {
	if( bolTip ) {
		
		//														//
		//			obtem as coordenadas do mouse				//
		//														//
		
		objMouse = objMouse || window.event; // hack para IE
				
		if( objMouse.pageX || objMouse.pageY ) { // hack para IE
			intX = objMouse.pageX;
			intY = objMouse.pageY;
		} else {
			intX = objMouse.clientX;
			intY = objMouse.clientY;
			intX += document.documentElement.scrollLeft;
			intY += document.documentElement.scrollTop;
		}
		
		//										//
		//			aplica o offset				//
		//										//
		
		intX += intOffsetX;
		intY += intOffsetY;
		
		//																//
		//			obtem a referencia para elementos html				//
		//																//
		
		tipElemento=document.getElementById("Tooltip");
		
		//												//
		//			modifica o estilo css				//
		//												//
		
		tipElemento.style.left = intX + "px";
		tipElemento.style.top = intY + "px";
		tipElemento.style.visibility = "visible";
	}
	return false;
}

//											//
//			desliga a tooltip				//
//											//

function fncDesligarTip() {
	bolTip=false;
	
	//																//
	//			obtem a referencia para elementos html				//
	//																//
	
	tipElemento=document.getElementById("Tooltip");
	
	//												//
	//			modifica o estilo css				//
	//												//
	
	tipElemento.style.visibility="hidden";
}

//										//
//			chama a funcao				//
//										//

document.onmousemove=fncPosicionarTip;