/* */ //
function confirmar (operacion)
{
var exito = true;
if(arguments.length==2)
{
validar = arguments[1];
}
if(arguments.length<2)
{
validar = true;
}
switch(operacion)
{
case "INSERTAR":
if(validar)
{
exito = validarCampos();
}
break;
case "ACTUALIZAR":
if(validar)
{
exito = validarCampos();
}
if(exito) exito = confirm("¿Esta seguro que desea actualizar la información?");
break;
case "BORRAR":
exito = confirm("¿Esta seguro que desea eliminar la información?");
break;
case "BORRAR CARPETA":
exito = confirm("¿Esta seguro que desea eliminar la carpeta?");
break;
default:
exito = false;
}
return exito;
}
function listarCampos(forma)
{
var mensaje = "El formulario forma tiene los siguientes campos:\n";
for(var i=0;icadena.length)
{
ancho = cadena.length-i;
}
cadena_imprimir += cadena.substr(i,ancho)+"\n";
}
alert(cadena_imprimir);
}
function eliminar(id)
{
var idc=window.document.getElementById(id);
idc.parentNode.removeChild(idc);
}
function asignarPropiedades(campo,propiedades,imprimir)
{
for(var j=0;j 31 && (charCode <48 || charCode> 57)) { // Chequeamos que sea un numero comparandolo con los valores ASCII
//alert("ESTE VALOR DEBE SER NUMERICO!")
return false
}
return true
}
function esTelefono(e) {
var charCode
if (navigator.appName == 'Netscape') // Veo si es Netscape o Explorer (mas adelante lo explicamos)
charCode = e.which // leo la tecla que ingreso
else
charCode = e.keyCode // leo la tecla que ingreso
//alert(charCode);
status = charCode
if (charCode> 31 && (charCode <48 || charCode> 57) && charCode!=32) { // Chequeamos que sea un numero comparandolo con los valores ASCII
//alert("ESTE VALOR DEBE SER NUMERICO!")
return false
}
return true
}
function tienePunto(cadena)
{
for(var i=0;i 31 && (charCode <48 || charCode> 57)) { // Chequeamos que sea un numero comparandolo con los valores ASCII
if(charCode==46)
{
if(tienePunto(campo.value))
{
//alert("ESTE VALOR DEBE SER NUMERICO!");
return false;
}
}
else
{
//alert("ESTE VALOR DEBE SER NUMERICO!");
return false;
}
}
return true
}
function numeroConMenos(entrada)
{
for(var i=0;i=15 && charCode>=48 && charCode<=57)
return false;
var tienePunto = numeroConPunto(entrada.value);
if (charCode> 31 && (charCode <48 || charCode> 57) && (charCode!=46 || tienePunto)) { // Chequeamos que sea un numero comparandolo con los valores ASCII
//alert(\"ESTE VALOR DEBE SER NUMERICO!\")
return false
}
return true
}
function calcularTotal(formulario,prefijo,sufijo,entrada_total)
{
var valorT,total=0;
for(var i=0;i0)
{
calcularValorRecaudo();
}else
{
alert('NO dispone de más dinero para pagar esta factura');
}
}else
{
alert('Debe digitar el valor de un pago');;
}
}
function calcularValorRecaudo()
{
if(existeCampo('contador_factura_fija',document.forma))
var contador_factura_fija = document.forma.contador_factura_fija.value;
if(existeCampo('contador_factura_extra',document.forma))
var contador_factura_extra = document.forma.contador_factura_extra.value;
var total_pagar = 0;
if (document.forma.factura_fija.checked)
{
total_pagar += parseFloat(document.forma.interes_fijo.value);
for(var i=1;i=3)?(numero.length-3):(0);
numero_formateado = numero.substr(pos_ini,numero.length);
for(var i=numero.length-3,j=0;i>0;i-=3,j++)
{
if(j%2==0) separador = ".";
else separador = "'";
pos_ini = (i>=3)?(i-3):(0);
numero_formateado = numero.substr(pos_ini,i-pos_ini)+separador+numero_formateado;
}
numero_formateado = menos+numero_formateado;
return numero_formateado;
}
/**
* Funcion utilizada en el establecimiento de los privilegios
* Encargada de marcar o desmarcar la casilla del privilegio
* de cada columna en caso de haberse hecho clic sobre la casilla
* de todos los atributos
*
* @author Juan Manuel Reyes García
* @access public
* @copyright Grupo de Desarrollo G98 - 2003
* @since 2004-02-21
* @version 0.1
*/
function marcarDesmarcarColumna (nombre_campo,valor,formulario)
{
var elemento, tam_nombre_campo;
tam_nombre_campo = nombre_campo.length;
for(var i=0;i
* @access public
* @copyright Grupo de Desarrollo G98 - 2003
* @since 2004-02-25
* @version 0.1
*/
function cerrarVentana (ventana)
{
ventana.close();
}
function cerrarVentanaSeleccion (e)
{
//alert('presionó el caracter '+e.which+'\nCon los modificadores '+e.modifiers);
if(e.which==0)
{
cerrarVentana(window.self);
}
}
/**
* Funcion que abre la ventana de selección para bajar al formulario
* el valor de un atributo
*
* @author Juan Manuel Reyes García
* @access public
* @copyright Grupo de Desarrollo G98 - 2003
* @since 2004-02-24
* @version 0.1
*/
function abrirVentanaDeSeleccion (formulario,nombre_ventana,nombre_ventana_origen,nombre_clase,nombre,prefijo_caja_texto,funcion_js_antes,funcion_js,ancho,alto,te,ts,tva,tvs,operacion,posicion_x,posicion_y,con_caja_texto,nombre_completo_caja_texto)
{
var direccion_ventana = "";
var caracteristicas_ventana = "";
var nombre_formulario = "";
var separador;
var cantidad_variables_antes;
var pos;
// caracteristicas_ventana += "alwaysRaised";
caracteristicas_ventana += "dependent";
caracteristicas_ventana += "directories=no";
caracteristicas_ventana += ",height="+alto;
caracteristicas_ventana += ",hotkeys=no";
// caracteristicas_ventana += ",innerHeight";
// caracteristicas_ventana += ",innerWidth";
caracteristicas_ventana += ",location=no";
caracteristicas_ventana += ",menubar=no";
// caracteristicas_ventana += ",outerHeight";
caracteristicas_ventana += ",personalbar=no";
caracteristicas_ventana += ",resizable=yes";
caracteristicas_ventana += ",screenX=0";
caracteristicas_ventana += ",screenY=0";
caracteristicas_ventana += ",scrollbars=yes";
caracteristicas_ventana += ",status=no";
caracteristicas_ventana += ",titlebar=no";
caracteristicas_ventana += ",toolbar=no";
caracteristicas_ventana += ",left="+posicion_x;
caracteristicas_ventana += ",top="+posicion_y;
caracteristicas_ventana += ",width="+ancho;
caracteristicas_ventana += ",z-lock=no";
direccion_ventana = "http://encuentrolenguaje.univalle.edu.co/matriculaencuentrolenguaje/Herramienta/ventanaDeSeleccion.php";
separador = "&";
cantidad_variables_antes = 19;
if(typeof(formulario)!="undefined")
{
nombre_formulario = "document."+formulario.name;
}
direccion_ventana += "?";
direccion_ventana += "nom="+nombre;
direccion_ventana += separador+"nfo="+nombre_formulario;
direccion_ventana += separador+"nvo="+nombre_ventana_origen;
direccion_ventana += separador+"pct="+prefijo_caja_texto;
direccion_ventana += separador+"fjs="+funcion_js;
direccion_ventana += separador+"fjsa="+funcion_js_antes;
direccion_ventana += separador+"te="+te;
direccion_ventana += separador+"ts="+ts;
direccion_ventana += separador+"tva="+tva;
direccion_ventana += separador+"in=0";
direccion_ventana += separador+"nc="+nombre_clase;
direccion_ventana += separador+"op="+operacion;
direccion_ventana += separador+"cct="+con_caja_texto;
direccion_ventana += separador+"nct="+nombre_completo_caja_texto;
var nombre_campo_fm, valor_campo_fm,nombre_campo_adicional,valor_campo_adicional;
for (var i=0; i
* @access public
* @copyright Grupo de Desarrollo G98 - 2003
* @since 2004-02-25
* @version 0.1
*/
function asignarValorACampo (nombre_campo,valor_campo,formulario)
{
var campo;
//alert("asignando "+valor_campo+" a "+nombre_campo+".\n El objeto es "+campo);
campo = obtenerCampo(nombre_campo,formulario);
//campo.value = valor_campo;
switch(campo.type)
{
case "text":
case "textarea":
case "button":
case "submit":
case "hidden":
campo.value = valor_campo;
break;
case "select-one":
case "select-multiple":
asignarValorASelect(campo,valor_campo);
break;
}
}
/**
* Función que asgina cadena vacía a todos los campos del formulario
* que entran como parametros
*
* @author Juan Manuel Reyes García
* @access public
* @copyright Grupo de Desarrollo G98 - 2003
* @since 2004-03-09
* @version 0.1
*/
function limpiarCampos (formulario)
{
//alert("limpiando campos ...");
for(var i=1;i
* @access public
* @copyright Grupo de Desarrollo G98 - 2003
* @since 2004-02-25
* @version 0.1
*/
function obtenerValorCampo (nombre_campo,formulario)
{
var campo,valor;
//alert("obteniendo el valor del campo "+nombre_campo);
campo = obtenerCampo(nombre_campo,formulario);
switch(campo.type)
{
case "text":
case "textarea":
case "button":
case "submit":
case "hidden":
case "select-one":
case "select-multiple":
valor = campo.value;
break;
case "radio":
valor = obtenerValorRadio(campo,formulario);
break;
case "checkbox":
valor = obtenerValorCheckBox(campo);
break;
}
//alert("obteniendo el valor del campo '"+nombre_campo+"' cuyo valor es '"+valor+"'"+"\nEl nombre del campo es '"+campo.name+"'");
return valor;
}
function obtenerValorCheckBox (campo)
{
return campo.checked;
}
function obtenerValorRadio (campo)
{
for(var i=0;i
* @access public
* @copyright Grupo de Desarrollo G98 - 2003
* @since 2004-02-25
* @version 0.1
*/
function obtenerCampo (nombre_campo,formulario,temp)
{
var elemento, campo, encontro_campo;
encontro_campo = false;
for(var i=0;i La fecha Inicial no puede ser mayor a la Fecha Final ("+hoy.getFullYear()+"-"+hoy.getMonth()+"-"+hoy.getDate()+")";
texto = "\n--> La fecha Inicial no puede ser mayor a la Fecha Final";
alert (texto);
resp = false;
}
return resp;
}
function validarAtributosForma()
{
formulario = 'document.forma';
resp = true;
//alert ('Se van a bajar los atributos seleccionados');
/*
arreglo = new Array('reb_esp_codigo','reb_pel_codigo','bid_numero_serial','bnr_meses_garantia','bid_cco_codigo','bid_cif_codigo');
nombres = new Array('UBICACIÓN (Edificio - Espacio)','FUNCIONARIO RESPONSABLE','NÚMERO SERIAL','MESES DE GARANTIA','CENTRO DE COSTOS','CENTRO DE INFORMACIÓN');
tam = arreglo.length;
texto = "";
for (i=0; i El campo "+nombres[i]+" es obligatorio y debe ingresarlo";
resp = false;
}
}
if (!resp)
alert ('Se ha producido un error.'+texto);
*/
return resp;
}
function verificarNumero(forma,elemento)
{
for(var i=0;i
* @author Henry Arley Taquez Q
* @access public
* @copyright Equis Uno Software 2.004
* @since 2004-10-06
*
*/
function crearFormularioConfiguracionReporte(atr_codigo,atr_nombre_descripcion,tab_codigo,i)
{
var nuevo_atr_codigo,nuevo_atr_nombre_descripcion,seleccionar;
var arreglo = new Array();
nuevo_atr_codigo = window.opener.top.document.createElement("INPUT");
nuevo_atr_codigo.type = "HIDDEN";
nuevo_atr_codigo.name = atr_codigo.name+tab_codigo.value;
nuevo_atr_codigo.value = atr_codigo.value;
nuevo_atr_nombre_descripcion = window.opener.top.document.createElement("INPUT");
nuevo_atr_nombre_descripcion.type = "TEXT";
nuevo_atr_nombre_descripcion.name = atr_nombre_descripcion.name;
nuevo_atr_nombre_descripcion.value = atr_nombre_descripcion.value;
nuevo_atr_nombre_descripcion.size = "50";
nuevo_atr_nombre_descripcion.style.background = "#FFFFFF";
nuevo_atr_nombre_descripcion.style.borderBottom = "#FFFFFF";
nuevo_atr_nombre_descripcion.style.borderRight = "#FFFFFF";
nuevo_atr_nombre_descripcion.style.borderLeft = "#FFFFFF";
nuevo_atr_nombre_descripcion.style.borderTop = "#FFFFFF";
//nuevo_atr_nombre_descripcion.readonly
seleccionar = window.opener.top.document.createElement("INPUT");
seleccionar.type = "CHECKBOX";
seleccionar.name = "seleccionar"+i+tab_codigo.value;
arreglo[0] = nuevo_atr_codigo;
arreglo[1] = nuevo_atr_nombre_descripcion;
arreglo[2] = seleccionar;
return arreglo;
}
/**
* Construir un area de trabajo dinamico que incluye una tabla con un formulario
*
* Pasa los atributos seleccionados de una tabla desde una ventana pop up a un formulario
*
* @author Julián Montes Guzmán
* @author Henry Arley Taquez Q
* @access public
* @copyright Equis Uno Software 2.004
* @since 2004-10-06
*
*/
function construirAreaTrabajoDinamicamente(atr_codigo,atr_nombre_descripcion,tab_codigo,i)
{
var fila, columna1,columna2;
fila = window.opener.top.document.createElement("TR");
columna1 = window.opener.top.document.createElement("TD");
columna1.align = "center";
columna1.style.color = "#000000";
columna1.style.fontFamily = "Helvetica,Verdana, Arial,sans-serif";
columna1.style.fontSize = "11px";
columna2 = window.opener.top.document.createElement("TD");
columna2.align = "center";
arreglo = crearFormularioConfiguracionReporte(atr_codigo,atr_nombre_descripcion,tab_codigo,i);
columna1.appendChild(arreglo[0]);
columna1.appendChild(arreglo[1]);
columna2.appendChild(arreglo[2]);
fila.appendChild(columna1);
fila.appendChild(columna2);
return fila;
}
function validarCamposChequeados(forma,elemento)
{
var cadena,respuesta;
respuesta = false;
for(var i=0;i
* @author Henry Arley Taquez Q
* @access public
* @copyright Equis Uno Software 2.004
* @since 2004-10-06
*
*/
function pasarAtributosTabla(num_atributos, forma)
{
var tabla, fila,cuerpo_tabla,boton_enviar,tab_codigo_nuevo,tab_codigo;
var atr_codigo,atr_nombre_descripcion;
tab_codigo = forma.tab_codigo;
fud_codigo = forma.fud_codigo;
tab_codigo_nuevo = window.opener.top.document.createElement("INPUT");
tab_codigo_nuevo.type = "HIDDEN";
tab_codigo_nuevo.name = tab_codigo.name+tab_codigo.value;
tab_codigo_nuevo.value = tab_codigo.value;
window.opener.top.document.getElementById("formulario").appendChild(tab_codigo_nuevo);
for(var i=0;i 1){
i = obtenerPosicionElementoForma(valor)+posicionAsumar;
//alert ("J diferente de 1, posCalculada= "+i);
}
else{// Igual a 1, para wincombos tradicionales
i = obtenerPosicionElementoForma(valor)+1;
//alert ("J igual de 1,posCalculada= "+i);
}
url = "/sabs/paquetes/herramientas/"+url+"&patron="+valor.value+"&posCalculada="+i;
url = url+"&patron2="+valor2.value;
url = url+"&patron3="+valor3.value;
url = url+"&patron4="+valor4.value;
wWidth = Math.round((screen.availWidth*2)/100);
wHeight = Math.round((screen.availHeight*2)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
busqueda = window.open (url,"application","width=" + wWidth + ",height=" + wHeight + ",resizable=no,status=no,scrollbars=no,top=" + wYPos + ",left=" + wXPos);
if (busqueda.opener == null) busqueda.opener = window;
busqueda.focus();
}
}
function validarFechaActual(campo)
{
var today = new Date();
var mesActual = today.getMonth();
var anoActual = today.getFullYear();
mesActual++; //el mes esta entre 0 y 11
var diaActual = today.getDate();
cadena=campo.value;
var longitud = cadena.length ;
var anno= cadena.substring(0,4);
var mes= cadena.substring(5,7);
var dia= cadena.substring(8,longitud);
if(anno!=anoActual){
alert('Fecha Inválida: Verifique el AÑO del campo fecha');
return false;
}
if(mes>mesActual)
{
alert('Fecha Inválida: Verifique el MES del campo fecha');
return false;
}
if((mes==mesActual)&&(dia>diaActual)){
alert('Fecha Inválida: Verifique el MES y DÍA del campo fecha');
return false;
}
return true;
}
/**
* Funcion obtenerPosicionElementoForma
* Determina la posicion del elemento dentro de la forma
*
*
* @author Carlos Andres Quintero
* @access public
* @copyright Netcentric, Universidad del Valle 2.002
* @since 2002-10-25
* @version 1.0
*
* Precondiciones: La forma dentro del documento html se debe llamar 'forma'
*/
function obtenerPosicionElementoForma (Elemento){
var i;
for(i=0;i 1){
i = obtenerPosicionElementoForma(valor)-posicionArestar;
//alert ("J diferente de 1, variableCalculada= "+i);
}
else{// Igual a 1, para wincombos tradicionales
i = obtenerPosicionElementoForma(valor)-1;
//alert ("J igual de 1,variableCalculada= "+i);
}
//alert ('La conexion es '+conexion);
url = "/sac/Paquetes/Utilidades/"+url+"&patron="+valor.value+"&variableCalculada="+i;
//alert ("url "+url);
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
miventana = window.open (url,"application","width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null) miventana.opener = window;
miventana.focus();
}
function wincomboPaquete(url,w,h,posicionArestar,valor,valor2,valor3,valor4){
// FUNCION QUE PERMITE ABRIR LA VENTANA PARA EL WINCOMBO
// RECIBE EL VALOR(CADENA) CON EL CUAL SE VA A HACER LA BUSQUEDA PARA MOSTRAR
// EN EL WINCOMBO, Y LA URL(EL ARCHIVO QUE SE VA A ABRIR=wincombo.php)
// alert ('h '+h);
// alert ('url '+url);
var i;
if (posicionArestar > 1){
i = obtenerPosicionElementoForma(valor)-posicionArestar;
//alert ("J diferente de 1, variableCalculada= "+i);
}
else{// Igual a 1, para wincombos tradicionales
i = obtenerPosicionElementoForma(valor)-1;
//alert ("J igual de 1,variableCalculada= "+i);
}
url = "/sabs/paquetes/"+url+"&patron="+valor.value+"&variableCalculada="+i;
//alert ("url "+url);
if(valor2){
url = url+"&patron2="+valor2.value;
}
if(valor3){
url = url+"&patron3="+valor3.value;
}
if(valor4){
url = url+"&patron4="+valor4.value;
}
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
miventana = window.open (url,"","width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null) miventana.opener = window;
miventana.focus();
}
function wincombo7(valor, valor2, valor3, valor4, valor5, valor6, valor7, url,w,h,posicionArestar)
{
// FUNCION QUE PERMITE ABRIR LA VENTANA PARA EL WINCOMBO
// RECIBE EL VALOR(CADENA) CON EL CUAL SE VA A HACER LA BUSQUEDA PARA MOSTRAR
// EN EL WINCOMBO, Y LA URL(EL ARCHIVO QUE SE VA A ABRIR=wincombo.php)
// alert ('h '+h);
// url = url+"&patron="+valor.value;
var i;
if (posicionArestar > 1)
{
i = obtenerPosicionElementoForma(valor)-posicionArestar;
//alert ("J diferente de 1, variableCalculada= "+i);
}
else
{// Igual a 1, para wincombos tradicionales
i = obtenerPosicionElementoForma(valor)-1;
//alert ("J igual de 1,variableCalculada= "+i);
}
url = "/sabs/paquetes/herramientas/"+url+"&patron="+valor.value+"&variableCalculada="+i;
url = url+"&patron2="+valor2.value;
url = url+"&patron3="+valor3.value;
url = url+"&patron4="+valor4.value;
url = url+"&patron5="+valor5.value;
url = url+"&patron6="+valor6.value;
url = url+"&patron7="+valor7.value;
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
miventana = window.open (url,"","width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null)
miventana.opener = window;
miventana.focus();
}
function wincombo6(valor, valor2, valor3, valor4, valor5, valor6, url,w,h,posicionArestar)
{
// FUNCION QUE PERMITE ABRIR LA VENTANA PARA EL WINCOMBO
// RECIBE EL VALOR(CADENA) CON EL CUAL SE VA A HACER LA BUSQUEDA PARA MOSTRAR
// EN EL WINCOMBO, Y LA URL(EL ARCHIVO QUE SE VA A ABRIR=wincombo.php)
// alert ('h '+h);
// url = url+"&patron="+valor.value;
var i;
if (posicionArestar > 1)
{
i = obtenerPosicionElementoForma(valor)-posicionArestar;
//alert ("J diferente de 1, variableCalculada= "+i);
}
else
{// Igual a 1, para wincombos tradicionales
i = obtenerPosicionElementoForma(valor)-1;
//alert ("J igual de 1,variableCalculada= "+i);
}
url = "/sabs/paquetes/herramientas/"+url+"&patron="+valor.value+"&variableCalculada="+i;
url = url+"&patron2="+valor2.value;
url = url+"&patron3="+valor3.value;
url = url+"&patron4="+valor4.value;
url = url+"&patron5="+valor5.value;
url = url+"&patron6="+valor6.value;
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
miventana = window.open (url,"","width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null)
miventana.opener = window;
miventana.focus();
}
function wincombo5(valor, valor2, valor3, valor4, valor5, url,w,h,posicionArestar)
{
// FUNCION QUE PERMITE ABRIR LA VENTANA PARA EL WINCOMBO
// RECIBE EL VALOR(CADENA) CON EL CUAL SE VA A HACER LA BUSQUEDA PARA MOSTRAR
// EN EL WINCOMBO, Y LA URL(EL ARCHIVO QUE SE VA A ABRIR=wincombo.php)
// alert ('h '+h);
// url = url+"&patron="+valor.value;
var i;
if (posicionArestar > 1)
{
i = obtenerPosicionElementoForma(valor)-posicionArestar;
//alert ("J diferente de 1, variableCalculada= "+i);
}
else
{// Igual a 1, para wincombos tradicionales
i = obtenerPosicionElementoForma(valor)-1;
//alert ("J igual de 1,variableCalculada= "+i);
}
url = "/sabs/paquetes/herramientas/"+url+"&patron="+valor.value+"&variableCalculada="+i;
url = url+"&patron2="+valor2.value;
url = url+"&patron3="+valor3.value;
url = url+"&patron4="+valor4.value;
url = url+"&patron5="+valor5.value;
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
miventana = window.open (url,"","width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null)
miventana.opener = window;
miventana.focus();
}
function wincombo4(valor, valor2, valor3, valor4, url,w,h,posicionArestar)
{
// FUNCION QUE PERMITE ABRIR LA VENTANA PARA EL WINCOMBO
// RECIBE EL VALOR(CADENA) CON EL CUAL SE VA A HACER LA BUSQUEDA PARA MOSTRAR
// EN EL WINCOMBO, Y LA URL(EL ARCHIVO QUE SE VA A ABRIR=wincombo.php)
// alert ('h '+h);
// url = url+"&patron="+valor.value;
var i;
if (posicionArestar > 1)
{
i = obtenerPosicionElementoForma(valor)-posicionArestar;
//alert ("J diferente de 1, variableCalculada= "+i);
}
else
{// Igual a 1, para wincombos tradicionales
i = obtenerPosicionElementoForma(valor)-1;
//alert ("J igual de 1,variableCalculada= "+i);
}
url = "/sabs/paquetes/herramientas/"+url+"&patron="+valor.value+"&variableCalculada="+i;
url = url+"&patron2="+valor2.value;
url = url+"&patron3="+valor3.value;
url = url+"&patron4="+valor4.value;
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
miventana = window.open (url,"","width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null)
miventana.opener = window;
miventana.focus();
}
function wincombo3(valor, valor2, valor3, url,w,h,posicionArestar)
{
// FUNCION QUE PERMITE ABRIR LA VENTANA PARA EL WINCOMBO
// RECIBE EL VALOR(CADENA) CON EL CUAL SE VA A HACER LA BUSQUEDA PARA MOSTRAR
// EN EL WINCOMBO, Y LA URL(EL ARCHIVO QUE SE VA A ABRIR=wincombo.php)
// alert ('h '+h);
// url = url+"&patron="+valor.value;
var i;
if (posicionArestar > 1)
{
i = obtenerPosicionElementoForma(valor)-posicionArestar;
//alert ("J diferente de 1, variableCalculada= "+i);
}
else
{// Igual a 1, para wincombos tradicionales
i = obtenerPosicionElementoForma(valor)-1;
//alert ("J igual de 1,variableCalculada= "+i);
}
url = "/sabs/paquetes/herramientas/"+url+"&patron="+valor.value+"&variableCalculada="+i;
url = url+"&patron2="+valor2.value;
url = url+"&patron3="+valor3.value;
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
miventana = window.open (url,"","width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null)
miventana.opener = window;
miventana.focus();
}
function wincombo2(valor, valor2, url,w,h,posicionArestar){
// FUNCION QUE PERMITE ABRIR LA VENTANA PARA EL WINCOMBO
// RECIBE EL VALOR(CADENA) CON EL CUAL SE VA A HACER LA BUSQUEDA PARA MOSTRAR
// EN EL WINCOMBO, Y LA URL(EL ARCHIVO QUE SE VA A ABRIR=wincombo.php)
//alert ('VALOR '+valor);
// url = url+"&patron="+valor.value;
var i,j;
/* var conexion = "sabs";
var longitud = document.forma.length;
for(j=0;j 1){
i = obtenerPosicionElementoForma(valor)-posicionArestar;
//alert ("J diferente de 1, variableCalculada= "+i);
}
else{// Igual a 1, para wincombos tradicionales
i = obtenerPosicionElementoForma(valor)-1;
//alert ("J igual de 1,variableCalculada= "+i);
}
//alert('conexion='+conexion);
//url = "/sabs/paquetes/herramientas/"+url+"&patron="+valor.value+"&variableCalculada="+i;
url = "/sac/paquetes/Utilidades/"+url+"&patron="+valor.value+"&variableCalculada="+i;
url = url+"&patron2="+valor2.value;
// alert ("url "+url);
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
miventana = window.open (url,"","width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null) miventana.opener = window;
miventana.focus();
}
function abrirVentanaAtributos(url,w,h)
{
var cadena = 'index.php?PHPSESSID=$PHPSESSID&accion=reporte';
abrirVentanaConNombre(url,50,50,'atributosTabla');
return true;
}
function abrirVentanaGeneradorReporte(w,h)
{
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var url;
var miventana;
url = "";
miventana = window.open (url,"Miventana","width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null) miventana.opener = window;
miventana.focus();
return true;
}
function abrirVentana(url,w,h){
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var url
var miventana;
miventana = window.open (url,"","width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null) miventana.opener = window;
miventana.focus();
}
function abrirUrl(url){
// FUNCION QUE PERMITE ABRIR UNA URL
window.location.href=url;
}
function abrirVentanaRecibeFormulario (formulario,ancho,alto,x,y)
{
abrirPopUp('',formulario.target,ancho,alto,x,y);
return true;
}
function abrirPopUp (url, nombre, ancho, alto, x, y)
{
var caracteristicas_ventana = "";
// caracteristicas_ventana += "alwaysRaised";
caracteristicas_ventana += "dependent";
caracteristicas_ventana += ",directories=no";
caracteristicas_ventana += ",height="+alto;
caracteristicas_ventana += ",hotkeys=no";
// caracteristicas_ventana += ",innerHeight";
// caracteristicas_ventana += ",innerWidth";
caracteristicas_ventana += ",location=no";
caracteristicas_ventana += ",menubar=no";
// caracteristicas_ventana += ",outerHeight";
caracteristicas_ventana += ",personalbar=no";
caracteristicas_ventana += ",resizable=yes";
caracteristicas_ventana += ",screenX=0";
caracteristicas_ventana += ",screenY=0";
caracteristicas_ventana += ",scrollbars=yes";
caracteristicas_ventana += ",status=no";
caracteristicas_ventana += ",titlebar=no";
caracteristicas_ventana += ",toolbar=no";
caracteristicas_ventana += ",width="+ancho;
caracteristicas_ventana += ",z-lock=yes";
caracteristicas_ventana += ",left="+x;
caracteristicas_ventana += ",top="+y;
window.open(url,nombre,caracteristicas_ventana);
}
// Esta función abre en una ventana nueva la forma de inserción del maestro asociado elegido en
// el SELECT de maestros asocidos del maestro base sobre el que se está trabajando
function abrirMaestro()
{
var w = 80;
var h = 60;
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
url = document.forma.maestro.options[document.forma.maestro.selectedIndex].value;
if(url != "")
{
miventana = window.open (url,"","width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null) miventana.opener = window;
miventana.focus();
}// END if(url != "")
}// END function abrirMaestro
function imprimir(){
window.print();
}
function cerrar(){
window.close();
}
function bloquear(campo){
campo.blur();
}
function busquedaRegistro3(valor,valor2,valor3,url,posicionAsumar){
// FUNCION QUE PERMITE BUSCAR UN VALOR DE ACUERDO AL IDENTIFICACOR QUE SE HAYA DIGITADO
valor_forma = valor.value;
if (valor_forma != ""){
var i;
if (posicionAsumar > 1){
i = obtenerPosicionElementoForma(valor)+posicionAsumar;
//alert ("J diferente de 1, posCalculada= "+i);
}
else{// Igual a 1, para wincombos tradicionales
i = obtenerPosicionElementoForma(valor)+1;
//alert ("J igual de 1,posCalculada= "+i);
}
url = "/sabs/paquetes/herramientas/"+url+"&patron="+valor.value+"&posCalculada="+i;
url = url+"&patron2="+valor2.value;
url = url+"&patron3="+valor3.value;
wWidth = Math.round((screen.availWidth*2)/100);
wHeight = Math.round((screen.availHeight*2)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
busqueda = window.open (url,"","width=" + wWidth + ",height=" + wHeight + ",resizable=no,status=no,scrollbars=no,top=" + wYPos + ",left=" + wXPos);
if (busqueda.opener == null) busqueda.opener = window;
busqueda.focus();
}
}
function busquedaRegistro(valor,url,posicionAsumar){
// FUNCION QUE PERMITE BUSCAR UN VALOR DE ACUERDO AL IDENTIFICACOR QUE SE HAYA DIGITADO
valor_forma = valor.value;
if (valor_forma != ""){
var i;
if (posicionAsumar > 1){
i = obtenerPosicionElementoForma(valor)+posicionAsumar;
//alert ("J diferente de 1, posCalculada= "+i);
}
else{// Igual a 1, para wincombos tradicionales
i = obtenerPosicionElementoForma(valor)+1;
//alert ("J igual de 1,posCalculada= "+i);
}
url = "/sabs/paquetes/herramientas/"+url+"&patron="+valor.value+"&posCalculada="+i;
//alert ("url "+url);
wWidth = Math.round((screen.availWidth*2)/100);
wHeight = Math.round((screen.availHeight*2)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
busqueda = window.open (url,"","width=" + wWidth + ",height=" + wHeight + ",resizable=no,status=no,scrollbars=no,top=" + wYPos + ",left=" + wXPos);
if (busqueda.opener == null) busqueda.opener = window;
busqueda.focus();
}
}
function irA(){
location=document.informes.option.options[document.informes.option.selectedIndex].value
}
function cancelar(){
window.close();
}
var isIE=document.all?true:false;
var isDOM=document.getElementById?true:false;
var isNS4=document.layers?true:false;
/* _w : which ID (1) or (2) */
/* _h : (h)ide or (s)how */
function ocultandoElementosForma(_w1,_w2,_w3,_w4,_w5,_h) {
if (isDOM){
if (_h=='s'){
if(_w1!='')
document.getElementById(_w1).style.visibility='visible';
if(_w2!='')
document.getElementById(_w2).style.visibility='visible';
if(_w3!='')
document.getElementById(_w3).style.visibility='visible';
if(_w4!='')
document.getElementById(_w4).style.visibility='visible';
if(_w5!='')
document.getElementById(_w5).style.visibility='visible';
}
if (_h=='h'){
if(_w1!='')
document.getElementById(_w1).style.visibility='hidden';
if(_w2!='')
document.getElementById(_w2).style.visibility='hidden';
if(_w3!='')
document.getElementById(_w3).style.visibility='hidden';
if(_w4!='')
document.getElementById(_w4).style.visibility='hidden';
if(_w5!='')
document.getElementById(_w5).style.visibility='hidden';
}
}
else if (isIE) {
if (_h=='s'){
eval("document.all."+_w1+".style.visibility='visible';");
eval("document.all."+_w2+".style.visibility='visible';");
eval("document.all."+_w3+".style.visibility='visible';");
if(_w4!='')
eval("document.all."+_w4+".style.visibility='visible';");
if(_w5!='')
eval("document.all."+_w5+".style.visibility='visible';");
}
if (_h=='h'){
eval("document.all."+_w1+".style.visibility='hidden';");
eval("document.all."+_w2+".style.visibility='hidden';");
eval("document.all."+_w3+".style.visibility='hidden';");
if(_w4!='')
eval("document.all."+_w4+".style.visibility='hidden';");
if(_w5!='')
eval("document.all."+_w5+".style.visibility='hidden';");
}
}
else if(isNS4){
if (_h=='s'){
eval("document.layers['"+_w1+"'].visibility='show';");
eval("document.layers['"+_w2+"'].visibility='show';");
eval("document.layers['"+_w3+"'].visibility='show';");
if(_w4!='')
eval("document.layers['"+_w4+"'].visibility='show';");
if(_w5!='')
eval("document.layers['"+_w5+"'].visibility='show';");
}
if (_h=='h'){
eval("document.layers['"+_w1+"'].visibility='hide';");
eval("document.layers['"+_w2+"'].visibility='hide';");
eval("document.layers['"+_w3+"'].visibility='hide';");
if(_w4!='')
eval("document.layers['"+_w4+"'].visibility='hide';");
if(_w5!='')
eval("document.layers['"+_w5+"'].visibility='hide';");
}
}
}
/// funciones que se usan en el formulario de admisiones
function estaVacio(valor,nombre){
if(valor.value==""){
// document.forma.valor.focus();
alert("El area "+nombre+" se encuentra vacia");
}
}
function compararValorAreas(valor, campo, valor2){
var i;
i = obtenerPosicionElementoForma (valor2);
if( document.forma.elements[i].value < valor){
// document.forma.elements[i].value='';
document.forma.elements[i].focus();
alert ("EL AREA "+campo+" DEBE SER SUPERIOR A "+valor+" . EL AREA TIENE "+ document.forma.elements[i].value );
// document.forma.elements[i].focus();
}
}
function compararValor(sumatotal, valor2){
if(valor2 > sumatotal){
alert ("EL PUNTAJE DEL ICFES DEBE SER SUPERIOR A "+valor2+ ". EL VALOR DIGITADO ES "+sumatotal);
}
}
function sumarValores5(valorInicial,valorTotal,valor,valor2,valor3,valor4, valor5){
var suma=0;
var exito;
suma= parseInt(valor.value) ;
suma=suma+parseInt(valor2.value);
suma=suma+parseInt(valor3.value);
suma=suma+parseInt(valor4.value);
suma=suma+parseInt(valor5.value);
if( valorInicial.value < suma){
alert("ERROR: La suma de las areas es de "+suma+", pero el puntaje mínimo de inscripción es de "+valorInicial);
}
// valorTotal.value=suma;
// compararValor(valorTotal.value,valorInicial);
}
function sumarValores4(valorInicial,valorTotal,valor,valor2,valor3,valor4)
{
var suma=0;
var exito;
suma= parseInt(valor.value) ;
suma=suma+parseInt(valor2.value);
suma=suma+parseInt(valor3.value);
suma=suma+parseInt(valor4.value);
if( valorInicial.value < suma){
alert("ERROR: La suma de las areas es de "+suma+", pero el puntaje mínimo de inscripción es de "+valorInicial);
}
// valorTotal.value=suma;
/// compararValor(valorTotal.value,valorInicial);
}
/*
function wincomboCriteriosBusquedaAdicional(valor, valor2, url,w,h){
url = url+"&patron="+valor.value+"&coo_obj_nombre="+valor2.options[valor2.selectedIndex].value;
alert('coo_obj_nombre '+valor2.options[valor2.selectedIndex].value);
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
miventana = window.open (url,"application","width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,$
if (miventana.opener == null) miventana.opener = window;
miventana.focus();
}
*/
function validarExclusionEntreElementos (){
var asp_presto_servicio_militar_real;
asp_presto_servicio_militar_real = document.forma.asp_presto_servicio_militar_real.options[document.forma.asp_presto_servicio_militar_real.selectedIndex].value
var asp_presto_servicio_militar_academia;
asp_presto_servicio_militar_academia = document.forma.asp_presto_servicio_militar_academia.options[document.forma.asp_presto_servicio_militar_academia.selectedIndex].value
if (asp_presto_servicio_militar_real=="t" && asp_presto_servicio_militar_academia=="t"){
document.forma.asp_presto_servicio_militar_real.focus();
alert("ERROR: Solo puede seleccionar UNA SOLA Situación de Servicio Militar Obligatorio");
return false;
}
}
function validarCondicionIndigena (){
var cea_coe_codigo;
cea_coe_codigo = document.forma.cea_coe_codigo.options[document.forma.cea_coe_codigo.selectedIndex].value
if (document.forma.api_eci_eti_codigo.value == "" && document.forma.api_eci_cbd_codigo.value == "" && cea_coe_codigo=="IN"){
document.forma.wincomboapi_eci_eti_codigo.focus();
alert("ERROR: Debe suministrar el CABILDO y la ETNIA INDIGENA del Aspirante");
return false;
}
if (cea_coe_codigo!="IN"){
if (document.forma.wincomboapi_eci_eti_codigo.value != "" ) {
alert ("ERROR Debe seleccionar tipo de Condicion de Excepcion -> INDIGENA");
}
}
}
/*
function validarInformacionSituacionMilitar (){
var return_validarInformacionSituacionMilitar=true;
var asp_libreta_militar_distrito;
var asp_libreta_militar_numero;
var asp_libreta_militar_slm_codigo;
var asp_libreta_militar_clm_codigo;
asp_libreta_militar_clm_codigo = document.forma.asp_libreta_militar_clm_codigo.options[document.forma.asp_libreta_militar_clm_codigo.selectedIndex].value;
asp_libreta_militar_slm_codigo = document.forma.asp_libreta_militar_slm_codigo.options[document.forma.asp_libreta_militar_slm_codigo.selectedIndex].value;
if (document.forma.asp_libreta_militar_numero.value != "" || document.forma.asp_libreta_militar_distrito.value != "" || asp_libreta_militar_slm_codigo != "" || asp_libreta_militar_clm_codigo!= "")
{
if (document.forma.asp_libreta_militar_numero.value == "" || document.forma.asp_libreta_militar_distrito.value == "" || asp_libreta_militar_slm_codigo=="" || asp_libreta_militar_clm_codigo==""){
document.forma.asp_libreta_militar_numero.focus();
alert("ERROR: Si posee Libreta Militar DEBE Diligenciar TODO el punto 1.4 -> Situacion Militar");
return_validarInformacionSituacionMilitar = false;
}
}
return return_validarInformacionSituacionMilitar;
}
*/
function validarInformacionIdioma (){
var ipa_idi_codigo;
var ipa_lugar_donde_estudio;
var ipa_cuanto_tiempo;
var ipa_tti_codigo;
var ipa_habla_ndc_codigo;
var ipa_escribe_ndc_codigo;
var ipa_lee_ndc_codigo;
ipa_idi_codigo = document.forma.ipa_idi_codigo.options[document.forma.ipa_idi_codigo.selectedIndex].value
ipa_tti_codigo = document.forma.ipa_tti_codigo.options[document.forma.ipa_tti_codigo.selectedIndex].value
ipa_habla_ndc_codigo = document.forma.ipa_habla_ndc_codigo.options[document.forma.ipa_habla_ndc_codigo.selectedIndex].value
ipa_escribe_ndc_codigo = document.forma.ipa_escribe_ndc_codigo.options[document.forma.ipa_escribe_ndc_codigo.selectedIndex].value
ipa_lee_ndc_codigo = document.forma.ipa_lee_ndc_codigo.options[document.forma.ipa_lee_ndc_codigo.selectedIndex].value
if (document.forma.ipa_lugar_donde_estudio.value != "" || ipa_idi_codigo != "" || ipa_tti_codigo != "" || ipa_habla_ndc_codigo != "" || ipa_escribe_ndc_codigo != "" || ipa_lee_ndc_codigo != "")
{
if (document.forma.ipa_lugar_donde_estudio.value == "" ||
document.forma.ipa_cuanto_tiempo.value == "" ||
ipa_tti_codigo=="" || ipa_habla_ndc_codigo=="" || ipa_escribe_ndc_codigo=="" || ipa_lee_ndc_codigo=="")
{
alert("ERROR: Si Seleccino otro idioma, debe diligenciar todo el punto 6.1.5");
return false;
}
}
}
function validarTipoVinculacionConUV (){
var asr_pers_vincul_tla_codigo;
var asr_pers_vincul_rcu_codigo;
asr_pers_vincul_tla_codigo = document.forma.asr_pers_vincul_tla_codigo.options[document.forma.asr_pers_vincul_tla_codigo.selectedIndex].value
asr_pers_vincul_rcu_codigo = document.forma.asr_pers_vincul_rcu_codigo.options[document.forma.asr_pers_vincul_rcu_codigo.selectedIndex].value
if (document.forma.asr_pers_vincul_tla_codigo.value != "" && document.forma.asr_pers_vincul_rcu_codigo.value != ""){
alert("ERROR: SOLO debe seleccionar un TIPO de relacion con la Universidad");
return false;
}
}
function validarSiTrabajaJornadaAmpliada (){
var hla_trabaja_actualmente;
hla_trabaja_actualmente = document.forma.hla_trabaja_actualmente.options[document.forma.hla_trabaja_actualmente.selectedIndex].value
if (hla_trabaja_actualmente == "t" && (document.forma.hla_empresa_o_lugar.value == "" || document.forma.wincombohla_empresa_o_lugar.value == "")){
alert("ERROR: Debe suministrar el nombre de la empresa en la que trabaja");
//document.forma.boton_hla_empresa_o_lugar.focus();
return false;
}
if (hla_trabaja_actualmente == "f" && (document.forma.hla_empresa_o_lugar.value != "" || document.forma.wincombohla_empresa_o_lugar.value != "")){
alert("ERROR: Debe seleccionar PRIMERO que el aspirante trabaja actualmente");
//document.forma.boton_hla_empresa_o_lugar.focus();
return false;
}
}
function validarVinculacionConUV (){
var asr_pers_vincul_tla_codigo;
var asr_pers_vincul_rcu_codigo;
var asr_pers_vincul_tiv_codigo;
var asr_pers_vincul_nombre_completo;
var asr_pers_vincul_tid_codigo;
var asr_pers_vincul_num_identificac;
var asr_pers_vincul_ded_codigo;
var asr_pers_vincul_num_hora_semana;
asr_pers_vincul_tla_codigo = document.forma.asr_pers_vincul_tla_codigo.options[document.forma.asr_pers_vincul_tla_codigo.selectedIndex].value
asr_pers_vincul_rcu_codigo = document.forma.asr_pers_vincul_rcu_codigo.options[document.forma.asr_pers_vincul_rcu_codigo.selectedIndex].value
asr_pers_vincul_tiv_codigo = document.forma.asr_pers_vincul_tiv_codigo.options[document.forma.asr_pers_vincul_tiv_codigo.selectedIndex].value
asr_pers_vincul_tid_codigo = document.forma.asr_pers_vincul_tid_codigo.options[document.forma.asr_pers_vincul_tid_codigo.selectedIndex].value
asr_pers_vincul_ded_codigo = document.forma.asr_pers_vincul_ded_codigo.options[document.forma.asr_pers_vincul_ded_codigo.selectedIndex].value
if (asr_pers_vincul_tla_codigo != "" || asr_pers_vincul_rcu_codigo != "" || document.forma.asr_pers_vincul_nombre_completo.value != ""
|| document.forma.asr_pers_vincul_num_identificac.value != "" || document.forma.asr_pers_vincul_num_hora_semana.value != ""
){
if (asr_pers_vincul_tiv_codigo == "" || asr_pers_vincul_tid_codigo== "" || asr_pers_vincul_ded_codigo== "" ||
document.forma.asr_pers_vincul_nombre_completo.value == "" || document.forma.asr_pers_vincul_num_identificac.value == ""
|| document.forma.asr_pers_vincul_num_hora_semana.value == ""){
alert("ERROR: Debe diligenciar TODO el punto 7.2 para continuar");
}
}
}
/**
* Funcion buscarAtributos
*
* Despliega los atributos de la Tabla tabla para ser elegidos
* como Estaticos o Dinamicos y los baja a la Posicion valor
*
* @author Richard Jaramillo Herrera
* @access public
* @copyright Netcentric, Universidad del Valle 2.002
* @since 2002-11-11
* @version 1.0
*
*/
function buscarAtributos(estaticos,dinamicos,tabla,tipo,url)
{
var w = 50;
var h = 70;
var i;
i = obtenerPosicionElementoForma(dinamicos);
url = "/sabs/paquetes/herramientas/"+url+"&valor="+i+"&estaticos="+estaticos.value+"&dinamicos="+dinamicos.value+"&tabla="+tabla.value+"&tipo="+tipo.value;
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
miventana = window.open (url,"application","width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null) miventana.opener = window;
miventana.focus();
}// END function buscarAtributos
function historial(valor,url,w,h)
{
url = "/sabs/paquetes/herramientas/"+url+"&patron="+valor.value;
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
miventana = window.open(url,"","width="+wWidth+",height="+wHeight+",menubar=yes,resizable=yes,status=no,scrollbars=yes,top="+wYPos+",left="+wXPos);
if (miventana.opener == null)
miventana.opener = window;
miventana.focus();
}
/**
* Funcion limpiarCampo, asigna cadena vacia al atributo value de
* la variable de entrada, lo que es equivalente a limpiar el campo
*
* Este procemiento funciona ya que javascript pasa los parametros
* por referencia
*
* @author Juan Manuel Reyes
* @access public
* @copyright OIT, Universidad del Valle
* @since 2003-07-02
* @version 1.0
*
*/
function limpiarCampo(atributo)
{
atributo.value = "";
}
/**
* Funcion convertirValor, toma un valor simple y lo asigna
* a una variable atributoi de la forma
*
* El proposito de esta funcion es pasar el valor de un
* input de tipo radio, como parametro a un wincombo
*
* Para ser utilizada, debe estar definido un input de nombre
* atributoi en el formulario actual
*
* @author Juan Manuel Reyes
* @access public
* @copyright OIT, Universidad del Valle
* @since 2003-07-02
* @version 1.0
*
*/
function convertirValor (variable_objeto,valor,variable_elegida)
{
switch(variable_elegida)
{
case 0: variable_objeto.form.atributo0.value = valor; return variable_objeto.form.atributo0;
case 1: variable_objeto.form.atributo1.value = valor; return variable_objeto.form.atributo1;
case 2: variable_objeto.form.atributo2.value = valor; return variable_objeto.form.atributo2;
case 3: variable_objeto.form.atributo3.value = valor; return variable_objeto.form.atributo3;
}
}
/**
* Funcion aparece, muestra el objeto html
* cuyo id es id.
*
* @author Juan Manuel Reyes
* @access public
* @copyright OIT, Universidad del Valle
* @since 2003-07-02
* @version 1.0
*
*/
function aparece(id)
{
var objeto = document.getElementById(id);
objeto.style.display = 'block';
/*
if(!document.all)
{
window.resizeBy(-1,-1);
window.resizeBy(1,1);
} */
}
function aparece2(id)
{
var objeto = document.getElementById(id);
objeto.style.visibility = 'visible';
if(!document.all)
{
window.resizeBy(-1,-1);
window.resizeBy(1,1);
}
}
/**
* Funcion desaparece, desaparece el objeto html
* cuyo id es id.
*
* @author Juan Manuel Reyes
* @access public
* @copyright OIT, Universidad del Valle
* @since 2003-07-02
* @version 1.0
*
*/
function desaparece(id)
{
var objeto = document.getElementById(id);
objeto.style.display = 'none';
/*
if(!document.getElementById)
{
window.resizeBy(-1,-1);
window.resizeBy(1,1);
} */
/*
if(!document.all)
{
window.resizeBy(-1,-1);
window.resizeBy(1,1);
} */
}
function desaparece2(id)
{
var objeto = document.getElementById(id);
objeto.style.visibility = 'hidden';
if(!document.all)
{
window.resizeBy(-1,-1);
window.resizeBy(1,1);
}
}
/**
* Funcion selectSiAparece, muestra el objeto html
* señalado con id, en caso de que el select tenga el
* valor t, es decir, que esté señalada la opcion Si
*
* Solamente funciona para select construidos a partir
* de la tabla estadosino
*
* @author Juan Manuel Reyes
* @access public
* @copyright OIT, Universidad del Valle
* @since 2003-07-02
* @version 1.0
*
*/
function selectSiAparece (varselect,id)
{
switch (varselect.value)
{
case 't': aparece(id); break;
default : desaparece(id); break;
}
}
/**
* Funcion selectNoAparece, muestra el objeto html
* señalado con id, en caso de que el select tenga el
* valor f, es decir, que esté señalada la opcion No
*
* Solamente funciona para select construidos a partir
* de la tabla estadosino
*
* @author Juan Manuel Reyes
* @access public
* @copyright OIT, Universidad del Valle
* @since 2003-07-02
* @version 1.0
*
*/
function selectNoAparece (varselect,id)
{
switch (varselect.value)
{
case 'f': aparece(id); break;
default : desaparece(id); break;
}
}
function apareceDesaparceHoras (varselect,id,prefijo)
{
resto_cadena = new Array();
var i = 0;
switch (varselect.value)
{
case '3': aparece(id);
eval("document.forma."+prefijo+"cantidad_horas_x_semana.value = ''");
eval("document.forma."+prefijo+"cantidad_horas_x_semana.focus()");
break;
case 't': aparece(id);
switch (prefijo)
{
case "enf_":
resto_cadena[i] = "codigo_banco_para_pago";
i=i+1;
resto_cadena[i] = "dig_chequeo_para_pago";
break;
default:
resto_cadena[i] = "fecha_finalizacion";
}
for (var j=0;j
* @access public
* @copyright OIT, Universidad del Valle
* @since 2003-07-02
* @version 1.0
*
*/
function chequearColumna (forma,elemento)
{
var cadena;
var indice = 0;
flag = elemento.checked;
//alert('elemento: '+elemento.name);
for(var i=0;i
* @access public
* @copyright OIT, Universidad del Valle
* @since 2003-07-02
* @version 1.0
*
*/
function limpiarWincomboUnaLlave (forma,elemento)
{
for(var i=0;i
* @access public
* @copyright OIT, Universidad del Valle
* @since 2003-07-02
* @version 1.0
*
*/
function limpiarWincomboDosLlaves (forma,elemento)
{
for(var i=0;i
* @author Germán González
* @access public
* @copyright OIT, Universidad del Valle
* @since 2003-12-02
* @version 1.0
*
*/
function textoContador(campoContar, campoContador, limite)
{
if ((campoContar.value.length) > limite)
campoContar.value = campoContar.value.substring(0, limite);
else
campoContador.value = limite - (campoContar.value.length);
} //END function textoContador
function abrirVentanaConNombre(url,w,h,nombre){
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
miventana = window.open (url,nombre,"alwaysRaised"+"dependent"+",directories=no"+",hotkeys=no"+",innerHeight"+",width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,menubar=yes,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null) miventana.opener = window;
miventana.focus();
}
/**************************************************************************************************************************/
/**
* Funcion convertirMoneda
*
* Permite convertir una cadena en formato de número flotante al formato de moneda.
* Ejemplo: pasa de 1542.30 a 1.542,30
*
* @author Alejandro Forero Arango
* @access public
* @copyright OIT, Universidad del Valle
* @since 2004-04-15
* @version 1.0
*
*/
function convertirMoneda(valor)
{
valor = valor.toString();
pos_punto = valor.lastIndexOf('.');
if (pos_punto > 0)
{
nuevo_valor = ','+valor.substring(pos_punto+1,pos_punto+3);
valor = valor.substring(0,pos_punto);
}
else
nuevo_valor = ',00';
tamano = valor.length;
inicio = tamano-3;
fin = tamano;
while (inicio > 0)
{
cadena = valor.substring(inicio,fin);
nuevo_valor = cadena+nuevo_valor;
//alert ('dentro del while la cadena es '+cadena);
inicio -= 3;
fin -= 3;
if (fin > 0)
nuevo_valor = '.'+nuevo_valor;
//alert (' el nuevo valor dentro del while va en'+nuevo_valor);
}
if (fin>0)
{
cadena = valor.substring(0,fin);
nuevo_valor = cadena+nuevo_valor;
}
//alert(' en convertirMoneda el nuevo valor es '+nuevo_valor);
return nuevo_valor;
}
/**************************************************************************************************************************/
/**
* Funcion monedaToCadena
*
* Permite convertir una variable en formato de moneda al formato de flotante.
* Ejemplo: de 1.542,30 se pasa a 1542.30
*
* @author Alejandro Forero Arango
* @access public
* @copyright OIT, Universidad del Valle
* @since 2004-04-15
* @version 1.0
*
*/
function monedaToCadena(valor)
{
regPunto = /\./gi;
regComa = /,/gi;
valor = valor.replace(regPunto,'');
valor = valor.replace(regComa,'.');
//alert (' el valor en cadena es '+valor);
return valor;
}
/**
* Funcion abrirVentanaReporte
*
* Permite abrir una nueva ventana para desplegar un reporte
*
* @author Henry Taquez
* @access public
* @copyright OIT, Universidad del Valle
* @since 2004-04-15
* @version 1.0
*
*/
function abrirVentanaReporte(forma,w,h)
{
nombre_ventana = forma.nombre_reporte.value;
nombre_ventana = nombre_ventana.replace(/-/g,'');
nombre_ventana = nombre_ventana.replace(/ /g,'');
forma.target = nombre_ventana;
abrirVentanaConNombre('',w,h,nombre_ventana);
document.forma.submit();
forma.target = '';
}
function abrirVentanaConNombreImpresion(url,w,h,nombre){
wWidth = Math.round((screen.availWidth*w)/100);
wHeight = Math.round((screen.availHeight*h)/100);
wXPos = Math.round((screen.availWidth - wWidth) / 2);
wYPos = Math.round((screen.availHeight - wHeight ) / 2);
var miventana;
miventana = window.open (url,nombre,"alwaysRaised"+"dependent"+",directories=no"+",hotkeys=no"+",innerHeight"+",width=" + wWidth + ",height=" + wHeight + ",resizable=yes,status=no,directories=no,location=no,menubar=yes,scrollbars=yes,top=" + wYPos + ",left=" + wXPos);
if (miventana.opener == null) miventana.opener = window;
miventana.focus();
}
/**
*
* @author Henry Taquez
* @access public
* @copyright OIT, Universidad del Valle
* @since 2004-04-15
* @version 1.0
*
*/
function abrirVentanaImpresion(forma,w,h,nombre)
{
//forma.action='';
//nombre_ventana = forma.nombre_reporte.value;
//nombre_ventana = nombre_ventana.replace(/-/g,'');
//nombre_ventana = 'ventanaimpresion';
forma.target = 'ventanaimpresion';
abrirVentanaConNombreImpresion('',w,h,'ventanaimpresion');
//document.forma.submit();
//forma.target = '';
}
function apareceDesaparceTipoAtributo(forma,idtipo,select_tipo)
{
var tipo = select_tipo.value
var cadena;
if(tipo == 4)
{
aparece(idtipo);
}else
{
desaparece(idtipo);
}
}
function hora(){
var fecha = new Date()
var hora = fecha.getHours()
var minuto = fecha.getMinutes()
var segundo = fecha.getSeconds()
var anno = fecha.getFullYear()
var mes = fecha.getMonth()+1
var dia = fecha.getDate()
if(mes <10){mes = "0"+mes}
if(dia<10) {dia = "0"+dia}
if (hora < 10) {hora = "0" + hora}
if (minuto < 10) {minuto = "0" + minuto}
if (segundo < 10) {segundo = "0" + segundo}
var fechahora = anno+"-"+mes+"-"+dia+" "+hora + ":" + minuto + ":" + segundo
document.getElementById('hora').firstChild.nodeValue = fechahora
tiempo = setTimeout('hora()',1000)
}
function inicio(){
document.write('')
document.write ('000000')
hora();
}
/**
* Funcion bderecho
*
* Inhabilita el botón derecho del browser de la aplicación
*
* @author Henry Taquez
* @access public
* @copyright Equis Uno Software
* @since 2004-04-15
* @version 1.0
*
*/
function bderecho(e)
{
/*if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3))
{
alert(" El botón derecho del raton se encuentra inhabilitado");
return false;
}
return true;*/
}
//Este código se debe poner en el encabezado de la página del browser
/*if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=bderecho;
document.onmousedown=bderecho;*/
function teclas()
{
alert(" Las teclas no funcionan ");
}
//document.onkeydown=teclas;
//if (document.layers) window.captureEvents(Event.MOUSEDOWN);
//window.onmousedown=right;
function keypressed()
{
alert(" Las teclas no funcionan ");
}
//document.onmousedown=right;
//document.onkeydown=keypressed;
/**********************************************************************************
ScrollText
* Copyright (C) 2001 Thomas Brattli
* This script was released at DHTMLCentral.com
* Visit for more great scripts!
* This may be used and changed freely as long as this msg is intact!
* We will also appreciate any links you could give us.
*
* Made by Thomas Brattli
*
* Script date: 09/23/2001 (keep this date to check versions)
*********************************************************************************/
/*function lib_bwcheck(){ //Browsercheck (needed)
this.ver=navigator.appVersion
this.agent=navigator.userAgent
this.dom=document.getElementById?1:0
this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
this.ie=this.ie4||this.ie5||this.ie6
this.mac=this.agent.indexOf("Mac")>-1
this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
return this
}
var bw=lib_bwcheck()
var speed = 30
var loop, timer
function makeObj(obj,nest){
nest=(!nest) ? "":'document.'+nest+'.';
this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
this.up=goUp;this.down=goDown;
this.moveIt=moveIt; this.x=0; this.y=0;
this.obj = obj + "Object";
eval(this.obj + "=this");
return this;
}
// A unit of measure that will be added when setting the position of a layer.
var px = bw.ns4||window.opera?"":"px";
function moveIt(x,y){
this.x = x
this.y = y
this.css.left = this.x+px
this.css.top = this.y+px
}
//Makes the object go up
function goDown(move){
if (this.y>-this.scrollHeight+oCont.clipHeight){
this.moveIt(0,this.y-move)
if (loop) setTimeout(this.obj+".down("+move+")",speed)
}
}
//Makes the object go down
function goUp(move){
if (this.y<0){
this.moveIt(0,this.y-move)
if (loop) setTimeout(this.obj+".up("+move+")",speed)
}
}
//Calls the scrolling functions. Also checks whether the page is loaded or not.
function scroll(speed){
if (scrolltextLoaded){
loop = true;
if (speed>0) oScroll.down(speed)
else oScroll.up(speed)
}
}
//Stops the scrolling (called on mouseout)
function noScroll(){
loop = false
if (timer) clearTimeout(timer)
}
//Makes the object
var scrolltextLoaded = false
function scrolltextInit(){
oCont = new makeObj('divScrollTextCont')
oScroll = new makeObj('divText','divScrollTextCont')
oScroll.moveIt(0,0)
oCont.css.visibility = "visible"
scrolltextLoaded = true
}
//Call the init on page load if the browser is ok...
if (bw.bw) onload = scrolltextInit
/***************
Multiple Scripts
If you have two or more scripts that use the onload event, probably only one will run (the last one).
Here is a solution for starting multiple scripts onload:
1. Delete or comment out all the onload assignments, onload=initScroll and things like that.
2. Put the onload assignments in the body tag like in this example, note that they must have braces ().
Example:
**************/
//
function oNumero(numero)
{
//Propiedades
this.valor = numero || 0
this.dec = -1;
//Métodos
this.formato = numFormat;
this.ponValor = ponValor;
//Definición de los métodos
function ponValor(cad)
{
if (cad =='-' || cad=='+') return
if (cad.length ==0) return
if (cad.indexOf('.') >=0)
this.valor = parseFloat(cad);
else
this.valor = parseInt(cad);
}
function numFormat(dec, miles)
{
var num = this.valor, signo=3, expr;
var cad = ""+this.valor;
var ceros = "", pos, pdec, i;
for (i=0; i < dec; i++)
ceros += '0';
pos = cad.indexOf('.')
if (pos < 0)
cad = cad+"."+ceros;
else
{
pdec = cad.length - pos -1;
if (pdec <= dec)
{
for (i=0; i< (dec-pdec); i++)
cad += '0';
}
else
{
num = num*Math.pow(10, dec);
num = Math.round(num);
num = num/Math.pow(10, dec);
cad = new String(num);
}
}
pos = cad.indexOf('.')
if (pos < 0) pos = cad.lentgh
if (cad.substr(0,1)=='-' || cad.substr(0,1) == '+')
signo = 4;
if (miles && pos > signo)
do{
expr = /([+-]?\d)(\d{3}[\.\,]\d*)/
cad.match(expr)
cad=cad.replace(expr, RegExp.$1+','+RegExp.$2)
}
while (cad.indexOf(',') > signo)
if (dec<0) cad = cad.replace(/\./,'')
return cad;
}
}//Fin del objeto oNumero: