var offsetfrommouse=[15,25]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.

var defaultimageheight = 40;	// maximum image size.
var defaultimagewidth = 40;	// maximum image size.

var timer;
document.onmousemove=followmouse;
function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function showtrail(contenido){	
	$("contenido_globo").innerHTML=contenido;
	$("globo_ayuda").style.display='block';
}
function hide2(){	
	$("contenido_globo").innerHTML='';
	$("globo_ayuda").style.display='none';
}
function gettrailobj(){
	if (document.getElementById)
	return document.getElementById("globo_ayuda").style
}
function followmouse(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = e.pageX - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < defaultimageheight + 2*offsetfrommouse[1]){
			ycoord += e.pageY - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (defaultimageheight + 2*offsetfrommouse[1])){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}
	gettrailobj().left=xcoord-10+"px"
	gettrailobj().top=ycoord-5+"px"

}
function create_globo(texto){
	var htm='';
	htm+="<table border='0' cellpadding='0' cellspacing='0' width='200'>"+    
"  <tr>"+
"   <td colspan='3'><img name='globo_r2_c1' src='../images/globo_r2_c1.png' width='200' height='30' border='0' alt=''></td>"+
"   <td><img src='../images/spacer.gif' width='1' height='30' border='0' alt=''></td>"+
"  </tr>"+
"  <tr>"+
"   <td background='../images/globo_r3_c1.png'></td>"+
"   <td background='../images/globo_r3_c2.png' valign='top'>"+texto+"</td>"+
"   <td background='../images/globo_r3_c3.png'></td>"+
"   <td><img src='../images/spacer.gif' width='1' height='104' border='0' alt=''></td>"+
"  </tr>"+
"  <tr>"+
"   <td><img name='globo_r4_c1' src='../images/globo_r4_c1.png' width='7' height='14' border='0' alt=''></td>"+
"   <td><img name='globo_r4_c2' src='../images/globo_r4_c2.png' width='186' height='14' border='0' alt=''></td>"+
"   <td><img name='globo_r4_c3' src='../images/globo_r4_c3.png' width='7' height='14' border='0' alt=''></td>"+
"   <td><img src='../images/spacer.gif' width='1' height='14' border='0' alt=''></td>"+
"  </tr>"+
"</table>";
return htm;
}