function contraer(bloque,skin){
	contraerTodos(bloque,skin);
	cambiarEstado(bloque,skin);
}
function contraerTodos(capa,skin){
	var todos = menus.split("|");
	for(var i=0;i<todos.length;i++){
		if(todos[i]!=capa){
				if(document.getElementById(todos[i])!=null){
					document.getElementById(todos[i]).style.visibility = "hidden";
					document.getElementById(todos[i]).style.display = "none";
					//document.getElementById(todos[i]+"_t").style.color = "#FFFFFF"
					//eval('document.' + 'img_' + todos[i] + '.src = "images/"+skin+"/menu0.gif"');
				}
		}
	}
}
function cambiarEstado(bloque,skin){
	try{
		if (document.getElementById(bloque).style.visibility == "visible"){
			document.getElementById(bloque).style.visibility = "hidden";
			document.getElementById(bloque).style.display = "none";
			//document.getElementById(bloque+"_t").style.color = "#FFFFFF"
			//eval('document.' + 'img_' + bloque + '.src = "images/"+skin+"/menu0.gif"');
		}else{
			document.getElementById(bloque).style.visibility = "visible";
			document.getElementById(bloque).style.display = "block";
			//document.getElementById(bloque+"_t").style.color = "#990000"
			//eval('document.' + 'img_' + bloque + '.src = "images/"+skin+"/menu1.gif"');
		}
	}catch(Exception){}
}
function obtenerConexion(){
	var objConn;
	try {
    	objConn = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (Exception) {
    	try { 
        	objConn= new ActiveXObject ("Microsoft.XMLHTTP");
        } catch (Exception2) {
        	objetus= false; 
        } 
    }
    if (! objConn && typeof XMLHttpRequest!= 'undefined') {
        objConn = new XMLHttpRequest();
    } 
    return objConn
}
var objetoConn = obtenerConexion();

function actualizar(){
	/*objetoConn.open("POST", "pedir_num_expedientes.asp", false);
	objetoConn.send(null);

	var alertas = objetoConn.responseText.split(",");
	//window.document.getElementById("estado_conexion").innerHTML = objetoConn.responseText;
	for(var i=0;i<alertas.length;i++){
		var Numero_alerta = (isNaN(alertas[i]))? "-" : alertas[i];
		try{
			if(!isNaN(Numero_alerta)){
				window.document.getElementById("alerta"+i).innerHTML = ""+alertas[i]+"";
			}else{
				//window.document.getElementById("estado_conexion").innerHTML = objetoConn.responseText
			}
		}catch(Exception){
			
		}
	}
	setTimeout("actualizar()",2000) */
}

var empezar = false
var retardo 
var ocultar

function muestra(capa){
	xShow(capa);
}
function oculta(capa){
	xHide(capa);
}
function posiciona(){
	try{
		for (i=0;i<capas.length;i++){
			posx= xOffsetLeft(anclas[i])
			posy= xOffsetTop (anclas[i])
			xMoveTo(capas[i],posx+50,posy+21)
		}
	}catch(e){}
}

/*window.onload = function() {
	posiciona();
	empezar = true;
}*/
window.onresize = function() {
	posiciona();
}

function muestra_coloca(capa){
	try{
		if (empezar){
			for (i=0;i<capas.length;i++){
				if (capas[i] != capa) xHide(capas[i]);
			}
			clearTimeout(retardo);
			xShow(capa);
		}
	}catch(e){}
}

function oculta_retarda(capa){
	if (empezar){
		ocultar =capa;
		clearTimeout(retardo);
		retardo = setTimeout("xHide('" + ocultar + "')",1000);
	}
}

function muestra_retarda(ind){
	if (empezar){
		clearTimeout(retardo);
	}
}

function entrar(src,color_entrada) {
	src.bgColor=color_entrada;
}
function salir(src,color_default) {
	src.bgColor=color_default;
}

function Cambio(link,color_entrada){
	document.link.color=color_entrada;
}
