var tReferenciaEstilo;
var tCapaVisible;
var tNavegador;

if(document.all) {
      tReferenciaEstilo = ".style.";
} else {
	if(document.layers) {
		tReferenciaEstilo = ".";
	} else {
		if(document.getElementById) {
			tReferenciaEstilo = ".style.";
		}
	}
}

function referenciaCapa(nombreCapa){
	if(document.all)
      return "document.all('"+nombreCapa+"')";
	else if(document.layers)
      return "document.layers['"+nombreCapa+"']";
	else if(document.getElementById)
      return "document.getElementById('"+nombreCapa+"')";
}

function setNombreCapa(itNombreCapa,itNavegador)
{
    if (itNavegador == "Netscape"){
        if(document.getElementById){
            return "document.getElementById['" + itNombreCapa + "'].";
        }

        if(document.layers){
            return "document.layers['" + itNombreCapa + "'].";
        }
    }else{
        return "document.all['" + itNombreCapa + "'].";
	}
}

function ocultarCapa(otNombreCapa)
{
  eval(referenciaCapa(otNombreCapa)+tReferenciaEstilo+'visibility = "hidden"');
}

function mostrarCapa(itNombreCapa) {

    //modifica la propiedad visibility de la capa referenciándola dinámicamente 
    eval(referenciaCapa(itNombreCapa) + tReferenciaEstilo + 'visibility = "visible"');

    //actualiza la variable global ncapaactual
    ncapaactual = itNombreCapa;
}
