// Tooltip
var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0
if(ns){doc = "document."; sty = ""}
if(ie){doc = "document.all."; sty = ".style"}

var initialize = 0;
var pos;
var altura;
var Ex, Ey, topColor, subColor, ContentInfo;

if (ie) {
	Ex = "event.x"
	Ey = "event.y"
	topColor = "#0A2D6E"
	subColor = "#DEDBF1"
}
if (ns) {
	Ex = "e.pageX"
	Ey = "e.pageY"
	window.captureEvents(Event.MOUSEMOVE)
	window.onmousemove=overhere
	topColor = "#0A2D6E"
	subColor = "#BDC3D3"
}

function MoveToolTip (layerName, FromTop, FromLeft, e){
	if (altura == "up"){
		if(ie){eval(doc + layerName + sty + ".top = "  + (eval(FromTop) + document.body.scrollTop - 30))}
		if(ns){eval(doc + layerName + sty + ".top = "  +  (eval(FromTop) - 30))}
	} else {
		if(ie){eval(doc + layerName + sty + ".top = "  + (eval(FromTop) + document.body.scrollTop + 15))}
		if(ns){eval(doc + layerName + sty + ".top = "  +  (eval(FromTop) + 15))}
	}
	if (pos == "derecha"){
		eval(doc + layerName + sty + ".left = " + (eval(FromLeft) - 150))
	} else {
		eval(doc + layerName + sty + ".left = " + eval(FromLeft))
	}
}
function ReplaceContent (layerName) {
	if(ie){document.all[layerName].innerHTML = ContentInfo}
	if(ns){
		with(document.layers[layerName].document) {
			open(); 
			write(ContentInfo); 
			close(); 
		}
	}
}
function Activate(posi,alto){
	initialize=1;
	pos = posi;
	altura = alto;
}
function deActivate(){
	initialize=0;
	pos = "izquierda";
}
function overhere(e){
	if(initialize){
		MoveToolTip("ToolTip", Ey, Ex, e)
		eval(doc + "ToolTip" + sty + ".visibility = 'visible'")
	}else{
		MoveToolTip("ToolTip", 0, 0)
		eval(doc + "ToolTip" + sty + ".visibility = 'hidden'")
	}
}

function EnterContent(layerName, TTitle, TContent){
	ContentInfo = '<table border="0" width="150" cellspacing="0" cellpadding="0">'+
	'<tr><td width="100%" bgcolor="#999999">'+
	'<table border="0" width="100%" cellspacing="1" cellpadding="0">'+
	'<tr><td width="100%" bgcolor='+topColor+'>'+
	'<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+
	'<tr><td width="100%">'+
	'<font class="txt2">&nbsp;'+TTitle+'</font>'+
	'</td></tr>'+
	'</table>'+
	'</td></tr>'+
	'<tr><td width="100%" bgcolor='+subColor+'>'+
	'<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+
	'<tr><td width="100%">'+
	'<font class="txt1">'+TContent+'</font>'+
	'</td></tr>'+
	'</table>'+
	'</td></tr>'+
	'</table>'+
	'</td></tr>'+
	'</table>';
	ReplaceContent(layerName)
}
function abrepop(cual, nombre_pop, alto, ancho, ajustable, barras_de_scroll) {
	var ventana;
	if (ie) {
		window.open(cual, nombre_pop, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars='+barras_de_scroll+', resizable='+ajustable+', copyhistory=no, width='+ancho+', height='+alto+', top=0, left=0');
	} else if (ns) {
		window.open(cual, nombre_pop,'left=0,top=0,width=740,height=500,location=no,toolbar=no,directories=no,menubar=no,resizable='+ajustable+',scrollbars=yes,status=no');		
	} else {
		window.open(cual, nombre_pop, 'left=0,top=0,width='+ancho+',height='+(alto+5)+',location=no,toolbar=no,directories=no,menubar=no,resizable='+ajustable+',scrollbars=no,status=no');		
	}
}

