/***************** CONSTRUCTOR oAviso **********************/ function oAviso() { this.nomVariable = 'aviso'; this.idCapa = 'capaAviso'; this.tipo = 'error'; this.codError = 'codError'; this.descBreve = 'descBreve'; this.descLarga = 'descLarga'; this.textoBtnAceptar = 'Aceptar'; this.accionBtnAceptar = null; this.formulario = null; this.textoBtnCancelar = null; this.imgFondo = './igep/images/pestanyas/pix_trans.gif'; this.rutaImg = './igep/images/avisos/'; this.zIndice = 200; //ZIndex a partir del cual se trabaja this.ancho = 200; //Ancho de la capa de aviso this.alto = 200;//Alto de la capa de aviso //Tamaño en pixels del espacio donde se visualiza la página. ie = (document.all)? true:false; //Cambia de IE al resto if(ie) { this.anchoPagina = document.body.clientWidth; this.altoPagina = document.body.clientHeight; } else { this.anchoPagina = innerWidth; this.altoPagina = innerHeight; } /* Métodos */ this.mostrarAviso = f_oAviso_mostrarAviso; this.mostrarMensajeCargando = f_oAviso_mostrarMensajeCargando; this.set =f_oAviso_set; this.cerrarCapa = f_oAviso_cerrarCapa; this.capaBloqueo = f_oAviso_capaBloqueo; this.capaError = f_oAviso_capaError; this.enviaForm = f_oAviso_enviaForm; } /******************* SET ***********************************************/ function f_oAviso_set(nombre, idCapa, tipo, codError, descBreve, descLarga, textoBtnCancelar, textoBtnAceptar, nombreForm, accionBtnAceptar) { this.nomVariable = nombre; this.idCapa = idCapa; this.tipo = tipo.toUpperCase(); this.codError = codError; this.descBreve = descBreve; this.descLarga = descLarga; this.textoBtnCancelar = textoBtnCancelar; if (textoBtnAceptar) this.textoBtnAceptar = textoBtnAceptar; if ((nombreForm) && (nombreForm!='')) { this.formulario = eval('document.forms["'+nombreForm+'"]'); } else { this.formulario = document.forms[1]; } if (accionBtnAceptar) this.accionBtnAceptar = accionBtnAceptar; } function f_oAviso_enviaForm() { if(this.accionBtnAceptar!='') { this.formulario.action = this.accionBtnAceptar; } this.formulario.target = '_self'; this.formulario.submit(); this.cerrarCapa(); } /******************* CERRAR CAPA *************************************/ function f_oAviso_cerrarCapa(idObjGen) { var capaAviso = null; capaAviso = eval('document.getElementById("'+this.idCapa+'")'); capaAviso.style.display = "none"; var capaBloqueo = document.getElementById("capaBloqueo"); document.body.removeChild(capaBloqueo); if ((idObjGen!=null) && (idObjGen!='')) { document.getElementById(idObjGen).focus(); } } /******************* Mostrar Aviso *************************************/ function f_oAviso_mostrarAviso(objetoGenerador) { var capaAviso = null; var contenido = ''; var imgBk = ''; var cerrar = ''; var idObjGenerador =''; if (objetoGenerador !== undefined) { idObjGenerador = objetoGenerador.id; } else { idObjGenerador=''; } //Creamos la capa de bloqueo this.capaBloqueo(); //Creamos la capa de Error this.capaError(); switch(this.tipo) //Según el tipo de aviso... { case 'ERROR': case 'error': imgBk = this.rutaImg+'aviso-rojo.gif'; cerrar = this.rutaImg+'cerrar-rojo.gif'; break; case 'AVISO': case 'aviso': imgBk = this.rutaImg+'aviso-azul.gif'; cerrar = this.rutaImg+'cerrar-azul.gif'; break; case 'SUGERENCIA': case 'sugerencia': imgBk = this.rutaImg+'aviso-verde.gif'; cerrar = this.rutaImg+'cerrar-verde.gif'; break; case 'ALERTA': case 'alerta': imgBk = this.rutaImg+'aviso-amarillo.gif'; cerrar = this.rutaImg+'cerrar-amarillo.gif'; break; }; // Dibuja la ventana y fija el contenido de la capa //Formulario y campos ocultos para el manejo de mensajes contenido += '
';
contenido += '
| ';
contenido += '