/* AUTHOR: Orestes Gonzalez */
/* CREATION DATE: 28/09/2000 */

function Navegador() {
  this.NS4 = document.layers;
  this.IE4 = document.all;
  this.DOM = document.getElementById;
  this.DHTML = this.NS4 || this.IE4 || this.DOM;

  layerRef    =(this.IE4)?'document.all' :'document.layers';
  styleSwitch =(this.IE4)?'.style':'';
  
}

var sp = new Navegador();

function mostrarCapa() {
  eval(this.capaRefStr + this.styleRefStr + '.visibility = "visible"');	
  if (sp.DOM){
      this.domRef.style.visibility = "visible";
  	  this.domRef.style.display = "block";
  }	  
}

function ocultarCapa() {
  eval(this.capaRefStr + this.styleRefStr + '.visibility = "hidden"');	
  if (sp.DOM){
      this.domRef.style.visibility = "hidden";
//	  this.domRef.style.display = "none";
  }	
}

function PosicionCapa(left,top) {
  eval(this.capaRefStr + this.styleRefStr + this.topRefStr + ' = top');
  eval(this.capaRefStr + this.styleRefStr + this.leftRefStr + ' = left');
  if (sp.DOM){
//	this.domRef.style.display = "none";
    this.domRef.style.top = top;
    this.domRef.style.left = left;
  }
}

function Capa(capaID, left, top, width) {

  this.mostrar = mostrarCapa;
  this.ocultar = ocultarCapa;
  this.cambiarPosicion = PosicionCapa;
  
  if (sp.DOM) {
    this.domRef = document.getElementById(capaID);
	this.domRef.style.width = width;
//    this.domRef.style.display = "none";
  }
  this.capaRefStr  = (sp.NS4)  ? 'document["'+capaID+'"]' :
                    ((sp.IE4)  ? 'document.all["'+capaID+'"]' : 'this.domRef');
  this.styleRefStr = (sp.NS4)  ? ' ' : '.style';
  this.topRefStr   = (sp.NS4)  ? '.top':'.pixelTop' ;
  this.leftRefStr  = (sp.NS4)  ? '.left':'.pixelLeft' ;
  this.cambiarPosicion( left, top);
}

function mago(ident){
            if(sp.DOM)
		        document.getElementById(ident).style.visibility = (document.getElementById(ident).style.visibility=="visible")?"hidden":"visible";
           	 else{
			 if(eval(layerRef+'["'+ident+'"]'+styleSwitch+'.visibility=="visible"'))
		       eval(layerRef+'["'+ident+'"]'+styleSwitch+'.visibility="hidden"');
			 else
			   eval(layerRef+'["'+ident+'"]'+styleSwitch+'.visibility="visible"');
			 }
}

function ocultar(ident){
            if(sp.DOM)
		        document.getElementById(ident).style.visibility = "hidden";
           	 else
			   eval(layerRef+'["'+ident+'"]'+styleSwitch+'.visibility="hidden"');
}

function mostrar(ident){
            if(sp.DOM)
		        document.getElementById(ident).style.visibility = "visible";
           	 else
			   eval(layerRef+'["'+ident+'"]'+styleSwitch+'.visibility="visible"');
}

/*
function bgC( ident, color ){
            if(sp.DOM)
		        document.getElementById(ident).style.background = color;
           	 else
			   eval(layerRef+'["'+ident+'"]'+styleSwitch+'.background='+color);
}
*/

