// capasctr.js - Requires JavaScript 1.1
/* Control de capas internavegadores.  
   Necesita los ficheros ua.js y xbStyle.js desarrollados por Netscape Communications.
   Copyright 2001 FJLA. Distribuible bajo GNU como el código de los ficheros antedichos. 
   Revision 1.0 Octubre 2001
*/
function xbStyleCheck()
{
	if (navigator.family == 'gecko')
		return true;
	else if (navigator.family == 'nn4')
		return true;
	else if (navigator.family == 'ie4')
	        return true;
	else
                alert('Es necesario un navegador Netscape Navigator 4, Netscape 6, uno reciente basado en Mozilla o Internet Explorer 5 para Windows');
	return false;
}

function doHide(capa)
{
	var elm;
	var styleObj;
	elm = document.getElementById(capa);
	if (!elm)
		alert(capa+' no encontrada.');
	else
	{
		styleObj = new xbStyle(elm);
		styleObj.setVisibility('hidden');
	}
}

function doShow(capa)
{
	var elm;
	var styleObj;
	elm = document.getElementById(capa);
	if (!elm)
		alert(capa+' no encontrada.');
	else
	{
		styleObj = new xbStyle(elm);
		styleObj.setVisibility('visible');
	}
}

function doInfoVisibility(capa)
{
	var elm;
	var styleObj;
	elm = document.getElementById(capa);
	if (!elm)
		alert(capa+' no encontrada!');
	else
	{
		styleObj = new xbStyle(elm);
		return styleObj.getVisibility();
	}
}

function doShowHide(capa)
{ 
	switch( doInfoVisibility(capa).toLowerCase()) {
	case 'visible' :
          doHide(capa);
	  break;
	case 'hidden' :
	  doShow(capa);
	  break;
	case '':
	  doShow(capa);
          break;
	}
}

