function resize()
{
	x = 0;
	x = document.body.clientHeight;
	if (x == 0) x = window.innerHeight;
	tope = 228; // 228px es la distancia del top del documento al top del div.
	fondo = 60; //  60px es la distancia del bot del documento que debe haber al bot del div.
	alto = x - tope - fondo;
	if (alto <= 0) return;
	
	if (document.getElementById("d_lista") != null) document.getElementById("d_lista").style.height = alto;
	
	if (document.getElementById("d_lst") != null) {
		alto = x - tope - 110;
		document.getElementById("d_lst").style.height = alto;
	}
}
sref = "";
letraini = "";
this.onload = function() {
	dobjs = document.getElementsByTagName("div");
	for (idiv = 0; idiv < dobjs.length; idiv++) {
		if (dobjs[idiv].innerHTML.indexOf("Resultados al") == 0) dobjs[idiv].innerHTML = dobjs[idiv].innerHTML.substring(0, dobjs[idiv].innerHTML.length - 13);
	}
	checaurl();
	sref = location.href.split("/");
	letraini = sref[sref.length - 1].charAt(0)
	resize();
	rowhoverer();
	btncolorer();
}
this.onresize = resize;

function checaurl()
{
	cualurl = window.location.hostname;
	if (cualurl == "pp.sipre.org.mx" || cualurl == "cee.sipre.org.mx" || cualurl == "mty.sipre.org.mx" || cualurl == "cme.sipre.org.mx" || cualurl == "sp.sipre.org.mx" || cualurl == "siprecee:8088" || cualurl == "sipremty:8088" || cualurl == "sipretriara:8088") {
		document.getElementById("d_addthis").style.display = "none";
	}
}

function rowhoverer()
{
	if (navigator.appName.indexOf("Microsoft") < 0) return;
	
	ColorCambio = (letraini == "c" ? "black" : "white");
	
	latabla = document.getElementById("t_body");
	if (latabla == null) return;
	
	for (i = 0; i < latabla.rows.length; i++) {
		latabla.rows[i].onmouseover = function() {
			this.style.background = "#fdb913";
		}
		latabla.rows[i].onmouseout = function() {
			this.style.background = "";
		}
	}
}

function btncolorer()
{
	if (letraini != "c" && letraini != "g" && letraini != "a" && letraini != "p") return;
	if (letraini == "c" && document.getElementById("lc") != null) document.getElementById("lc").style.color = "silver";
	if (letraini == "g" && document.getElementById("lg") != null) document.getElementById("lg").style.color = "silver";
	if (letraini == "a" && document.getElementById("la") != null) document.getElementById("la").style.color = "silver";
	if (letraini == "p" && document.getElementById("lp") != null) document.getElementById("lp").style.color = "silver";
}
