// Navegador
var ie = document.all ? 1 : 0;
var ns = document.layers ? 1 : 0;

// popup
function abre_generica(cual, nombre_pop, alto, ancho, donde_x, donde_y, 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='+donde_y+', left='+donde_x+'');
	} else if (ns) {
		window.open(cual, nombre_pop,'left='+donde_x+',top='+donde_y+',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=yes,status=no');
	}
}
function cierraPop() { self.close(); }

// 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 Ex, Ey, topColor, subColor, ContentInfo;

if (ie) {
	Ex = "event.x";
	Ey = "event.y";
	topColor = "#21D220";
	subColor = "#FFFFFF";
}
if (ns) {
	Ex = "e.pageX";
	Ey = "e.pageY";
	window.captureEvents(Event.MOUSEMOVE);
	window.onmousemove=overhere;
	topColor = "#21D220";
	subColor = "#FFFFFF";
}

function MoveToolTip (layerName, FromTop, FromLeft, e){
	if(ie){eval(doc + layerName + sty + ".top = "  + (eval(FromTop) + document.body.scrollTop + 10))}
	if(ns){eval(doc + layerName + sty + ".top = "  +  eval(FromTop))}
	eval(doc + layerName + sty + ".left = " + (eval(FromLeft) + 15));
}
function ReplaceContent (layerName) {
	if(ie){document.all[layerName].innerHTML = ContentInfo}
	if(ns){
		with(document.layers[layerName].document) {
			open(); 
			write(ContentInfo); 
			close(); 
		}
	}
}
function Activate(){initialize=1;}
function deActivate(){initialize=0;}
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 cellspacing="1" cellpadding="5" align="center" border="0">'+
	'<tr><td class="f1" style="border-left: 1px solid #809995;">'+TTitle+'</td></tr>'+
	'<tr><td width="100%" class="f4" style="border-left: 1px solid #809995; border-bottom: 1px solid #809995;"><b>'+TContent+'</b></td></tr>'+
	'</table>';
	ReplaceContent(layerName)
}
function sacaComillas(palabra){
	var aux
	aux=palabra;
	while(aux.indexOf('"',0)!=-1){
		aux=aux.replace('"','');
	}
	return aux;
}

