// función para ampliar la imagen
function amplia() {
	cadena = "showpic.php?idp=" + arguments[0]
	window.open(cadena,"shfoto","width=150,height=150,toolbar=no,buttons=no,resizable=no")
	}

// Funciones de Fredy
function cambiar_color (celda, texto) {
	comp = "menu"+seccionSeleccionada;
	
	if(texto != comp) {
		celda.style.backgroundColor = '#003D6C';
		document.getElementById(texto).style.color = '#FFFFFF';
		}
}
function volver_color (celda, texto) {
	comp = "menu"+seccionSeleccionada;
	
	if(texto != comp) {
		celda.style.backgroundColor = '#DDE6EC';
		document.getElementById(texto).style.color = '#003D6C';
		}
}
function cambiar_color_a (texto) {
	texto.style.color = '#98B1C5';
}
function volver_color_a (texto) {
	texto.style.color = '#003D6C';
}
/*
function cambiar_color_b (elemento1, elemento2, elemento3) {
	elemento1.style.backgroundColor = '#003D6C';
	document.getElementById(elemento2).style.color = '#FFFFFF';
	document.getElementById(elemento3).src = 'img/cuadrado2.gif';
}
function volver_color_b (elemento1, elemento2, elemento3) {
	elemento1.style.backgroundColor = '#DDE6EC';
	document.getElementById(elemento2).style.color = '#000000';
	document.getElementById(elemento3).src = 'img/cuadrado1.gif';
}
*/
function mostrar_menu (objeto1, objeto2, objeto3, objeto4) {
    if (document.getElementById(objeto1).style.display == 'none') {
        document.getElementById(objeto1).style.display = 'inline';
		document.getElementById(objeto2).innerHTML = '-';
		objeto3.style.borderBottom = 'solid #003D6C 1px';
		objeto3.style.borderLeft = 'solid #003D6C 1px';
		document.getElementById(objeto4).style.borderBottom = 'none';
    } else {
        document.getElementById(objeto1).style.display = 'none';
		document.getElementById(objeto2).innerHTML = '+';
		objeto3.style.borderBottom = 'none';
		objeto3.style.borderLeft = 'none';
		document.getElementById(objeto4).style.borderBottom = 'solid #003D6C 1px';
    }
}

function seleccionaSeccion() {
	var cual = "tds"+arguments[0];
	var texto = "menu"+arguments[0];
	
	document.getElementById(cual).style.backgroundColor = '#003D6C';
	document.getElementById(texto).style.color = '#FFFFFF';
	}

function sihacefalta() {
	if(destino_datos) {
		if(destino_datos.document.body.scrollHeight  > 320) document.getElementById('flechasImg').style.visibility = 'visible'
		else document.getElementById('flechasImg').style.visibility = 'hidden'
		}
	}

function sihacefaltaL() {
	if(destino_listado) {
		if(destino_listado.document.body.scrollHeight  > 290) document.getElementById('flechasImgL').style.visibility = 'visible'
		else document.getElementById('flechasImgL').style.visibility = 'hidden'
		}
	}

var a
var b

function scrollUp() {
	destino_datos.scrollBy(0,2)
	a = setTimeout("scrollUp()",40)
	}
function scrollDown() {
	destino_datos.scrollBy(0,-2)
	a = setTimeout("scrollDown()",40)
	}
function stopScroll() {
	clearTimeout(a);
	}

function scrollUpL() {
	destino_listado.scrollBy(0,2)
	b = setTimeout("scrollUpL()",40)
	}
function scrollDownL() {
	destino_listado.scrollBy(0,-2)
	b = setTimeout("scrollDownL()",40)
	}
function stopScrollL() {
	clearTimeout(b);
	}