/* Funciones de MMDW 3.0 */ function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i Date.parse(fcierre)){*/ if (!comparar_fechas(document.forma.fechainicio.value, document.forma.horainicio.value, document.forma.fechacierre.value, document.forma.horacierre.value)) { errors += 'La fecha de cierre debe ser mayor a la fecha de inicio.\n'; } for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe contener una direcci�n de e-mail.\n'; } else if (test!='R') { num = parseFloat(val); if (val!=''+num) errors+='- '+nm+' debe contener un n�mero.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num 0){ eval("document.forms[0]." + lstSecondary + ".options[0].selected = true"); } } /* Funci�n que redirecciona para detallar la info de un cliente*/ function clienteSoporte() { var cadena = 'Debe seleccionar un cliente primero'; var ruta = '../../ModuloCliente/formaCliente.asp?id_cliente='; if(document.forma.idcliente.value == 0){ alert(cadena); }else{ location.href = ruta + document.forma.idcliente.value + '&modulo=CL'; } } /* Funci�n que ordena */ function ordenar(orden) { document.forma.ordenar.value = orden; document.forma.submit(); } /* Funci�n que ordena */ function ordenar2(orden) { document.modo.ordenar.value = orden; document.modo.submit(); } /* Funci�n que ejecuta la paginaci�n */ function paginar(pag) { document.forma.pagina.value = pag; document.forma.submit(); } /* Funci�n que ejecuta la paginaci�n */ function paginarC(pag) { document.forma.paginaC.value = pag; document.forma.submit(); } /* Funci�n que ejecuta la paginaci�n */ function paginar2(pag) { document.modo.pagina.value = pag; document.modo.submit(); } /* Funci�n que filtra con los filtros predeterminados o shortcuts */ function modolista(valor) { document.modo.pagina.value = 1; document.modo.accionf.value = valor; document.modo.submit(); } /* Funci�n que filtra con los filtros predeterminados o shortcuts */ function modolistaf(valor) { document.forma.accionf.value = valor; document.forma.submit(); } /* Funci�n que filtra con los filtros predeterminados o shortcuts */ function modolistaAC() { document.formaSAC.submit(); } /* Funci�n que evalua la accion al enviar en el modo de forma */ function modoforma(valor) { if (valor == 2) { document.forma.reset(); if (document.forms.length > 1) { if (!(document.forma.modulo.value == 'AC')) { document.formaA.reset(); } } } else if (valor == 3) { if (!(document.forma.idasignado2.value == '') && (document.forma.solactivas.value == '1')) { location.href = 'cierre.asp?idsol=' + document.forma.idsol.value;} } else if (valor == 6) { document.formaA.accion.value = valor; document.formaA.submit(); } else { document.forma.accion.value = valor; document.forma.submit(); } } /* Funci�n que evalua la accion al enviar en el modo de forma */ function modoformabaja(valor) { if (valor == 1) { location.href = 'borraractivo.asp?id=' + document.forma.iddispositivo.value + '&iden=' + document.forma.identificador.value; } } /* Funci�n que evalua la accion al enviar en el modo de nuevo */ function modonuevo(valor) { if (valor == 2) { document.forma.reset(); } else { //document.forma.accion.value = valor; document.forma.submit(); } } /* Funci�n que evalua la accion al enviar en el modo de nuevo ----------------------------------------------------------------------------------- Modificaci�n: 1. Autor: John Alexander Ardila Fecha: 21-mar-2003 Descripci�n: Incluir validaci�n de longitud y caracteres especiales para evitar inconsistencia en al guardar en la BD, o al intentar mostrar el contenido en un control HTML. Ej: textarea name="xxx" value="Hasta aqui se mostrara" De aqui en adelante no debido a la comilla doble despues de la palabra mostrara..." Solicitud No. 4346 ----------------------------------------------------------------------------------- */ function modonuevofb(valor) { if (valor == 2) { document.forma.reset(); } else { if (document.forma.sugerencias.value.length > 500) { alert('El campo Sugerencia excede el tama�o maximo de caracteres.'); document.respValidacion = false; document.forma.sugerencias.focus(); } else { // comprobar que no contenga comillas ya que causan problemas en la generacion de la pagina y/o con la BD if ((document.forma.sugerencias.value.indexOf('"') >= 0) || (document.forma.sugerencias.value.indexOf("'") >= 0)) { alert('El campo Sugerencia contiene comillas dobles o sencillas.\n\nRetirelas y vuelva a intentar el proceso.'); document.respValidacion = false; document.forma.sugerencias.focus(); } else { document.forma.accion.value = valor; document.forma.submit(); } } } } /* ----------------------------------------------------------------------------------- Nombre: validarCamposFeedBack() Descripcion: Validar campos de las paginas de FeedBack, reemplaza a modonuevofb() y a validarForma() Parametros: valor Operacion a realizar: 1=Aprobar, 2=Reset, 3=Rechazar objForma Formulario sobre el cual se intenta validar Autor: John Alexander Ardila Fecha Creacion: 25-mar-2003 Modificaci�n: 1. Autor: John Alexander Ardila Fecha: 25-mar-2003 Descripci�n: Incluir validaci�n de longitud y caracteres especiales para evitar inconsistencia en al guardar en la BD, o al intentar mostrar el contenido en un control HTML. Ej: textarea name="xxx" value="Hasta aqui se mostrara" De aqui en adelante no debido a la comilla doble despues de la palabra mostrara..."/ Solicitud No. 4346 2. Autor: John Alexander Ardila Fecha: 26-mar-2003 Descripci�n: En botones [Ingresar FeedBack] y [Rechazar] cambiar el llamado a funcion modonuevofb(n) por accion(n) y validarForma(modo, modulo) por onMouseDown="validarCamposFeedBack(1, modulo, document.forma); return document.respValidacion;", a fin de evitar utilizar validarForma(...) debido a la extension de esta ultima. Cambio aplicado en: /TMS/ServicioCliente/ModuloFeedback/modoNuevo.asp /TMS/ServicioCliente/ModuloFeedback/modoforma.asp /TMS/ModuloDocumental/ModuloFeedback/modonuevo.asp /TMS/ModuloDocumentalPortal/ModuloFeedback/modoNuevo.asp /TMS/HelpDesk/ModuloFeedBack/modoNuevo.asp /TMS/ModuloAcademico/ModuloFeedback/modonuevo.asp /TMS/ModuloAcademico/ModuloFeedback/modoforma.asp /TMS/ServicioClientePortal/ModuloFeedBack/modoForma.asp Se creo la funcion validarCamposFeedBack(...) en ../../General/scripts.js Solicitud No. 4346 ----------------------------------------------------------------------------------- */ function validarCamposFeedBack(accion, modulo, objForma) { var strError = ''; // inicializar modo pesimista document.respValidacion = false; // Modo optimista, hacer que todos los controles del formulario sean opcionales, y luego especificar los que deben ser obligatorios, segun se requiere en funcion validarCampos(objForma, strError) for(var i = 0; i < objForma.length; i++) { var e = objForma.elements[i]; if (((e.type == "text") || (e.type == "textarea") || (e.type == "select-one"))) { e.optional = true; } } // obligatorios comunes objForma.idsol.optional = false; objForma.causa.optional = false; // de acuerdo a la accion if (accion == 2) { objForma.reset(); } else if (accion == 1) { // Ingreso FeedBack objForma.sugerencias.optional = true; /* if (modulo == 'SC') { // Especifico para 'SC' // Validar el usuario aprobador if (objForma.usuarioaprobador.value == '') { errores += '-El campo Usuario Aprobador es requerido.\n'; objForma.usuarioaprobador.focus(); } } */ // En Servicio al Cliente Portal no existe este campo, pero debe validarse en los demas modulos if (modulo != 'SCP' && modulo != 'SCF' && modulo != 'AAF') objForma.usuario.optional = false; // Validacion comun para todos los modulos if (objForma.sugerencias.value.length > 500) { strError += '-El campo Sugerencia excede el tama�o maximo de caracteres.\n'; objForma.sugerencias.focus(); } // comprobar que no contenga comillas ya que causan problemas en la generacion de la pagina y/o con la BD if ((objForma.sugerencias.value.indexOf('"') >= 0) || (objForma.sugerencias.value.indexOf("'") >= 0)) { strError = '-El campo Sugerencia contiene comillas dobles o sencillas.\nRetirelas y vuelva a intentar el proceso.\n'; objForma.sugerencias.focus(); } // Validar campos validarCampos(objForma, strError); } else if (accion == 3) { // Rechazo FeedBack objForma.sugerencias.optional = false; /* if (modulo == 'SC') { // Especifico para 'SC' // Validar el usuario aprobador if (objForma.usuarioaprobador.value == '') { errores += '-El campo Usuario Aprobador es requerido.\n'; objForma.usuarioaprobador.focus(); } } */ // En Servicio al Cliente Portal no existe este campo, pero debe validarse en los demas modulos if (modulo != 'SCP' && modulo != 'SCF' && modulo != 'AAF') objForma.usuario.optional = false; // Validacion comun para todos los modulos if (objForma.sugerencias.value.length > 500) { strError += '-El campo Sugerencia excede el tama�o maximo de caracteres.\n'; objForma.sugerencias.focus(); } // comprobar que no contenga comillas ya que causan problemas en la generacion de la pagina y/o con la BD if ((objForma.sugerencias.value.indexOf('"') >= 0) || (objForma.sugerencias.value.indexOf("'") >= 0)) { strError += '-El campo Sugerencia contiene comillas dobles o sencillas.\nRetirelas y vuelva a intentar el proceso.\n'; objForma.sugerencias.focus(); } // Validar campos validarCampos(objForma, strError); } } /* Funci�n que evalua la accion al enviar en el modo de filtro */ function modofiltro(valor) { if (valor == 2) { document.forma.reset(); } else { if (document.forma.accion) document.forma.accion.value = valor; document.forma.submit(); } } /* Funci�n que evalua la accion al enviar en el modo de cierre */ function modocierre(valor) { if (valor == 1) { document.forma.accion.value = valor; document.forma.submit(); } else if (valor == 2) { document.forma.reset(); } else if (valor == 4) { location.href = 'gastoparte.asp?asignado=' + document.forma.asignado2.value + '&idsol=' + document.forma.idsol.value; } else if (valor == 5) { history.back(); } else { location.href = 'cierre.asp?idsol=' + document.forma.idsol.value; } } /* Funci�n que evalua la accion al enviar en el modo de cierre */ function modogastoparte(valor) { if (valor == 2) { document.forma.reset(); } else if (valor == 3) { history.back(); } else { document.forma.accion.value = valor; document.forma.submit(); } } /* Funci�n que evalua la accion al enviar hacia la base de conocimiento */ function modobasecon(valor) { if (valor == 2) { document.forma.reset(); } else if (valor == 8) { document.forma.accionf.value = valor; document.forma.submit(); } else { document.forma.accion.value = valor; document.forma.submit(); } } /* Funci�n que evalua la accion al enviar en el modo de lista de historico de dispositivo */ function modohistorial(valor) { if (valor == 1) { history.back(); } } /* Funci�n que auto selecciona los elementos en las listas dependientes */ function autosel(numero) { if (!(numero == 0)) { if (!(document.formita.elements.length == 0)) { if (!(parent.opener.document.forma.elements[numero].value == '')) { for (var i = 0; i < document.formita.elements[0].options.length; i++) { if (document.formita.elements[0].options[i].value == parent.opener.document.forma.elements[numero].value) { document.formita.elements[0].selectedIndex = i; document.formita.elements[0].options[i].value = parent.opener.document.forma.elements[numero].value; } } if (!((numero == 26) || (numero == 29) || (numero == 20) || (numero == 12))) { actualizar_frame(); } } } } } /* Funci�n que muestra u oculta elementos dependientes */ function change(objID){ var obj = document.getElementById(objID); if (obj.style.display == "none") { obj.style.display = ''; } else { obj.style.display = "none"; } } /* Funci�n que muestra u oculta elementos dependientes */ function changeById(objID){ change(objID); } /* Funci�n actualiza la descripcion y la solucion en feedback */ function actualizarDescSol(){ var nested = document.all('calificacion'); eval('document.forma.descripcion.value = document.forma.d' + document.forma.idsol.options[document.forma.idsol.selectedIndex].value + '.value'); eval('document.forma.solucion.value = document.forma.s' + document.forma.idsol.options[document.forma.idsol.selectedIndex].value + '.value'); eval('document.forma.causa.value = document.forma.c' + document.forma.idsol.options[document.forma.idsol.selectedIndex].value + '.value'); eval('document.forma.problema.value = document.forma.p' + document.forma.idsol.options[document.forma.idsol.selectedIndex].value + '.value'); eval('document.forma.problema2.value = document.forma.p' + document.forma.idsol.options[document.forma.idsol.selectedIndex].value + '.value'); if (eval('document.forma.necesitafeedback' + document.forma.idsol.options[document.forma.idsol.selectedIndex].value + '.value == "A"')) { if (!(nested.style.display == "none")) { nested.style.display = "none"; } } else if (eval('document.forma.necesitafeedback' + document.forma.idsol.options[document.forma.idsol.selectedIndex].value + '.value == "S"')) { if (nested.style.display == "none") { nested.style.display = ''; } } } /* Funci�n que evaluar que controles deshabilitar */ function verificarControles() { //Si es tarea y no es supervisor y no es jefe, deshabilitamos delegable y vencimiento //if(document.forma.delegable) if (document.forma.delegable[1].checked) { //if(forma.supervisor) //if(document.forma.esjefe) if (!(document.forma.supervisor.value == '1') && !(document.forma.esjefe.value == 'true')) { document.forma.delegable[0].disabled = true; document.forma.delegable[1].disabled = true; //if(document.forma.vencimiento) document.forma.vencimiento.disabled = true; //if(document.forma.idasignado) document.forma.idasignado.disabled = true; } } //Si no esta el modulo de procesos, deshabilitamos tiposolicitud //if(document.forma.proceso) if (document.forma.proceso.value == '1') { //if(document.forma.tiposolicitud) document.forma.tiposolicitud.disabled = true; } } /* Funci�n que hace la validaci�n de la forma ----------------------------------------------------------------------------------- Modificaci�n: 1. Autor: John Alexander Ardila Fecha: 21-mar-2003 Descripci�n: Incluir validaci�n de longitud y caracteres especiales para evitar inconsistencia en al guardar en la BD, o al intentar mostrar el contenido en un control HTML. Ej: textarea name="xxx" value="Hasta aqui se mostrara" De aqui en adelante no debido a la comilla doble despues de la palabra mostrara..."/ Solicitud No. 4346 2. Autor: John Alexander Ardila Fecha: 05-may-2003 Descripci�n: Incluir validacion de campos obligatorios para el modulo de Servicio al Cliente en proceso Nuevo Solicitud No. 4727 3. Autor: John Alexander Ardila Fecha: 20-may-2003 Descripci�n: Retirar validacion de campos de SC-Solicitudes, no debe ser estricto por los asterisco rojos, sino relativos a Producto, o Usuario, o Nombre, o Nit/C.C. Solicitud No. 4973 4. Autor: Silvano Urrego R. Fecha: 02-Julio-2003. Descripci�n: Se omite la validaci�n de la fecha de inicio. La fecha de inicio puede ser menor a la fecha actual seg�n solicitud No. 4749. 5. Autor: Fecha: Descripci�n: ----------------------------------------------------------------------------------- */ function validarForma(modo, modulo){ var errores; var valf, valh, cFechaVen, tFechaVen, tFechaH; var tFechaIni, cFechaIni; errores = ''; /* MODO NUEVO */ if (modo == 'N') { /* HELP DESK */ if (modulo == 'HD') { if (document.forma.numdispo.value == '0') { /* Validar los requeridos absolutos */ if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo Tipo de Solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } /* Validar los requeridos relativos */ if ((document.forma.dispositivo.value == '') && (document.forma.usuario.value == '') && (document.forma.nombre.value == '') && (document.forma.ccnit.value == '') && document.forma.idusuarios1.value == '') { errores += '-El campo Dispositivo, o Usuario, o Nombre, o Nit/C.C. es requerido.\n'; } // Tama�os de campos. if (document.forma.descripcion.value.length > 5000) { errores += '-El campo descripcion excede el tama�o maximo\n.'; } } /* Validar la hora */ valh = document.forma.hora.value; if (!(valh == '')) { if (valh.length <= 5) { if ((valh.indexOf(':') == -1) || (isNaN(parseFloat(valh.substring(0,valh.indexOf(':',0))))) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) > 23) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) < 0) || (isNaN(parseFloat(valh.substring(3,valh.length)))) || (parseFloat(valh.substring(3,valh.length)) > 59) || (parseFloat(valh.substring(3,valh.length)) < 0) ) { errores += '-El campo hora debe contener una hora en el formato hh:mm.\n'; document.forma.hora.focus(); } } } /* Validar la fecha de vencimiento */ if (!(document.forma.vencimiento.value.length == 0)) { if (document.forma.hora.value.length == 0) { cFechaVen =document.forma.vencimiento.value + ' ' + '23:59'; errores += '-El campo Hora Vencimiento es Requerido.\n'; } else if (document.forma.hora.value == '00:00') { errores += '-El campo Hora Vencimiento debe ser diferente de 00:00\n'; cFechaVen = document.forma.vencimiento.value + ' ' + document.forma.hora.value; } else if (!IsDateVal(document.forma.vencimiento.value)){ errores+= "- El Campo " + document.forma.vencimiento.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.vencimiento.value + "\n"; } } /* Validar la hora inicio*/ valh = document.forma.horainicio.value; if (!(valh == '')) { if (valh.length <= 5) { if ((valh.indexOf(':') == -1) || (isNaN(parseFloat(valh.substring(0,valh.indexOf(':',0))))) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) > 23) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) < 0) || (isNaN(parseFloat(valh.substring(3,valh.length)))) || (parseFloat(valh.substring(3,valh.length)) > 59) || (parseFloat(valh.substring(3,valh.length)) < 0) ) { errores += '-El campo hora inicio debe contener una hora en el formato hh:mm.\n'; document.forma.hora.focus(); } } } /* Validar la fecha de inicio */ if (!(document.forma.timestamp.value.length == 0)) { if (document.forma.horainicio.value.length == 0) { cFechaIni =document.forma.timestamp.value + ' ' + '00:00'; errores += '-El campo Hora Inicio es Requerido.\n'; } else if (document.forma.horainicio.value == '00:00') { cFechaIni = document.forma.timestamp.value + ' ' + document.forma.horainicio.value; errores += '-El campo Hora Inicio debe ser diferente a 00:00\n'; } else if (!IsDateVal(document.forma.timestamp.value)){ errores+= "- El Campo " + document.forma.timestamp.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.timestamp.value + "\n"; } } /* MODULO COMERCIAL - COTIZACIONES*/ } else if (modulo == 'COT') { if (document.forma.tipocotizacion[2].checked) { if (document.forma.trim.value == '' || document.forma.trim.value == 0){ errores += '-El campo TRM es requerido.\n'; document.forma.trim.focus(); } } if (document.forma.nombre.value == '') { errores += '-El campo Nombre es requerido.\n'; document.forma.nombre.focus(); } if (document.forma.condicionescom.value.length > 900) { errores += '-El campo Condiciones Comerciales excede el tama�o maximo.\n'; document.forma.condicionescom.focus(); } /*valida el margen*/ if (!(document.forma.margen.value == '')) { if (!(parseFloat(document.forma.margen.value) == '' + document.forma.margen.value)) { errores += '-El campo margen debe ser num�rico.\n'; document.forma.margen.focus(); } } /*valida dias de vigencia*/ if (!(document.forma.diasvig.value == '')) { if (!(parseFloat(document.forma.diasvig.value) == '' + document.forma.diasvig.value)) { errores += '-El campo dias de vigencia debe ser num�rico.\n'; document.forma.diasvig.focus(); } } /*trm*/ if (!(document.forma.trim.value == '')) { if (!(parseFloat(document.forma.trim.value) == '' + document.forma.trim.value)) { errores += '-El campo trm debe ser num�rico.\n'; document.forma.trim.focus(); } } /* MODULO COMERCIAL - NEGOCIOS*/ } else if (modulo == 'CO') { if (document.forma.nom_cliente.value == '') { errores += '-El campo Nombre de cliente es requerido.\n'; } if (document.forma.desc_negociofilter.value.length > 300) { errores += '-El campo descripci�n excede el tama�o maximo.\n'; } /*numero de orden*/ //if (!(document.forma.num_ocomprafilter.value == '')) { // if (!(parseFloat(document.forma.num_ocomprafilter.value) == '' + document.forma.num_ocomprafilter.value)) { // errores += '-El campo orden de compra debe ser num�rico.\n'; // document.forma.num_ocomprafilter.focus(); // } //} /* MODULO AUTOAYUDA WIZARD*/ } else if (modulo == 'WZ') { if (document.forma.respuesta.value.length > 150) { errores += '-El campo respuesta excede el tama�o maximo.\n'; } /* SERVICIO AL CLIENTE */ } else if (modulo == 'SC') { if (document.forma.asignados == '' ) document.forma.idasignados =''; /* Validar los requeridos absolutos */ if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo Tipo de Solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } /* Validar los requeridos relativos */ if ((document.forma.producto.value == '') && (document.forma.usuario.value == '') && (document.forma.nombre.value == '') && (document.forma.ccnit.value == '') && document.forma.idusuarios1.value == '') { errores += '-El campo Producto, o Usuario, o Nombre, o Nit/C.C. es requerido.\n'; } // Tama�os de campos. if (document.forma.descripcion.value.length > 5000) { errores += '-El campo descripcion excede el tama�o maximo\n.'; } if (document.forma.detalledocumentos.value.length > 1000) { errores += '-El campo detalle documentos excede el tama�o maximo\n.'; document.forma.detalledocumentos.focus(); } /* Validar la hora */ valh = document.forma.hora.value; if (!(valh == '')) { if (valh.length <= 5) { if ((valh.indexOf(':') == -1) || (isNaN(parseFloat(valh.substring(0,valh.indexOf(':',0))))) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) > 23) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) < 0) || (isNaN(parseFloat(valh.substring(3,valh.length)))) || (parseFloat(valh.substring(3,valh.length)) > 59) || (parseFloat(valh.substring(3,valh.length)) < 0) ) { errores += '-El campo hora debe contener una hora en el formato hh:mm.\n'; document.forma.hora.focus(); } } } /* Validar la fecha de vencimiento */ if (!(document.forma.vencimiento.value.length == 0)) { if (document.forma.hora.value.length == 0) { cFechaVen =document.forma.vencimiento.value + ' ' + '23:59'; errores += '-El campo Hora Vencimiento es Requerido.\n'; } else if (document.forma.hora.value == '00:00') { errores += '-El campo Hora Vencimiento debe ser diferente de 00:00\n'; cFechaVen = document.forma.vencimiento.value + ' ' + document.forma.hora.value; } else if (!IsDateVal(document.forma.vencimiento.value)){ errores+= "- El Campo " + document.forma.vencimiento.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.vencimiento.value + "\n"; } } /* Validar la hora inicio*/ valh = document.forma.horainicio.value; if (!(valh == '')) { if (valh.length <= 5) { if ((valh.indexOf(':') == -1) || (isNaN(parseFloat(valh.substring(0,valh.indexOf(':',0))))) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) > 23) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) < 0) || (isNaN(parseFloat(valh.substring(3,valh.length)))) || (parseFloat(valh.substring(3,valh.length)) > 59) || (parseFloat(valh.substring(3,valh.length)) < 0) ) { errores += '-El campo hora inicio debe contener una hora en el formato hh:mm.\n'; document.forma.hora.focus(); } } } /* Validar la fecha de inicio */ if (!(document.forma.timestamp.value.length == 0)) { if (document.forma.horainicio.value.length == 0) { cFechaIni =document.forma.timestamp.value + ' ' + '00:00'; errores += '-El campo Hora Inicio es Requerido.\n'; } else if (document.forma.horainicio.value == '00:00') { cFechaIni = document.forma.timestamp.value + ' ' + document.forma.horainicio.value; errores += '-El campo Hora Inicio debe ser diferente a 00:00\n'; } else if (!IsDateVal(document.forma.timestamp.value)){ errores+= "- El Campo " + document.forma.timestamp.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.timestamp.value + "\n"; } } /* DOCUMENTAL */ } else if (modulo == 'DO') { /* Validar los requeridos absolutos */ if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo Tipo de Solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } if (document.forma.iddocumento.value == '') { errores += '-El campo Id Documento es requerido.\n'; document.forma.iddocumento.focus(); } /* Validar la hora */ valh = document.forma.hora.value; if (!(valh == '')) { if (valh.length <= 5) { if ((valh.indexOf(':') == -1) || (isNaN(parseFloat(valh.substring(0,valh.indexOf(':',0))))) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) > 23) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) < 0) || (isNaN(parseFloat(valh.substring(3,valh.length)))) || (parseFloat(valh.substring(3,valh.length)) > 59) || (parseFloat(valh.substring(3,valh.length)) < 0) ) { errores += '-El campo hora debe contener una hora en el formato hh:mm.\n'; document.forma.hora.focus(); } } } /* Validar la fecha de vencimiento */ if (!(document.forma.vencimiento.value.length == 0)) { if (document.forma.hora.value.length == 0) { cFechaVen =document.forma.vencimiento.value + ' ' + '23:59'; errores += '-El campo Hora Vencimiento es Requerido.\n'; } else if (document.forma.hora.value == '00:00') { errores += '-El campo Hora Vencimiento debe ser diferente de 00:00\n'; cFechaVen = document.forma.vencimiento.value + ' ' + document.forma.hora.value; } else if (!IsDateVal(document.forma.vencimiento.value)){ errores+= "- El Campo " + document.forma.vencimiento.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.vencimiento.value + "\n"; } } /* Validar la hora inicio*/ valh = document.forma.horainicio.value; if (!(valh == '')) { if (valh.length <= 5) { if ((valh.indexOf(':') == -1) || (isNaN(parseFloat(valh.substring(0,valh.indexOf(':',0))))) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) > 23) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) < 0) || (isNaN(parseFloat(valh.substring(3,valh.length)))) || (parseFloat(valh.substring(3,valh.length)) > 59) || (parseFloat(valh.substring(3,valh.length)) < 0) ) { errores += '-El campo hora inicio debe contener una hora en el formato hh:mm.\n'; document.forma.hora.focus(); } } } /* Validar la fecha de inicio*/ if (!(document.forma.timestamp.value.length == 0)) { if (document.forma.horainicio.value.length == 0) { cFechaIni =document.forma.timestamp.value + ' ' + '00:00'; errores += '-El campo Hora Inicio es Requerido.\n'; } else if (document.forma.horainicio.value == '00:00') { cFechaIni = document.forma.timestamp.value + ' ' + document.forma.horainicio.value; errores += '-El campo Hora Inicio debe ser diferente a 00:00\n'; } else if (!IsDateVal(document.forma.timestamp.value)){ errores+= "- El Campo " + document.forma.timestamp.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.timestamp.value + "\n"; } } /* E-BUSINESS */ } else if (modulo == 'EB') { /* Validar los requeridos */ if ((document.forma.NomProducto.value == '') || (document.forma.NomProducto.value == '0')) { errores += '-El campo de busqueda es requerido.\n'; document.forma.NomProducto.focus(); } /* SUBASTAS*/ } else if (modulo == 'SU') { /* Validar los requeridos */ if ((document.forma.NomProducto.value == '') || (document.forma.NomProducto.value == '0')) { errores += '-El campo de busqueda es requerido.\n'; document.forma.NomProducto.focus(); } /* ACTIVOS */ } else if (modulo == 'AC') { /* Validar los requeridos */ if ((document.forma.nivel.value == '') || (document.forma.nivel.value == '0')) { errores += '-El campo localizacion es requerido.\n'; document.forma.nivel.focus(); } if ((document.forma.tipo.value == '') || (document.forma.tipo.value == '0')) { errores += '-El campo tipo es requerido.\n'; document.forma.tipo.focus(); } if (document.forma.identificador.value == '') { errores += '-El campo identificador es requerido.\n'; document.forma.identificador.focus(); } /*Validar la unidad de tiempo*/ if ((document.forma.OptionGroup4.value == '')){ errores += '-El campo unidad de tiempo es requerido.\n'; document.forma.OptionGroup4.focus(); } /*Validar la cobertura diaria*/ if ((document.forma.tcobertura.value == '')){ errores += '-El campo tipo de cobertura es requerido.\n'; document.forma.tipocobertura.focus(); } /*Valida el t_critico*/ if (parseInt(document.forma.tcritico.value.length) == 0){ errores += '-El campo Tiempo critico es requerido.\n'; document.forma.tcritico.focus(); } /* Validar la coherencia de los tiempos */ if ((document.forma.tnormal.value != '') || (document.forma.tcritico.value != '') || (document.forma.texcedido.value != '') || (document.forma.tatencion.value != '') || (document.forma.tnotificacion.value != '')) { if (!(parseFloat(document.forma.tatencion.value) == '' + document.forma.tatencion.value)) { errores += '-El campo tiempo atencion debe ser num�rico.\n'; document.forma.tatencion.focus(); } if (!(parseFloat(document.forma.tnotificacion.value) == '' + document.forma.tnotificacion.value)) { errores += '-El campo tiempo notificacion debe ser num�rico.\n'; document.forma.tnotificacion.focus(); } if (!(parseFloat(document.forma.tnormal.value) == '' + document.forma.tnormal.value)) { errores += '-El campo tiempo normal debe ser num�rico.\n'; document.forma.tnormal.focus(); } if (!(parseFloat(document.forma.tcritico.value) == '' + document.forma.tcritico.value)) { errores += '-El campo tiempo critico debe ser num�rico.\n'; document.forma.tcritico.focus(); } if (!(parseFloat(document.forma.texcedido.value) == '' + document.forma.texcedido.value)) { errores += '-El campo tiempo excedido debe ser num�rico.\n'; document.forma.texcedido.focus(); } document.forma.tatencion.min = 0; document.forma.tatencion.max = document.forma.tnotificacion.value; document.forma.tnotificacion.min = document.forma.tatencion.value; document.forma.tnotificacion.max = document.forma.tnormal.value; document.forma.tnormal.min = document.forma.tnotificacion.value; document.forma.tnormal.max = document.forma.texcedido.value; document.forma.tcritico.min = 0; document.forma.tcritico.max = document.forma.texcedido.value; document.forma.texcedido.min = document.forma.tcritico.value; document.forma.texcedido.max = 99999.99; if (parseFloat(document.forma.tatencion.value) < parseFloat(document.forma.tatencion.min)) errores += '\n tatencion debe ser mayor que ' + document.forma.tatencion.min; if (parseFloat(document.forma.tatencion.value) > parseFloat(document.forma.tatencion.max)) errores += '\n tatencion debe ser menor que ' + document.forma.tatencion.max; if (parseFloat(document.forma.tnotificacion.value) < parseFloat(document.forma.tnotificacion.min)) errores += '\n tnotificacion debe ser mayor que ' + document.forma.tnotificacion.min; if (parseFloat(document.forma.tnotificacion.value) > parseFloat(document.forma.tnotificacion.max)) errores += '\n tnotificacion debe ser menor que ' + document.forma.tnotificacion.max; if (parseFloat(document.forma.tnormal.value) < parseFloat(document.forma.tnormal.min)) errores += '\n tnormal debe ser mayor que ' + document.forma.tnormal.min; if (parseFloat(document.forma.tnormal.value) > parseFloat(document.forma.tnormal.max)) errores += '\n tnormal debe ser menor que ' + document.forma.tnormal.max; if (parseFloat(document.forma.tcritico.value) < parseFloat(document.forma.tcritico.min)) errores += '\n tcritico debe ser mayor que ' + document.forma.tcritico.min; if (parseFloat(document.forma.tcritico.value) > parseFloat(document.forma.tcritico.max)) errores += '\n tcritico debe ser menor que ' + document.forma.tcritico.max; if (parseFloat(document.forma.texcedido.value) < parseFloat(document.forma.texcedido.min)) errores += '\n texcedido debe ser mayor que ' + document.forma.texcedido.min; if (parseFloat(document.forma.texcedido.value) > parseFloat(document.forma.texcedido.max)) errores += '\n texcedido debe ser menor que ' + document.forma.texcedido.max; if ((parseFloat(document.forma.tatencion.value) > parseFloat(document.forma.tnotificacion.value)) || (parseFloat(document.forma.tnotificacion.value) > parseFloat(document.forma.tnormal.value)) || (parseFloat(document.forma.tnormal.value) > parseFloat(document.forma.tcritico.value)) || (parseFloat(document.forma.tcritico.value) > parseFloat(document.forma.texcedido.value)) || (parseFloat(document.forma.tnormal.value) > parseFloat(document.forma.texcedido.value))) { errores += '\n-Los tiempos deben cumplir con t_ate <= t_not < t_nor <= t_cri <= t_exc.\n'; document.forma.tcritico.focus(); //alert('paso ' + errores); } } /* Evaluar los campos num�ricos */ if (!(document.forma.valor.value == '')) { if (!(parseFloat(document.forma.valor.value) == '' + document.forma.valor.value)) { errores += '-El campo valor debe ser num�rico.\n'; document.forma.valor.focus(); } } if (!(document.forma.severidad.value == '')) { if (!(parseFloat(document.forma.severidad.value) == '' + document.forma.severidad.value)) { errores += '-El campo severidad debe ser num�rico.\n'; document.forma.severidad.focus(); } } if (!(document.forma.tiempogarantia.value == '')) { if (!(parseFloat(document.forma.tiempogarantia.value) == '' + document.forma.tiempogarantia.value)) { errores += '-El campo tiempo garantia debe ser num�rico.\n'; document.forma.tiempogarantia.focus(); } } if (!(document.forma.tiempomantenimiento.value == '')) { if (!(parseFloat(document.forma.tiempomantenimiento.value) == '' + document.forma.tiempomantenimiento.value)) { errores += '-El campo tiempo mantenimiento debe ser num�rico.\n'; document.forma.tiempomantenimiento.focus(); } } if (!(document.forma.poralta.value == '')) { if (!(parseFloat(document.forma.poralta.value) == '' + document.forma.poralta.value)) { errores += '-El campo porcentaje alta debe ser num�rico.\n'; document.forma.poralta.focus(); } } if (!(document.forma.porbaja.value == '')) { if (!(parseFloat(document.forma.porbaja.value) == '' + document.forma.porbaja.value)) { errores += '-El campo porcentaje baja debe ser num�rico.\n'; document.forma.porbaja.focus(); } } /* Validar las fechas */ valf = document.forma.fechacompra.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= "- El Campo " + document.forma.fechacompra.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fechacompra.value + "\n"; } } valf = document.forma.fecharemision.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= "- El Campo " + document.forma.fecharemision.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fecharemision.value + "\n"; } } valf = document.forma.ingresogarantia.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= "- El Campo " + document.forma.ingresogarantia.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.ingresogarantia.value + "\n"; } } valf = document.forma.ingresomantenimiento.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= "- El Campo " + document.forma.ingresomantenimiento.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.ingresomantenimiento.value + "\n"; } } /* CAUSA MOVIMIENTO */ } else if (modulo == 'CM') { /* Validar los requeridos */ if (document.forma.nombre.value == '') { errores += '-El campo Nombre es requerido.\n'; document.forma.nombre.focus(); } /* BASE CONOCIMIENTO */ } else if (modulo == 'BC') { /* Validar los requeridos */ if (document.forma.causa.value == '') { errores += '-El campo Causa es requerido.\n'; document.forma.causa.focus(); } if (document.forma.keywords.value == '') { errores += '-El campo Keywords es requerido.\n'; document.forma.keywords.focus(); } if (document.forma.solucion.value == '') { errores += '-El campo Solucion es requerido.\n'; document.forma.solucion.focus(); } if (document.forma.problema.value == '') { errores += '-El campo Problema es requerido.\n'; document.forma.problema.focus(); } if (document.forma.descripcion.value == '') { errores += '-El campo Descripcion es requerido.\n'; document.forma.descripcion.focus(); } if (document.forma.idsol.value == '') { errores += '-El campo id solicitud es requerido.\n'; document.forma.idsol.focus(); } if (document.forma.titulo.value == '') { errores += '-El campo Titulo es requerido.\n'; document.forma.titulo.focus(); } /* BASE CONOCIMIENTO 2 */ } else if (modulo == 'BC2') { /* Validar los requeridos */ if (document.forma.causa.value == '') { errores += '-El campo Causa es requerido.\n'; document.forma.causa.focus(); } if (document.forma.keywords.value == '') { errores += '-El campo Keywords es requerido.\n'; document.forma.keywords.focus(); } if (document.forma.solucion.value == '') { errores += '-El campo Solucion es requerido.\n'; document.forma.solucion.focus(); } if (document.forma.problema.value == '') { errores += '-El campo Problema es requerido.\n'; document.forma.problema.focus(); } if (document.forma.descripcion.value == '') { errores += '-El campo Descripcion es requerido.\n'; document.forma.descripcion.focus(); } if (document.forma.titulo.value == '') { errores += '-El campo Titulo es requerido.\n'; document.forma.titulo.focus(); } /* REPORTES: REPORTE GESTION SOLICITUDES */ } else if ((modulo == 'RGS') || (modulo == 'RDP') || (modulo == 'RUS') || (modulo == 'APC')) { /* Validar las fechas */ valf = document.forma_parametro.fechaIni1.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= "- El Campo " + document.forma_parametro.fechaIni1.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma_parametro.fechaIni1.value + "\n"; } } else { errores += '-El campo fecha inicial 1 debe contener una fecha en el formato: ' + Mostrar_Formato_Fecha() + '\n'; document.forma_parametro.fechaIni1.focus(); } valf = document.forma_parametro.FechaFin1.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= "- El Campo " + document.forma_parametro.FechaFin1.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma_parametro.FechaFin1.value + "\n"; } } else { errores += '-El campo fecha final 1 debe contener una fecha en el formato: ' + Mostrar_Formato_Fecha() + '\n'; document.forma_parametro.FechaFin1.focus(); } if (modulo == 'APC') { valf = document.forma_parametro.FechaIni2.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= "- El Campo " + document.forma_parametro.FechaIni2.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma_parametro.FechaIni2.value + "\n"; } } else { errores += '-El campo fecha inicial 2, debe contener una fecha en el formato: ' + Mostrar_Formato_Fecha() + '\n'; document.forma_parametro.FechaIni2.focus(); } valf = document.forma_parametro.FechaFin2.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= "- El Campo " + document.forma_parametro.FechaFin2.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma_parametro.FechaFin2.value + "\n"; } } else { errores += '-El campo fecha final 2, debe contener una fecha en el formato: ' + Mostrar_Formato_Fecha() + '\n'; document.forma_parametro.FechaFin2.focus(); } } } /* MODO FORMA */ } else if (modo == 'F') { /* HELP DESK */ if (modulo == 'HD') { /* Validar los requeridos absolutos */ if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo Tipo de Solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } /* Validar los requeridos relativos */ if ((document.forma.dispositivo.value == '') && (document.forma.usuario.value == '') && (document.forma.nombre.value == '') && (document.forma.ccnit.value == '')) { errores += '-El campo Dispositivo, o Usuario, o Nombre, o Nit/C.C. es requerido.\n'; } // Tama�os de campos. if (document.forma.descripcion.value.length > 5000) { errores += '-El campo descripcion excede el tama�o maximo\n.'; } /* Validar la hora */ valh = document.forma.hora.value; if (!(valh == '')) { if (valh.length <= 5) { if ((valh.indexOf(':') == -1) || (isNaN(parseFloat(valh.substring(0,valh.indexOf(':',0))))) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) > 23) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) < 0) || (isNaN(parseFloat(valh.substring(3,valh.length)))) || (parseFloat(valh.substring(3,valh.length)) > 59) || (parseFloat(valh.substring(3,valh.length)) < 0) ) { errores += '-El campo hora debe contener una hora en el formato hh:mm.\n'; document.forma.hora.focus(); } } } /* Validar la fecha de vencimiento */ if (!(document.forma.vencimiento.value.length == 0)) { if (document.forma.hora.value.length == 0) { cFechaVen =document.forma.vencimiento.value + ' ' + '23:59'; errores += '-El campo Hora Vencimiento es Requerido.\n'; } else if (document.forma.hora.value == '00:00') { errores += '-El campo Hora Vencimiento debe ser diferente de 00:00\n'; cFechaVen = document.forma.vencimiento.value + ' ' + document.forma.hora.value; } else if (!IsDateVal(document.forma.vencimiento.value)){ errores+= "- El Campo " + document.forma.vencimiento.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.vencimiento.value + "\n"; } } if (document.forma.tipo_estado.value == 'SF') { /* Validar la hora inicio*/ valh = document.forma.horainicio.value; if (!(valh == '')) { if (valh.length <= 5) { if ((valh.indexOf(':') == -1) || (isNaN(parseFloat(valh.substring(0,valh.indexOf(':',0))))) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) > 23) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) < 0) || (isNaN(parseFloat(valh.substring(3,valh.length)))) || (parseFloat(valh.substring(3,valh.length)) > 59) || (parseFloat(valh.substring(3,valh.length)) < 0) ) { errores += '-El campo hora inicio debe contener una hora en el formato hh:mm.\n'; document.forma.hora.focus(); } } } /* Validar la fecha de inicio */ if (!(document.forma.timestamp.value.length == 0)) { if (document.forma.horainicio.value.length == 0) { cFechaIni =document.forma.timestamp.value + ' ' + '00:00'; errores += '-El campo Hora Inicio es Requerido.\n'; } else if (document.forma.horainicio.value == '00:00') { cFechaIni = document.forma.timestamp.value + ' ' + document.forma.horainicio.value; errores += '-El campo Hora Inicio debe ser diferente a 00:00\n'; } else if (!IsDateVal(document.forma.timestamp.value)){ errores+= "- El Campo " + document.forma.timestamp.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.timestamp.value + "\n"; } } } /* MODULO COMERCIAL - NEGOCIOS*/ } else if (modulo == 'CO') { if (document.forma.nomcliente.value == '') { errores += '-El campo Nombre de cliente es requerido.\n'; } if (document.forma.descnegocio.value.length > 1000) { errores += '-El campo descripci�n excede el tama�o maximo.\n'; } /*numero de orden*/ //if (!(document.forma.numocompra.value == '')) { // if (!(parseFloat(document.forma.numocompra.value) == '' + document.forma.numocompra.value)) { // errores += '-El campo orden de compra debe ser num�rico.\n'; // document.forma.numocompra.focus(); // } //} /* SERVICIO AL CLIENTE */ } else if (modulo == 'SC') { /* Validar los requeridos absolutos */ if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo Tipo de Solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } /* Validar los requeridos relativos */ if ((document.forma.producto.value == '') && (document.forma.usuario.value == '') && (document.forma.nombre.value == '') && (document.forma.ccnit.value == '')) { errores += '-El campo Producto, o Usuario, o Nombre, o Nit/C.C. es requerido.\n'; } // Tama�os de campos. if (document.forma.descripcion.value.length > 5000) { errores += '-El campo descripcion excede el tama�o maximo\n.'; } if (document.forma.detalledocumentos.value.length > 1000) { errores += '-El campo detalle documentos excede el tama�o maximo\n.'; document.forma.detalledocumentos.focus(); } /* Validar la hora */ valh = document.forma.hora.value; if (!(valh == '')) { if (valh.length <= 5) { if ((valh.indexOf(':') == -1) || (isNaN(parseFloat(valh.substring(0,valh.indexOf(':',0))))) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) > 23) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) < 0) || (isNaN(parseFloat(valh.substring(3,valh.length)))) || (parseFloat(valh.substring(3,valh.length)) > 59) || (parseFloat(valh.substring(3,valh.length)) < 0) ) { errores += '-El campo hora debe contener una hora en el formato hh:mm.\n'; document.forma.hora.focus(); } } } /* Validar la fecha de vencimiento */ if (!(document.forma.vencimiento.value.length == 0)) { if (document.forma.hora.value.length == 0) { cFechaVen =document.forma.vencimiento.value + ' ' + '23:59'; errores += '-El campo Hora Vencimiento es Requerido.\n'; } else if (document.forma.hora.value == '00:00') { errores += '-El campo Hora Vencimiento debe ser diferente de 00:00\n'; cFechaVen = document.forma.vencimiento.value + ' ' + document.forma.hora.value; } else if (!IsDateVal(document.forma.vencimiento.value)){ errores+= "- El Campo " + document.forma.vencimiento.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.vencimiento.value + "\n"; } } if (document.forma.tipo_estado.value == 'SF') { /* Validar la hora inicio*/ valh = document.forma.horainicio.value; if (!(valh == '')) { if (valh.length <= 5) { if ((valh.indexOf(':') == -1) || (isNaN(parseFloat(valh.substring(0,valh.indexOf(':',0))))) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) > 23) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) < 0) || (isNaN(parseFloat(valh.substring(3,valh.length)))) || (parseFloat(valh.substring(3,valh.length)) > 59) || (parseFloat(valh.substring(3,valh.length)) < 0) ) { errores += '-El campo hora inicio debe contener una hora en el formato hh:mm.\n'; document.forma.hora.focus(); } } } /* Validar la fecha de inicio*/ if (!(document.forma.timestamp.value.length == 0)) { if (document.forma.horainicio.value.length == 0) { cFechaIni =document.forma.timestamp.value + ' ' + '00:00'; errores += '-El campo Hora Inicio es Requerido.\n'; } else if (document.forma.horainicio.value == '00:00') { cFechaIni = document.forma.timestamp.value + ' ' + document.forma.horainicio.value; errores += '-El campo Hora Inicio debe ser diferente a 00:00\n'; } else if (!IsDateVal(document.forma.timestamp.value)){ errores+= "- El Campo " + document.forma.timestamp.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.timestamp.value + "\n"; } } } /* DOCUMENTAL */ } else if (modulo == 'DO') { /* Validar los requeridos absolutos */ if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo Tipo de Solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } /* Validar los requeridos relativos */ if (document.forma.iddocumento.value == '') { errores += '-El campo id documento es requerido.\n'; document.forma.iddocumento.focus(); } /* Validar la hora */ valh = document.forma.hora.value; if (!(valh == '')) { if (valh.length <= 5) { if ((valh.indexOf(':') == -1) || (isNaN(parseFloat(valh.substring(0,valh.indexOf(':',0))))) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) > 23) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) < 0) || (isNaN(parseFloat(valh.substring(3,valh.length)))) || (parseFloat(valh.substring(3,valh.length)) > 59) || (parseFloat(valh.substring(3,valh.length)) < 0) ) { errores += '-El campo hora debe contener una hora en el formato hh:mm.\n'; document.forma.hora.focus(); } } } /* Validar la fecha de vencimiento */ if (!(document.forma.vencimiento.value.length == 0)) { if (document.forma.hora.value.length == 0) { cFechaVen =document.forma.vencimiento.value + ' ' + '23:59'; errores += '-El campo Hora Vencimiento es Requerido.\n'; } else if (document.forma.hora.value == '00:00') { errores += '-El campo Hora Vencimiento debe ser diferente de 00:00\n'; cFechaVen = document.forma.vencimiento.value + ' ' + document.forma.hora.value; } else if (!IsDateVal(document.forma.vencimiento.value)){ errores+= "- El Campo " + document.forma.vencimiento.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.vencimiento.value + "\n"; } } if (document.forma.tipo_estado.value == 'SF') { /* Validar la hora inicio*/ valh = document.forma.horainicio.value; if (!(valh == '')) { if (valh.length <= 5) { if ((valh.indexOf(':') == -1) || (isNaN(parseFloat(valh.substring(0,valh.indexOf(':',0))))) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) > 23) || (parseFloat(valh.substring(0,valh.indexOf(':',0))) < 0) || (isNaN(parseFloat(valh.substring(3,valh.length)))) || (parseFloat(valh.substring(3,valh.length)) > 59) || (parseFloat(valh.substring(3,valh.length)) < 0) ) { errores += '-El campo hora inicio debe contener una hora en el formato hh:mm.\n'; document.forma.hora.focus(); } } } /* Validar la fecha de inicio*/ if (!(document.forma.timestamp.value.length == 0)) { if (document.forma.horainicio.value.length == 0) { cFechaIni =document.forma.timestamp.value + ' ' + '00:00'; errores += '-El campo Hora Inicio es Requerido.\n'; } else if (document.forma.horainicio.value == '00:00') { cFechaIni = document.forma.timestamp.value + ' ' + document.forma.horainicio.value; errores += '-El campo Hora Inicio debe ser diferente a 00:00\n'; } else if (!IsDateVal(document.forma.timestamp.value)){ errores+= "- El Campo " + document.forma.timestamp.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.timestamp.value + "\n"; } } } /* ACTIVOS */ } else if (modulo == 'AC') { /* Validar los requeridos */ if ((document.forma.nivel.value == '') || (document.forma.nivel.value == '0')) { errores += '-El campo Localizacion es requerido.\n'; document.forma.nivel.focus(); } if ((document.forma.tipo.value == '') || (document.forma.tipo.value == '0')) { errores += '-El campo Tipo es requerido.\n'; document.forma.tipo.focus(); } if (document.forma.identificador.value == '') { errores += '-El campo Identificador es requerido.\n'; document.forma.identificador.focus(); } /* Validar si hubo cambio de localizaci�n */ if (!(document.forma.localizacion.value == document.forma.localizacion_old.value)) { if ((document.forma.causaentrada.value == '') || (document.forma.causaentrada.value == '0')) { errores += '-El campo Causa Entrada es requerido.\n'; document.forma.nivel.focus(); //document.forma.causaentrada.focus(); } if ((document.forma.causasalida.value == '') || (document.forma.causasalida.value == '0')) { errores += '-El campo Causa Salida es requerido.\n'; document.forma.nivel.focus(); //document.forma.causasalida.focus(); } } /*Validar la unidad de tiempo*/ if ((document.forma.OptionGroup4.value == '')){ errores += '-El campo unidad de tiempo es requerido.\n'; document.forma.OptionGroup4.focus(); } /*Validar la cobertura diaria*/ if ((document.forma.tcobertura.value == '')){ errores += '-El campo tipo de cobertura es requerido.\n'; document.forma.tipocobertura.focus(); } /*Valida el t_critico*/ if (parseInt(document.forma.tcritico.value.length) == 0){ errores += '-El campo Tiempo critico es requerido.\n'; document.forma.tcritico.focus(); } /* Validar la coherencia de los tiempos */ if ((document.forma.tnormal.value != '') || (document.forma.tcritico.value != '') || (document.forma.texcedido.value != '') || (document.forma.tatencion.value != '') || (document.forma.tnotificacion.value != '')) { if (!(parseFloat(document.forma.tatencion.value) == '' + document.forma.tatencion.value)) { errores += '-El campo tiempo atencion debe ser num�rico.\n'; document.forma.tatencion.focus(); } if (!(parseFloat(document.forma.tnotificacion.value) == '' + document.forma.tnotificacion.value)) { errores += '-El campo tiempo notificacion debe ser num�rico.\n'; document.forma.tnotificacion.focus(); } if (!(parseFloat(document.forma.tnormal.value) == '' + document.forma.tnormal.value)) { errores += '-El campo tiempo normal debe ser num�rico.\n'; document.forma.tnormal.focus(); } if (!(parseFloat(document.forma.tcritico.value) == '' + document.forma.tcritico.value)) { errores += '-El campo tiempo critico debe ser num�rico.\n'; document.forma.tcritico.focus(); } if (!(parseFloat(document.forma.texcedido.value) == '' + document.forma.texcedido.value)) { errores += '-El campo tiempo excedido debe ser num�rico.\n'; document.forma.texcedido.focus(); } document.forma.tatencion.min = 0; document.forma.tatencion.max = document.forma.tnotificacion.value; document.forma.tnotificacion.min = document.forma.tatencion.value; document.forma.tnotificacion.max = document.forma.tnormal.value; document.forma.tnormal.min = document.forma.tnotificacion.value; document.forma.tnormal.max = document.forma.texcedido.value; document.forma.tcritico.min = 0; document.forma.tcritico.max = document.forma.texcedido.value; document.forma.texcedido.min = document.forma.tcritico.value; document.forma.texcedido.max = 99999.99; if (parseFloat(document.forma.tatencion.value) < parseFloat(document.forma.tatencion.min)) errores += '\n tatencion debe ser mayor que ' + document.forma.tatencion.min; if (parseFloat(document.forma.tatencion.value) > parseFloat(document.forma.tatencion.max)) errores += '\n tatencion debe ser menor que ' + document.forma.tatencion.max; if (parseFloat(document.forma.tnotificacion.value) < parseFloat(document.forma.tnotificacion.min)) errores += '\n tnotificacion debe ser mayor que ' + document.forma.tnotificacion.min; if (parseFloat(document.forma.tnotificacion.value) > parseFloat(document.forma.tnotificacion.max)) errores += '\n tnotificacion debe ser menor que ' + document.forma.tnotificacion.max; if (parseFloat(document.forma.tnormal.value) < parseFloat(document.forma.tnormal.min)) errores += '\n tnormal debe ser mayor que ' + document.forma.tnormal.min; if (parseFloat(document.forma.tnormal.value) > parseFloat(document.forma.tnormal.max)) errores += '\n tnormal debe ser menor que ' + document.forma.tnormal.max; if (parseFloat(document.forma.tcritico.value) < parseFloat(document.forma.tcritico.min)) errores += '\n tcritico debe ser mayor que ' + document.forma.tcritico.min; if (parseFloat(document.forma.tcritico.value) > parseFloat(document.forma.tcritico.max)) errores += '\n tcritico debe ser menor que ' + document.forma.tcritico.max; if (parseFloat(document.forma.texcedido.value) < parseFloat(document.forma.texcedido.min)) errores += '\n texcedido debe ser mayor que ' + document.forma.texcedido.min; if (parseFloat(document.forma.texcedido.value) > parseFloat(document.forma.texcedido.max)) errores += '\n texcedido debe ser menor que ' + document.forma.texcedido.max; if ((parseFloat(document.forma.tatencion.value) > parseFloat(document.forma.tnotificacion.value)) || (parseFloat(document.forma.tnotificacion.value) > parseFloat(document.forma.tnormal.value)) || (parseFloat(document.forma.tnormal.value) > parseFloat(document.forma.tcritico.value)) || (parseFloat(document.forma.tcritico.value) > parseFloat(document.forma.texcedido.value)) || (parseFloat(document.forma.tnormal.value) > parseFloat(document.forma.texcedido.value))) { errores += '\n-Los tiempos deben cumplir con t_ate <= t_not < t_nor <= t_cri <= t_exc.\n'; document.forma.tcritico.focus(); //alert('paso ' + errores); } } /* Evaluar los campos num�ricos */ if (!(document.forma.valor.value == '')) { if (!(parseFloat(document.forma.valor.value) == '' + document.forma.valor.value)) { errores += '-El campo valor debe ser num�rico.\n'; document.forma.valor.focus(); } } if (!(document.forma.severidad.value == '')) { if (!(parseFloat(document.forma.severidad.value) == '' + document.forma.severidad.value)) { errores += '-El campo severidad debe ser num�rico.\n'; document.forma.severidad.focus(); } } if (!(document.forma.tiempogarantia.value == '')) { if (!(parseFloat(document.forma.tiempogarantia.value) == '' + document.forma.tiempogarantia.value)) { errores += '-El campo tiempo garantia debe ser num�rico.\n'; document.forma.tiempogarantia.focus(); } } if (!(document.forma.tiempomantenimiento.value == '')) { if (!(parseFloat(document.forma.tiempomantenimiento.value) == '' + document.forma.tiempomantenimiento.value)) { errores += '-El campo tiempo mantenimiento debe ser num�rico.\n'; document.forma.tiempomantenimiento.focus(); } } if (!(document.forma.poralta.value == '')) { if (!(parseFloat(document.forma.poralta.value) == '' + document.forma.poralta.value)) { errores += '-El campo porcentaje alta debe ser num�rico.\n'; document.forma.poralta.focus(); } //else //{ // if (!(parseFloat(document.forma.texcedido.value) == '' + document.forma.texcedido.value)) { // errores += '-Los valores de alta son validos si usted asigna tiempos.\n'; // document.forma.poralta.value=''; // } //} } if (!(document.forma.porbaja.value == '')) { if (!(parseFloat(document.forma.porbaja.value) == '' + document.forma.porbaja.value)) { errores += '-El campo porcentaje baja debe ser num�rico.\n'; document.forma.porbaja.focus(); } //else //{ // if (!(parseFloat(document.forma.texcedido.value) == '' + document.forma.texcedido.value)) { // errores += '-Los valores de baja son validos si usted asigna tiempos.\n'; // document.forma.porbaja.value=''; // } //} } if ((parseFloat(document.forma.poralta.value) == '' + document.forma.poralta.value) && !(parseFloat(document.forma.porbaja.value) == '' + document.forma.porbaja.value)) { errores += '-EL valor de baja no es valido.\n'; document.forma.porbaja.value = ''; } if (!(parseFloat(document.forma.poralta.value) == '' + document.forma.poralta.value) && (parseFloat(document.forma.porbaja.value) == '' + document.forma.porbaja.value)) { errores += '-EL valor de alta no es valido.\n'; document.forma.poralta.value = ''; } //if (!(parseFloat(document.forma.poralta.value) == '' + document.forma.poralta.value) && (parseFloat(document.forma.texcedido.value) == '' + document.forma.texcedido.value)) // { // errores += '-Debe asignar valores para tiempos como para porcentajes o ninguno de ellos.\n'; // } /* Validar las fechas */ valf = document.forma.fechacompra.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= "- El Campo " + document.forma.fechacompra.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fechacompra.value + "\n"; } } valf = document.forma.fecharemision.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= "- El Campo " + document.forma.fecharemision.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fecharemision.value + "\n"; } } valf = document.forma.ingresogarantia.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= "- El Campo " + document.forma.ingresogarantia.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.ingresogarantia.value + "\n"; } } valf = document.forma.ingresomantenimiento.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= "- El Campo " + document.forma.ingresomantenimiento.name + " debe contener una "; errores+= "fecha valida en el formato "; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.ingresomantenimiento.value + "\n"; } } } /* MODO INGRESO DE ACTIVIDADES */ } else if (modo == 'FA') { /* Validar los requeridos */ if (document.formaA.descripcionA.value == '') { errores += '-El campo descripcion es requerido.\n'; document.formaA.descripcionA.focus(); } /* verificaci�n de tama�os.*/ if (document.formaA.descripcionA.value.length > 5000) { errores += '-El campo descripcion excede el tama�o\n'; } /* Validar Horas y minutos.*/ if ( isNaN(parseFloat(document.formaA.duracionHA.value)) || isNaN(parseFloat(document.formaA.duracionMA.value)) ) { errores += '- El campo duracion debe ser numerico.\n'; } else { document.formaA.duracionHA.value = parseFloat(document.formaA.duracionHA.value); document.formaA.duracionMA.value = parseFloat(document.formaA.duracionMA.value); } /* Validar T. Viaje*/ if ( isNaN(parseFloat(document.formaA.tviajeHA.value)) || isNaN(parseFloat(document.formaA.tviajeMA.value)) ) { errores += '- El campo tiempo de viaje debe ser numerico.\n'; } else { document.formaA.tviajeHA.value = parseFloat(document.formaA.tviajeHA.value); document.formaA.tviajeMA.value = parseFloat(document.formaA.tviajeMA.value); } if ( parseFloat(document.formaA.duracionHA.value) < 0 || parseFloat(document.formaA.duracionHA.value) > 23 ) { errores += '- El campo hora de duracion debe estar entre 0 y 23.\n'; } if ( parseFloat(document.formaA.duracionMA.value) < 0 || parseFloat(document.formaA.duracionMA.value) > 59 ) { errores += '- El campo minuto de duracion debe estar entre 0 y 59.\n'; } if ( parseFloat(document.formaA.tviajeHA.value) < 0 ) { errores += '- El campo tiempo de viajes (hora) debe ser mayor o igual a 0.\n'; } if ( parseFloat(document.formaA.tviajeMA.value) < 0 || parseFloat(document.formaA.tviajeMA.value) > 59 ) { errores += '- El campo minuto de viaje debe estar entre 0 y 59.\n'; } /* Validar la hora inicio*/ if (document.formaA.horaA.value == '') { errores += '- El campo hora es obligatorio.\n'; } else { if (document.formaA.horaA.value.length <= 5) { if ((document.formaA.horaA.value.indexOf(':') == -1) || (isNaN(parseFloat(document.formaA.horaA.value.substring(0,document.formaA.horaA.value.indexOf(':',0))))) || (parseFloat(document.formaA.horaA.value.substring(0,document.formaA.horaA.value.indexOf(':',0))) > 23) || (parseFloat(document.formaA.horaA.value.substring(0,document.formaA.horaA.value.indexOf(':',0))) < 0) || (isNaN(parseFloat(document.formaA.horaA.value.substring(3,document.formaA.horaA.value.length)))) || (parseFloat(document.formaA.horaA.value.substring(3,document.formaA.horaA.value.length)) > 59) || (parseFloat(document.formaA.horaA.value.substring(3,document.formaA.horaA.value.length)) < 0) ) { errores += '-El campo hora debe contener una hora en el formato hh:mm.\n'; } } } /* Validar las fechas */ if (!(document.formaA.fechaA.value == 0)){ if (!IsDateVal(document.formaA.fechaA.value)){ errores+= '- El Campo ' + document.formaA.fechaA.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.formaA.fechaA.value + '\n'; } } else { errores += '- El campo Fecha inicio de la actividad es obligatorio.\n'; } /*var cFechaActividad = document.formaA.fechaA.value + ' ' + document.formaA.horaA.value; var tDuracionActividad = (document.formaA.duracionHA.value * 60 * 60 * 1000) + (document.formaA.duracionMA.value * 60 * 1000); var tFechaActividad = Date.parse(cFechaActividad); var tTotalActividad = tFechaActividad + tDuracionActividad; var tFechaHoy = (new Date()).getTime(); if (tTotalActividad > tFechaHoy) { errores += '-La fecha de la actividad no puede ser mayor a la actual.\n'; }*/ /* MODO CIERRE */ } else if (modo == 'C') { /* HELP DESK */ if (modulo == 'HD') { /* Validar solucion */ if (document.forma.solucion.value == '') { errores += '-El campo solucion es requerido.\n'; document.forma.solucion.focus(); } if (document.forma.solucion.value.length > 5000) { errores += '-El campo solucion excede el tama�o maximo.\n'; document.forma.solucion.focus(); } /* Validar problema */ if (document.forma.problema.value == '') { errores += '-El campo problema es requerido.\n'; document.forma.problema.focus(); } if (document.forma.problema.value.length > 500) { errores += '-El campo problema excede el tama�o maximo.\n'; document.forma.problema.focus(); } if (document.forma.descripcion2.value.length > 5000) { errores += '-El campo descripcion excede el tama�o maximo.\n'; document.forma.descripcion2.focus(); } /* Validar causa */ if ((document.forma.causa.value == '') || (document.forma.causa.value == '0')) { errores += '-El campo causa es requerido.\n'; document.forma.causa.focus(); } /* Validar tipo de solicitud */ if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo tipo de solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } /* Validar los requeridos relativos */ if ((document.forma.dispositivo.value == '') && (document.forma.usuario.value == '')) { errores += '-El campo Dispositivo, o Usuario es requerido.\n'; } /* SERVICIO AL CLIENTE */ } else if (modulo == 'SC') { /* Validar solucion */ if (document.forma.solucion.value == '') { errores += '-El campo solucion es requerido.\n'; document.forma.solucion.focus(); } if (document.forma.solucion.value.length > 5000) { errores += '-El campo solucion excede el tama�o maximo.\n'; document.forma.solucion.focus(); } /* Validar problema */ if (document.forma.problema.value == '') { errores += '-El campo problema es requerido.\n'; document.forma.problema.focus(); } if (document.forma.problema.value.length > 500) { errores += '-El campo problema excede el tama�o maximo.\n'; document.forma.problema.focus(); } if (document.forma.descripcion2.value.length > 5000) { errores += '-El campo descripcion excede el tama�o maximo.\n'; document.forma.descripcion2.focus(); } /* Validar causa */ if ((document.forma.causa.value == '') || (document.forma.causa.value == '0')) { errores += '-El campo causa es requerido.\n'; document.forma.causa.focus(); } /* Validar tipo de solicitud */ if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo tipo de solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } /* Validar los requeridos relativos */ if ((document.forma.usuario.value == '')) { errores += '-Usuario es requerido.\n'; } /* DOCUMENTAL */ } else if (modulo == 'DO') { /* Validar solucion */ if (document.forma.solucion.value == '') { errores += '-El campo solucion es requerido.\n'; document.forma.solucion.focus(); } if (document.forma.solucion.value.length > 5000) { errores += '-El campo solucion excede el tama�o maximo.\n'; document.forma.solucion.focus(); } /* Validar causa */ if ((document.forma.causa.value == '') || (document.forma.causa.value == '0')) { errores += '-El campo causa es requerido.\n'; document.forma.causa.focus(); } /* Validar tipo de solicitud */ if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo tipo de solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } /* Validar los requeridos relativos */ if (document.forma.iddocumento.value == '') { errores += '-El campo id documento es requerido.\n'; document.forma.iddocumento.focus(); } } /* MODO INGRESO DE FEEDBACK */ } else if (modo == 'FE') { /* Validar los requeridos */ if (document.forma.causa.value == '') { errores += '-El campo causa es requerido.\n'; document.forma.causa.focus(); } if (document.forma.sugerencias.value.length > 500) { errores += '-El campo Sugerencia excede el tama�o maximo.\n'; document.forma.sugerencias.focus(); } /* MODO FILTRO */ } else if (modo == 'FI') { /* HELP DESK */ if (modulo == 'HD') { /* Validar los campos de tipo num�rico */ /* if (!(document.forma.idsol.value == '')) { if (!(parseFloat(document.forma.idsol.value) == '' + document.forma.idsol.value)) { errores += '-El campo Id solicitud debe ser num�rico.\n'; document.forma.idsol.focus(); } } */ if (!(document.forma.idsolorigen.value == '')) { if (!(parseFloat(document.forma.idsolorigen.value) == '' + document.forma.idsolorigen.value)) { errores += '-El campo Id solicitud origen debe ser num�rico.\n'; document.forma.idsolorigen.focus(); } } if (!(document.forma.ttrans1.value == '')) { if (!(parseFloat(document.forma.ttrans1.value) == '' + document.forma.ttrans1.value)) { errores += '-El campo tiempo transcurrido debe ser num�rico.\n'; document.forma.ttrans1.focus(); } } if (!(document.forma.ttrans2.value == '')) { if (!(parseFloat(document.forma.ttrans2.value) == '' + document.forma.ttrans2.value)) { errores += '-El campo tiempo transcurrido debe ser num�rico.\n'; document.forma.ttrans2.focus(); } } /* Validar las fechas */ valf = document.forma.fecha1.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fecha1.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fecha1.value + '\n'; } } valf = document.forma.fecha2.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fecha2.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fecha2.value + '\n'; } } valf = document.forma.vencimiento1.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.vencimiento1.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.vencimiento1.value + '\n'; } } valf = document.forma.vencimiento2.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.vencimiento2.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.vencimiento2.value + '\n'; } } /* MODULO COMERCIAL - COTIZACIONES*/ } else if (modulo == 'COT') { valf = document.forma.fecha1filter.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fecha1filter.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fecha1filter.value + '\n'; } } valf = document.forma.fecha2filter.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fecha2filter.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fecha2filter.value + '\n'; } } /*valida el id de la cotizacion*/ if (!(document.forma.idcotfilter.value == '')) { if (!(parseFloat(document.forma.idcotfilter.value) == '' + document.forma.idcotfilter.value)) { errores += '-El campo Id de cotizaci�n debe ser num�rico.\n'; document.forma.idcotfilter.focus(); } } /*valida el precio1 de pesos*/ if (!(document.forma.preciopesos1filter.value == '')) { if (!(parseFloat(document.forma.preciopesos1filter.value) == '' + document.forma.preciopesos1filter.value)) { errores += '-El campo precio pesos debe ser num�rico.\n'; document.forma.preciopesos1filter.focus(); } } /*valida el precio2 de pesos*/ if (!(document.forma.preciopesos2filter.value == '')) { if (!(parseFloat(document.forma.preciopesos2filter.value) == '' + document.forma.preciopesos2filter.value)) { errores += '-El campo precio pesos debe ser num�rico.\n'; document.forma.preciopesos2filter.focus(); } } /*valida el margen*/ if (!(document.forma.margenfilter.value == '')) { if (!(parseFloat(document.forma.margenfilter.value) == '' + document.forma.margenfilter.value)) { errores += '-El campo margen debe ser num�rico.\n'; document.forma.margenfilter.focus(); } } /*valida el precio1 de dolares*/ if (!(document.forma.preciodolares1filter.value == '')) { if (!(parseFloat(document.forma.preciodolares1filter.value) == '' + document.forma.preciodolares1filter.value)) { errores += '-El campo precio dolares debe ser num�rico.\n'; document.forma.preciodolares1filter.focus(); } } /*valida el precio2 de dolares*/ if (!(document.forma.preciodolares2filter.value == '')) { if (!(parseFloat(document.forma.preciodolares2filter.value) == '' + document.forma.preciodolares2filter.value)) { errores += '-El campo precio dolares debe ser num�rico.\n'; document.forma.preciodolares2filter.focus(); } } /*valida dias de vigencia*/ if (!(document.forma.diasvigenfilter.value == '')) { if (!(parseFloat(document.forma.diasvigenfilter.value) == '' + document.forma.diasvigenfilter.value)) { errores += '-El campo dias de vigencia debe ser num�rico.\n'; document.forma.diasvigenfilter.focus(); } } /*trm*/ if (!(document.forma.trmfilter.value == '')) { if (!(parseFloat(document.forma.trmfilter.value) == '' + document.forma.trmfilter.value)) { errores += '-El campo trm debe ser num�rico.\n'; document.forma.trmfilter.focus(); } } if (document.forma.condicionescomfilter.value.length > 900) { errores += '-El campo Condiciones Comerciales excede el tama�o maximo.\n'; document.forma.condicionescomfilter.focus(); } /*MODULO COMERCIAL - NEGOCIOS*/ } else if (modulo == 'CO') { /*numero de orden*/ //if (!(document.forma.num_ocomprafilter.value == '')) { // if (!(parseFloat(document.forma.num_ocomprafilter.value) == '' + document.forma.num_ocomprafilter.value)) { // errores += '-El campo orden de compra debe ser num�rico.\n'; // document.forma.num_ocomprafilter.focus(); // } //} /*precio dolares*/ if (!(document.forma.precio_dolaresfilter.value == '')) { if (!(parseFloat(document.forma.precio_dolaresfilter.value) == '' + document.forma.precio_dolaresfilter.value)) { errores += '-El campo precio dolares debe ser num�rico.\n'; document.forma.precio_dolaresfilter.focus(); } } /*precio pesos*/ if (!(document.forma.precio_pesosfilter.value == '')) { if (!(parseFloat(document.forma.precio_pesosfilter.value) == '' + document.forma.precio_pesosfilter.value)) { errores += '-El campo precio pesos debe ser num�rico.\n'; document.forma.precio_pesosfilter.focus(); } } /*costo dolares*/ if (!(document.forma.costo_dolaresfilter.value == '')) { if (!(parseFloat(document.forma.costo_dolaresfilter.value) == '' + document.forma.costo_dolaresfilter.value)) { errores += '-El campo costo dolares debe ser num�rico.\n'; document.forma.costo_dolaresfilter.focus(); } } /*costo pesos*/ if (!(document.forma.costo_pesosfilter.value == '')) { if (!(parseFloat(document.forma.costo_pesosfilter.value) == '' + document.forma.costo_pesosfilter.value)) { errores += '-El campo costo pesos debe ser num�rico.\n'; document.forma.costo_pesosfilter.focus(); } } if (document.forma.desc_negociofilter.value.length > 300) { errores += '-El campo descripcion excede el tama�o maximo.\n'; document.forma.desc_negociofilter.focus(); } /* MODULO AUTOAYUDA WIZARD*/ } else if (modulo == 'WZ') { if (document.forma.respuesta.value.length > 150) { errores += '-El campo respuesta excede el tama�o maximo.\n'; } /* SERVICIO CLIENTE */ } else if (modulo == 'SC') { /* Validar los campos de tipo num�rico */ /* if (!(document.forma.idsol.value == '')) { if (!(parseFloat(document.forma.idsol.value) == '' + document.forma.idsol.value)) { errores += '-El campo Id solicitud debe ser num�rico.\n'; document.forma.idsol.focus(); } } */ if (!(document.forma.idsolorigen.value == '')) { if (!(parseFloat(document.forma.idsolorigen.value) == '' + document.forma.idsolorigen.value)) { errores += '-El campo Id solicitud origen debe ser num�rico.\n'; document.forma.idsolorigen.focus(); } } if (!(document.forma.ttrans1.value == '')) { if (!(parseFloat(document.forma.ttrans1.value) == '' + document.forma.ttrans1.value)) { errores += '-El campo tiempo transcurrido debe ser num�rico.\n'; document.forma.ttrans1.focus(); } } if (!(document.forma.ttrans2.value == '')) { if (!(parseFloat(document.forma.ttrans2.value) == '' + document.forma.ttrans2.value)) { errores += '-El campo tiempo transcurrido debe ser num�rico.\n'; document.forma.ttrans2.focus(); } } /* Validar las fechas */ valf = document.forma.fecha1.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fecha1.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fecha1.value + '\n'; } } valf = document.forma.fecha2.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fecha2.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fecha2.value + '\n'; } } valf = document.forma.vencimiento1.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.vencimiento1.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.vencimiento1.value + '\n'; } } valf = document.forma.vencimiento2.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.vencimiento2.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.vencimiento2.value + '\n'; } } } else if (modulo == 'AC') { /* Validar la coherencia de los tiempos */ if (!((document.forma.tnormal.value == '') && (document.forma.tcritico.value == '') && (document.forma.texcedido.value == ''))) { if(parseFloat(document.forma.tatencion.value.length) > 0) if (!(parseFloat(document.forma.tatencion.value) == '' + document.forma.tatencion.value)) { errores += '-El campo tiempo atencion debe ser num�rico.\n'; document.forma.tatencion.focus(); } if(parseFloat(document.forma.tnotificacion.value.length) > 0) if (!(parseFloat(document.forma.tnotificacion.value) == '' + document.forma.tnotificacion.value)) { errores += '-El campo tiempo tnotificacion debe ser num�rico.\n'; document.forma.tnotificacion.focus(); } if(parseFloat(document.forma.tnormal.value.length) > 0) if (!(parseFloat(document.forma.tnormal.value) == '' + document.forma.tnormal.value)) { errores += '-El campo tiempo normal debe ser num�rico.\n'; document.forma.tnormal.focus(); } if(parseFloat(document.forma.tcritico.value.length) > 0) if (!(parseFloat(document.forma.tcritico.value) == '' + document.forma.tcritico.value)) { errores += '-El campo tiempo critico debe ser num�rico.\n'; document.forma.tcritico.focus(); } if(parseFloat(document.forma.texcedido.value.length) > 0) if (!(parseFloat(document.forma.texcedido.value) == '' + document.forma.texcedido.value)) { errores += '-El campo tiempo excedido debe ser num�rico.\n'; document.forma.texcedido.focus(); } } /* Evaluar los campos num�ricos */ if (!(document.forma.valor.value == '')) { if (!(parseFloat(document.forma.valor.value) == '' + document.forma.valor.value)) { errores += '-El campo valor debe ser num�rico.\n'; document.forma.valor.focus(); } } if (!(document.forma.severidad.value == '')) { if (!(parseFloat(document.forma.severidad.value) == '' + document.forma.severidad.value)) { errores += '-El campo severidad debe ser num�rico.\n'; document.forma.severidad.focus(); } } if (!(document.forma.tiempogarantia.value == '')) { if (!(parseFloat(document.forma.tiempogarantia.value) == '' + document.forma.tiempogarantia.value)) { errores += '-El campo tiempo garantia debe ser num�rico.\n'; document.forma.tiempogarantia.focus(); } } if (!(document.forma.tiempomantenimiento.value == '')) { if (!(parseFloat(document.forma.tiempomantenimiento.value) == '' + document.forma.tiempomantenimiento.value)) { errores += '-El campo tiempo mantenimiento debe ser num�rico.\n'; document.forma.tiempomantenimiento.focus(); } } if (!(document.forma.poralta.value == '')) { if (!(parseFloat(document.forma.poralta.value) == '' + document.forma.poralta.value)) { errores += '-El campo porcentaje alta debe ser num�rico.\n'; document.forma.poralta.focus(); } } if (!(document.forma.porbaja.value == '')) { if (!(parseFloat(document.forma.porbaja.value) == '' + document.forma.porbaja.value)) { errores += '-El campo porcentaje baja debe ser num�rico.\n'; document.forma.porbaja.focus(); } } /* Validar las fechas */ valf = document.forma.fechaingreso1.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fechaingreso1.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fechaingreso1.value + '\n'; } } /* Validar las fechas */ valf = document.forma.fechaingreso2.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fechaingreso2.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fechaingreso2.value + '\n'; } } /* Validar las fechas */ valf = document.forma.fechacompra1.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fechacompra1.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fechacompra1.value + '\n'; } } /* Validar las fechas */ valf = document.forma.fechacompra2.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fechacompra2.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fechacompra2.value + '\n'; } } valf = document.forma.fecharemision1.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fecharemision1.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fecharemision1.value + '\n'; } } valf = document.forma.fecharemision2.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fecharemision2.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fecharemision2.value + '\n'; } } valf = document.forma.fechaingresogar1.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fechaingresogar1.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fechaingresogar1.value + '\n'; } } valf = document.forma.fechaingresogar2.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fechaingresogar2.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fechaingresogar2.value + '\n'; } } valf = document.forma.fechaingresomant1.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fechaingresomant1.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fechaingresomant1.value + '\n'; } } valf = document.forma.fechaingresomant2.value; if (!(valf == '')) { if (!IsDateVal(valf)){ errores+= '- El Campo ' + document.forma.fechaingresomant2.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.fechaingresomant2.value + '\n'; } } } } if (errores) alert('Los siguientes errores ocurrieron:\n' + errores); /* Retornar */ document.respValidacion = (errores == ''); } /***************************************************************************** * Nombre: validarFormaUF * * Descripci�n: Funci�n que realiza la validaci�n de la forma de Usuario * * Final). * * Parametros: * * modo Entrada Indica el tipo de forma en la hay que realizar la * * validaci�n. (forma,nuevo, etc) * * modulo Entrada Indica el m�dulo al que pertenece la forma * * Autor: Juan Pablo Fern�ndez R. Fecha de Creaci�n: 01 de Marzo de 2001 * * Modificaciones * * 1. Autor: Juan Pablo Fern�ndez R. Fecha de Modificaci�n: 17 Sept 2002 * * Descripci�n: * * - Se incluyo validaci�n para nuevo de flujo documental. * *****************************************************************************/ function validarFormaUF(modo, modulo) { var errores; errores = ''; if (modo == 'N') { // Se valida el modo nuevo. /* SERVIVIO AL CLIENTE */ if (modulo == 'SC') { // Validar producto //if (document.forma.producto.value == '') { // errores += '-El campo producto es requerido.\n'; // document.forma.producto.focus(); //} // Validar tipo de solicitud if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo tipo de solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } } /* DOCUMENTAL */ else if (modulo == 'DO') { /* Validar los requeridos absolutos */ if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo Tipo de Solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } if (document.forma.iddocumento.value == '') { errores += '-El campo Id Documento es requerido.\n'; document.forma.iddocumento.focus(); } } /* HELP DESK */ else if (modulo == 'HD') { // Validar tipo solicitud if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo Tipo de Solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } } } if (errores) alert('Los siguientes errores ocurrieron:\n' + errores); /* Retornar */ document.respValidacion = (errores == ''); } /*Funci�n que muestra o oculta los campos Basicos de un cliente*/ function changeTipo(objID){ if (objID == "datTipoDoc") { change('datTipoDoc') } if (objID == "datBasicos1"){ change('datBasicos1') change('datBasicos2') }else{ change('datBasicos1') change('datBasicos2') change('datBasicos3') change('datBasicos4') change('datBasicos5') } } function changeLocalizacion(objID){ var nested = document.all(objID); if (document.getElementById(objID).style.display == "none") { document.getElementById(objID).style.display = ''; } else { document.getElementById(objID).style.display = 'none' } } /*****************************************************************************************************/ /*Funci�n que muestra o oculta los campos Basicos de un cliente*/ function changetabs(objID, objCotenedor){ if (objCotenedor == null) objCotenedor = "document"; var nested = null; if (objID == 'DOCUMENTO') { nested = eval(objCotenedor + '.all(\'DOCUMENTO\')'); if (nested) nested.style.display = ''; //document.DOCUMENTO.style.display = ''; nested = eval(objCotenedor + '.all(\'ACCIONES\')'); if (nested) nested.style.display = ''; //ACCIONES.style.display = ''; nested = eval(objCotenedor + '.all(\'ANEXOS\')'); if (nested) nested.style.display = ''; //ANEXOS.style.display = ''; nested = eval(objCotenedor + '.all(\'TIPODOCUMENTO\')'); if (nested) nested.style.display = ''; //TIPODOCUMENTO.style.display = ''; } if (objID == 'ANEXOS'){ nested = eval(objCotenedor + '.all(\'ANEXOS\')'); if (nested) nested.style.display = ''; //ANEXOS.style.display = ''; nested = eval(objCotenedor + '.all(\'ACCIONES\')'); if (nested) nested.style.display = 'none'; //ACCIONES.style.display = 'none'; nested = eval(objCotenedor + '.all(\'DOCUMENTO\')'); if (nested) nested.style.display = 'none'; //DOCUMENTO.style.display = 'none'; nested = eval(objCotenedor + '.all(\'TIPODOCUMENTO\')'); if (nested) nested.style.display = 'none'; //TIPODOCUMENTO.style.display = 'none'; } if (objID == 'TIPODOCUMENTO') { nested = eval(objCotenedor + '.all(\'TIPODOCUMENTO\')'); if (nested) nested.style.display = 'none'; //TIPODOCUMENTO.style.display = 'none'; nested = eval(objCotenedor + '.all(\'DOCUMENTO\')'); if (nested) nested.style.display = ''; //DOCUMENTO.style.display = ''; nested = eval(objCotenedor + '.all(\'ACCIONES\')'); if (nested) nested.style.display = ''; //ACCIONES.style.display = ''; nested = eval(objCotenedor + '.all(\'ANEXOS\')'); if (nested) nested.style.display = 'none'; //ANEXOS.style.display = 'none'; } } /*Funci�n que muestra o oculta los campos Basicos de un cliente*/ function changeTipo2(objID){ if (objID == "datTipoDoc") { change('datTipoDoc') } if (objID == "datBasicos1"){ change('datBasicos1') change('datBasicos2') }else{ /* change('datBasicos1') change('datBasicos2') change('datBasicos3') */ change('datBasicos4') /* change('datBasicos5') */ } } /***************************************************************************** * Nombre: validarFormaBS * * Descripci�n: Funci�n que realiza la validaci�n de la forma personalizada * * al BS. * * Parametros: * * modo Entrada Indica el tipo de forma en la hay que realizar la * * validaci�n. (forma,nuevo, etc) * * modulo Entrada Indica el m�dulo al que pertenece la forma * * Autor: LGP. Fecha de Creaci�n: 01 de Marzo de 2001 * * Modificaciones * * 1. Autor: Juan Pablo Fern�ndez R. Fecha de Modificaci�n: 05 Marzo 2001 * * Descripci�n: - El campo identificador del producto puede ser alfa * * num�rico, se elimina la validaci�n que obligaba que fuera* * num�rico. * * 2. Autor: John Alexander Ardila. Fecha de Modificaci�n: 24 Junio 2003 * * Descripci�n: - Los campos Tipo de Producto, No Producto, Direccion y * * ciudad deben ser opcionales, solicitado x vpinilla * * 3. Autor: John Alexander Ardila Fecha: 02 Julio de 2003 * * Descripci�n: * * - Cambiar temporalmente validacin validarForma() x * * validarFormaBS(), para validar obligatoriedad de campos y * * tipificacion (Banco de Credito). * * Solicitud No. 4973 * * 4. Autor: John Alexander Ardila Fecha: 11-Julio-2003 * * Descripci�n: * * - Incluir en campos ocultos tipific... bandera q facilita la * * la validacion al tratar de ingresar solicitudes en SC * * que debe obligar a tipificar cuando la solicitud tenga definidos * niveles de tipificacion. * * rutina General/scripts.js-validarFormaBS() * * pagina ServicioCliente/ModuloSolicitudes/solicitudSoporte.asp * * SP SPListarTipoSolicitud() * * Destino: Banco de Credito. * * Solicitudes No. 4973, 4991 * *****************************************************************************/ function validarFormaBS(modo, modulo){ var errores; var valf, valh, cFechaVen, tFechaVen, tFechaH; var bSelectTS = true; errores = ''; /* MODO NUEVO */ if (modo == 'N') { /* SERVICIO AL CLIENTE */ if (modulo == 'SC') { /* Validar tipo de solicitud */ bSelectTS = true; if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { bSelectTS = false; errores += '-El campo tipo de solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } // Tama�os de campos. if (document.forma.descripcion.value.length > 5000) { errores += '-El campo descripcion excede el tama�o maximo\n.'; document.forma.descripcion.focus(); } if (document.forma.detalledocumentos.value.length > 1000) { errores += '-El campo detalle documentos excede el tama�o maximo\n.'; document.forma.detalledocumentos.focus(); } /* Validar la ciudad del cliente if (document.forma.ciudadorigen.value == '') { errores += '-El campo ciudad es requerido.\n'; document.forma.ciudadorigen.focus(); } Validar la direccion del cliente if (document.forma.direccion.value == '') { errores += '-El campo direccion es requerido.\n'; document.forma.direccion.focus(); } */ /* Validar la cedula del cliente */ if (document.forma.ccnit.value == '') { errores += '-El campo nit/c.c. es requerido.\n'; document.forma.ccnit.focus(); } /* Validar nombre del cliente */ if (document.forma.nombre.value == '') { errores += '-El campo nombre es requerido.\n'; document.forma.nombre.focus(); } /* Validar tipo de producto if (document.forma.tipoproducto.value == '') { errores += '-El campo Tipo de Producto es requerido.\n'; document.forma.tipoproducto.focus(); } Validar producto if (document.forma.producto.value == '') { errores += '-El campo No. producto es requerido.\n'; document.forma.producto.focus(); } */ /* Validar la fecha de vencimiento */ if (!(document.forma.vencimiento.value.length == 0)) { if (document.forma.hora.value.length == 0) { cFechaVen =document.forma.vencimiento.value + ' ' + '23:59'; errores += '-El campo Hora Vencimiento es Requerido.\n'; } else if (document.forma.hora.value == '00:00') { errores += '-El campo Hora Vencimiento debe ser diferente de 00:00\n'; cFechaVen = document.forma.vencimiento.value + ' ' + document.forma.hora.value; } else if (!IsDateVal(document.forma.vencimiento.value)){ errores+= '- El Campo ' + document.forma.vencimiento.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.vencimiento.value + '\n'; } } /* Validar que haya completado todos los niveles de la categoria */ if (bSelectTS) if ((eval('document.forma.tipific'+document.forma.tiposolicitud.value+'.value') == 1) && (document.forma.nivelcompleto.value != 'ok')) errores += '-Usted debe completar hasta el ultimo nivel de la clasificacion.\n'; if (!document.forma.tiposolicitud.disabled) document.forma.tiposolicitud.focus(); /* Validar que haya completado todos los niveles de la categoria if (document.forma.nivelcompleto.value != 'ok') { errores += '-Usted debe completar hasta el ultimo nivel de la clasificaci�n.\n'; if (!document.forma.tiposolicitud.disabled) document.forma.tiposolicitud.focus(); } */ } /* MODO FORMA */ } else if (modo == 'F') { /* SERVICIO AL CLIENTE */ if (modulo == 'SC') { /* Validar tipo de solicitud */ if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo tipo de solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } /* Validar la cedula del cliente */ if (document.forma.ccnit.value == '') { errores += '-El campo nit/c.c. es requerido.\n'; document.forma.ccnit.focus(); } /* Validar nombre del cliente */ if (document.forma.nombre.value == '') { errores += '-El campo nombre es requerido.\n'; document.forma.nombre.focus(); } /* Validar producto if (document.forma.producto.value == '') { errores += '-El campo No. producto es requerido.\n'; document.forma.producto.focus(); } */ // Tama�os de campos. if (document.forma.descripcion.value.length > 5000) { errores += '-El campo descripcion excede el tama�o maximo\n.'; } if (document.forma.detalledocumentos.value.length > 1000) { errores += '-El campo detalle documentos excede el tama�o maximo\n.'; document.forma.detalledocumentos.focus(); } /* Validar la fecha de vencimiento */ if (!(document.forma.vencimiento.value.length == 0)) { if (document.forma.hora.value.length == 0) { cFechaVen =document.forma.vencimiento.value + ' ' + '23:59'; errores += '-El campo Hora Vencimiento es Requerido.\n'; } else if (document.forma.hora.value == '00:00') { errores += '-El campo Hora Vencimiento debe ser diferente de 00:00\n'; cFechaVen = document.forma.vencimiento.value + ' ' + document.forma.hora.value; } else if (!IsDateVal(document.forma.vencimiento.value)){ errores+= '- El Campo ' + document.forma.vencimiento.name + ' debe contener una '; errores+= 'fecha valida en el formato '; errores+= Mostrar_Formato_Fecha(); errores+= document.forma.vencimiento.value + '\n'; } } /* Validar que haya completado todos los niveles de la categoria if (document.forma.nivelcompleto.value != 'ok') { errores += '-Usted debe completar hasta el ultimo nivel de la clasificaci�n.\n'; document.forma.tiposolicitud.focus(); } */ } /* MODO FEEDBACK */ } else if (modo == 'FE') { /* SERVICIO AL CLIENTE */ if (modulo == 'SC') { /* Validar el usuario aprobador */ if (document.forma.usuarioaprobador.value == '') { errores += '-El campo Usuario Aprobador es requerido.\n'; document.forma.usuarioaprobador.focus(); } } /* MODO CIERRE */ } else if (modo == 'C') { /* SERVICIO AL CLIENTE */ if (modulo == 'SC') { /* Validar afavor del cliente */ if (document.forma.afavorcliente.value == '') { errores += '-El campo Resuelto a Favor de cliente es requerido.\n'; document.forma.afavorcliente.focus(); } /* Validar solucion */ if (document.forma.solucion.value == '') { errores += '-El campo solucion es requerido.\n'; document.forma.solucion.focus(); } if (document.forma.solucion.value.length > 5000) { errores += '-El campo solucion excede el tama�o maximo.\n'; document.forma.solucion.focus(); } /* Validar problema */ if (document.forma.problema.value == '') { errores += '-El campo problema es requerido.\n'; document.forma.problema.focus(); } if (document.forma.problema.value.length > 500) { errores += '-El campo problema excede el tama�o maximo.\n'; document.forma.problema.focus(); } if (document.forma.descripcion2.value.length > 5000) { errores += '-El campo descripcion excede el tama�o maximo.\n'; document.forma.descripcion2.focus(); } /* Validar causa */ if ((document.forma.causa.value == '') || (document.forma.causa.value == '0')) { errores += '-El campo causa es requerido.\n'; document.forma.causa.focus(); } /* Validar tipo de solicitud */ if ((document.forma.tiposolicitud.value == '') || (document.forma.tiposolicitud.value == '0')) { errores += '-El campo tipo de solicitud es requerido.\n'; document.forma.tiposolicitud.focus(); } /* Validar producto if (document.forma.producto.value == '') { errores += '-El campo No. producto es requerido.\n'; document.forma.producto.focus(); } */ /* Validar que haya completado todos los niveles de la categoria if (document.forma.nivelcompleto.value == 'err') { errores += '-Usted debe completar hasta el ultimo nivel de la clasificaci�n.\n'; if (!document.forma.tiposolicitud.disabled) document.forma.tiposolicitud.focus(); } */ /* MODULO ACADEMICO */ } else if (modulo == 'AA') { /* Tipo de Identificaci�n del aspirante */ if (document.forma.tipoid_AA.value == '') { errores += '-El campo tipo de identificaci�n es requerido.\n'; document.forma.tipoid_AA.focus(); } /* N�mero de Identificaci�n del aspirante */ if (document.forma.documento_AA.value == '') { errores += '-El campo identificaci�n es requerido.\n'; document.forma.documento_AA.focus(); } /* Nombres del aspirante */ if (document.forma.nombres_AA.value == '') { errores += '-El campo nombres es requerido.\n'; document.forma.nombres_AA.focus(); } /* Apellidos del aspirante */ if (document.forma.apellidos_AA.value == '') { errores += '-El campo apellidos es requerido.\n'; document.forma.apellidos_AA.focus(); } /* Tipo de Programa */ if (document.forma.tipoprograma_AA.value == '') { errores += '-El campo tipo de programa es requerido.\n'; document.forma.tipoprograma_AA.focus(); } /* Programa */ if (document.forma.programa_AA.value == '') { errores += '-El programa es requerido.\n'; document.forma.programa_AA.focus(); } } } if (errores) alert('Los siguientes errores ocurrieron:\n' + errores); /* Retornar */ document.respValidacion = (errores == ''); } /* funci�n que muestra el registro seleccionado en modo de forma */ function mostrarregistro(qstring) { document.forma.action = 'proc_modolista.asp' + qstring document.forma.submit(); } /* Funci�n que envia la forma al modo de lista */ function modo(pagina) { if(pagina == 'old') { document.formaL.submit(); } else { document.forma.action = pagina document.forma.submit(); } } /* Funci�n que envia la forma al modo de lista */ function modonegocio(pagina) { if(pagina == 'old') { document.formaL.submit(); } else { document.forma.action = pagina document.forma.target = 'principal' document.forma.submit(); } } /* Funci�n que limpia la clasificacion y los detalles */ function limpiarAsiClaDet(nomforma) { /* Limpiar asignado */ document.forma.idasignado.value=''; /* Limpiar clasificacion */ document.forma.clasificacion.value=''; document.forma.idplataforma.value=''; document.forma.idcategoria.value=''; document.forma.idsubcategoria.value=''; document.forma.idcomponente.value=''; /* Limpiar detalles */ document.forma.detalles.value=''; document.forma.iddetalles.value=''; document.forma.txdetalles.value=''; } /***************************************************************************** * Nombre: limpiarClasificacion * * Descripci�n: Limpia los campos que almacenan la clasificaci�n escogida por* * el usuario. * * Parametros: * * Autor: Juan Pablo Fern�ndez R Fecha de Creaci�n: 04 de Abril de 2001 * * Modificaciones * * 1. Autor: Fecha de Modificaci�n: * * Descripci�n: * *****************************************************************************/ function limpiarClasificacion(){ /* Limpiar clasificacion */ document.forma.clasificacion.value=''; document.forma.idplataforma.value=''; document.forma.idcategoria.value=''; document.forma.idsubcategoria.value=''; document.forma.idcomponente.value=''; } /* Funci�n que limpia los detalles del tipo de activo */ function limpiarDetallesTipo() { /* Limpiar detalles */ document.forma.iddetallestipo.value=''; document.forma.detalles.value=''; } /* Funci�n que limpia los detalles de localizacion */ function limpiarNivelesLocalizacion() { /* Limpiar niveles localizacion */ document.forma.localizacion.value=''; document.forma.detalleloc.value=''; document.forma.idslocalizacion.value=''; } /* Funci�n que limpia los detalles de localizacion */ function limpiarNivelesLocalizacionA() { /* Limpiar niveles localizacion */ document.forma.localizaciona.value=''; document.forma.detalleloca.value=''; document.forma.idslocalizaciona.value=''; } /* Funci�n que limpia los detalles de ubicacion organizacional */ function limpiarUbicacionOrg() { /* Limpiar niveles organizacionales */ document.forma.id_depto.value=''; document.forma.detalleubicorg.value=''; document.forma.idsubicacionorg.value=''; } /* Funci�n que limpia los detalles de ubicacion organizacional */ function limpiarUbicacionOrgA() { /* Limpiar niveles organizacionales */ document.forma.ubicacionorga.value=''; document.forma.detalleubicorga.value=''; document.forma.idsubicacionorga.value=''; } /* Funci�n que limpia los detalles de ubicacion organizacional */ function limpiarUbicacionOrgU() { /* Limpiar niveles organizacionales */ document.forma.ubicacionorgu.value=''; document.forma.detalleubicorgu.value=''; document.forma.idsubicacionorgu.value=''; } /* Funci�n que limpia los detalles de localizacion */ function limpiarNivelesLocalizacionU() { /* Limpiar niveles localizacion */ document.forma.localizacionu.value=''; document.forma.detallelocu.value=''; document.forma.idslocalizacionu.value=''; } /* Funci�n que limpia los detalles de localizacion en la forma de usuario */ function limpiarNivelesLocalizacionUsu() { /* Limpiar niveles localizacion */ document.thisForm.localizacion.value=''; document.thisForm.detalleloc.value=''; } /* Funci�n que establece la localizacion cuando se cambia el primer nivel */ function asignarLocalizacion() { document.forma.localizacion.value = document.forma.nivel.options[document.forma.nivel.selectedIndex].value; } /* Funci�n que establece la localizacion cuando se cambia el primer nivel */ function asignarLocalizacionA() { document.forma.localizaciona.value = document.forma.nivela.options[document.forma.nivela.selectedIndex].value; } /* Funci�n que establece la ubicacion organizacional cuando se cambia el primer nivel */ function asignarUbicacionOrg() { document.forma.id_depto.value = document.forma.departamento.options[document.forma.departamento.selectedIndex].value; } /* Funci�n que establece la ubicacion organizacional cuando se cambia el primer nivel */ function asignarUbicacionOrgA() { document.forma.ubicacionorga.value = document.forma.depasignado.options[document.forma.depasignado.selectedIndex].value; } /* Funci�n que establece la ubicacion organizacional cuando se cambia el primer nivel */ function asignarUbicacionOrgU() { document.forma.ubicacionorgu.value = document.forma.depusuario.options[document.forma.depusuario.selectedIndex].value; } /* Funci�n que establece la localizacion cuando se cambia el primer nivel */ function asignarLocalizacionU() { document.forma.localizacionu.value = document.forma.nivelu.options[document.forma.nivelu.selectedIndex].value; } /* Funcion que da de baja a un activo */ function baja() { if (document.forma.status.value == 'D') { mywindow=window.open('','Activos','width=' + 320 + ',height=' + 50 + ',left=100,top=100,scrollbars=yes'); mywindow.location.href= 'baja.asp?id=' + document.forma.iddispositivo.value + '&identificador=' + document.forma.identificador.value; mywindow.focus(); } } /* Funci�n que establece la localizacion cuando se cambia el primer nivel en la p�gina usuario*/ function asignarLocalizacionUsu() { document.thisForm.localizacion.value = document.thisForm.nivel.options[document.thisForm.nivel.selectedIndex].value; } function Mostrarforma(qstring,strpagina,nomforma,strnombre) { document.forma.action = nomforma + '.asp' + qstring; document.forma.submit(); } function validarTipSolicCliente(objForma){ var strError, strLongInvalida,strtiposolicitud; // Se validan campos requeridos relativos, longitud de cadenas, etc. if ( objForma.tipo_solicitud.value.length > 100 ) { strLongInvalida = '\n Nombre Solicitud'; } if (strLongInvalida){ strError += '\n Los siguientes campos exceden el tama�o permitido:\n' + strLongInvalida + '\n'; } // llamado a la funci�n que realiza la validaci�n. /* Validaci�n de campos obligatorios, num�ricos, etc.*/ //validarCampos(objForma, strError); } function validarTipSolicSubasta(objForma){ var strError, strLongInvalida,strtiposolicitud; // Se validan campos requeridos relativos, longitud de cadenas, etc. if ( objForma.tipo_solicitud.value.length > 100 ) { strLongInvalida = '\n Nombre Solicitud'; } if (strLongInvalida){ strError += '\n Los siguientes campos exceden el tama�o permitido:\n' + strLongInvalida + '\n'; } // llamado a la funci�n que realiza la validaci�n. /* Validaci�n de campos obligatorios, num�ricos, etc.*/ //validarCampos(objForma, strError); } /***************************************************************************** * Nombre: accion * * Descripci�n: Da valor a la operacion a realizar y envia la forma. * * Parametros: * * Autor: Juan Pablo Fern�ndez R. Fecha de Creaci�n: 21 de Nov de 2001 * * Modificaciones * * 1. Autor: Fecha de Modificaci�n: * * Descripci�n: * *****************************************************************************/ function accion(operacion) { document.forma.accion.value = operacion; document.forma.submit(); } /************************************************************************************************************/ /*Objetivo: muestra el registro seleccionado y en una forma especifica */ /*Parametros: */ /* Nombre E/S Prop�sito */ /* qstring Entrada Recibe el Id o identificador por el cual se busca */ /* para mostrar el registro seleccionado */ /*Autor: OLC */ /*Creacion: 12/13/00 */ /*Modificaci�n: */ /* 1. Autor: John Alexander Ardila Fecha de Modificaci�n: 10-Jul-2003 */ /* Descripci�n: - Ajustes para permitir mantener listaGeneral.asp de acuerdo al filtro establecido */ /* cuando las paginas de mantenimiento de tablas dinamicas es invocado desde ftbase.asp,*/ /* principalmente para el mantenimiento de la parametrizacion de ESCALAMIENTO RELATIVO. */ /* Recibe nuevo parametro strQSadicional en el cual es posible enviar un URL. */ /* Solicitud No. 4871 */ /* 2. Autor: Alfonso Gallegos T�llez Fecha: 2003/07/21 */ /* Sol. 5024 */ /* Manejo de la p�gina modoListaError. /************************************************************************************************************/ function mostrarregistroForma(qstring,strpagina,nomforma,strnombre,strQSadicional,strTarget) { if (strQSadicional == null) { strQSadicional = ''; } if(strpagina == 'basecon') { if (strnombre == '') { if(strTarget) if (strTarget != null && strTarget != '') document.modo.target = strTarget; document.modo.actual.value = qstring; document.modo.action = nomforma + '.asp?id=' + qstring + strQSadicional; document.modo.submit(); } else { if(strTarget) if (strTarget != null && strTarget != '') document.modo.target = strTarget; document.modo.actual.value = qstring; document.modo.action = nomforma + '.asp?id=' + qstring + strQSadicional + '&nombre=' + strnombre; document.modo.submit(); } } else if (strpagina == 'modoListaError') { if(strTarget) if (strTarget != null && strTarget != '') document.modo.target = strTarget; document.modo.actual.value = strpagina; document.modo.action = nomforma + '.asp' + qstring + strQSadicional; document.modo.submit(); } else{ if (strpagina == 'listaProyecto'){ if(strTarget) if (strTarget != null && strTarget != '') document.modo.target = strTarget; document.forma.actual.value = strpagina; document.forma.action = nomforma + '.asp' + qstring + strQSadicional; document.forma.submit(); } else{ if(strTarget) if (strTarget != null && strTarget != '') document.modo.target = strTarget; document.modo.actual.value = strpagina; document.modo.action = nomforma + '.asp' + qstring + strQSadicional; document.modo.submit(); } } } /*Objetivo: muestra el registro seleccionado y en una forma especifica*/ /*Parametros: */ /* Nombre E/S Prop�sito*/ /* qstring Entrada Recibe el Id o identificador por el cual se busca*/ /* para mostrar el registro seleccionado y el modulo*/ /*Autor: Jack Santos */ /*Creacion: 02/08/02 */ /*Modificaci�n: */ function mostrarregistroFormaTipSolic(qstring,strpagina,nomforma,strnombre,strmodulo) { if(strpagina == 'basecon') { if (strnombre == '') { document.modo.actual.value = qstring; document.modo.action = nomforma + '.asp?id=' + qstring + '&strmodulo=' + strmodulo; document.modo.submit(); } else { document.modo.actual.value = qstring; document.modo.action = nomforma + '.asp?id=' + qstring + '&nombre=' + strnombre + '&strmodulo=' + strmodulo; document.modo.submit(); } } else { document.modo.actual.value = strpagina; document.modo.action = nomforma + '.asp' + qstring; document.modo.submit(); } } /* */ function mostrarregistroFPagosPerfil(qstring1,qstring2,strpagina){ if(strpagina == 'formapagoperfil'){ document.modo.actual.value = qstring1 document.modo.actual.value = qstring2 document.modo.action = 'formapagoperfil.asp?idformapago=' + qstring1 + '&idperfil=' + qstring2; document.modo.submit(); } } function mostrarregistroFechaspago(qstring1,qstring2,qstring3,strpagina){ if(strpagina == 'fechapago'){ document.modo.actual.value = qstring1 document.modo.actual.value = qstring2 document.modo.actual.value = qstring3 document.modo.action = 'formafechapagos.asp?idfechapago=' + qstring1 + '&idnegocio=' + qstring2 + '&tipofacturacion=' + qstring3; document.modo.submit(); } } function mostrarregistroBloquesCampo(qstring0,qstring1,qstring2,qstring3,qstring4,qstring5,qstring6,qstring7,habilitar,strpagina){ if(strpagina == 'forma'){ document.modo.action = 'formaBloquesCampo.asp?habilitar=' + habilitar + '&tipocampo=' + qstring7 + '&idcampo=' + qstring0 + '&idbloqueHab=' + qstring1 + '&nomcampo=' + qstring2 + '&idxsl=' + qstring3 + '&nomtabla=' + qstring4 + '&nomcampotabla=' + qstring5 + '&idtabla=' + qstring6; document.modo.submit(); } } /* funci�n que muestra el registro seleccionado en modo de forma */ /*******************************************************************************/ /* Modificaciones: 1. Autor: John Ardila Fecha: 29 de Abril de 2003 Descripcion: Incluir Link sobre el Nombre del Cliente en los ModoLista de actividades presentes, y futuras para permitir la consulta del mismo. Incluir control en paginas ModoForma y ModoFiltro de actividades presentes y futuras a fin de mostrar el boton [Cliente] si y solo la pagina recibe o dispone de un ID de cliente valido. Ver solicitud No. 4670. Objetos Modificados: ModuloActividades/ProgramacionActividad/filtroActividadFutura.asp ModuloActividades/ProgramacionActividad/formaActividadFutura.asp ModuloActividades/ProgramacionActividad/nuevaActividadFutura.asp ModuloActividades/ReporteActividad/filtroReporteActividad.asp ModuloActividades/ReporteActividad/formaReporteActividad.asp ModuloActividades/ReporteActividad/nuevoReporteActividad.asp ModuloActividades/ReporteActividad/libreria.asp ModuloActividades/Scripts/libreriaActividades.asp General/scripts.js SPListarActividadesRepPorDia SPListarActividadesProgramadasPorDia */ /*******************************************************************************/ function mostrarregistroGeneral(qstring,strpagina){ if(strpagina == 'clientes'){ document.modo.actual.value = qstring document.modo.action = 'formaCliente.asp?id_cliente=' + qstring; document.modo.submit(); }else if(strpagina == 'clientesactividades'){ document.modo.actual.value = qstring document.modo.action = '../../ModuloCliente/formaCliente.asp?id_cliente=' + qstring; document.modo.submit(); }else if(strpagina == 'contactosfl'){ document.modo.actual.value = qstring; document.modo.action = 'modoformacontacto.asp?idcont=' + qstring; document.modo.submit(); }else if(strpagina == 'contactos'){ location.href = 'contacto.asp?idcont=' + qstring; }else if(strpagina == 'formaproyecto'){ location.href = 'formaproyecto.asp?id=' + qstring; }else if(strpagina == 'formaRepActividad'){ document.modo.actual.value = qstring; document.modo.action = 'formaRepActividad.asp?id_rep_actividad=' + qstring; document.modo.submit(); }else if(strpagina == 'Actividad'){ location.href = '../ModuloActividades/ReporteActividad/formaReporteActividad.asp?id_rep_actividad=' + qstring; }else if(strpagina == 'productos'){ document.modo.actual.value = qstring; document.modo.action = 'modoformaportafolio.asp?idprod=' + qstring; document.modo.submit(); }else if(strpagina == 'portafolio'){ document.modo.actual.value = qstring; document.modo.action = 'modoformaportafolioSub.asp?idprod=' + qstring; document.modo.submit(); }else if(strpagina == 'subasta'){ document.modo.actual.value = qstring; document.modo.action = 'productosporsubasta.asp?idsub=' + qstring; document.modo.submit(); }else if(strpagina == 'clienteportafolio'){ document.modo.actual.value = qstring; document.modo.action = 'clienteportafolio.asp?numpro=' + qstring; document.modo.submit(); }else if(strpagina == 'negocio'){ document.modo.actual.value = qstring; document.modo.action = 'principal.asp?idneg=' + qstring; document.modo.submit(); }else if(strpagina == 'factura'){ document.modo.actual.value = qstring; document.modo.action = 'nuevafactura.asp?idfactura=' + qstring; document.modo.submit(); }else if(strpagina == 'fechapago'){ document.modo.actual.value = qstring; document.modo.action = 'formafechapagos.asp?idfechapago=' + qstring; document.modo.submit(); }else if(strpagina == 'basecon'){ document.modo.actual.value = qstring; document.modo.action = 'modoforma.asp?id=' + qstring; document.modo.submit(); }else if(strpagina == 'modoformaDocumento'){ document.modo.actual.value = qstring; document.modo.action = 'modoformaDocumento.asp?id=' + qstring; document.modo.submit(); }else if(strpagina == 'modoformaFeedback'){ document.modo.actual.value = qstring; document.modo.action = 'modoforma.asp?idsol=' + qstring; document.modo.submit(); }else if(strpagina == 'aspirantes'){ document.modo.actual.value = qstring document.modo.action = 'modoforma.asp?idaspi=' + qstring; document.modo.submit(); }else if(strpagina == 'cotizaciones'){ document.modo.actual.value = qstring document.modo.action = 'pagcotizacion.asp?idcot=' + qstring; document.modo.submit(); }else if((strpagina == 'TRDO')||(strpagina == 'TRHD')||(strpagina == 'TRSC')){ document.forms['modo'].actual.value = strpagina; document.forms['modo'].target="_parent"; document.forms['modo'].action = '../../ModuloSeguimiento/seguimiento.asp' + qstring; document.forms['modo'].submit(); }else { document.forms['modo'].actual.value = strpagina; document.forms['modo'].action = 'modoforma.asp' + qstring; document.forms['modo'].submit(); } } /* funci�n que muestra el registro seleccionado en modo de forma para UF */ function mostrarregistroGeneralUf(qstring,strpagina){ if(strpagina == 'clientes'){ document.modo.actual.value = qstring document.modo.action = 'modoforma.asp?idcli=' + qstring; document.modo.submit(); }else if(strpagina == 'contactosfl'){ document.modo.actual.value = qstring; document.modo.action = 'modoformacontacto.asp?idcont=' + qstring; document.modo.submit(); }else if(strpagina == 'contactos'){ location.href = 'contacto.asp?idcont=' + qstring; }else if(strpagina == 'productos'){ document.modo.actual.value = qstring; document.modo.action = 'modoformaportafolio.asp?idprod=' + qstring; document.modo.submit(); }else if(strpagina == 'clienteportafolio'){ document.modo.actual.value = qstring; document.modo.action = 'modoformaclientepor.asp?numpro=' + qstring; document.modo.submit(); }else if(strpagina == 'basecon'){ document.modo.actual.value = qstring; document.modo.action = 'modoforma.asp?id=' + qstring; document.modo.submit(); }else if(strpagina == 'modoformaDocumento'){ document.modo.actual.value = qstring; document.modo.action = 'modoformaDocumento.asp?idDoc=' + qstring; document.modo.submit(); }else if(strpagina == 'TRDO'){ document.forms['modo'].actual.value = strpagina; document.forms['modo'].action = '../../ModuloDocumental/ModuloSeguimiento/modoformauf.asp' + qstring; document.forms['modo'].submit(); }else if(strpagina == 'TRHD'){ document.forms['modo'].actual.value = strpagina; document.forms['modo'].action = '../../HelpDesk/ModuloSeguimiento/modoformauf.asp' + qstring; document.forms['modo'].submit(); } else if(strpagina == 'TRSC'){ document.forms['modo'].actual.value = strpagina; document.forms['modo'].action = '../../serviciocliente/ModuloSeguimiento/modoformauf.asp' + qstring; document.forms['modo'].submit(); }else { document.forms['modo'].actual.value = strpagina; document.forms['modo'].action = 'modoformauf.asp' + qstring; document.forms['modo'].submit(); } } /* Redirecciona */ function redireccionar(pagina){ if(pagina != ''){ top.location.href = pagina; } } /* Funci�n que evalua la accion para navegar entre registros*/ function mover(valor,pagina) { //Siguiente if(valor == 8){ var tam; tam = document.forma.tam.value; //buscar cu�l es... for(var j=0; j <= tam-1; j++){ if (document.forma.actual.value.indexOf('&') != -1) var actual = document.forma.actual.value.substr(0,document.forma.actual.value.indexOf('&')); else var actual = document.forma.actual.value; if( actual == eval('document.forma.identity' + j + '.value')) { //Verificar s� es el �ltimo if(j < tam-1){ j += 1; document.forma.actual.value = eval('document.forma.identity' + j + '.value'); document.forma.id.value = document.forma.actual.value; document.forma.action = pagina + document.forma.actual.value; document.forma.submit(); break; } } } }else if(valor == 7){ // ir al anterior var tam; tam = document.forma.tam.value; //buscar cu�l es... for(var j=0; j <= tam-1; j++){ if (document.forma.actual.value.indexOf('&') != -1) var actual = document.forma.actual.value.substr(0,document.forma.actual.value.indexOf('&')); else var actual = document.forma.actual.value; if( actual == eval('document.forma.identity' + j + '.value')) { //Verificar s� es el primero if( j > 0 ){ j -= 1; document.forma.actual.value = eval('document.forma.identity' + j + '.value'); document.forma.id.value = document.forma.actual.value; document.forma.action = pagina + document.forma.actual.value; document.forma.submit(); break; } } } }else{ var tam; tam = document.forma.tam.value; //buscar cu�l es... for(var j=0; j < tam; j++){ if(document.forma.actual.value == eval('document.forma.identity' + j + '.value')){ //Verificar s� es el primero if(j != 0){ j -= 1; document.forma.actual.value = eval('document.forma.identity' + j + '.value'); document.forma.action = pagina + document.forma.actual.value; document.forma.submit(); }else{ j = tam - 1; document.forma.actual.value = eval('document.forma.identity' + j + '.value'); document.forma.action = pagina + document.forma.actual.value; document.forma.submit(); } } } } } /* Funci�n que evalua la accion para navegar entre registros*/ function moverhdsc(valor,pagina) { //Siguiente if(valor == 8) { var tam; tam = document.forma.tam.value; //buscar cu�l es... for(var j=0; j <= tam-1; j++){ if(document.forma.actual.value == eval('document.forma.identity' + j + '.value')) { //Verificar s� es diferente del �ltimo (en el �ltimo no se avanza) if(j < tam-1) { j += 1; document.forma.actual.value = eval('document.forma.identity' + j + '.value'); document.forma.idsol.value = eval('document.forma.identity' + j + '.value'); document.forma.action = pagina + '?idsol=' + document.forma.actual.value + '&status=' + eval('document.forma.statusf' + j + '.value'); document.forma.submit(); break; }else { // document.forma.actual.value = document.forma.identity0.value; // document.forma.action = pagina + '?idsol=' + document.forma.actual.value + '&status=' + document.forma.statusf0.value; // document.forma.submit(); } } } }else if(valor == 7) // Ir al anterior { var tam; tam = document.forma.tam.value; //buscar cu�l es... for(var j=tam-1; j > 0; j--){ if(document.forma.actual.value == eval('document.forma.identity' + j + '.value')) { //Verificar s� es el primero (en el primero no se retrocede) if(j > 0) { j -= 1; document.forma.actual.value = eval('document.forma.identity' + j + '.value'); document.forma.idsol.value = eval('document.forma.identity' + j + '.value'); document.forma.action = pagina + '?idsol=' + document.forma.actual.value + '&status=' + eval('document.forma.statusf' + j + '.value'); document.forma.submit(); break; } } } } else { var tam; tam = document.forma.tam.value; //buscar cu�l es... for(var j=0; j < tam; j++){ if(document.forma.actual.value == eval('document.forma.identity' + j + '.value')){ //Verificar s� es el primero if(j != 0){ j -= 1; document.forma.actual.value = eval('document.forma.identity' + j + '.value'); document.forma.action = pagina + '?idsol=' + document.forma.actual.value + '&status=' + eval('document.forma.statusf' + j + '.value'); document.forma.submit(); }else{ j = tam - 1; document.forma.actual.value = eval('document.forma.identity' + j + '.value'); document.forma.action = pagina + '?idsol=' + document.forma.actual.value + '&status=' + eval('document.forma.statusf' + j + '.value'); document.forma.submit(); } } } } } /* Funci�n que evalua la accion para navegar entre registros*/ function moverac(valor,pagina) { //Siguiente if(valor == 8){ var tam; tam = document.forma.tam.value; //buscar cu�l es... for(var j=0; j < tam; j++){ if(document.forma.actual.value == eval('document.forma.identity' + j + '.value')){ //Verificar s� es el �ltimo if(j != tam-1){ j += 1; document.forma.actual.value = eval('document.forma.identity' + j + '.value'); document.forma.action = pagina + '?id=' + document.forma.actual.value + '&status=' + eval('document.forma.statusf' + j + '.value'); document.forma.submit(); }else{ document.forma.actual.value = document.forma.identity0.value; document.forma.action = pagina + '?id=' + document.forma.actual.value + '&status=' + document.forma.statusf0.value; document.forma.submit(); } } } }else{ var tam; tam = document.forma.tam.value; //buscar cu�l es... for(var j=0; j < tam; j++){ if(document.forma.actual.value == eval('document.forma.identity' + j + '.value')){ //Verificar s� es el primero if(j != 0){ j -= 1; document.forma.actual.value = eval('document.forma.identity' + j + '.value'); document.forma.action = pagina + '?id=' + document.forma.actual.value + '&status=' + eval('document.forma.statusf' + j + '.value'); document.forma.submit(); }else{ j = tam - 1; document.forma.actual.value = eval('document.forma.identity' + j + '.value'); document.forma.action = pagina + '?id=' + document.forma.actual.value + '&status=' + eval('document.forma.statusf' + j + '.value'); document.forma.submit(); } } } } } /* Funci�n que limpia los detalles de localizacion en la forma de usuario */ function limpiarNivelesTipoDoc(pagina) { /* Limpiar niveles localizacion */ if(pagina == 'DocuNuevo'){ document.forma.TipoDoc.value=''; document.forma.detalleTipoDoc.value=''; } else if (pagina == ''){ document.formaFiltro.TipoDoc.value=''; document.formaFiltro.detalleTipoDoc.value=''; } } /* Funci�n que limpia los detalles de localizacion del filtro de tipo de Solicitud */ function limpiarNivelesTipoSol() { /* Limpiar niveles localizacion */ document.forma.idsTiposSoli.value=''; document.forma.detalleTipoSoli.value=''; } /* Funci�n que establece la localizacion cuando se cambia el primer nivel */ function asignarTipoDoc(pagina) { if(pagina == 'DocuNuevo'){ document.forma.TipoDoc.value = document.forma.nivel.options[document.forma.nivel.selectedIndex].value; } else if (pagina == 'filtroTipoDocu'){ document.formaFiltro.TipoDoc.value = document.formaFiltro.nivel.options[document.formaFiltro.nivel.selectedIndex].value; } } function verificar_cambios(y) { switch(y) { case 1: { forma.por_atencion.value=''; break; } case 2: { forma.t_atencion.value=''; break; } case 3: { forma.por_notificacion.value='' break; } case 4: { forma.t_notificacion.value='' break; } case 5: { forma.por_normal.value='' break; } case 6: { forma.t_normal.value='' break; } case 7: { forma.por_excedido.value='' break; } case 8: { forma.t_excedido.value='' break; } } } /* * Esta funci�n realiza el redondeo de un numero al n�mero de posiciones decimales que especifique. */ function Round(number,X) { // rounds number to X decimal places, defaults to 2 X = (!X ? 2 : X); return Math.round(number*Math.pow(10,X))/Math.pow(10,X); } /* * Esta funci�n realiza la validaci�n de los campos de tiempos de una forma. */ function validarTiempos() { if (t_critico > 0) { /*Tiempo de atenci�n*/ if (por_atencion > 0) { t_atencion = ((t_critico * por_atencion)/100); t_atencion = Round(t_atencion,5); } else if (t_atencion > 0) { por_atencion = ((t_atencion /t_critico)*100); por_atencion = Round(por_atencion,5); } /*Tiempo de notificacion*/ if (por_notificacion > 0) { t_notificacion = ((t_critico * por_notificacion)/100); t_notificacion = Round(t_notificacion,5); } else if (t_notificacion > 0) { por_notificacion = ((t_notificacion/t_critico)*100); por_notificacion = Round(por_notificacion,5); } /*Tiempo de normal*/ if (por_normal > 0) { t_normal = ((t_critico * por_normal)/100); t_normal = Round(t_normal,5); } else if (t_normal > 0) { por_normal = ((t_normal/t_critico)*100); por_normal = Round(por_normal,5); } if (por_excedido > 0) { t_excedido = ((t_critico * por_excedido)/100); t_excedido = Round(t_excedido,5); } else if (t_excedido > 0) { por_excedido = ((t_excedido/t_critico)*100); por_excedido = Round(por_excedido); } } } /* * Esta funci�n realiza la validaci�n de una forma. Se invocada desde el * evento onSubmit() del event handler. El handler debe retornar el * valor que rertorne esta funci�n. */ function validarCampos(laForma, strOtrosErrores) { var mensaje; var camposVacios = ""; var errores = ""; if (strOtrosErrores == null) { // Se asigna vacio, para evitar problemas cuando este // parametro esta indefinido. strOtrosErrores = ''; } /* * Recorre la lista de los elementos de la forma, buscando aquellos cuyo * tipo sea "text", "textarea" y "selects" que no tengan definida la propiedad "optional". * Luego, revisa los campos que son vacios (y no deber�an serlo) y realiza una lista * de ellos. Tambi�n si alguno de los elementos tiene alguna de las siguientes propiedades * definidas: min, max y/o numeric verifica que sea num�rico y se encuentre en el rango * correspondiente. Muestra los mensajes de error para los campos que tengan valores * incorrectos. */ for(var i = 0; i < laForma.length; i++) { var p; var e = laForma.elements[i]; if (((e.type== "text") || (e.type == "textarea") || (e.type == "select-one"))) { // Esto es valido para los campos de tipo_cobertura por ser un caso especial. if ((e.name=='sabado_habil') || (e.name=='domingo_habil') || (e.name=='basica')) { if (e.value.length > 0) { if (e.value == 's' || e.value == 'S') e.value = 'S'; else if(e.value == 'n' || e.value == 'N') e.value = 'N'; else return (0); } } // Revisa los campos vacios if ((e.optional!=null && !e.optional) && ((e.value == null) || (e.value == "") || esBlanco(e.value))) { camposVacios += "\n " + e.name; continue; } // Verifica los campos num�ricos. var filter = /^-?\d*\.?\d*$/; if (e.getAttribute("numeric")) { if (filter.test(e.value)) { if ((e.getAttribute("min") != null && e.getAttribute("min") != "") || (e.getAttribute("max") != null && e.getAttribute("max") != "") && (!esBlanco(e.value))) { var v = parseFloat(e.value); if (isNaN(v) || ((e.getAttribute("min") != null) && (v < e.getAttribute("min")) && e.getAttribute("min") != "") || ((e.getAttribute("max") != null) && (v > e.getAttribute("max")) && e.getAttribute("max") != "")) { errores += "- El Campo " + e.name + " deber ser num?rico"; if (e.getAttribute("min") != null) errores += " mayor o igual que " + e.getAttribute("min"); if (e.getAttribute("max") != null && e.getAttribute("min") != null) errores += " y menor o igual que " + e.getAttribute("max"); else if (e.getAttribute("max") != null) errores += " menor o igual que " + e.getAttribute("max"); errores += ".\n"; } else { e.value = v; } } } else { errores += "- El Campo " + e.name + " deber ser numerico\n"; } } /* Verifica campos de tipo fecha (m�nima y m�xima) if ( ( e.date || (e.dmin != null) || (e.dmax != null)) && !esBlanco(e.value) ) { if (!IsDateVal (e.value)){ errores+= "- El Campo " + e.name + " debe contener una fecha valida.\n"; } var v = new Date(e.value); if ( isNaN(v) || ((e.dmin != null) && (v < (new Date(e.dmin)))) || (e.dmax != null) && (v > (new Date(e.dmax))) ) { errores += "- El Campo " + e.name + " debe ser una fecha"; if (e.dmin != null) { errores += " mayor que " + e.dmin; } if (e.dmax != null && e.dmin != null){ errores += " y menor que " + e.dmax; } else if (e.dmax != null) { errores += " menor que " + e.dmax; } errores += ".\n"; } }*/ // El campo debe contener una direcci�n de correo electr�nico if (e.mail && !esBlanco(e.value)) { p = e.value.indexOf('@'); if ( p < 1 || p == (e.value.length-1) ) errores+= "- El Campo " + e.name + " debe contener una direccion de correo electronico.\n"; } } } /* * Ahora, si se encontraron errores, se muestra el mensaje, y se * cancela el submit. */ if (camposVacios || errores || strOtrosErrores){ // Ocurrio un error mensaje = "La forma no fue enviada.\nOcurrieron los siguientes error(es):\n"; if (camposVacios) { // Hay campos vacios se a�aden al mensaje. mensaje += "- Los siguientes campos son obligatorios:" + camposVacios + "\n"; } if (errores) { // Hay otros tipos de errores se a�aden al mensaje. mensaje += "\n"; mensaje += errores; } if (strOtrosErrores) { // Errores validados en la funci�n que llama a esta. mensaje += "\n"; mensaje += strOtrosErrores; } mensaje += "\nPor favor corrija estos error(es) y reenvie"; alert(mensaje); } document.respValidacion = (errores == '' && camposVacios == '' && strOtrosErrores == ''); } /* * Funci�n que retorna si una cadena esta compuesta solamente * por caracteres blancos. */ function esBlanco(cadena) { for(var i = 0; i < cadena.length; i++) { var c = cadena.charAt(i); if ((c != ' ') && (c != '\n') && (c != '\t')) return false; } return true; } /* * Funci�n que deshabilita el boton de ingreso de solicitudes */ function deshabilitarIngreso(numenlace) { var coll = document.all.tags("A"); if (coll!=null) { coll[numenlace].href="#"; } } /* * Funci�n que recorre un listbox de una forma y selecciona la opcion por text */ function seleccionarPorTexto(nomforma, nomselect, nomopcion) { var elemento, i, forma; eval('forma = ' + nomforma); eval('elemento = ' + nomforma + '.' + nomselect); for (i = 0; i < elemento.options.length; i++) { if (elemento.options[i].text == nomopcion) { elemento.selectedIndex = i; /* Limpiar asignado */ forma.idasignado.value=''; /* Limpiar clasificacion */ forma.clasificacion.value=''; forma.idplataforma.value=''; forma.idcategoria.value=''; forma.idsubcategoria.value=''; forma.idcomponente.value=''; /* Limpiar detalles */ forma.detalles.value=''; forma.iddetalles.value=''; forma.txdetalles.value=''; forma.nivelcompleto.value='' } } } /*****************************************************************************************************/ /*Objetivo: Funci�n que valida el titulo del formato*/ /*Parametros:*/ /* NOMBRE E/S PORPOSITO*/ /*Autor: FQT*/ /*Creacion: 15/01/2001*/ /*****************************************************************************************************/ function ValidarTitulo() { var errores; errores = ''; /* Validar los requeridos */ /*Titulo del tipo de docuemtno*/ if (document.forma.nombre.value == '') { errores += '-El campo Nombre es requerido.\n'; document.forma.nombre.focus(); } if (errores) alert('Los siguientes errores ocurrieron:\n' + errores); /* Retornar */ document.respValidacion = (errores == ''); } /**/ function abrirVentana_(URL, ancho, alto, nombre, resizable) { var vResizable = 'yes'; if (resizable != true) vResizable = 'no'; mywindow=window.open('',nombre,'width=' + ancho + ',height=' + alto + ',left=100,top=100,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable='+vResizable); mywindow.location.href= URL; mywindow.focus(); } /***************************************************************************** * Nombre: abrirVentana * * Descripci�n: Se encarga de desplegar una ventana y cargar en ella una * * p�gina asp que llega como par�metro. * * Parametros: * * strNombreServ Entrada Nombre del servidor donde se encuentra el * * sistema. * * strDirRaiz Entrada Directorio virtual base del sistema. * * strNomVenatana Entrada Nombre de la ventana. * * strPagina Entrada nombre de la p�gina (con estructura de * * directorios a partir de la ra�z virtual. * * intAlto Entrada Indica el alto de la ventana. * * intAncho Entrada Indica el ancho de la ventana. * * strParams Entrada Par�metros de la p�gina que se carga en la * * ventana. * * blnTamVar Entrada Indica si la ventana es de tama�o variable * * Autor: Juan Pablo Fern�ndez R Fecha: 06 de Abril de 2001 * * Modificaciones * * 1. Autor: Juan Pablo Fern�ndez Ram�rez Fecha: 09 de Mayo de 2003 * * Descripci�n: * * - Se adiciono parametro puerto, para el caso en que el puerto no es * * el por defecto. * *****************************************************************************/ function abrirVentana( strNombreServ, strDirRaiz, strNombreVentana, strPagina, intAlto, intAncho, strParams, blnTamVar, strPuerto) { var strTamVar; var strRuta = ''; // almacena el path a la p�gina. if ( (strPagina.toLowerCase().indexOf('http://') == -1) && (strPagina.toLowerCase().indexOf('https://') == -1) ) strRuta = 'https://' + strNombreServ + strPuerto + strDirRaiz; strRuta += strPagina if ((strParams != null) && (strParams != '')) strRuta += '?' + strParams; if (blnTamVar) { strTamVar = 'resizable=yes'; } else { strTamVar = 'resizable=no'; } var vFullSize = ((strPagina.toLowerCase().indexOf('formatoarchivosnet.asp') > -1) ||(strPagina.toLowerCase().indexOf('formatipodocarchivos.asp') > -1) || (strPagina.toLowerCase().indexOf('formatipflujo.asp') > -1) || (strPagina.toLowerCase().indexOf('signencbin.asp') > -1) || (strPagina.toLowerCase().indexOf('verifybin.asp') > -1) || (strPagina.toLowerCase().indexOf('formaexpedientes.asp') > -1) || (strPagina.toLowerCase().indexOf('formametadata.asp') > -1) || (strPagina.toLowerCase().indexOf('firmastransferencia.asp') > -1) || (strPagina.toLowerCase().indexOf('modificarperiodoretencion.asp') > -1) || (strPagina.toLowerCase().indexOf('asociarcamposdin.asp') > -1)); if (vFullSize) { laVentana = window.open( '', strNombreVentana, 'width=' + intAncho + ',height=' + intAlto + ',left=20,top=20,scrollbars=yes,status=yes, ' + strTamVar); } else { if ((intAlto > 600 || intAncho > 600) && (!vFullSize) ) { laVentana = window.open( '', strNombreVentana, 'width="100%",height="100%",scrollbars=yes,status=yes, ' + strTamVar); } else { laVentana = window.open( '', strNombreVentana, 'width=' + intAncho + ',height=' + intAlto + ',left=100,top=100,scrollbars=yes,status=yes, ' + strTamVar); } } laVentana.location.href = strRuta; laVentana.focus(); } // Invoca los procesos de distribuci�n en una nueva ventana realizando la petici�n por Post function abrirVentanaDistribucionPost( strNombreServ, strDirRaiz, strNombreVentana, strPagina, intAlto, intAncho, blnTamVar, strPuerto, vDocs, proceso, accion) { var strTamVar; var strRuta = ''; // almacena el path a la p�gina if ( (strPagina.toLowerCase().indexOf('http://') == -1) && (strPagina.toLowerCase().indexOf('https://') == -1) ){ strRuta = 'https://' + strNombreServ + strPuerto + strDirRaiz; } if(strNombreVentana == ""){ strNombreVentana = "Generaci�n de Planillas - Distribuci�n Documental"; } strRuta += strPagina if (blnTamVar) { strTamVar = 'resizable=yes'; } else { strTamVar = 'resizable=no'; } // arreglo con los par�metros var dataRequest = {}; // Datos fijos dataRequest['proceso'] = proceso; dataRequest['accion'] = accion; dataRequest['f'] = new Date(); if(vDocs.length > 5000) { // Seccionar el n�mero de documentos ya que se trunca la informaci�n en la petici�n POST // cuando un campo supera una longitud promedio de 5500 caracteres. var blnStop = false; var cnt = 2; var vDocsTemp; var posCom; posCom = vDocs.indexOf(",", 5000); dataRequest['IDsDocsProceso'] = vDocs.substring(0, posCom); vDocsTemp = vDocs.substring(posCom); while (!blnStop) { if(vDocsTemp.length > 5000) { posCom = vDocsTemp.indexOf(",", 5000); dataRequest['IDsDocsProceso'+cnt] = vDocsTemp.substring(0, posCom); vDocsTemp = vDocsTemp.substring(posCom); cnt++; } else { dataRequest['IDsDocsProceso'+cnt] = vDocsTemp; blnStop = true; } } dataRequest['NumSeccionesDocs'] = cnt; } else { dataRequest['IDsDocsProceso'] = vDocs; } //console.log("vDocs: " + vDocs); //console.log("vDocs2: " + vDocs2); $("#CargarDistribucion").show(); $.post(strRuta, dataRequest, function (data) { $("#CargarDistribucion").hide(); var newWindow = window.open("", strNombreVentana, "width=" + intAncho + ",height=" + intAlto + ',left=100,top=100,scrollbars=yes,status=yes, ' + strTamVar); newWindow.document.write(data); }).fail(function(){ //alert("error"); console.log("error"); }); /*var vRespuesta = 0; $.ajax({ type: "POST", async: false, url: strRuta, //data: {IDsDocsProceso: vDocs, IDsDocsProceso2: vDocs2, proceso: proceso, accion: accion, f : new Date()}, data: prueba, success: function(data) { vRespuesta = data; } }); //return vRespuesta;*/ } /***************************************************************************** * Nombre: escogerValor * * Descripci�n: Toma el conjunto de valores escogido por el usuario en una * * ventana de b�squeda y lo pasa a la p�gina principal. Si * * strServidor, strDirRaiz, strPagina son diferentes de vacio * * es por que se debe cargar(recargar) la p�gina strP�gina * * Parametros: * * intIndice Entrada N�mero del campo en la ventana de b�squeda donde se * * encuentra la informaci�n a copiar. * * strPagina Entrada Nombre de la p�gina (con estructura de directorios * * a partir de la ra�z virtual) que se debe cargar. * * strCampos Entrada Cadena separada por comas (,), con los nombres de * * en los cuales se deben copiar la informaci�n. El * * orden debe ser equivalente a los valores en el campo * * con indice intIndice. * * strServidor Entrada Nombre del servidor donde se encuentra el sistema. * * strDirRaiz Entrada Directorio virtual base del sistema. * * strParamPagina Entrada Parametros adicinales a strPagina * * * * OJO: Se espera que strPagina sea la misma p�gina que abrio la ventana de * * b�squeda. * * * * Autor: Juan Pablo Fern�ndez R Fecha: 11 de Abril de 2001 * * Modificaciones * * 1. Autor: Juan Pablo Fern�ndez R. Fecha: 09 de mayo de 2003 * * Descripci�n: * * - Se incluyo campos strPuerto para cuando el puerto no es el por * * defecto. * *****************************************************************************/ function escogerValor(intIndice, strPagina, strCampos, strServidor, strDirRaiz, strParamPagina, strPuerto){ var j, strRuta; // Se obtiene el nombre de los campos en los cuales se debe copiar la info. var arrNombreCampos = strCampos.split(','); // Se obtienen los valores a copiar var arrValoresCampos = document.forms[0].elements[intIndice].value.split('?'); // Se copian los valores en los campos correspondientes. for (j = 0; j < arrNombreCampos.length; j++ ){ eval("opener.document.forms[0]." + arrNombreCampos[j] + '.value="' + arrValoresCampos[j] + '"'); } if (strPagina != '' && strServidor != '' && strDirRaiz != ''){ // Ademas de copiar la info se carga esta p�gina. strRuta = 'https://' + strServidor + strPuerto + strDirRaiz + strPagina + '?' + arrNombreCampos[0] + '=' + arrValoresCampos[0]; if (strParamPagina != '') { /* Se pegan los parametros adicionales. */ strRuta += '&' + strParamPagina; } opener.location.href = strRuta; } //sirve para validar FiltroTablaCampos. if(typeof opener.Validar == "function"){ parent.opener.Validar(); } if(typeof opener.Validar1 == "function"){ parent.opener.Validar1(); } if(typeof opener.Validar2 == "function"){ parent.opener.Validar2(); } //Jmendez 27/10/2016 Se agrega para validar los campos del modal que se encuentra en el calendario de reporte actividades if (typeof opener.f_ValidarSeleccionHoras == "function") { if(arrNombreCampos == "id_cliente,nom_cliente"){ parent.opener.document.forma.nom_cliente.classList.add("datos") } if(arrNombreCampos == "id_negocio,nom_negocio,id_cliente,nom_cliente,id_actividad,nom_actividad"){ parent.opener.document.forma.nom_negocio.classList.add("datos") } if(arrNombreCampos == "id_contacto,nom_contacto"){ parent.opener.document.forma.nom_contacto.classList.add("datos") } if(arrNombreCampos == "id_actividad,nom_actividad"){ parent.opener.document.forma.nom_actividad.classList.add("datos") } if(arrNombreCampos == "id_categoria,nom_categoria,necesita_cliente,necesita_negocio"){ parent.opener.document.forma.nom_categoria.classList.add("datos") } parent.opener.Validacampos(); } } function escogerValorCampo(intidcampo, strcampo){ window.close(); parent.opener.forma.camtabla.value = intidcampo; parent.opener.forma.nombrecam.value = strcampo; } function escogerValorTabla(intidtabla, strtabla){ window.close(); parent.opener.forma.numtabla.value = strtabla; parent.opener.forma.tabla.value = intidtabla; } function escogerValorDepend(strvalor){ window.close(); parent.opener.forma.valorbusquedaBD.value = strvalor; } /***************************************************************************** * Nombre: escogerValorAdicionar * * Descripci�n: Toma el conjunto de valores escogido por el usuario en una * * ventana de b�squeda y lo pasa a la p�gina principal * * adicionando el valor al campo respectivo no sobresribiendo. * * si strServidor, strDirRaiz, strPagina son diferentes de vacio* * es por que se debe cargar(recargar) la p�gina strP�gina * * Parametros: * * intIndice Entrada N�mero del campo en la ventana de b�squeda donde se * * encuentra la informaci�n a copiar. * * strPagina Entrada Nombre de la p�gina (con estructura de directorios * * a partir de la ra�z virtual) que se debe cargar. * * strCampos Entrada Cadena separada por comas (,), con los nombres de * * en los cuales se deben copiar la informaci�n. El * * orden debe ser equivalente a los valores en el campo * * con indice intIndice. * * strServidor Entrada Nombre del servidor donde se encuentra el sistema. * * strDirRaiz Entrada Directorio virtual base del sistema. * * strParamPagina Entrada Parametros adicinales a strPagina * * * * OJO: Se espera que strPagina sea la misma p�gina que abrio la ventana de * * b�squeda. * * * * Autor: Juan Pablo Fern�ndez R Fecha: 09 de Sep de 2002 * * Modificaciones * * 1. Autor: Juan Pablo Fern�nde R Fecha: 09 de Mayo de 2003 * * Descripci�n: * * - Se incluyo parametro puerto, para cuando el puerto no es por * * defecto. * *****************************************************************************/ function escogerValorAdicionar(intIndice, strPagina, strCampos, strServidor, strDirRaiz, strParamPagina, strPuerto){ var j, strRuta; // Se obtiene el nombre de los campos en los cuales se debe copiar la info. var arrNombreCampos = strCampos.split(','); // Se obtienen los valores a copiar var arrValoresCampos = document.forms[0].elements[intIndice].value.split('?'); // Se copian los valores en los campos correspondientes. for (j = 0; j < arrNombreCampos.length; j++ ){ if (eval("opener.document.forms[0]." + arrNombreCampos[j] + ".value == ''")) { eval("opener.document.forms[0]." + arrNombreCampos[j] + ".value+='" + arrValoresCampos[j] + "'"); } else { eval("opener.document.forms[0]." + arrNombreCampos[j] + ".value+=', " + arrValoresCampos[j] + "'"); } } if (strPagina != '' && strServidor != '' && strDirRaiz != ''){ // Ademas de copiar la info se carga esta p�gina. strRuta = 'https://' + strServidor + strPuerto + strDirRaiz + strPagina + '?' + arrNombreCampos[0] + '=' + arrValoresCampos[0]; if (strParamPagina != '') { /* Se pegan los parametros adicionales. */ strRuta += '&' + strParamPagina; } opener.location.href = strRuta; } } /*Escoge el valor de la forma CIU*/ function escogerValorCiu(intIndice, strPagina, strCampos, strServidor, strDirRaiz, strParamPagina, strPuerto){ var j, strRuta; // Se obtiene el nombre de los campos en los cuales se debe copiar la info. var arrNombreCampos = strCampos.split(','); // Se obtienen los valores a copiar var arrValoresCampos = document.forms[0].elements[intIndice].value.split('?'); // Se copian los valores en los campos correspondientes. for (j = 0; j < arrNombreCampos.length; j++ ){ eval("opener.document.forms[0]." + arrNombreCampos[j] + ".value='" + arrValoresCampos[j] + "'"); } if (strPagina != '' && strServidor != '' && strDirRaiz != ''){ // Ademas de copiar la info se carga esta p�gina. strRuta = 'https://' + strServidor + strPuerto + strDirRaiz + strPagina + '?' + arrNombreCampos[0] + '=' + arrValoresCampos[0]; if (strParamPagina != '') { /* Se pegan los parametros adicionales. */ strRuta += '&' + strParamPagina; } opener.location.href = strRuta; } opener.document.forma.desciu.value = opener.document.forma.nom_ciiu.value; opener.document.forma.nom_ciiu.value = opener.document.forma.id_ciiu.value; } /***************************************************************************** * Nombre: escogerTodos * * Descripci�n: Marca o Desmarca todos los checkbox de un p�gina. * * Parametros: * * intAccion Entrada Indica la acci�n deseada 1 Marca 0 DesMarca. * * Autor: Juan Pablo Fern�ndez R Fecha de Creaci�n: 20 de Abril de 2001 * * Modificaciones * * 1. Autor: Fecha de Modificaci�n: * * Descripci�n: * *****************************************************************************/ function escogerTodos(intAccion) { var elementos, i, blnAccion; elementos = document.forma.elements; blnAccion = (intAccion == 1) ? true : false; for ( i = 0; i < elementos.length; i++ ) { if (elementos[i].type.toUpperCase() == 'CHECKBOX') { elementos[i].checked = blnAccion; } } } /***************************************************************************** * Nombre: generarEscogidos * * Descripci�n: Genera una cadena con los identificadores asociados a los * * checkbox. Este valor se almacena en el campo escogidos de * * la forma. * * Parametros: * * intAccion Entrada Acci�n que debe realizar la p�gina. * * strNomBaseCheck Entrada Nombre base de los checkbox. Se espera que los * * nombres de los checkbox sean del estilo nombre + * * consecutivo, ej nom1, nom2 ... * * strNomBaseId Entrada Nombre base del campo donde de almacena el id * * asociado al checkbox. * * Autor: Juan Pablo Fern�ndez R Fecha de Creaci�n: 23 de Abril de 2001 * * Modificaciones * * 1. Autor: Fecha de Modificaci�n: * * Descripci�n: * *****************************************************************************/ function generarEscogidos(intAccion, strNomBaseCheck, strNomBaseId) { var arrElementos, i, intFlag, intConsCheck = 0; arrElementos = document.forma.elements; for( i = 0, intFlag = 0; i < arrElementos.length; i++ ){ if (arrElementos[i].type.toUpperCase() == 'CHECKBOX') { /*El elemento es un checkbox.*/ if ( eval('document.forma.' + strNomBaseCheck + intConsCheck +'.checked') ) { /* el elemento esta marcado se incluye el identifcador que representa. */ document.forma.escogidos.value = document.forma.escogidos.value + eval('document.forma.' + strNomBaseId + intConsCheck + '.value') + '?'; intFlag++; } intConsCheck++; } } if ( intFlag > 0 ){ /* Hab�an elementos escogidos se prosigue y se debe hacer submit. */ if ( intAccion != 0 ) { // Se debe hacer submit. document.forma.accion.value = intAccion; document.forma.submit(); } else { document.respValidacion = true; } } else { /* No se escogio valor. */ alert('Debe escoger un valor.\n'); document.respValidacion = false; } } /*****************************************************************************************************/ /*Objetivo: Funci�n desasocia los documentos que han sido seleccionados /*Parametros:*/ /* NOMBRE E/S PORPOSITO*/ /*Autor: OLC*/ /*Creacion: 12/09/2001*/ /*****************************************************************************************************/ function DesasociarDtos(accion) { var tam,i,flag; flag = 0; tam = eval('document.forma.tam.value') document.forma.escogidos.value = ''; for(i= 0;i 0 ? strMarcados.substring(0, strMarcados.length - 1) : " "; strNoMarcados = strNoMarcados.length > 0 ? strNoMarcados.substring(0, strNoMarcados.length - 1) : " "; // se actualizan los campos ocultos. eval('document.forma.' + strNomMarcados + '.value = ' + '"' + strMarcados + '"'); eval('document.forma.' + strNomNoMarcados + '.value = ' + '"' + strNoMarcados + '"'); } function validarFaq() { var strMensaje, strErrores; strErrores = ''; if (document.forma.descripcion.value.length > 2000) { strErrores += '- El campo descripcion excede el tama�o maximo\n'; } if (document.forma.problema.value.length > 2000) { strErrores += '- El campo problema excede el tama�o maximo\n'; } if (document.forma.solucion.value.length > 2000) { strErrores += '- El campo solucion excede el tama�o maximo\n'; } if (document.forma.keywords.value.length > 500) { strErrores += '- El campo keywords excede el tama�o maximo\n'; } if (strErrores) { // Ocurrio un error. strMensaje = "______________________________________________________\n\n" strMensaje += "La forma no fue enviada. Ocurrieron los siguientes error(es)\n"; strMensaje += "Por Favor corrija estos error(es) y re-envie\n"; strMensaje += "______________________________________________________\n\n" strMensaje += "\n"; strMensaje += strErrores; alert(strMensaje); } document.respValidacion = (strErrores == ''); } /***************************************************************************** * Nombre: limpiarCamposPadre * * Descripci�n: Coloca '' en los campos de un p�gina base que vengan como * * parametro desde una ventana de b�squeda o similar. * * Parametros: * * strCampos Entrada Nombres de los campos separados por comas a los * * cuales se le asigana ''. * * strNombreF Entrada Nombre de la forma en la cual se encuentran los * * campos. * * Autor: . Fecha de Creaci�n: * * Modificaciones * * 1. Autor: Juan Pablo Fern�ndez R. Fecha de Modificaci�n: 19 Nov 2001 * * Descripci�n: * *****************************************************************************/ function limpiarCamposPadre(strCampos, strNombreF) { var arrCampos, i; /* Se obtienen los nombres de los campos*/ arrCampos = strCampos.split(','); for (i = 0; i < arrCampos.length; i++ ) { eval("opener.document." + strNombreF + "." + arrCampos[i] + ".value=''"); parent.opener.Validacampos(); } } /***************************************************************************** * Nombre: limpiarCampos * * Descripci�n: Coloca '' en los campos que vengan como parametro que * * pertenecen a la p�gina actual. * * Parametros: * * strCampos Entrada Nombres de los campos separados por comas a los * * cuales se le asigana ''. * * strNombreF Entrada Nombre de la forma en la cual se encuentran los * * campos. * * Autor: . Fecha de Creaci�n: * * Modificaciones * * 1. Autor: Juan Pablo Fern�ndez R. Fecha de Modificaci�n: 19 Nov 2001 * * Descripci�n: * *****************************************************************************/ function limpiarCampos(strCampos, strNombreF) { var arrCampos, i; /* Se obtienen los nombres de los campos*/ arrCampos = strCampos.split(','); for (i = 0; i < arrCampos.length; i++ ) { eval("document." + strNombreF + "." + arrCampos[i] + ".value=''"); } } /***************************************************************************** * Nombre: MM_validateFormCotizacion * * Descripci�n: Valida los campos del formulario de cotizaciones * * Parametros: * * Autor: JSC Fecha de Creaci�n: 10 Sept de 2002 * *****************************************************************************/ function MM_validateFormCotizacion() { //v3.0 var i,p,q,nm,test,num,min,max,errors='',args=MM_validateFormCotizacion.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe contener una direcci�n de e-mail.\n'; } else if (test!='R') { num = parseFloat(val); if (val!=''+num) errors+='- '+nm+' debe contener un n�mero.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num 1000) { errors += '- '+ 'El tama�o del campo Condiciones Comerciales excede los 1000 caracteres.\n'; } if (errors) alert('Los siguientes errores ocurrieron:\n'+errors); document.MM_returnValue = (errors == ''); } /***************************************************************************** * Nombre: LLenarCamposMasivos * * Descripci�n: llena los valores de campos masivos en HD y SC * * Parametros: * * Autor: Msosa Fecha de Creaci�n: 13 Sept de 2002 * *****************************************************************************/ function LLenarCamposMasivos() { document.forma.idasignados.value = document.forma.idasignados1.value ; document.forma.idusuarios.value = document.forma.idusuarios1.value ; } /***************************************************************************** * Nombre: ventanaasociar * * Descripci�n: Permite asociar documentos a la solicitud * * * * Parametros: * * iddocumento,titulo,autor,ubicacion * * Autor: Jack Santos Fecha de Creaci�n: 30 de Sep de 2002 * * Modificaciones * * 1. Autor: Fecha de Modificaci�n: * * Descripci�n: * *****************************************************************************/ function ventanaasociar(iddocumento,titulo,autor,ubicacion,solicitud) { var cadenavalores; cadenavalores = "../modulogeneraldocumento/docunuevo.asp?influjo=A&error=" window.open(cadenavalores,'principal'); } /***************************************************************************** * Nombre: FormatearMoney * * Descripci�n: Retorna un valor formateado MONEY a ciertos decimales * * * * Parametros: * * Campo = Nombre del campo del cual lee el valor * * Decimales = Cantidad de Digitos decimales a mostar * * Autor: Msosa Fecha de Creaci�n: 06 de Nov de 2002 * * Modificaciones * * 1. Autor: Fecha de Modificaci�n: * * Descripci�n: * *****************************************************************************/ function FormatearMoney(Campo,Decimales) { var i,ValorD,ValorE,Cents,Resultado; var Dec = 10; i = 1; //Si Decimales=0 entonces use dos decimales if (Decimales == 0) Decimales = 2; //Para obtener la cantidad de decimales se hace potencia de 10 while (i=0;i--) { var Comma=""; if((ValorConvertidoA.length-i)%3==0 && i!=0) Comma=","; //20 ValorConvertido = Comma + ValorConvertidoA[i] + ValorConvertido; } var Resultado="$"+ValorConvertido; Resultado+="."+Cents; return (Resultado); } /* Funci�n que evalua la accion a realizar para los formatos por tipo de doc*/ function accionFormatoTipoDoc(evalaccion) { var parametro; if(evalaccion == 1){ /* crea el registro con el formato y el tipo de doc.*/ document.forma.accion.value = 1; document.forma.submit(); } } /***************************************************************************** * Nombre: Reemplazar_amp * * Descripci�n: Cambia el signo & por %26, para paso por query string * * * * Parametros: * * dato = valor que va a reemplazar * * * * Autor: Msosa Fecha de Creaci�n: 26 de Dic 2002 * * Modificaciones * * 1. Autor: Fecha de Modificaci�n: * * Descripci�n: * *****************************************************************************/ function Reemplazar_amp(dato) { var d,i,tam; d=''; tam = dato.length; for (i=0;i<=tam;i++) { //alert( dato.substr(i,1) + ' ' + i); if (dato.substr(i,1) == '&') { d = d + '%26'; } else { d = d + dato.substr(i,1); } } return(d); } /***************************************************************************** * Nombre: limpiarCamposPadreDoc * * Descripci�n: Coloca '' en los campos de un p�gina base que vengan como * * parametro desde una ventana de b�squeda o similar. * * Parametros: * * strCampos Entrada Nombres de los campos separados por comas a los * * cuales se le asigana ''. * * strNombreF Entrada Nombre de la forma en la cual se encuentran los * * campos. * * Autor: . Fecha de Creaci�n: * * Modificaciones * * 1. Autor: Juan Pablo Fern�ndez R. Fecha de Modificaci�n: 19 Nov 2001 * * Descripci�n: * *****************************************************************************/ function limpiarCamposPadreDoc(strCampos, strNombreF) { var arrCampos, i; /* Se obtienen los nombres de los campos*/ arrCampos = strCampos.split(','); for (i = 0; i < arrCampos.length; i++ ) { eval("opener.document." + strNombreF + "." + arrCampos[i] + ".value=''"); } alert(opener.document.Forma.tablas.value); } function reloadpage(nomtabla,campos,nomtablarel){ var localizacion; location.href = 'filtroTablaCampos.asp?' + 'tabla=' + nomtabla + '&campo=' + campos + '&tablarel=' + nomtablarel; } //----------------------------------------------------------------------------- //Nombre: IsDateValide //Objetivo: Valida si el dato es de tipo Alfab�tico,Especiales y Num�ricos //Parametros: // year: A�o // month: Mes // day: Dia //Autor: Jose J. Rojas R. //Creaci�n: 02/05/2003 //Modificacion: // Autor: Fecha : // Descripcion: // - //----------------------------------------------------------------------------- function IsDateValide(year, month, day) { bi = (year%400==0 || (year%4==0 && year%100!=0)); if ( ( month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12 ) && day >= 1 && day <= 31) { correct = true;} else { if ( ( month == 4 || month == 6 || month == 9 || month == 11 ) && day >= 1 && day <= 30) { correct = true;} else { if (bi) { correct = ( day >= 1 && day <= 29 && month == 2);} else { correct = ( day >= 1 && day <= 28 && month == 2);} } } return correct; } //----------------------------------------------------------------------------- //Nombre: IsDateVal //Objetivo: Valida si el dato es de tipo Alfab�tico,Especiales y Num�ricos //Parametros: // valf: Dato de entrada a validar //Autor: Jose J. Rojas R. //Creaci�n: 02/05/2003 //Modificacion: // Autor: Fecha : // Descripcion: // - //----------------------------------------------------------------------------- function IsDateVal(valf) { valf=valf.trim(); var Fechas = new Array; if (valf.length>0) { if (valf != '') { if(valf.indexOf(' ',0)>0) { valf=valf.substring(0,valf.indexOf(' ',0)); } if (valf.length <= 10) { Fechas = separar_fecha(valf,Fechas) if (Fechas!=null) { if (Fechas.length) { if (IsDateValide(parseFloat(Fechas[0]), parseFloat(Fechas[1]), parseFloat(Fechas[2]))) { return true; } else { return false; } } else { return false; } } else { return false; } } else { return false; } } else { return true; } } else { return false; } } //----------------------------------------------------------------------------- //Nombre: Mostrar_Formato_Fecha //Objetivo: Muestra el formato de fecha definido para el T&MS. // //Autor: Silvano Urrego R. //Creaci�n: 14-Noviembre-2003 //Modificacion: //Autor: Fecha : //Descripcion: // - //----------------------------------------------------------------------------- function Mostrar_Formato_Fecha() { var intFormato, strSeparador; intFormato = 5; strSeparador = '-'; switch(intFormato) { case 1: //MM/DD/YYYY { return 'MM' + strSeparador + 'DD' + strSeparador + 'YYYY\n'; break; } case 2: //MM/YYYY/DD { return 'MM' + strSeparador + 'YYYY' + strSeparador + 'DD\n'; break; } case 3: //DD/MM/YYYY { return 'DD' + strSeparador + 'MM' + strSeparador + 'YYYY\n'; break; } case 4: //DD/YYYY/MM { return 'DD' + strSeparador + 'YYYY' + strSeparador + 'MM\n'; break; } case 5: //YYYY/MM/DD { return 'YYYY' + strSeparador + 'MM' + strSeparador + 'DD\n'; break; } case 6: //YYYY/DD/MM { return 'YYYY' + strSeparador + 'DD' + strSeparador + 'MM\n'; break; } } } //----------------------------------------------------------------------------- //Nombre: separar_fecha //Objetivo: Extrae desde un campo de tipo fecha, el dia, mes y a�o. Dependiendo // del formato que se haya definido. //Parametros: // strFecha: Fecha a dividir. //Autor: Silvano Urrego R. //Creaci�n: 14-Noviembre-2003 //Modificacion: //Autor: Fecha : //Descripcion: // - //----------------------------------------------------------------------------- function separar_fecha(strFecha, Fechas) { var intFormato, strSeparador, ano, mes, dia; intFormato = 5; strSeparador = '-'; Fechas = strFecha.split(strSeparador); if (Fechas!=null) { if (Fechas.length>1) { if ((isNaN(parseFloat(Fechas[0]))) || (isNaN(parseFloat(Fechas[1]))) || (isNaN(parseFloat(Fechas[2])))) { return false; } switch(intFormato) { case 1: //MM/DD/YYY { dia=Fechas[1]; mes=Fechas[0]; ano=Fechas[2]; break; } case 2: //MM/YYYY/DD { dia=Fechas[2]; mes=Fechas[0]; ano=Fechas[1]; break; } case 3: //DD/MM/YYYY { dia=Fechas[0]; mes=Fechas[1]; ano=Fechas[2]; break; } case 4: //DD/YYYY/MM { dia=Fechas[0]; mes=Fechas[2]; ano=Fechas[1]; break; } case 5: //YYYY/MM/DD { dia=Fechas[2]; mes=Fechas[1]; ano=Fechas[0]; break; } case 6: //YYYY/DD/MM { dia=Fechas[1]; mes=Fechas[2]; ano=Fechas[0]; break; } } Fechas[0]=ano; Fechas[1]=mes; Fechas[2]=dia; return Fechas; } } } //----------------------------------------------------------------------------- //Nombre: trim //Objetivo: Propiedad que permite realizar un trim en JavScriprt. //Autor: Jose J. Rojas R. //Creaci�n: 06/05/2003 //Modificacion: // Autor: Fecha : // Descripcion: // - //----------------------------------------------------------------------------- /* String.prototype.trim = function() { var x=this; x=x.replace(/^\s*(.*)/, "$1"); x=x.replace(/(.*?)\s*$/, "$1"); return x; } */ String.prototype.trim= function(){ var TRIM_VALUE=this; if(TRIM_VALUE.length < 1){ return""; } TRIM_VALUE = TRIM_VALUE.rtrim(); TRIM_VALUE = TRIM_VALUE.ltrim(); if(TRIM_VALUE==""){ return ""; } else{ return TRIM_VALUE; } } //End Function String.prototype.rtrim=function(){ var VALUE=this; var w_space = String.fromCharCode(32); var v_length = VALUE.length; var strTemp = ""; if(v_length < 0){ return""; } var iTemp = v_length -1; while(iTemp > -1){ if(VALUE.charAt(iTemp) == w_space){ } else{ strTemp = VALUE.substring(0,iTemp +1); break; } iTemp = iTemp-1; } //End While return strTemp; } //End Function String.prototype.ltrim=function(){ var VALUE=this; var w_space = String.fromCharCode(32); if(v_length < 1){ return""; } var v_length = VALUE.length; var strTemp = ""; var iTemp = 0; while(iTemp < v_length){ if(VALUE.charAt(iTemp) == w_space){ } else{ strTemp = VALUE.substring(iTemp,v_length); break; } iTemp = iTemp + 1; } //End While return strTemp; } //End Function /* Funci�n que muestra u oculta elementos dependientes */ function change2(objID, ver){ var obj = document.getElementById(objID); if (ver) obj.style.display = ''; else obj.style.display = "none"; } /*Descripci�n: Asocia el asignado a la lsita de solicitudes*/ function AsociarAsignado() { if (eval(document.forma) != null){ if (document.forma.idasignado.value== ''){ alert('Debe seleccionar un Usuario Valido para establecer como Asignado.'); }else{ if (confirm('Desea Establecer como Asignado de TODAS las Solicitudes del Filtro a ' + document.forma.idasignadoTMP.value + ' ?')) { document.modo.accionfiltro.value=1; document.modo.idasignado.value = document.forma.idasignado.value; document.modo.submit(); } } } } function f_ValidarEstructuraNumRad(vFormato) { var strMsg = ''; var vVariable = ''; var vRestoFormato = ''; var vPosIni = -1; var vPosFin = -1; // Asignar formato vRestoFormato = vFormato; // Primer & vPosIni = vRestoFormato.indexOf('&'); if (!(vPosIni > -1)) { alert('El Formato de Numero de Radicacion debe incluir una o mas Variables predefinidas.\n\n' + vRestoFormato + '\n\n' + 'Para mayor Informacion consulte la ayuda de Formatos [Estructura No. Radicaci�n].'); return false; } // Resto de la cadena vRestoFormato = vRestoFormato.substring(vPosIni + 1); while (vPosIni > -1) { // Segundo & vPosFin = vRestoFormato.indexOf('&'); if (!(vPosFin > -1)) { alert('El caracter & debe ser utilizado unicamente para incluir las Variables Predefinidas.\n\n' + vRestoFormato + '\n\n' + 'Para mayor Informacion consulte la ayuda de Formatos [Estructura No. Radicaci�n].'); return false; } // Obtener la variable vVariable = vRestoFormato.substring(0, vPosFin).toUpperCase(); //alert('vPosIni ' + vPosIni + '\nvPosFin ' + vPosFin + '\nvRestoFormato ' + vRestoFormato + '\nvVariable ' + vVariable); if (!( vVariable == 'AA' || vVariable == 'AAAA' || vVariable == 'M' || vVariable == 'MM' || vVariable == 'MMM' || vVariable == 'D' || vVariable == 'DD' || vVariable == 'HH:MM:SS' || vVariable == 'HH:MM' || vVariable == 'MM:SS' || vVariable == 'HH' || vVariable == 'MI' || vVariable == 'SS' || vVariable == 'NUMR' || vVariable.indexOf('NUMR') > -1 || vVariable == 'NUMDOCPPAL' || vVariable.indexOf('NUMDOCPPAL') > -1 || vVariable == 'NUMXDOCTDOCPORG' || vVariable.indexOf('NUMXDOCTDOCPORG') > -1 || vVariable == 'NUMXDOCTDOCPANT' || vVariable.indexOf('NUMXDOCTDOCPANT') > -1 || vVariable == 'NUMPROCORG' )) { if(vVariable == 'NUMPROCANT' || vVariable.indexOf('NUMPROCANT') > -1) { if(vVariable.length < 13){ alert('La Variable predefinida NUMPROCANT debe contener un caracter (separador) entre par�ntesis y no debe tener m�s caracteres despu�s del ultimo par�ntesis.' + '\n\nVariable ' + vVariable + '\n' + vRestoFormato); return false; } else if(vVariable.length > 13){ alert('La Variable predefinida NUMPROCANT debe contener un caracter (separador) entre par�ntesis y no debe tener m�s caracteres despu�s del ultimo par�ntesis.' + '\n\nVariable ' + vVariable + '\n' + vRestoFormato); return false; } else{ if(vVariable.charAt(10) != '(' || vVariable.charAt(12) != ')' || vVariable.charAt(11) == ' '){ alert('La Variable predefinida NUMPROCANT debe contener un caracter (separador) entre par�ntesis y no debe tener m�s caracteres despu�s del ultimo par�ntesis.' + '\n\nVariable ' + vVariable + '\n' + vRestoFormato); return false; } } } else{ alert('Las Variables Predefinidas deben estar entre &, y solo pueden ser una o varias de las siguientes:\n\n &AA& \n &AAAA& \n &M& \n &MM& \n &MMM& \n &D& \n &DD& \n &HH:MM:SS& \n HH:MM \n &MM:SS& \n &HH& \n &MI& \n &SS& \n &NUMR& \n &NUMR(c,n), donde c es el caracter a repetir tantas veces como indique n. \n &NUMDOCPPAL& \n &NUMPROCANT(CaracterSeparador), donde CaracterSeparador es el caracter separador de los numerales del proceso. \n' + 'Para mayor Informacion consulte la ayuda de Formatos de Radicacion [Estructura No. Radicaci�n].' + '\n\nVariable ' + vVariable + '\n' + vRestoFormato); return false; } } // Resto de la cadena sin el & anterior vRestoFormato = vRestoFormato.substring(vPosFin + 1); // Primer & vPosIni = vRestoFormato.indexOf('&'); if (vPosIni > -1) vRestoFormato = vRestoFormato.substring(vPosIni + 1); } return vRestoFormato; } function Formaoptional(objForma){ for(var i = 0; i < objForma.length; i++) { var e = objForma.elements[i]; //if (((e.type == "text") || (e.type == "textarea") || (e.type == "select-one"))) e.optional = true; } } //----------------------------------------------------------------------------- //Nombre: comparar_fechas //Objetivo: Evalua si una fecha es mayor que otra. //Parametros: // strFecha1: Fecha a validar. // strHora1: Hora a validar. // strFecha2: Fecha contra la que se compara // strHora2: Hora contra la que se compara. //Autor: Silvano Urrego R. //Creaci�n: 24-Diciembre-2003 //Modificacion: //Autor: Fecha : //Descripcion: // - //----------------------------------------------------------------------------- function comparar_fechas() { var strFecha1, strHora1, strFecha2, strHora2, strErrores; var Fecha1 = new Array; var Hora1 = new Array; var Fecha2 = new Array; var Hora2 = new Array; strFecha1 =((arguments[0] == null)||(!arguments[0]))?"":arguments[0]; strHora1 =((arguments[1] == null)||(!arguments[1]))?"":arguments[1]; strFecha2 =((arguments[2] == null)||(!arguments[2]))?"":arguments[2]; strHora2 =((arguments[3] == null)||(!arguments[3]))?"":arguments[3]; if ((IsDateVal(strFecha1)) && (IsDateVal(strFecha2))) { Fecha1 = separar_fecha(strFecha1, Fecha1) Fecha2 = separar_fecha(strFecha2, Fecha2) Hora1 = strHora1.split(':'); Hora2 = strHora2.split(':'); if (!Hora1.length){ Hora1[0] = 0; Hora1[1] = 0; } if (!Hora2.length){ Hora2[0] = 0; Hora2[1] = 0; } var datFec1 = new Date(Fecha1[0],Fecha1[1],Fecha1[2],Hora1[0],Hora1[1]); var datFec2 = new Date(Fecha2[0],Fecha2[1],Fecha2[2],Hora2[0],Hora2[1]); if (datFec2 < datFec1){ if ((arguments[4] != null) && (arguments[3])) { strErrores=arguments[4]; strErrores += '\nLa fecha:\n' + strFecha1 + ' ' + strHora1 + '.\n' strErrores += 'No puede ser mayor a: \n' + strFecha2 + ' ' + strHora2 + '.' alert(strErrores); } return false } else return true return (strFec1 > strFec2) } else { return false; } } function exportar(tipo) { var strTarget, intPagina; if(document.modo){ if(document.modo.solodatos){ strTarget=document.modo.target; document.modo.target='TMSExportar'; document.modo.solodatos.value='true'; document.modo.tipomime.value=tipo; intPagina=document.modo.pagina.value; document.modo.pagina.value=1; document.modo.submit(); document.modo.target=strTarget; document.modo.solodatos.value=''; document.modo.tipomime.value=''; document.modo.pagina.value=intPagina; } } else if(document.modo1){ if(document.modo1.solodatos){ strTarget=document.modo1.target; document.modo1.target='TMSExportar'; document.modo1.solodatos.value='true'; document.modo1.tipomime.value=tipo; intPagina=document.modo.pagina.value; document.modo1.pagina.value=1; document.modo1.submit(); document.modo1.target=strTarget; document.modo1.solodatos.value=''; document.modo1.tipomime.value=''; document.modo1.pagina.value=intPagina; } } else if(document.forma){ if(document.forma.solodatos){ strTarget=document.forma.target; document.forma.target='TMSExportar'; document.forma.solodatos.value='true'; document.forma.tipomime.value=tipo; document.forma.submit(); document.forma.target=strTarget; } } } function vdCopiarSeleccion() { if ((document.modo) && (document.forma)) if ((document.modo.idsSolsSelect) && (document.forma.idsSolsSelect)) document.modo.idsSolsSelect.value = document.forma.idsSolsSelect.value; } function vdCopiarSeleccionDocs() { if ((document.modo) && (document.forma)) if ((document.modo.idsDocsSelect) && (document.forma.idsDocsSelect)) document.modo.idsDocsSelect.value = document.forma.idsDocsSelect.value; } function strCadenaValoresCheckbox(strNombreCheck,NomCampo) { var arrElementos, i = 0,intConsCheck = 0; var strvalor = ''; arrElementos = document.formita.elements; for( i = 0; i < arrElementos.length; i++ ){ if (arrElementos[i].type.toUpperCase() == 'CHECKBOX') { /*El elemento es un checkbox.*/ if ( eval('document.formita.' + strNombreCheck + intConsCheck +'.checked') ) { strvalor = strvalor + eval('document.formita.' + strNombreCheck + intConsCheck + '.value') + ';'; } intConsCheck++; } } eval("opener.document.forms[0]." + NomCampo + ".value='" + strvalor.substring(0,(strvalor.length)-1) + "'"); } function EnviarFoco(strForma,strCampo){ if(document.forms[strForma]){ //alert(document.forms[strForma].name); if(document.forms[strForma].elements[strCampo]){ //alert(document.forms[strForma].name + document.forms[strForma].elements[strCampo].name); if(document.forms[strForma].elements[strCampo].focus){ //alert(document.forms[strForma].elements[strCampo].focus); document.forms[strForma].elements[strCampo].focus(); } } } } function strValidarNumerico(vCampo,vLabelCampo,vValInicialPermitido,vValFinalPermitido) { if (vValInicialPermitido == null) vValInicialPermitido = 1; var strMsg = ''; if (vCampo) { vValor = parseFloat(vCampo.value); if ( isNaN( vValor )) { // No inicia por numero strMsg = '-El valor del campo ' + vLabelCampo + ' debe ser num�rico.\n'; } else { // Validar q todo sea numerico if (vValor != vCampo.value) { strMsg = '-El valor del campo ' + vLabelCampo + ' contiene datos no validos.\n'; } else { if (!(vValor >= vValInicialPermitido)) { strMsg = '-El valor del campo ' + vLabelCampo + ' debe ser mayor o igual a ' + vValInicialPermitido + '.\n'; } else { if (vValFinalPermitido != null) if (vValor > vValFinalPermitido) strMsg = '-El valor del campo ' + vLabelCampo + ' debe ser menor o igual a ' + vValFinalPermitido + '.\n'; } } } } return strMsg; } function vdSHExp() { var oframesetarchivistica = parent.document.getElementById('framesetarchivistica'); if ((oframesetarchivistica != 'undefined') && (oframesetarchivistica != null)) { if (oframesetarchivistica.cols != '0,*'){ oframesetarchivistica.cols = '0,*'; $("#expArb").attr('data-original-title','Contraer �rbol'); $("#expArb").html(' '); } else {oframesetarchivistica.cols = '*,250'; $("#expArb").attr('data-original-title','Expandir �rbol'); $("#expArb").html(' '); } } } function vdSHTree() { var oframesetarchivistica = parent.document.getElementById('framesetarchivistica'); if ((oframesetarchivistica != 'undefined') && (oframesetarchivistica != null)) { if (oframesetarchivistica.cols != '*,0') oframesetarchivistica.cols = '*,0'; else oframesetarchivistica.cols = '*,250'; } } function vdSHNave() { if (window.parent.parent.frames['framesetadmon']) { if (window.parent.parent.frames['framesetadmon'].cols != '0,*') { window.parent.parent.frames['framesetadmon'].cols = '0,*'; } else { window.parent.parent.frames['framesetadmon'].cols = '153,*'; } if (window.parent.frames['framesetseries']) { if (window.parent.frames['framesetseries'].cols != '155,*') { window.parent.frames['framesetseries'].cols = '155,*'; } else { window.parent.frames['framesetseries'].cols = '300,*'; } } //blnArbolVisible = (!blnArbolVisible); } } function ValidarCampoIndividual(vCampoNom, vTipoDato, vLabelCampo, bObligatorio, vCampoID, vValInicialPermitido, vValFinalPermitido) { var vFecha = null; var vCampo = null; if (typeof(vValInicialPermitido) != "undefined") { if (vValInicialPermitido == null) { vValInicialPermitido = 0; } } if (vCampoNom) { vTipoDato = vTipoDato.toLowerCase(); if ((vCampoNom.value != '') || (bObligatorio == 1)) { // Establecer el campo a validar, cuando es binocular, se debe validar vCampoID if ((vCampoID != null) && (vCampoID != '')) { if (vCampoID) vCampo = vCampoID; else vCampo = vCampoNom; } else { vCampo = vCampoNom; } if (vTipoDato == 'numeric' || vTipoDato == 'float' || vTipoDato == 'int' || vTipoDato == 'real' || vTipoDato == 'smallint' || vTipoDato == 'tinyint') { vValor = parseFloat(vCampo.value); if ( isNaN( vValor )) { // No inicia por numero if ((vCampoID != null) && (vCampoID != '')){ //alert('El campo ' + vLabelCampo + ' contiene un valor no permitido.\n\nDebe validar el dato con los Binoculares.'); //var $ts = $("input[name='"+vCampoID.nombre+"']"); var vC = $("input[name='"+vCampoID.attributes.name.value+"']"); vC.parent().find('.alerta').remove(); var alerta = ''+"El campo" +" " +vLabelCampo +" "+ "contiene un valor no permitido Debe validar el dato con la lupa"+''; vC.parent().removeClass('has-success'); vC.parent().addClass('has-error'); vC.parent().append(alerta); } else{ //alert('El campo ' + vLabelCampo + ' contiene un valor no permitido.\n\nDebe ser numerico.');ya var Cn = $("input[name='"+vCampo.attributes.name.value+"']"); Cn.parent().find('.alerta').remove(); var alerta = ''+"El campo" +" " +vLabelCampo +" "+ "contiene un valor no permitido.Debe ser numerico."+''; Cn.parent().removeClass('has-success'); Cn.parent().addClass('has-error'); Cn.parent().append(alerta); } if (vCampoNom.isVisible){ vCampoNom.focus(); } return false; } else { // Validar q todo sea numerico if (vValor != vCampo.value) { if ((vCampoID != null) && (vCampoID != '')) alert('El campo ' + vLabelCampo + ' contiene caracteres no permitidos.\n\nDebe validar el dato con los Binoculares.'); else //alert('El campo ' + vLabelCampo + ' contiene caracteres no permitidos.\n\nDebe ser numerico.');yes var Cn = $("input[name='"+vCampoID.attributes.name.value+"']"); Cn.parent().find('.alerta').remove(); var alerta = ''+"El campo" +" " +vLabelCampo +" "+ "contiene un valor no permitido.Debe ser numerico."+''; Cn.parent().removeClass('has-success'); Cn.parent().addClass('has-error'); Cn.parent().append(alerta); if (vCampoNom.isVisible) vCampoNom.focus(); return false; } else { if (typeof(vValInicialPermitido) != "undefined") { if (!(vValor >= vValInicialPermitido)) { alert('El valor del campo ' + vLabelCampo + ' debe ser mayor o igual a ' + vValInicialPermitido + '.'); return false; } else { if (vValFinalPermitido != null) if (vValor > vValFinalPermitido) { alert('El valor del campo ' + vLabelCampo + ' debe ser menor o igual a ' + vValFinalPermitido + '.'); return false; } } } } } } if (vTipoDato == 'datetime') { if (!IsDateVal(vCampo.value)) { //alert('El campo ' + vLabelCampo + ' contiene un valor no permitido.\n\nDebe ser de tipo Fecha, y con Formato ' + Mostrar_Formato_Fecha()); var Cf = $("input[name='"+vCampo.attributes.name.value+"']"); Cf.parent().find('.alerta').remove(); var alerta = ''+"El campo" +" " +vLabelCampo +" "+ "contiene un valor no permitido.Debe ser de tipo Fecha, y con Formato '" + Mostrar_Formato_Fecha()+''; Cf.parent().removeClass('has-success'); Cf.parent().addClass('has-error'); Cf.parent().append(alerta); if (vCampoNom.isVisible) vCampoNom.focus(); return false; } } if ((vTipoDato == 'varchar') && (bObligatorio = 1) && (vCampo.value == '') ){ //alert('El campo ' + vLabelCampo + ' contiene un valor no permitido.'); var texta = $("textarea[name='"+vCampo.attributes.name.value+"']"); texta.parent().find('.alerta').remove(); var alerta = ''+"El campo" +" " +vLabelCampo +" "+ "contiene un valor no permitido"+''; texta.parent().removeClass('has-success'); texta.parent().addClass('has-error'); texta.parent().append(alerta); var $td = $("input[name='"+vCampo.attributes.name.value+"']"); $td.parent().find('.alerta').remove(); var alerta = ''+"El campo" +" " +vLabelCampo +" "+ "contiene un valor no permitido"+''; $td.parent().removeClass('has-success'); $td.parent().addClass('has-error'); $td.parent().append(alerta); if (vCampoNom.isVisible){ vCampoNom.focus(); } return false; } if(vCampo && vCampo.attributes && vCampo.attributes.name){ var $td = $("input[name='"+vCampo.attributes.name.value+"']"); $td.parent().removeClass('has-error'); $td.parent().addClass('has-success'); $td.parent().find('.alerta').remove(); } if(vCampoID && vCampoID.attributes && vCampoID.attributes.name){ //if(vCampoID){ var $vC = $("input[name='"+vCampoID.attributes.name.value+"']"); $vC.parent().removeClass('has-error'); $vC.parent().addClass('has-success'); $vC.parent().find('.alerta').remove(); } if(vCampo && vCampo.attributes && vCampo.attributes.name){ var texta = $("textarea[name='"+vCampo.attributes.name.value+"']"); texta.parent().removeClass('has-error'); texta.parent().addClass('has-success'); texta.parent().find('.alerta').remove(); } if(vCampo && vCampo.attributes && vCampo.attributes.name){ var Cf = $("input[name='"+vCampo.attributes.name.value+"']"); Cf.parent().removeClass('has-error'); Cf.parent().addClass('has-success'); Cf.parent().find('.alerta').remove(); } if(vCampo && vCampo.attributes && vCampo.attributes.name){ var Cn = $("input[name='"+vCampo.attributes.name.value+"']"); Cn.parent().removeClass('has-error'); Cn.parent().addClass('has-success'); Cn.parent().find('.alerta').remove(); } if(vCampoID && vCampoID.attributes && vCampoID.attributes.name){ var Cn = $("input[name='"+vCampoID.attributes.name.value+"']"); Cn.parent().removeClass('has-error'); Cn.parent().addClass('has-success'); Cn.parent().find('.alerta').remove(); } } } return true; } /******************************* MENU Click Derecho *************************************/ /* jsDOMenu Version 1.2.1 Copyright (C) 2003 - 2004 Toh Zhiqiang Released on 15 July 2004 jsDOMenu is distributed under the terms of the GNU GPL license Refer to license.txt for more informatiom */ /* Determine whether the browser is IE5 or IE5.5. */ function isIE5() { // Private method return (navigator.userAgent.indexOf("MSIE 5") > -1); } /* Determine whether the browser is IE6. */ function isIE6() { // Private method return ((navigator.userAgent.indexOf("MSIE 6") > -1) && (navigator.userAgent.indexOf("Opera") == -1)); } /* Determine whether the browser is IE. */ function isIE() { // Private method return (isIE5() || isIE6()); } /* Determine whether the browser is Opera. */ function isOpera() { // Private method return (navigator.userAgent.indexOf("Opera") > -1); } /* Determine whether the browser is Safari. */ function isSafari() { // Private method return ((navigator.userAgent.indexOf("Safari") > -1) && (navigator.userAgent.indexOf("Mac") > -1)); } /* Determine the page render mode. 0: Quirks mode. 1: Strict mode. */ function getPageMode() { // Private method if (document.compatMode) { switch (document.compatMode) { case "BackCompat": return 0; case "CSS1Compat": return 1; case "QuirksMode": return 0; } } else { if (isIE5()) { return 0; } if (isSafari()) { return 1; } } return 0; } /* Alias for document.getElementById(). */ function getElmId(id) { // Private method return document.getElementById(id); } /* Alias for document.createElement(). */ function createElm(tagName) { // Private method return document.createElement(tagName); } /* Get the x-coordinate of the cursor position relative to the window. */ function getX(e) { // Private method if (!e) { var e = window.event; } if (isSafari()) { return (e.clientX - getScrollLeft()); } else { return e.clientX; } } /* Get the y-coordinate of the cursor position relative to the window. */ function getY(e) { // Private method if (!e) { var e = window.event; } if (isSafari()) { return (e.clientY - getScrollTop()); } else { return e.clientY; } } /* Get the scrollLeft property. */ function getScrollLeft() { // Private method switch (pageMode) { case 0: return document.body.scrollLeft; case 1: if (document.documentElement && (document.documentElement.scrollLeft > 0)) { return document.documentElement.scrollLeft; } else { return document.body.scrollLeft; } } } /* Get the scrollTop property. */ function getScrollTop() { // Private method switch (pageMode) { case 0: return document.body.scrollTop; case 1: if (document.documentElement && (document.documentElement.scrollTop > 0)) { return document.documentElement.scrollTop; } else { return document.body.scrollTop; } } } /* Get the clientHeight property. */ function getClientHeight() { // Private method switch (pageMode) { case 0: return document.body.clientHeight; case 1: if (isSafari()) { return self.innerHeight; } else { if ((isOpera && !isOpera()) && document.documentElement && (document.documentElement.clientHeight > 0)) { return document.documentElement.clientHeight; } else { return document.body.clientHeight; } } } } /* Get the clientWidth property. */ function getClientWidth() { // Private method switch (pageMode) { case 0: return document.body.clientWidth; case 1: if (isSafari()) { return self.innerWidth; } else { if ((isOpera && !isOpera()) && document.documentElement && (document.documentElement.clientWidth > 0)) { return document.documentElement.clientWidth; } else { return document.body.clientWidth; } } } } /* Get the left position of the pop-up menu. */ function getMainMenuLeftPos(menuObj, x) { // Private method if ((x + menuObj.offsetWidth) <= getClientWidth()) { return x; } else { if (x <= getClientWidth()) { return (x - menuObj.offsetWidth); } else { return (getClientWidth() - menuObj.offsetWidth); } } } /* Get the top position of the pop-up menu. */ function getMainMenuTopPos(menuObj, y) { // Private method if ((y + menuObj.offsetHeight) <= getClientHeight()) { return y; } else { if (y <= getClientHeight()) { return (y - menuObj.offsetHeight); } else { return (getClientHeight() - menuObj.offsetHeight); } } } /* Get the left position of the submenu. */ function getSubMenuLeftPos(menuObj, x, offset) { // Private method var borderLeftWidth = parseInt(getPropertyValue(menuObj, "border-left-width")); if ((x + menuObj.offsetWidth - borderLeftWidth - 5) <= getClientWidth()) { return (x - borderLeftWidth - 5); } else { if (x <= getClientWidth()) { return (x - menuObj.offsetWidth - offset); } else { return (getClientWidth() - menuObj.offsetWidth); } } } /* Get the top position of the submenu. */ function getSubMenuTopPos(menuObj, y, offset) { // Private method var borderTopWidth = parseInt(getPropertyValue(menuObj, "border-top-width")); if ((y + menuObj.offsetHeight) <= getClientHeight()) { if (isSafari()) { return (y - borderTopWidth); } else { return y; } } else { if (y <= getClientHeight()) { if (isSafari()) { return (y - borderTopWidth - menuObj.offsetHeight + offset); } else { return (y - menuObj.offsetHeight + offset); } } else { return (getClientHeight() - menuObj.offsetHeight + offset); } } } /* Pop up the main menu. */ function popUpMainMenu(menuObj, e) { // Private method menuObj.style.left = (getMainMenuLeftPos(menuObj, getX(e)) + getScrollLeft()) + "px"; menuObj.style.top = (getMainMenuTopPos(menuObj, getY(e)) + getScrollTop()) + "px"; popUpMenuObj.menuObj.style.visibility = "visible"; } /* Pop up the submenu. */ function popUpSubMenu(menuItemObj) { // Private method var parentMenuObj = menuItemObj.parent.menuObj; var menuObj = menuItemObj.subMenu.menuObj; var borderTopWidth = parseInt(getPropertyValue(menuObj, "border-top-width")); var borderBottomWidth = parseInt(getPropertyValue(menuObj, "border-bottom-width")); if (menuObj.style.position == "fixed") { var x = parentMenuObj.offsetLeft + parentMenuObj.offsetWidth; var y = parentMenuObj.offsetTop + menuItemObj.offsetTop; menuObj.style.position = "absolute"; menuObj.style.left = getSubMenuLeftPos(menuObj, x, menuItemObj.offsetWidth) + "px"; menuObj.style.top = getSubMenuTopPos(menuObj, y, menuItemObj.offsetHeight + borderBottomWidth + borderTopWidth) + "px"; menuObj.style.position = "fixed"; } else { var x = parentMenuObj.offsetLeft + parentMenuObj.offsetWidth - getScrollLeft(); var y = parentMenuObj.offsetTop + menuItemObj.offsetTop - getScrollTop(); menuObj.style.left = (getSubMenuLeftPos(menuObj, x, menuItemObj.offsetWidth) + getScrollLeft()) + "px"; menuObj.style.top = (getSubMenuTopPos(menuObj, y, menuItemObj.offsetHeight + borderBottomWidth + borderTopWidth) + getScrollTop()) + "px"; } if ((isIE()) && (menuObj.mode == "fixed")) { menuObj.initialLeft = parseInt(menuObj.style.left) - getScrollLeft(); menuObj.initialTop = parseInt(menuObj.style.top) - getScrollTop(); } menuObj.style.visibility = "visible"; } /* Convert the string into lower camel case. */ function toCamelCase(input) { // Private method var inputArray = input.split("-"); if (inputArray.length == 1) { return inputArray[0]; } else { var camelCase = inputArray[0]; var i; for (i = 1; i < inputArray.length; i++) { var word = inputArray[i]; camelCase += word.charAt(0).toUpperCase() + word.substring(1); } return camelCase; } } /* Get the value of the property of the object. */ function getPropertyValue(obj, propertyName) { // Private method var propertyValue = obj.style[toCamelCase(propertyName)]; if (propertyValue) { return propertyValue; } else { if (document.defaultView && document.defaultView.getComputedStyle) { return document.defaultView.getComputedStyle(obj, null).getPropertyValue(propertyName); } else { if (obj.currentStyle) { return obj.currentStyle[toCamelCase(propertyName)]; } else { return null; } } } } /* Refresh the menu items. */ function refreshMenuItems(menuObj) { // Private method var i; for (i = 0; i < menuObj.childNodes.length; i++) { if (menuObj.childNodes[i].enabled) { menuObj.childNodes[i].className = menuObj.childNodes[i].itemClassName; if (menuObj.childNodes[i].hasSubMenu) { var arrowObj = getElmId(menuObj.childNodes[i].id + "Arrow"); arrowObj.className = menuObj.childNodes[i].arrowClassName; } } } } /* Event handler that handles onmouseover event of the menu item. */ function menuItemOver(e) { // Private method if (this.parent.previousItem) { if (this.parent.previousItem.className == this.parent.previousItem.itemClassNameOver) { this.parent.previousItem.className = this.parent.previousItem.itemClassName; } if (this.parent.previousItem.hasSubMenu) { this.parent.previousItem.className = this.parent.previousItem.itemClassName; var arrowObj = getElmId(this.parent.previousItem.id + "Arrow"); arrowObj.className = this.parent.previousItem.arrowClassName; } var menuObj = getElmId(this.parent.menuObj.id); var i; for (i = 0; i < menuObj.childNodes.length; i++) { if ((menuObj.childNodes[i].enabled) && (menuObj.childNodes[i].hasSubMenu)) { hideMenus(menuObj.childNodes[i].subMenu.menuObj); } } } if (this.enabled) { this.className = this.itemClassNameOver; if (this.hasSubMenu) { var arrowObj = getElmId(this.id + "Arrow"); arrowObj.className = this.arrowClassNameOver; popUpSubMenu(this); } } this.parent.previousItem = this; } /* Event handler that handles onclick event of the menu item. */ function menuItemClick(e) { // Private method if ((this.enabled) && (this.actionOnClick)) { var action = this.actionOnClick; if (action.indexOf("link:") == 0) { location.href = action.substr(5); } else { if (action.indexOf("code:") == 0) { eval(action.substr(5)); } else { location.href = action; } } } if (!e) { var e = window.event; e.cancelBubble = true; } if (e.stopPropagation) { e.stopPropagation(); } if (this.parent.menuObj.mode == "cursor") { hideCursorMenus(); } if ((this.parent.menuObj.mode == "absolute") || (this.parent.menuObj.mode == "fixed")) { hideVisibleMenus(); if (typeof(hideMenuBarMenus) != "undefined") { hideMenuBarMenus(); } } } /* Event handler that handles onmouseout event of the menu item. */ function menuItemOut() { // Private method if (this.enabled) { if (!((this.hasSubMenu) && (this.subMenu.menuObj.style.visibility == "visible"))) { this.className = this.itemClassName; } if (this.hasSubMenu) { var arrowObj = getElmId(this.id + "Arrow"); if (this.subMenu.menuObj.style.visibility == "visible") { arrowObj.className = this.arrowClassNameOver; } else { arrowObj.className = this.arrowClassName; } } } } /* Set the menu object that will show up when the cursor is over the menu item object. Argument: menuObj : Required. Menu object that will show up when the cursor is over the menu item object. */ function setSubMenu(menuObj) { // Public method var arrowElm = createElm("div"); arrowElm.id = this.id + "Arrow"; arrowElm.className = this.arrowClassName; this.appendChild(arrowElm); var height; if (isIE()) { var height = parseInt(getPropertyValue(arrowElm, "height")); } else { var height = arrowElm.offsetHeight; } if(isNaN(height))height=0; arrowElm.style.top = Math.floor((this.offsetHeight - height) / 2) + "px"; this.hasSubMenu = true; this.subMenu = menuObj; this.arrowObj = arrowElm; this.setArrowClassName = function(className) { // Public method if (this.arrowObj) { this.arrowClassName = className; this.arrowObj.className = this.arrowClassName; } }; this.setArrowClassNameOver = function(className) { // Public method if (this.arrowObj) { this.arrowClassNameOver = className; } }; menuObj.menuObj.style.zIndex = this.parent.menuObj.level + 1; menuObj.menuObj.level = this.parent.menuObj.level + 1; } /* Add a new menu item to the menu. Argument: menuItemObj : Required. Menu item object that is going to be added to the menu object. */ function addMenuItem(menuItemObj) { // Public method if (menuItemObj.displayText == "-") { var hrElm = createElm("hr"); var itemElm = createElm("div"); itemElm.appendChild(hrElm); itemElm.id = menuItemObj.id; if (menuItemObj.className.length > 0) { itemElm.sepClassName = menuItemObj.className; } else { itemElm.sepClassName = menuItemObj.sepClassName; } itemElm.className = itemElm.sepClassName; this.menuObj.appendChild(itemElm); itemElm.parent = this; itemElm.setClassName = function(className) { // Public method this.sepClassName = className; this.className = this.sepClassName; }; itemElm.onclick = function(e) { // Private method if (!e) { var e = window.event; e.cancelBubble = true; } if (e.stopPropagation) { e.stopPropagation(); } }; itemElm.onmouseover = menuItemOver; if (menuItemObj.itemName.length > 0) { this.items[menuItemObj.itemName] = itemElm; } else { this.items[this.items.length] = itemElm; } } else { var itemElm = createElm("div"); itemElm.id = menuItemObj.id; itemElm.actionOnClick = menuItemObj.actionOnClick; itemElm.enabled = menuItemObj.enabled; itemElm.itemClassName = menuItemObj.className; itemElm.itemClassNameOver = menuItemObj.classNameOver; itemElm.className = itemElm.itemClassName; itemElm.hasSubMenu = false; itemElm.subMenu = null; itemElm.arrowClassName = arrowClassName; itemElm.arrowClassNameOver = arrowClassNameOver; this.menuObj.appendChild(itemElm); var textNode = document.createTextNode(menuItemObj.displayText); itemElm.appendChild(textNode); itemElm.parent = this; itemElm.setClassName = function(className) { // Public method this.itemClassName = className; this.className = this.itemClassName; }; itemElm.setClassNameOver = function(classNameOver) { // Public method this.itemClassNameOver = classNameOver; }; itemElm.setDisplayText = function(text) { // Public method this.firstChild.nodeValue = text; }; itemElm.setSubMenu = setSubMenu; itemElm.onmouseover = menuItemOver; itemElm.onclick = menuItemClick; itemElm.onmouseout = menuItemOut; if (menuItemObj.itemName.length > 0) { this.items[menuItemObj.itemName] = itemElm; } else { this.items[this.items.length] = itemElm; } } } /* Create a new menu item object. Arguments: displayText : Required. String that specifies the text to be displayed on the menu item. If displayText is "-", a menu separator will be created instead. itemName : Optional. String that specifies the name of the menu item. Defaults to "" (no name). actionOnClick : Optional. String that specifies the action to be done when the menu item is being clicked. Defaults to "" (no action). enabled : Optional. Boolean that specifies whether the menu item is enabled/disabled. Defaults to true. className : Optional. String that specifies the CSS class selector for the menu item. Defaults to "jsdomenuitem". classNameOver : Optional. String that specifies the CSS class selector for the menu item when the cursor is over it. Defaults to "jsdomenuitemover". */ function menuItem() { // Public method this.displayText = arguments[0]; if (this.displayText == "-") { this.id = "MenuSep" + (++sepCount); this.className = sepClassName; } else { this.id = "MenuItem" + (++menuItemCount); this.className = menuItemClassName; } this.itemName = ""; this.actionOnClick = ""; this.enabled = true; this.classNameOver = menuItemClassNameOver; this.sepClassName = sepClassName; var length = arguments.length; if ((length > 1) && (arguments[1].length > 0)) { this.itemName = arguments[1]; } if ((length > 2) && (arguments[2].length > 0)) { this.actionOnClick = arguments[2]; } if ((length > 3) && (typeof(arguments[3]) == "boolean")) { this.enabled = arguments[3]; } if ((length > 4) && (arguments[4].length > 0)) { if (arguments[4] == "-") { this.className = arguments[4]; this.sepClassName = arguments[4]; } else { this.className = arguments[4]; } } if ((length > 5) && (arguments[5].length > 0)) { this.itemClassNameOver = arguments[5]; } } /* Create a new menu object. Arguments: width : Required. Integer that specifies the width of the menu. className : Optional. String that specifies the CSS class selector for the menu. Defaults to "jsdomenudiv". mode : Optional. String that specifies the mode of the menu. Defaults to "cursor". alwaysVisible : Optional. Boolean that specifies whether the menu is always visible. Defaults to false. */ function jsDOMenu() { // Public method this.items = new Array(); var menuElm = createElm("div"); menuElm.id = "DOMenu" + (++menuCount); menuElm.level = 10; menuElm.previousItem = null; menuElm.allExceptFilter = allExceptFilter; menuElm.noneExceptFilter = noneExceptFilter; menuElm.className = menuClassName; menuElm.mode = "cursor"; menuElm.alwaysVisible = false; menuElm.initialLeft = 0; menuElm.initialTop = 0; var length = arguments.length; if ((length > 1) && (arguments[1].length > 0)) { menuElm.className = arguments[1]; } if ((length > 2) && (arguments[2].length > 0)) { switch (arguments[2]) { case "cursor": menuElm.style.position = "absolute"; break; case "absolute": menuElm.style.position = "absolute"; menuElm.mode = "absolute"; break; case "fixed": if (isIE()) { menuElm.style.position = "absolute"; } else { menuElm.style.position = "fixed"; } menuElm.mode = "fixed"; break; } } if ((length > 3) && (typeof(arguments[3]) == "boolean")) { menuElm.alwaysVisible = arguments[3]; } with (menuElm.style) { width = arguments[0] + "px"; left = "0px"; top = "0px"; } document.body.appendChild(menuElm); if (!getPropertyValue(menuElm, "border-left-width")) { menuElm.style.borderWidth = menuBorderWidth + "px"; } this.menuObj = menuElm; this.addMenuItem = addMenuItem; this.setClassName = function(className) { // Public method this.menuObj.className = className; }; this.setMode = function(mode) { // Public method switch (mode) { case "cursor": this.menuObj.style.position = "absolute"; this.menuObj.mode = "cursor"; break; case "absolute": this.menuObj.style.position = "absolute"; this.menuObj.mode = "absolute"; var left = parseInt(this.menuObj.style.left); var top = parseInt(this.menuObj.style.top); this.menuObj.initialLeft = left; this.menuObj.initialTop = top; break; case "fixed": if (isIE()) { this.menuObj.style.position = "absolute"; var left = parseInt(this.menuObj.style.left); var top = parseInt(this.menuObj.style.top); this.menuObj.initialLeft = left; this.menuObj.initialTop = top; } else { this.menuObj.style.position = "fixed"; } this.menuObj.mode = "fixed"; break; } }; this.setAlwaysVisible = function(alwaysVisible) { // Public method if (typeof(alwaysVisible) == "boolean") { this.menuObj.alwaysVisible = alwaysVisible; } }; this.show = function() { // Public method this.menuObj.style.visibility = "visible"; }; this.hide = function() { // Public method this.menuObj.style.visibility = "hidden"; if (this.menuObj.mode == "cursor") { with (this.menuObj.style) { left = "0px"; top = "0px"; } menuObj.initialLeft = 0; menuObj.initialTop = 0; } }; this.setX = function(x) { // Public method this.menuObj.initialLeft = x; this.menuObj.style.left = x + "px"; }; this.setY = function(y) { // Public method this.menuObj.initialTop = y; this.menuObj.style.top = y + "px"; }; this.moveTo = function(x, y) { // Public method this.menuObj.initialLeft = x; this.menuObj.initialTop = y; this.menuObj.style.left = x + "px"; this.menuObj.style.top = y + "px"; }; this.moveBy = function(x, y) { // Public method var left = parseInt(this.menuObj.style.left); var top = parseInt(this.menuObj.style.top); this.menuObj.initialLeft = left + x; this.menuObj.initialTop = top + y; this.menuObj.style.left = (left + x) + "px"; this.menuObj.style.top = (top + y) + "px"; }; this.setAllExceptFilter = function(filter) { // Public method this.menuObj.allExceptFilter = filter; this.menuObj.noneExceptFilter = new Array(); }; this.setNoneExceptFilter = function(filter) { // Public method this.menuObj.noneExceptFilter = filter; this.menuObj.allExceptFilter = new Array(); }; this.setBorderWidth = function(width) { // Public method this.menuObj.style.borderWidth = width + "px"; }; } /* Determine whether any of the tag name/tag id pair in the filter matches the tagName/tagId pair. */ function findMatch(tagName, tagId, filter) { // Private method var i; for (i = 0; i < filter.length; i++) { var filterArray = filter[i].toLowerCase().split("."); if (((filterArray[0] == "*") && (filterArray[1] == "*")) || ((filterArray[0] == "*") && (filterArray[1] == tagId)) || ((filterArray[0] == tagName) && (filterArray[1] == "*")) || ((filterArray[0] == tagName) && (filterArray[1] == tagId))) { return true; } } return false; } /* Determine whether to show or hide the menu. */ function canShowMenu(tagName, tagId, allExcept, noneExcept) { // Private method if (allExcept.length > 0) { return (!findMatch(tagName.toLowerCase(), tagId.toLowerCase(), allExcept)); } else { if (noneExcept.length > 0) { return findMatch(tagName.toLowerCase(), tagId.toLowerCase(), noneExcept); } else { return true; } } } /* Shows/Hides the pop-up menu. */ function activatePopUpMenu(e) { // Private method if (!popUpMenuObj) { return; } var state = popUpMenuObj.menuObj.style.visibility; if (state == "visible") { var i; for (i = 1; i <= menuCount; i++) { var menuObj = getElmId("DOMenu" + i); if (menuObj.mode == "cursor") { with (menuObj.style) { visibility = "hidden"; left = "0px"; top = "0px"; } menuObj.initialLeft = 0; menuObj.initialTop = 0; refreshMenuItems(menuObj); } } } else { if (!e) { var e = window.event; } var targetElm = (e.target) ? e.target : e.srcElement; if (targetElm.nodeType == 3) { targetElm = targetElm.parentNode; } if (canShowMenu(targetElm.tagName, targetElm.id, popUpMenuObj.menuObj.allExceptFilter, popUpMenuObj.menuObj.noneExceptFilter)) { popUpMainMenu(popUpMenuObj.menuObj, e); } } } /* Specifies how the pop-up menu shows/hide. Arguments: showValue : Required. Integer that specifies how the menu shows. hideValue : Optional. Integer that specifies how the menu hides. If not specified, the menu shows/hides in the same manner. 0: Shows/Hides the menu by left click only. 1: Shows/Hides the menu by right click only. 2: Shows/Hides the menu by left or right click. */ function activatePopUpMenuBy() { // Public method showValue = ((typeof(arguments[0]) == "number") && (arguments[0] > -1)) ? arguments[0] : 0; if (arguments.length > 1) { hideValue = ((typeof(arguments[1]) == "number") && (arguments[1] > -1)) ? arguments[1] : 0; } else { hideValue = showValue; } if ((showValue == 1) || (showValue == 2) || (hideValue == 1) || (hideValue == 2)) { document.oncontextmenu = rightClickHandler; } } /* Hide all menus, except those with alwaysVisible = true. */ function hideAllMenus() { // Public method var i; for (i = 1; i <= menuCount; i++) { var menuObj = getElmId("DOMenu" + i); if (!menuObj.alwaysVisible) { if (menuObj.style.position == "fixed") { menuObj.style.position == "absolute"; menuObj.style.visibility = "hidden"; menuObj.style.position == "fixed"; } else { menuObj.style.visibility = "hidden"; if (menuObj.mode == "cursor") { with (menuObj.style) { left = "0px"; top = "0px"; } menuObj.initialLeft = 0; menuObj.initialTop = 0; } } } refreshMenuItems(menuObj); } } /* Hide all menus with mode = "cursor", except those with alwaysVisible = true. */ function hideCursorMenus() { // Public method var i; for (i = 1; i <= menuCount; i++) { var menuObj = getElmId("DOMenu" + i); if ((menuObj.mode == "cursor") && (!menuObj.alwaysVisible)) { with (menuObj.style) { visibility = "hidden"; left = "0px"; top = "0px"; } menuObj.initialLeft = 0; menuObj.initialTop = 0; } if (menuObj.mode == "cursor") { refreshMenuItems(menuObj); } } } /* Hide all menus with mode = "absolute" or mode = "fixed", except those with alwaysVisible = true. */ function hideVisibleMenus() { // Public method var i; for (i = 1; i <= menuCount; i++) { var menuObj = getElmId("DOMenu" + i); if (((menuObj.mode == "absolute") || (menuObj.mode == "fixed")) && (!menuObj.alwaysVisible)) { if (menuObj.style.position == "fixed") { menuObj.style.position = "absolute"; menuObj.style.visibility = "hidden"; menuObj.style.position = "fixed"; } else { menuObj.style.visibility = "hidden"; with (menuObj.style) { left = "0px"; top = "0px"; } menuObj.initialLeft = 0; menuObj.initialTop = 0; } } if ((menuObj.mode == "absolute") || (menuObj.mode == "fixed")) { refreshMenuItems(menuObj); } } } /* Hide the menu and all its submenus. Argument: menuObj : Required. Menu object that specifies the menu and all its submenus to be hidden. */ function hideMenus(menuObj) { // Public method refreshMenuItems(menuObj); var i; for (i = 0; i < menuObj.childNodes.length; i++) { if ((menuObj.childNodes[i].enabled) && (menuObj.childNodes[i].hasSubMenu)) { hideMenus(menuObj.childNodes[i].subMenu.menuObj); } } if (menuObj.style.position == "fixed") { menuObj.style.position = "absolute"; menuObj.style.visibility = "hidden"; menuObj.style.position = "fixed"; } else { menuObj.style.visibility = "hidden"; with (menuObj.style) { left = "0px"; top = "0px"; } menuObj.initialLeft = 0; menuObj.initialTop = 0; } } /* Event handler that handles left click event. */ function leftClickHandler(e) { // Private method if ((getX(e) > getClientWidth()) || (getY(e) > getClientHeight())) { return; } if (!e) { var e = window.event; } if ((e.button) && (e.button == 2)) { return; } hideVisibleMenus(); if (typeof(hideMenuBarMenus) == "function") { hideMenuBarMenus(); } if (popUpMenuObj) { var state = popUpMenuObj.menuObj.style.visibility; if ((state == "visible") && ((hideValue == 0) || (hideValue == 2))) { activatePopUpMenu(e); } if (((state == "hidden") || (state == "")) && ((showValue == 0) || (showValue == 2))) { activatePopUpMenu(e); } } } /* Event handler that handles right click event. */ function rightClickHandler(e) { // Private method if ((getX(e) > getClientWidth()) || (getY(e) > getClientHeight())) { return; } if (popUpMenuObj) { var state = popUpMenuObj.menuObj.style.visibility; if ((state == "visible") && ((hideValue == 1) || (hideValue == 2))) { activatePopUpMenu(e); return false; } if (((state == "hidden") || (state == "")) && ((showValue == 1) || (showValue == 2))) { activatePopUpMenu(e); return false; } } } /* Event handler that handles scroll event. */ function scrollHandler() { // Private method var i; for (i = 1; i <= menuCount; i++) { var menuObj = getElmId("DOMenu" + i); if ((isIE()) && (menuObj.mode == "fixed")) { with (menuObj.style) { left = (menuObj.initialLeft + getScrollLeft()) + "px"; top = (menuObj.initialTop + getScrollTop()) + "px"; } } } if (typeof(menuBarCount) == "number") { menuBarScrollHandler(); } } /* Set the menu object to be the pop-up menu. Argument: menuObj : Required. Menu object that specifies the pop-up menu. */ function setPopUpMenu(menuObj) { // Public method popUpMenuObj = menuObj; } /* Check browser compatibility and create the menus. */ function initjsDOMenu() { // Public method if (document.createElement && document.getElementById) { createjsDOMenu(); } } if (typeof(allExceptFilter) == "undefined") { var allExceptFilter = new Array("A.*", "BUTTON.*", "IMG.*", "INPUT.*", "OBJECT.*", "OPTION.*", "SELECT.*", "TEXTAREA.*"); // Public property } if (typeof(noneExceptFilter) == "undefined") { var noneExceptFilter = new Array(); // Public property } if (typeof(menuClassName) == "undefined") { var menuClassName = "jsdomenudiv"; // Public property } if (typeof(menuItemClassName) == "undefined") { var menuItemClassName = "jsdomenuitem"; // Public property } if (typeof(menuItemClassNameOver) == "undefined") { var menuItemClassNameOver = "jsdomenuitemover"; // Public property } if (typeof(sepClassName) == "undefined") { var sepClassName = "jsdomenusep"; // Public property } if (typeof(arrowClassName) == "undefined") { var arrowClassName = "jsdomenuarrow"; // Public property } if (typeof(arrowClassNameOver) == "undefined") { var arrowClassNameOver = "jsdomenuarrowover"; // Public property } if (typeof(menuBorderWidth) == "undefined") { var menuBorderWidth = 2; // Public property } var menuCount = 0; // Private property var menuItemCount = 0; // Private property var sepCount = 0; // Private property var popUpMenuObj = null; // Private property var showValue = 0; // Private property var hideValue = 0; // Private property var pageMode = getPageMode(); // Private property document.onclick = leftClickHandler; window.onscroll = scrollHandler; /********** Opciones del Menu ************/ function createjsDOMenu() { return; cursorMenu1 = new jsDOMenu(150); with (cursorMenu1) { addMenuItem(new menuItem("Imprimir", "", "code:self.print('');")); addMenuItem(new menuItem("Nueva ventana", "", "code:self.open('');")); addMenuItem(new menuItem("Ver fuente", "", "code:self.open('view-source:' + self.location.href);")); addMenuItem(new menuItem("Propiedades", "", "code:self.open('https://vuceimpo.vuce.gov.co:443/VUCEIMPO/general/Propiedades.html','propiedades','width=450,height=550,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no');")); addMenuItem(new menuItem("-")); addMenuItem(new menuItem("Sertisoft S.A.", "", "code:var objWinSS=self.open('http://www.sertisoft.com.co');objWinSS.focus();")); } /*cursorMenu1_1 = new jsDOMenu(130); with (cursorMenu1_1) { addMenuItem(new menuItem("Google", "", "http://www.google.com")); addMenuItem(new menuItem("Yahoo", "item2", "http://www.yahoo.com")); addMenuItem(new menuItem("MSN", "", "http://www.msn.com")); addMenuItem(new menuItem("Teoma", "item4", "http://www.teoma.com")); addMenuItem(new menuItem("Ask Jeeves", "", "http://www.askjeeves.com")); } cursorMenu1.items.se.setSubMenu(cursorMenu1_1); */ setPopUpMenu(cursorMenu1); activatePopUpMenuBy(1, 2); } function PonerEstilosMenu(){ var objCuerpo=document.body; if(objCuerpo){ var W3CDOM= (document.createElement && document.getElementsByTagName); if(!W3CDOM) { return ; } var bol=1; if(objCuerpo.innerHTML.toUpperCase().indexOf("0){ event.returnValue = false; var oTR = document.selection.createRange(); var iInsertLength = parseInt(maxLength) - obj.value.length + oTR.text.length; var sData = window.clipboardData.getData("Text").substr(0,iInsertLength); oTR.text = sData; } } function vdValidarCaracteres(obj){ var lstSpecialCharacter=["*","\'","\"","&","�","^","�"].reverse(); var valor, tipo, objeto, j; tipo=""; objeto=""; for (var i=0; i-1){ valor=obj.value; for (j=0; j