var ocultar = "";
var etiqueta = "";
var ico_ant = "";

function cambiaEstado(iden,carpeta,tema)
  {
    var este = document.getElementById(iden);
	var icono = document.getElementById(carpeta);
//	alert(este.id);
    if (este.style.display == 'block')  {
	  //icono.src="img/ico_carpeta1.gif";
      este.style.display = 'none';
	} else {
	  //icono.src="img/ico_carpeta2.gif";
      este.style.display = 'block';
	}
    if (ocultar!= "" && este!=ocultar) {
	  //ico_ant.src="img/ico_carpeta1.gif";
      ocultar.style.display = 'none';
    }
	if (etiqueta != "") {
	  //icono.src="img/ico_carpeta1.gif";
      etiqueta.style.display = 'none';
    }
    ocultar=document.getElementById(iden);
	//ico_ant=document.getElementById(carpeta);
	document.location="#"+tema;
  }
  
function validar_normal(campo)
  {
    formulario=eval("document.forms[0].elements[campo]");  //llamando solicitud al formulario con el parámetro name
	//alert(document.datos.elements[campo].name);
    if (formulario.value == "" || formulario.value == "nada")
      {
	alert ("No puede dejar el campo ''"+formulario.name+"'' vacío");
	formulario.focus(); 
	//alert(formulario.value);
	return false;
      }
    else
      {
        return true;
     }
  }

function validar(formu,campo)
  {
    formulario=eval("document."+formu+".elements[campo]");  //llamando solicitud al formulario con el parámetro name
	//alert(document.datos.elements[campo].name);
    if (formulario.value == "" || formulario.value == "nada")
      {
	alert ("No puede dejar el campo ''"+formulario.name+"'' vacío");
	formulario.focus(); 
	//alert(formulario.value);
	return false;
      }
    else
      {
        return true;
     }
  }
  
function imagen_size(miimg) {
	if (miimg.width > 200) {
		porcentaje=(200*100)/miimg.width;
		reducido=(porcentaje*miimg.height)/100;
		miimg.width=200;
		miimg.height=reducido;
	}
}

