
var offsetfromcursorX1=12 //Customize x offset of tooltip
var offsetfromcursorY1=10 //Customize y offset of tooltip
var offsetdivfrompointerX1=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY1=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).
document.write('<div id="dhtmltooltip1"><img src="img/loading.gif" id="minhaImagem"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer1" src="img/arrow2.gif">') //write out pointer image

var ie1=document.all
var ns61=document.getElementById && !document.all
var enabletip1=false
if (ie1||ns61)
var tipobj1=document.all? document.all["dhtmltooltip1"] : document.getElementById? document.getElementById("dhtmltooltip1") : ""
var tipoimg1=document.all? document.all["minhaImagem"] : document.getElementById? document.getElementById("minhaImagem") : ""
var pointerobj1=document.all? document.all["dhtmlpointer1"] : document.getElementById? document.getElementById("dhtmlpointer1") : ""
function ietruebody1(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function imagetip(thetext1, thewidth1, thecolor1, theimage){
if (ns61||ie1){
if (typeof thewidth1!="undefined") tipobj1.style.width=thewidth1+"px"
if (typeof thecolor1!="undefined" && thecolor1!="") tipobj1.style.backgroundColor=thecolor1

if(theimage!='' && thetext1!=''){
	var myimage= new Image();
	tipoimg1.src='img/loading.gif'
	enabletip1=true
	myimage.onload=function(){
		tipoimg1.innerHTML=''
		tipobj1.innerHTML=thetext1	
	}
	myimage.src=theimage

}
if(theimage!='' && thetext1==''){
	tipoimg1.src='img/loading.gif'
	enabletip1=true
	var myimage= new Image();
	myimage.src=theimage
	tipoimg1.src=myimage.src
	}


		//tipobj1.innerHTML=thetext1
		//enabletip1=true
	
return false
}
}
function positiontip1(e){
if (enabletip1){
var nondefaultpos1=false
var curX=(ns61)?e.pageX : event.clientX+ietruebody1().scrollLeft;
var curY=(ns61)?e.pageY : event.clientY+ietruebody1().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth1=ie1&&!window.opera? ietruebody1().clientWidth : window.innerWidth-20
var winheight1=ie1&&!window.opera? ietruebody1().clientHeight : window.innerHeight-20
var rightedge1=ie1&&!window.opera? winwidth1-event.clientX-offsetfromcursorX1 : winwidth1-e.clientX-offsetfromcursorX1
var bottomedge1=ie1&&!window.opera? winheight1-event.clientY-offsetfromcursorY1 : winheight1-e.clientY-offsetfromcursorY1
var leftedge=(offsetfromcursorX1<0)? offsetfromcursorX1*(-1) : -1000
if (rightedge1<tipobj1.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj1.style.left=curX-tipobj1.offsetWidth+"px"
nondefaultpos1=true
}
else if (curX<leftedge)
tipobj1.style.left="5px"
else{
tipobj1.style.left=curX+offsetfromcursorX1-offsetdivfrompointerX1+"px"
pointerobj1.style.left=curX+offsetfromcursorX1+"px"
}
if (bottomedge1<tipobj1.offsetHeight){
tipobj1.style.top=curY-tipobj1.offsetHeight-offsetfromcursorY1+"px"
nondefaultpos1=true
}
else{
tipobj1.style.top=curY+offsetfromcursorY1+offsetdivfrompointerY1+"px"
pointerobj1.style.top=curY+offsetfromcursorY1+"px"
}
tipobj1.style.visibility="visible"
if (!nondefaultpos1)
pointerobj1.style.visibility="visible"
else
pointerobj1.style.visibility="hidden"
}
}
function hideimagetip(){
if (ns61||ie1){
enabletip1=false
//tipobj1.innerHTML='<img src="img/loading.gif" id="minhaImagem">'
tipobj1.style.visibility="hidden"
pointerobj1.style.visibility="hidden"
tipobj1.style.left="-1000px"
tipobj1.style.backgroundColor=''
tipobj1.style.width=''
tipoimg1.src=''
}
}
document.onmousemove=positiontip1
