/********Rutinas generales para los casos Javascript***********/
/***Objetos globales definidos aquí**********/
function oNavegador(  ) {
	this.nombre = navigator.appName;
	this.iniciar = iniciar;
	this.IE = this.nombre.toUpperCase().indexOf('MICROSOFT') >=0;
	this.NS = this.nombre.toUpperCase().indexOf('NETSCAPE') >=0;
	this.OP = this.nombre.toUpperCase().indexOf('OPERA') >= 0;
	this.XX = !this.IE && !this.NS && !this.OP;
	this.version = this.iniciar();
	this.Verent = parseInt(this.version);
	this.standard = (this.IE && this.Verent >=5) || (this.NS && this.Verent >=6)

/* ======================================================================
	FUNCION:	iniciar( ), miembro de oNavegador
	ARGS: 		none.
	DEVUELVE:	nada
	DESCRIP:	Inicializa los valores del objeto
====================================================================== */
  function iniciar() {
  var ver = navigator.appVersion;
  if(ver+"" != "NaN")
	if (this.IE)
		{
		ver.match(/(MSIE)(\s*)([0-9].[0-9]+)/ig);
  		ver = RegExp.$3;
		}
  return ver;
  } //Termina la funcion iniciar el objeto
}

window.miNavegador = new oNavegador()
window.miNavegador.iniciar();
/*=========================================================================
FUNCION:	objHtml(n, d), 
ARGS:		n: un atributo ID del elemento que se desea encontrar
			d: documento en el que se busca
RETURN:		Referencia javascript al elemento HTML cuyo ID es el atributo n
DESCRIP:	Esta función busca un elemento HTML (un nodo) cuyo atributo ID sea igual al 
			que se pasa como primer argumento ( n ). La b´suqueda se realiza en el árbol
			que se le indique como segundo argumento, si éste no existe la busqueda se 
			realiza en document de la ventana actual. La función es recursiva.
================================================================================*/			
function objHtml(n, d) { 
  var p,i,x;  
  if(!d) d=document; 
  if (miNavegador.standard)
	  x = d.getElementById(n)	
  if(!(x=d[n]) && miNavegador.IE) 
      x=d.all[n]; 
  for (i=0; !x && i<d.forms.length; i++) 
      x=d.forms[i][n];
  for(i=0; !x && d.layers &&i< d.layers.length; i++) 
      x=objHtml(n,d.layers[i].document); 
  return x;
}

/*=========================================================================
FUNCION:	mostrarBlq(bl, sn), 
ARGS:		bl: un elemento HTML 
			sn: lógico, true para hacer visible, false ocultar. Si no existe sólo lee
			el estado actual
RETURN:		Estado actual de visibilidad
DESCRIP:	Si el segundo parámetro existe muestra u oculta un bloque DIV. Además 
			devuelve el	estado actual. Si el segundo parámetro no existe sólo devuelve
			el estado actual. Comprueba el explorador usado.
================================================================================*/

function mostrarBlq(obj, sino)
{
var estado;
if (arguments.length >1)
	{
	estado = sino?'visible':'hidden';
	if (miNavegador.standard)
		obj.style.visibility = estado;
	else 
		obj.visibility = estado;
	}		
else
	{
	if (miNavegador.standard)
		estado = obj.style.visibility;
	else 
		estado = obj.visibility;
	}	
return estado;		
}