/* -----------------------------------------------------------------------------------------------------------------------------
Nombre: Gral.js
Autor: José Octavio Gómez Cruz
Funciones que arman las partes fijas y que se repetiran en las páginas web de la institución
----------------------------------------------------------------------------------------------------------------------------- */
// window.onerror = function(msg, url, linenumber){
// var AlertaCIIA = 'Como proceso de mejora del CIIA, se solicita copiar las 3 lineas de abajo';
// AlertaCIIA = AlertaCIIA + '\n y enviarlas al correo electrónico: cpe_innovacion@pa.gob.mx'
// AlertaCIIA = AlertaCIIA + '\n\n1.- Alerta CIIA: '+msg+'\n2.- En la página: '+url+'\n3.- Número de Línea: '+linenumber
// AlertaCIIA = AlertaCIIA + '\n\n Click en Aceptar para continuar (Nota: puede seguir trabajando)'
// alert(AlertaCIIA)
// return true
// }
//ValidaSession(10)
//alert('Delegacion: '+ <%=Session("cve_edo")%>)
vf11=0;
vf12=0;
vf13=0;
vf14=0;
vf15=0;
vf16=0;
vf17=0;
//desactivar la tecla F11
document.onkeydown = function(){
if (window.event && window.event.keyCode == 112){
var a=showModalDialog('ayuda.asp?c=1','x','resizable:no; status:no; dialogWidth:1010px; dialogHeight:430px');
return false;
}
if (window.event && (window.event.keyCode == 122 || window.event.keyCode == 117)){
window.event.keyCode = 505;
}
if (window.event && window.event.keyCode == 505){
return false;
}
}
function ApagaBoton(boton,texto) {
// alert('Espere mientras se procesa su petición\nGracias\n\nPresione Aceptar para continuar');
document.getElementById(boton).disabled = true;
if (texto!="") {document.getElementById(boton).value = texto+'
Por favor espere...';}
}
function limpiadato(campo){
document.getElementById(campo).value=""
}
function Decimales(campo, dato, decimales){
if (dato==""){
document.getElementById(campo).value=""}
else{
document.getElementById(campo).value = Number(dato).toFixed(decimales)}
}
/* ---------------------------- Marco Superior (Sup) ---------------------------- */
/* Zona Nav del encabezado */
function Nav() {
document.write('
')
document.write('')
document.write('
')
}
/* Inserta la fecha en formato Xxxx 99, 9999 */
function fecha() {
var meses=new Array("ENERO","FEBRERO","MARZO","ABRIL","MAYO","JUNIO","JULIO","AGOSTO","SEPTIEMBRE","OCTUBRE","NOVIEMBRE","DICIEMBRE")
var dia_s=new Array("DOMINGO","LUNES","MARTES","MIERCOLES","JUEVES","VIERNES","SABADO")
var hoy = new Date( )
var dia = hoy.getDate( )
if (dia < 10)
dia = "0" + dia
var sdia = hoy.getDay( )
var mes = hoy.getMonth( )
var anio = hoy.getYear( )
if (anio < 1000) {anio += 1900}
document.write(dia_s[sdia]+" "+dia+" DE "+meses[mes]+" DE "+anio+" ")
}
/* Inserta la fecha en formato Xxxx 99, 9999 */
function fech() {
var meses=new Array("ENE","FEB","MAR","ABR","MAY","JUN","JUL","AGO","SEP","OCT","NOV","DIC")
var hoy = new Date( )
var dia = hoy.getDate( )
if (dia < 10) {dia = "0" + dia}
var sdia = hoy.getDay( )
var mes = hoy.getMonth( )
var anio = hoy.getYear( )
if (anio < 1000) {anio += 1900}
document.write(dia+"/"+meses[mes]+"/"+anio+" ")
}
/* ---------------------------- Marco Inferior (Pie) ---------------------------- */
/* Creditos */
function Creditos() {
document.write('diseño y desarrollo: Procuraduría Agraria')
}
function Version() {
document.write('algunos derechos reservados © ENERO 2009 CIIA ® versión 1.1.2009')
}
/* ---------------------------- Funciones de Uso General ---------------------------- */
/* Para abrir una nueva Ventana */
function liga(Prg) {
window.status='hola';
window.open(Prg,'_blank','fullscreen=yes');
parent.opener=top;
window.close();
}
/* Para abrir una nueva Ventana sin borrar el historial */
/*function Ir(Prg) {
window.location.href(Prg);*/
//JOSELUIS
function Ir(Prg) {
window.location.href = Prg;
}
/* Para regresar una Ventana (funciona siempre y cuando se hay utilizado la función Ir() */
function Atras() {
window.history.back();
}
/* Función para validar los caracteres restantes en un campo del tipo textarea (muestra los caracteres restantes)*/
function valcr(max, txtarea, cuenta) {
var cadena = document.getElementById(txtarea); // nombre del campo textarea
var n = cadena.value.length; // largo actual de la cadena capturada
if (n > max) {
cadena.value = cadena.value.substring(0, max);
}
document.getElementById(cuenta).value = max - cadena.value.length // nombre del campo donde se muestran los caracteres restantes
}
/* Función para validar los caracteres restantes en un campo del tipo textarea (NO muestra los caracteres restantes)*/
function valcrc(max, txtarea) {
var cadena = document.getElementById(txtarea); // nombre del campo textarea
var n = cadena.value.length; // largo actual de la cadena capturada
if (n > max) {
cadena.value = cadena.value.substring(0, max);
}
}
/* Funciones para la captura de fechas y validar su contenido */
function esNum(sChr){
var sCod = sChr.charCodeAt(0);
return ((sCod > 47) && (sCod < 58));
}
function vSep(oTxt){
var bOk = false;
bOk = bOk || ((oTxt.value.charAt(2) == "-") && (oTxt.value.charAt(5) == "-"));
bOk = bOk || ((oTxt.value.charAt(2) == "/") && (oTxt.value.charAt(5) == "/"));
return bOk;
}
function uDia(oTxt){
var nMes = parseInt(oTxt.value.substr(3, 2), 10);
var nRes = 0;
switch (nMes){
case 1: nRes = 31; break;
case 2: nRes = 29; break;
case 3: nRes = 31; break;
case 4: nRes = 30; break;
case 5: nRes = 31; break;
case 6: nRes = 30; break;
case 7: nRes = 31; break;
case 8: nRes = 31; break;
case 9: nRes = 30; break;
case 10: nRes = 31; break;
case 11: nRes = 30; break;
case 12: nRes = 31; break;
}
return nRes;
}
function vDia(oTxt){
var bOk = false;
var nDia = parseInt(oTxt.value.substr(0, 2), 10);
bOk = bOk || ((nDia >= 1) && (nDia <= uDia(oTxt)));
return bOk;
}
function vMes(oTxt){
var bOk = false;
var nMes = parseInt(oTxt.value.substr(3, 2), 10);
bOk = bOk || ((nMes >= 1) && (nMes <= 12));
return bOk;
}
function vAnio(oTxt){
var bOk = true;
var nAno = oTxt.value.substr(6);
bOk = bOk && ((nAno.length == 2) || (nAno.length == 4));
if (bOk){
for (var i = 0; i < nAno.length; i++){
bOk = bOk && esNum(nAno.charAt(i));
}
}
return bOk;
}
function valfec(oTxt, fhoy) {
var bOk = true;
if (oTxt.value != ""){
bOk = bOk && (vAnio(oTxt));
bOk = bOk && (vMes(oTxt));
bOk = bOk && (vDia(oTxt));
bOk = bOk && (vSep(oTxt));
if (!bOk) {
alert("La fecha no tiene el formato dd/mm/aaaa");
oTxt.focus();
}
if (!Com_Fec(oTxt.value, fhoy)) {
alert("La fecha que intenta registrar: "+oTxt.value+"\nes posterior al día de hoy: "+fhoy);
oTxt.value=""
oTxt.focus(); return false;
}
if (oTxt.value.length != 10) {
alert("Debe especificar la fecha en el formato correcto");
oTxt.focus(); return false;
}
}
}
/* Valida que una fecha (Obj1) no sea mayor que otra (Obj2) */
function Com_Fec(Obj1,Obj2) {
var Str1 = Obj1; var Str2 = Obj2;
dia1 = eval(Str1.substring(0,2)); mes1 = eval(Str1.substring(3,5)); anyo1 = eval(Str1.substring(6,10));
dia2 = eval(Str2.substring(0,2)); mes2 = eval(Str2.substring(3,5)); anyo2 = eval(Str2.substring(6,10));
if (anyo1>anyo2) {return false;}
if ((anyo1==anyo2) && (mes1>mes2)) {return false;}
if ((anyo1==anyo2) && (mes1==mes2) && (dia1>dia2)) {return false;}
return true;
}
/* Agrega las / como formato de fecha */
function mskfec(objeto, valor){
tecla = (document.all) ? event.keyCode : event.which;
if ((valor.length == 2 || valor.length == 5) && event.keyCode != 8){
document.getElementById(objeto).value = valor + '/';
document.getElementById(objeto).focus();
}
if (valor.length == 3 && event.keyCode != 8 && event.keyCode >= 48 && event.keyCode <= 57){
if (valor.substring(0,3) != "/"){
document.getElementById(objeto).value = valor.substring(0,2) + "/" + valor.substring(2,3);
}
}
if (valor.length == 6 && event.keyCode != 8 && event.keyCode >= 48 && event.keyCode <= 57){
if (valor.substring(0,6) != "/"){
document.getElementById(objeto).value = valor.substring(0,5) + "/" + valor.substring(5,6);
}
}
if (valor.substring(valor.length-2,valor.length) =="//"){
document.getElementById(objeto).value = valor.substring(0,valor.length-1)
}
}
function calendario(campo){
var datos = new Array();
var fecha = new Date();
datos[0] = 0;
if(document.getElementById(campo).value.length > 0){
datos[0] = document.getElementById(campo).value.substr(3,2);
datos[1] = document.getElementById(campo).value.substr(document.getElementById(campo).value.length-4,document.getElementById(campo).value.length-1);
}
else{
datos[0] = fecha.getMonth()+1;
//artler, jl//
datos[1] = fecha.getUTCFullYear();
//artler, jl//
}
do{
datos = showModalDialog('calend.asp?mes='+datos[0]+'&any='+datos[1],datos,'status:no; resizable:no; dialogWidth:280px; dialogHeight:200px;');
}while(datos[2]==1)
{
if (datos[0].length > 10){
datos[0]=''
}
document.getElementById(campo).value = datos[0];
document.getElementById(campo).focus();
seleccion(document.getElementById(campo));
}
}
function selecciona(elemento,combo1) {
var combo =document.getElementById(combo1);
var cantidad = combo.length;
for (i = 0; i < cantidad; i++) {
if (combo[i].value == elemento) {
combo[i].selected = true;
}
}
}
function valKey(e,c){
if (c==1) patron=/[0123456789]/; // Solo numeros
if (c==2) patron=/[a-z,A-ZñÑ0123456789 .]/; // Solo numeros y letras
if (c==3) patron=/[a-z,A-ZñÑ .]/; // Solo letras
if (c==4) patron=/[0123456789/]/; // Solo numeros y diagonales para fecha
if (c==5) patron=/[a-z,A-ZñÑ #:;*!?¿¡._0123456789-áéíóúÁÉÍÓÚ]/; // para domicilio
if (c==6) patron=/[a-z,A-ZñÑ #:;*!?¿¡._0123456789\-áéíóúÁÉÍÓÚ/]/; // para textarea
if (c==7) patron=/[0123456789.]/; // Solo numeros con puntos para decimales
if (c==8) patron=/[a-z,A-Z@._0123456789-]/; // para correo electronico
if (c==9) patron=/[a-z,A-Z@._/0123456789-]/; // para numero de oficio
tecla = (document.all) ? e.keyCode : e.which;
if (tecla==8 || tecla == 13) return true;
te = String.fromCharCode(tecla);
return patron.test(te);
}
/* Limpia de espacios una cadena */
function AllTrim(cadena, campo) {
for(i=0; i=0; i=cadena.length-1) {
if(cadena.charAt(i)==" ")
cadena=cadena.substring(0,i);
else
break;
}
document.getElementById(campo).value=cadena;
}
function trim(cadena) {
for(i=0; i=0; i=cadena.length-1) {
if(cadena.charAt(i)==" ")
cadena=cadena.substring(0,i);
else
break;
}
return cadena;
}
function trima(cadena) {
for(i=0; i=0; i=cadena.length-1) {
if(cadena.charAt(i)==" ")
cadena=cadena.substring(0,i);
else
break;
}
agend.vActividad.value=cadena;
}
function LimpiaTrim(campo, cadena) {
for(i=0; i=0; i=cadena.length-1) {
if(cadena.charAt(i)==" ")
cadena=cadena.substring(0,i);
else
break;
}
document.getElementById(campo).value=cadena;
}
/* Despliega una Etiqueta */
function feti(Etiq,Tam,Alig) {
var Tal = "left"
if (Alig==1) Tal="center";
if (Alig==2) Tal="right";
document.write(''+Etiq+'')
}
/* Despliega un Campo */
function fdat(Etiq,Tam,Alig) {
var Tal = "left"
if (Alig==1) Tal="center";
if (Alig==2) Tal="right";
document.write('')
document.write(Etiq+'')
}
function sumar() {
Fut.Edit5.value = eval(parseInt(Fut.Edit1.value) +parseInt(Fut.Edit2.value));
}
/* Abre dialogo para seleccionar Estado */
function doctos(accion, proced){
var aedo=new Array();
aedo[0]=proced;
aedo[1]=accion;
//aqui paso los datos a la ventana hija
showModalDialog('Documentos.asp',aedo,'status:no; resizable:no; dialogWidth:230px; dialogHeight:380px');
}
/* Abre dialogo para seleccionar Estado */
//JOSELUIS Inicio document.getElementById
function buscarestados(){
var aedo=new Array();
aedo[0]=document.getElementById('cboestado').value;
aedo[1]=document.getElementById('nestado').value;
//aqui paso los datos a la ventana hija
aedo=showModalDialog('estados.asp',aedo,'status:no; resizable:no; dialogWidth:380px; dialogHeight:480px');
//aqui recuepero datos de la ventana hija
document.getElementById('cboestado').value=aedo[0];
document.getElementById('nestado').value=aedo[1];
if (isNaN(aedo[0])){document.getElementById('cboestado').value=''};
document.getElementById('vcve_mun').value="";
document.getElementById('nmunicipio').value="";
document.getElementById('nucleo').value="";
document.getElementById('nnucleo').value="";
}
/* Abre dialogo para seleccionar Municipio */
function buscarmunicipios(){
var amun=new Array();
if (document.getElementById('cboestado').value == "") {
alert("debe seleccionar un estado");
}
else {
amun[0] = document.getElementById('vcve_mun').value;
amun[1] = document.getElementById('nmunicipio').value;
//aqui paso los datos a la ventana hija
amun=showModalDialog('municipios.asp?edo='+document.getElementById('cboestado').value,amun,'resizable:no; status:no; dialogWidth:370px; dialogHeight:430px');
//aqui recuepero datos de la ventana hija
document.getElementById('vcve_mun').value=amun[0];
document.getElementById('nmunicipio').value=amun[1];
document.getElementById('vprogmun').value="";
if (amun[2].substring(0,1) == '1'){
document.getElementById('vprogmun').value='*Atn prioritaria';}
if (amun[2].substring(1,2)=='1'){
document.getElementById('vprogmun').value = trim(document.getElementById('vprogmun').value+' *CONAFOR');}
if (amun[2].substring(2,3)=='1'){
document.getElementById('vprogmun').value = trim(document.getElementById('vprogmun').value+' *100x100');}
if (amun[2].substring(3,4)=='1'){
document.getElementById('vprogmun').value = trim(document.getElementById('vprogmun').value+' *ProArbol');}
if (trim(document.getElementById('vprogmun').value)==''){
document.getElementById('vprogmun').value = 'No se encuentra dentro de ningun programa';}
document.getElementById('nucleo').value="";
document.getElementById('nnucleo').value="";
}
}
function buscampio(vEdo){
var amun=new Array();
if (vEdo == "") {
alert("debe seleccionar un estado");
}
else {
amun[0] = vEdo;
amun[1] = document.getElementById('nmunicipio').value;
//aqui paso los datos a la ventana hija
amun=showModalDialog('municipios.asp?edo='+vEdo,amun,'resizable:no; status:no; dialogWidth:280px; dialogHeight:430px');
//aqui recuepero datos de la ventana hija
document.getElementById('vcve_mun').value=amun[0];
document.getElementById('nmunicipio').value=amun[1];
document.getElementById('nucleo').value="";
document.getElementById('nnucleo').value="";
}
}
/* Abre dialogo para seleccionar Núcleo Agrario */
function buscarnucleos(){
var anuc=new Array();
if (document.getElementById('cboestado').value == "") {
alert("debe seleccionar el estado");
}
else {
if (document.getElementById('vcve_mun').value == "") {
alert("debe seleccionar un municipio");
}
else {
anuc[0] = document.getElementById('nucleo').value;
anuc[1] = document.getElementById('nnucleo').value;
//aqui paso los datos a la ventana hija
anuc=showModalDialog('nucleos.asp?edo='+document.getElementById('cboestado').value+'&mun='+document.getElementById('vcve_mun').value,anuc,'status:no; resizable:no; dialogWidth:550px; dialogHeight:430px');
// aqui recupero datos de la ventana hija
document.getElementById('nucleo').value=anuc[0];
document.getElementById('nnucleo').value=anuc[1];
document.getElementById('vcve_res').value=anuc[2];
document.getElementById('vprognuc').value=anuc[3];
}
}
}
function buscanuc(vEdo,vMpio){
var anuc=new Array();
if (vEdo == "") {
alert("debe seleccionar el estado");
}
else {
if (vMpio == "") {
alert("debe seleccionar un municipio");
}
else {
anuc[0] = document.getElementById('nucleo').value;
anuc[1] = document.getElementById('nnucleo').value;
//aqui paso los datos a la ventana hija
anuc=showModalDialog('nucleos.asp?edo='+vEdo+'&mun='+vMpio,anuc,'status:no; resizable:no; dialogWidth:550px; dialogHeight:430px');
// aqui recuepero datos de la ventana hija
document.getElementById('nucleo').value=anuc[0];
document.getElementById('nnucleo').value=anuc[1];
}
}
}
/* Abre dialogo para seleccionar Residencias */
function buscarresidencia(dEdo){
var ares=new Array();
if (document.getElementById('cboestado').value == "") {
alert("debe seleccionar un Estado");
}
else {
//aqui paso los datos a la ventana hija
ares=showModalDialog('residencias.asp?edo='+dEdo,ares,'resizable:no; status:no; dialogWidth:280px; dialogHeight:430px');
//aqui recuepero datos de la ventana hija
document.getElementById('vcve_res').value=ares[0];
document.getElementById('residencia').value=ares[1];
}
}
//JOSELUIS fin document.getElementById
/* Abre dialogo para seleccionar Residencias */
function buscarfutxRes(dRes,dProced){
var afut=new Array();
if (document.getElementById('cboestado').value == "") {
alert("debe seleccionar un Estado");
}
else {
//ares[0] = document.all.cboestado.value;
//aqui paso los datos a la ventana hija
ares=showModalDialog('futxRes.asp?res='+dRes+'&Proced='+dProced,afut,'resizable:no; status:no; dialogWidth:370px; dialogHeight:430px');
//aqui recuepero datos de la ventana hija
document.all.Futs.value=afut[0];
document.all.vPromov.value=afut[1];
}
}
/* Abre dialogo para seleccionar Expediente */
function buscarexpediente(){
var aexp=new Array();
aexp[0] = document.all.cvfolio.value;
aexp[1] = document.all.cvpromovente.value;
aexp[2] = document.all.edosesion.value;
aexp[3] = document.all.numemp.value;
//aqui paso los datos a la ventana hija
aexp=showModalDialog('expediente.asp?afolio='+document.all.cvfolio.value+'&apromovente='+document.all.cvpromovente.value+'&aestado='+document.all.edosesion.value+'&anumemp='+document.all.numemp.value,aexp,'status:no; resizable:no; dialogHeight:430px');
// aqui recupero datos de la ventana hija
document.all.cvfolio.value=aexp[0];
document.all.cvpromovente.value=aexp[1];
}
/* Abre dialogo para seleccionar Municipio */
function buscarinstructores(){
var ains=new Array();
if (document.all.cboestado.value == "") {
alert("debe seleccionar un estado");
}
else {
ains[0] = document.all.vinstructor.value;
ains[1] = document.all.ninstructor.value;
//aqui paso los datos a la ventana hija
ains=showModalDialog('instructores.asp?edo='+document.all.cboestado.value,ains,'resizable:no; status:no; dialogWidth:280px; dialogHeight:430px');
//aqui recuepero datos de la ventana hija
document.all.vinstructor.value=ains[0];
document.all.ninstructor.value=ains[1];
}
}
/* Oculta o muestra un boton */
function mbtn(b) {
if (b==1){
document.all.btnprb.style.display = (document.all.btnprb.style.display == 'none') ? 'none' : 'none';
}
if (b==2){
document.all.btnprb.style.display = (document.all.btnprb.style.display == 'none') ? '' : '';
}
}
/* Abre dialogo para modificar Representantes del ORV */
function modORV(){
var vlig = "orv_REdat.asp"
var aorv = new Array()
/* Comisariado Ejidal o de Bienes Comunales (titulares) */
aorv[0] = document.all.vcet_ppat.value;
aorv[1] = document.all.vcet_pmat.value;
aorv[2] = document.all.vcet_pnom.value;
aorv[3] = document.all.vcet_pfec.value;
aorv[4] = document.all.vcet_psex.value;
aorv[5] = document.all.vcet_spat.value;
aorv[6] = document.all.vcet_smat.value;
aorv[7] = document.all.vcet_snom.value;
aorv[8] = document.all.vcet_sfec.value;
aorv[9] = document.all.vcet_ssex.value;
aorv[10] = document.all.vcet_tpat.value;
aorv[11] = document.all.vcet_tmat.value;
aorv[12] = document.all.vcet_tnom.value;
aorv[13] = document.all.vcet_tfec.value;
aorv[14] = document.all.vcet_tsex.value;
/* Consejo de Vigilancia (titulares) */
aorv[15] = document.all.vcvt_ppat.value;
aorv[16] = document.all.vcvt_pmat.value;
aorv[17] = document.all.vcvt_pnom.value;
aorv[18] = document.all.vcvt_pfec.value;
aorv[19] = document.all.vcvt_psex.value;
aorv[20] = document.all.vcvt_spat.value;
aorv[21] = document.all.vcvt_smat.value;
aorv[22] = document.all.vcvt_snom.value;
aorv[23] = document.all.vcvt_sfec.value;
aorv[24] = document.all.vcvt_ssex.value;
aorv[25] = document.all.vcvt_tpat.value;
aorv[26] = document.all.vcvt_tmat.value;
aorv[27] = document.all.vcvt_tnom.value;
aorv[28] = document.all.vcvt_tfec.value;
aorv[29] = document.all.vcvt_tsex.value;
/* Comisariado Ejidal o de Bienes Comunales (suplentes) */
aorv[30] = document.all.vces_ppat.value;
aorv[31] = document.all.vces_pmat.value;
aorv[32] = document.all.vces_pnom.value;
aorv[33] = document.all.vces_pfec.value;
aorv[34] = document.all.vces_psex.value;
aorv[35] = document.all.vces_spat.value;
aorv[36] = document.all.vces_smat.value;
aorv[37] = document.all.vces_snom.value;
aorv[38] = document.all.vces_sfec.value;
aorv[39] = document.all.vces_ssex.value;
aorv[40] = document.all.vces_tpat.value;
aorv[41] = document.all.vces_tmat.value;
aorv[42] = document.all.vces_tnom.value;
aorv[43] = document.all.vces_tfec.value;
aorv[44] = document.all.vces_tsex.value;
/* Consejo de Vigilancia (suplentes) */
aorv[45] = document.all.vcvs_ppat.value;
aorv[46] = document.all.vcvs_pmat.value;
aorv[47] = document.all.vcvs_pnom.value;
aorv[48] = document.all.vcvs_pfec.value;
aorv[49] = document.all.vcvs_psex.value;
aorv[50] = document.all.vcvs_spat.value;
aorv[51] = document.all.vcvs_smat.value;
aorv[52] = document.all.vcvs_snom.value;
aorv[53] = document.all.vcvs_sfec.value;
aorv[54] = document.all.vcvs_ssex.value;
aorv[55] = document.all.vcvs_tpat.value;
aorv[56] = document.all.vcvs_tmat.value;
aorv[57] = document.all.vcvs_tnom.value;
aorv[58] = document.all.vcvs_tfec.value;
aorv[59] = document.all.vcvs_tsex.value;
aorv[60] = document.all.vconsec.value;
aorv[61] = document.all.nnucleo.value;
aorv = showModalDialog(vlig,aorv,"status:no; resizable:no; dialogTop:180px; dialogWidth:1000px; dialogHeight:500px;");
/* Comisariado Ejidal o de Bienes Comunales (titulares) */
document.all.vcet_ppat.value = aorv[0];
document.all.vcet_pmat.value = aorv[1];
document.all.vcet_pnom.value = aorv[2];
document.all.vcet_pfec.value = aorv[3];
document.all.vcet_psex.value = aorv[4];
document.all.vcet_spat.value = aorv[5];
document.all.vcet_smat.value = aorv[6];
document.all.vcet_snom.value = aorv[7];
document.all.vcet_sfec.value = aorv[8];
document.all.vcet_ssex.value = aorv[9];
document.all.vcet_tpat.value = aorv[10];
document.all.vcet_tmat.value = aorv[11];
document.all.vcet_tnom.value = aorv[12];
document.all.vcet_tfec.value = aorv[13];
document.all.vcet_tsex.value = aorv[14];
/* Consejo de Vigilancia (titulares) */
document.all.vcvt_ppat.value = aorv[15];
document.all.vcvt_pmat.value = aorv[16];
document.all.vcvt_pnom.value = aorv[17];
document.all.vcvt_pfec.value = aorv[18];
document.all.vcvt_psex.value = aorv[19];
document.all.vcvt_spat.value = aorv[20];
document.all.vcvt_smat.value = aorv[21];
document.all.vcvt_snom.value = aorv[22];
document.all.vcvt_sfec.value = aorv[23];
document.all.vcvt_ssex.value = aorv[24];
document.all.vcvt_tpat.value = aorv[25];
document.all.vcvt_tmat.value = aorv[26];
document.all.vcvt_tnom.value = aorv[27];
document.all.vcvt_tfec.value = aorv[28];
document.all.vcvt_tsex.value = aorv[29];
/* Comisariado Ejidal o de Bienes Comunales (suplentes) */
document.all.vces_ppat.value = aorv[30];
document.all.vces_pmat.value = aorv[31];
document.all.vces_pnom.value = aorv[32];
document.all.vces_pfec.value = aorv[33];
document.all.vces_psex.value = aorv[34];
document.all.vces_spat.value = aorv[35];
document.all.vces_smat.value = aorv[36];
document.all.vces_snom.value = aorv[37];
document.all.vces_sfec.value = aorv[38];
document.all.vces_ssex.value = aorv[39];
document.all.vces_tpat.value = aorv[40];
document.all.vces_tmat.value = aorv[41];
document.all.vces_tnom.value = aorv[42];
document.all.vces_tfec.value = aorv[43];
document.all.vces_tsex.value = aorv[44];
/* Consejo de Vigilancia (suplentes) */
document.all.vcvs_ppat.value = aorv[45];
document.all.vcvs_pmat.value = aorv[46];
document.all.vcvs_pnom.value = aorv[47];
document.all.vcvs_pfec.value = aorv[48];
document.all.vcvs_psex.value = aorv[49];
document.all.vcvs_spat.value = aorv[50];
document.all.vcvs_smat.value = aorv[51];
document.all.vcvs_snom.value = aorv[52];
document.all.vcvs_sfec.value = aorv[53];
document.all.vcvs_ssex.value = aorv[54];
document.all.vcvs_tpat.value = aorv[55];
document.all.vcvs_tmat.value = aorv[56];
document.all.vcvs_tnom.value = aorv[57];
document.all.vcvs_tfec.value = aorv[58];
document.all.vcvs_tsex.value = aorv[59];
/* Concatena el Nombre Comisariado Ejidal (titulares y suplentes) */
document.all.vcet_pnomb.value = aorv[0] + " " + aorv[1] + " " + aorv[2] + " (" + aorv[4]+")"
document.all.vcet_snomb.value = aorv[5] + " " + aorv[6] + " " + aorv[7] + " (" + aorv[9]+")"
document.all.vcet_tnomb.value = aorv[10] + " " + aorv[11] + " " + aorv[12] + " (" + aorv[14]+")"
document.all.vces_pnomb.value = aorv[30] + " " + aorv[31] + " " + aorv[32] + " (" + aorv[34]+")"
document.all.vces_snomb.value = aorv[35] + " " + aorv[36] + " " + aorv[37] + " (" + aorv[39]+")"
document.all.vces_tnomb.value = aorv[40] + " " + aorv[41] + " " + aorv[42] + " (" + aorv[44]+")"
/* Concatena el Nombre Consejo de Vigilancia (titulares y suplentes) */
document.all.vcvt_pnomb.value = aorv[15] + " " + aorv[16] + " " + aorv[17] + " (" + aorv[19]+")"
document.all.vcvt_snomb.value = aorv[20] + " " + aorv[21] + " " + aorv[22] + " (" + aorv[24]+")"
document.all.vcvt_tnomb.value = aorv[25] + " " + aorv[26] + " " + aorv[27] + " (" + aorv[29]+")"
document.all.vcvs_pnomb.value = aorv[45] + " " + aorv[46] + " " + aorv[47] + " (" + aorv[49]+")"
document.all.vcvs_snomb.value = aorv[50] + " " + aorv[51] + " " + aorv[52] + " (" + aorv[54]+")"
document.all.vcvs_tnomb.value = aorv[55] + " " + aorv[56] + " " + aorv[57] + " (" + aorv[59]+")"
}
function pMenu(opc,menu,submen) {
// Opc = Es el elemento a elegir
// menu = Cuantos elementos tiene el menu
// submen= Cuantos elementos de submenu tenemos
var i;
var var1 = 'obs'
for(i=1; i <= menu; i++){
var1 = 'obs' + i
document.getElementById(var1).style.display = (document.getElementById(var1).style.display != 'none') ? 'none' : 'none';
}
for(i=1; i <= menu; i++){
var1 = 'obs' + i
if (opc==i) {
document.getElementById(var1).style.display = (document.getElementById(var1).style.display == 'none') ? '' : '';
}
}
for(i=1; i <= submen; i++){
var1 = 'sbs' + i
document.getElementById(var1).style.display = (document.getElementById(var1).style.display != 'none') ? 'none' : 'none';
}
}
function pSubMenu(opc,menu) {
// Opc = Es el elemento a elegir
// menu = Cuantos elementos tiene el submenu
var i;
var var1 = 'sbs'
for(i=1; i <= menu; i++){
var1 = 'sbs' + i
if (opc==i)
document.getElementById(var1).style.display = (document.getElementById(var1).style.display == 'none') ? '' : '';
else
document.getElementById(var1).style.display = (document.getElementById(var1).style.display != 'none') ? 'none' : 'none';
}
}
function pSubM(opc,menu) {
// Opc = Es el elemento a elegir
// menu = Cuantos elementos tiene el submenu
var i;
var var1 = 'rbs'
for(i=1; i <= menu; i++){
var1 = 'rbs' + i
if (opc==i)
document.getElementById(var1).style.display = (document.getElementById(var1).style.display == 'none') ? '' : '';
else
document.getElementById(var1).style.display = (document.getElementById(var1).style.display != 'none') ? 'none' : 'none';
}
}
function mMenu(b) {
var i,ok;
var var1 = 'obs';
i = 0;
ok = 0;
while(ok == 0){
i++;
var1 = 'obs' + i;
try{
document.getElementById(var1).style.display = 'none';
}catch(e){
ok = 1;
}
}
i = 0;
ok = 0;
while(ok == 0){
i++;
var1 = 'sbs' + i;
try{
document.getElementById(var1).style.display = 'none';
}catch(e){
ok = 1;
}
}
/* for(i=1; i <= 6; i++){
var1 = 'obs' + i
document.getElementById(var1).style.display = 'none';
}*/
/* Oculta los submenus */
/* for(i=1; i <= 10; i++){
var1 = 'sbs' + i
document.getElementById(var1).style.display = 'none';
}*/
var1 = 'obs'+b;
document.getElementById(var1).style.display = '';
}
function sMenu(b) {
var i;
var var1 = 'sbs'
/* Oculta los submenus */
for(i=1; i <= 10; i++){
var1 = 'sbs' + i
document.getElementById(var1).style.display = (document.getElementById(var1).style.display != 'none') ? 'none' : 'none';
}
/* Oculta los sub-submenus */
/* document.all.rbs1.style.display = (document.all.rbs1.style.display != 'none') ? 'none' : 'none';
document.all.rbs2.style.display = (document.all.rbs2.style.display != 'none') ? 'none' : 'none';*/
document.getElementById('rbs1').style.display = (document.getElementById('rbs1').style.display != 'none') ? 'none' : 'none';
document.getElementById('rbs2').style.display = (document.getElementById('rbs2').style.display != 'none') ? 'none' : 'none';
var1 = 'sbs'+b
document.getElementById(var1).style.display = (document.getElementById(var1).style.display == 'none') ? '' : '';
}
function subM(b) {
document.all.rbs1.style.display = (document.all.rbs1.style.display != 'none') ? 'none' : 'none';
document.all.rbs2.style.display = (document.all.rbs2.style.display != 'none') ? 'none' : 'none';
var1 = 'rbs'+b
document.getElementById(var1).style.display = (document.getElementById(var1).style.display == 'none') ? '' : '';
}
/* Abre dialogo para Cédulas Adicionales */
function mCedAdi(){
var vlig = "m_CedAdi.asp";
var lig = new Array();
lig[0] = "";
lig = showModalDialog(vlig,lig,"status:no; resizable:no; dialogWidth:390px; dialogHeight:360px;");
if (lig[0] != "m_VisAbo.asp") {
liga(lig[0]);
}
}
function mCedDGAOPR(){
var vlig = "m_CedDGAOPR.asp";
var lig = new Array();
lig[0] = "";
lig = showModalDialog(vlig,lig,"status:no; resizable:no; dialogWidth:390px; dialogHeight:360px;");
if (lig[0] != "m_VisAbo.asp") {
liga(lig[0]);
}
}
function acerca(b) {
if (b==1) {document.all.acerca.style.display = (document.all.acerca.style.display == 'none') ? '' : '';}
if (b==2) {document.all.acerca.style.display = (document.all.acerca.style.display == 'none') ? 'none' : 'none';}
}
function ldial(vlig) {
var agenda = new Array();
agenda = showModalDialog(vlig,agenda,"status:no; resizable:no; dialogLeft:200px; dialogTop:250px; dialogWidth:620px; dialogHeight:270px;");
liga = agenda[7];
/* Envia para actualización */
if (liga == 1) {
var vlig = "agen_actua_guarda.asp?vFecha=" + agenda[0] + "&vHora=" + agenda[1] + "&vEmp=" + agenda[2]
vlig = vlig + "&vActividad=" + agenda[3] + "&vResultado=" + agenda[4] + "&vActiv=" + agenda[5] + "&vStatus=" + agenda[6];
agenda = showModalDialog(vlig,"v","status:no; resizable:no; dialogLeft:200px; dialogTop:250px; dialogWidth:620px; dialogHeight:270px;");
location.reload();
}
if (liga == 2) {
var vlig = "agen_borra.asp?vFecha=" + agenda[0] + "&vHora=" + agenda[1] + "&vEmp=" + agenda[2]
vlig = vlig + "&vActividad=" + agenda[3] + "&vResultado=" + agenda[4] + "&vActiv=" + agenda[5] + "&vStatus=" + agenda[6];
agenda = showModalDialog(vlig,"v","status:no; resizable:no; dialogLeft:200px; dialogTop:250px; dialogWidth:620px; dialogHeight:270px;");
location.reload();
}
}
/* Función de validación de campos con datos de la Agenda */
function valida_actividad(hora, horat, actividad, descripcion, nucleo, folio, orig, dest){
if (hora == "" && (actividad == 1 || actividad == 2 || actividad == 3 || actividad == 4 ||actividad == 5 ||actividad == 6 || actividad == 8 || actividad == 9 || actividad == 10 || actividad == 11)){
alert("Seleccione la hora de inicio de la actividad,\n del panel izquierdo");
return false;}
if (horat == "" && (actividad == 1 || actividad == 2 || actividad == 3 || actividad == 4 ||actividad == 5 ||actividad == 6 || actividad == 8 || actividad == 9 || actividad == 10 || actividad == 11)){
alert("Seleccione la hora de termino de la actividad,\n del panel izquierdo");
return false;}
if (actividad == 0){
alert("Seleccione el tipo de actividad");
return false;}
if ((actividad == 1 || actividad == 2 || actividad == 3 || actividad == 6 || actividad == 8 || actividad == 9) && descripcion == "") {
alert("Describa la actividad");
return false;}
if (actividad == 2 && nucleo == 0) {
alert("Seleccione el nucleo agrario");
return false;}
if (actividad == 6 && folio == 0) {
alert("Seleccione el Folio del expediente");
return false;}
if (actividad == 4 && orig == ""){
alert("Seleccione el origen del traslado");
return false;}
if (actividad == 4 && dest == ""){
alert("Seleccione el destino del traslado");
return false;}
}
/* Función de validación de campos con datos de resultados de la Agenda */
function valida_res_act(resultado, status){
if (resultado == ""){
alert("Describa el resultado");
return false;}
if (status == 0){
alert("Seleccione el status de la actividad");
return false;}
}
/* Función de validación de campos con datos de validación de gastos */
function valida_gasto(gasto, combustible) {
if (gasto == 0){
alert("Seleccione el tipo de gasto");
return false;}
}
/* Función para mostrar u ocultar el campo de descripción de la actividad, la seleccion del nucleo y la seleccion de expediente */
function mActiv(b) {
if (b==1 || b==3 || b==8 || b==9 || b==11) {
document.getElementById('vActividad').style.display = (document.getElementById('vActividad').style.display == 'none') ? '' : '';
document.getElementById('vActividadt').style.display = (document.getElementById('vActividadt').style.display == 'none') ? '' : '';
document.getElementById('spannucleo').style.display = (document.getElementById('spannucleo').style.display != 'none') ? 'none' : 'none';
document.getElementById('spanexpediente').style.display = (document.getElementById('spanexpediente').style.display != 'none') ? 'none' : 'none';
document.getElementById('spanorigendestino').style.display = (document.getElementById('spanorigendestino').style.display != 'none') ? 'none' : 'none';
document.getElementById('horas').style.display = (document.getElementById('horas').style.display == 'none') ? '' : '';
document.getElementById('horast').style.display = (document.getElementById('horast').style.display == 'none') ? '' : '';
}
if (b==2) {
document.getElementById('vActividad').style.display = (document.getElementById('vActividad').style.display == 'none') ? '' : '';
document.getElementById('vActividadt').style.display = (document.getElementById('vActividadt').style.display == 'none') ? '' : '';
document.getElementById('spannucleo').style.display = (document.getElementById('spannucleo').style.display == 'none') ? '' : '';
document.getElementById('spanexpediente').style.display = (document.getElementById('spanexpediente').style.display != 'none') ? 'none' : 'none';
document.getElementById('spanorigendestino').style.display = (document.getElementById('spanorigendestino').style.display != 'none') ? 'none' : 'none';
document.getElementById('horas').style.display = (document.getElementById('horas').style.display == 'none') ? '' : '';
document.getElementById('horast').style.display = (document.getElementById('horast').style.display == 'none') ? '' : '';
}
if (b==4) {
document.getElementById('spanorigendestino').style.display = (document.getElementById('spanorigendestino').style.display == 'none') ? '' : '';
document.getElementById('vActividad').style.display = (document.getElementById('vActividad').style.display != 'none') ? 'none' : 'none';
document.getElementById('vActividadt').style.display = (document.getElementById('vActividadt').style.display != 'none') ? 'none' : 'none';
document.getElementById('spannucleo').style.display = (document.getElementById('spannucleo').style.display != 'none') ? 'none' : 'none';
document.getElementById('spanexpediente').style.display = (document.getElementById('spanexpediente').style.display != 'none') ? 'none' : 'none';
document.getElementById('horas').style.display = (document.getElementById('horas').style.display == 'none') ? '' : '';
document.getElementById('horast').style.display = (document.getElementById('horast').style.display == 'none') ? '' : '';
}
if (b==5 || b==10) {
document.getElementById('vActividad').style.display = (document.getElementById('vActividad').style.display != 'none') ? 'none' : 'none';
document.getElementById('vActividadt').style.display = (document.getElementById('vActividadt').style.display != 'none') ? 'none' : 'none';
document.getElementById('spannucleo').style.display = (document.getElementById('spannucleo').style.display != 'none') ? 'none' : 'none';
document.getElementById('spanexpediente').style.display = (document.getElementById('spanexpediente').style.display != 'none') ? 'none' : 'none';
document.getElementById('spanorigendestino').style.display = (document.getElementById('spanorigendestino').style.display != 'none') ? 'none' : 'none';
document.getElementById('horas').style.display = (document.getElementById('horas').style.display == 'none') ? '' : '';
document.getElementById('horast').style.display = (document.getElementById('horast').style.display == 'none') ? '' : '';
}
if (b==0 || b==7 || b==12) {
document.getElementById('vActividad').style.display = (document.getElementById('vActividad').style.display != 'none') ? 'none' : 'none';
document.getElementById('vActividadt').style.display = (document.getElementById('vActividadt').style.display != 'none') ? 'none' : 'none';
document.getElementById('spannucleo').style.display = (document.getElementById('spannucleo').style.display != 'none') ? 'none' : 'none';
document.getElementById('spanexpediente').style.display = (document.getElementById('spanexpediente').style.display != 'none') ? 'none' : 'none';
document.getElementById('spanorigendestino').style.display = (document.getElementById('spanorigendestino').style.display != 'none') ? 'none' : 'none';
document.getElementById('horas').style.display = (document.getElementById('horas').style.display != 'none') ? 'none' : 'none';
document.getElementById('horast').style.display = (document.getElementById('horast').style.display != 'none') ? 'none' : 'none';
}
if (b==6) {
document.getElementById('vActividad').style.display = (document.getElementById('vActividad').style.display == 'none') ? '' : '';
document.getElementById('vActividadt').style.display = (document.getElementById('vActividadt').style.display == 'none') ? '' : '';
document.getElementById('spannucleo').style.display = (document.getElementById('spannucleo').style.display != 'none') ? 'none' : 'none';
document.getElementById('spanexpediente').style.display = (document.getElementById('spanexpediente').style.display == 'none') ? '' : '';
document.getElementById('spanorigendestino').style.display = (document.getElementById('spanorigendestino').style.display != 'none') ? 'none' : 'none';
document.getElementById('horas').style.display = (document.getElementById('horas').style.display == 'none') ? '' : '';
document.getElementById('horast').style.display = (document.getElementById('horast').style.display == 'none') ? '' : '';
}
}
/* Función para mostrar u ocultar el campo de descripción del resultado */
function mResul(b) {
if (b==1) {
document.all.vResultado.style.display = (document.all.vResultado.style.display == 'none') ? '' : '';
}
if (b==0 || b==2) {
document.all.vResultado.style.display = (document.all.vResultado.style.display != 'none') ? 'none' : 'none';
}
}
function lSuces(vlig) {
var agenda = new Array();
agenda = showModalDialog(vlig,agenda,"status:no; resizable:no; dialogLeft:200px; dialogTop:250px; dialogWidth:620px; dialogHeight:270px;");
liga = agenda[7];
/* Envia para actualización */
if (liga == 1) {
var vlig = "agen_actua_guarda.asp?vFecha=" + agenda[0] + "&vHora=" + agenda[1] + "&vEmp=" + agenda[2]
vlig = vlig + "&vActividad=" + agenda[3] + "&vResultado=" + agenda[4] + "&vActiv=" + agenda[5] + "&vStatus=" + agenda[6];
agenda = showModalDialog(vlig,"v","status:no; resizable:no; dialogLeft:200px; dialogTop:250px; dialogWidth:620px; dialogHeight:270px;");
location.reload();
}
}
// JavaScript Document
function Modul1(){
var vlig = 'Contratos_Mod1.asp';
var cont = new Array();
cont = showModalDialog(vlig,cont,'status:no; resizable:no; dialogTop:180px; dialogWidth:1000px; dialogHeight:500px;');
}
function seleccion(input) {
var selectionEnd = 1;
if (input.setSelectionRange) {
input.focus();
input.setSelectionRange(1, selectionEnd);
}
else if (input.createTextRange) {
var range = input.createTextRange();
range.collapse(true);
range.moveEnd('character', input.value.length);
range.moveStart('character', 0);
range.select();
}
}
function largocampo(maximo, campo, largo){
var lar2 = document.getElementById(campo).value.length;
if (lar2 > maximo){
document.getElementById(campo).value = document.getElementById(campo).value.substring(0, maximo)
}
document.getElementById(largo).value = maximo - document.getElementById(campo).value.length
}
function QuitarCerosIzq(Numero){
if (Numero=="" || Numero==0 ){
return 0}
else{
var MiNum="";
var i=-1;
while(Numero.charAt(++i)==0);
// en "i" esta el indice del primer caracter no igual a cero
MiNum=Numero.substring(i,Numero.length);
return MiNum;}
}
/*function hoy()
{
var Digital=new Date();
var hours=Digital.getHours();
var minutes=Digital.getMinutes();
var seconds=Digital.getSeconds();
var dn="PM";
if (hours<12){
dn="AM";
}
if (hours>12 && hours<20){
dn="PM";
hours=hours-12;
}
if (hours>19){
dn="PM";
hours=hours-12;
}
if (hours==0)
hours=12;
if (minutes<=9)
minutes="0"+minutes;
if (seconds<=9)
seconds="0"+seconds;
lahora = " "+hours+":"+minutes+":"+seconds+" "+dn+""
if (document.layers){
document.layers.horaactual.document.write(lahora);
document.layers.horaactual.document.close();
}
else if (document.all)
horaactual.innerHTML=lahora;
else if (document.getElementById)
document.getElementById("horaactual").innerHTML=lahora;
setTimeout("hoy()",1000);
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i=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;
}
}
function setCombo(elemento,combobox) {
var combo = document.getElementById(combobox);
var cantidad = combo.length;
for (i = 0; i < cantidad; i++) {
if (combo[i].value == elemento) {
combo[i].selected = true;
}
}
}
function getSelRadio(radio){
var r, flagSelec = false;
if(isNaN(radio.length) && radio.checked){
alert("El elemento seleccionado es: 0");
return 0;
}
r=radio.length;
for (i=0; i0){setTimeout("ValidaSession("+seconds+")",1000)}
else{liga('logout.asp')}
}
function mascarahectarea(objeto, valor){
tecla = (document.all) ? event.keyCode : event.which;
if ((valor.length == 2 || valor.length == 5) && event.keyCode != 8){
document.getElementById(objeto).value = valor + '-';
document.getElementById(objeto).focus();
}
if (valor.length == 3 && event.keyCode != 8 && event.keyCode >= 48 && event.keyCode <= 57){
if (valor.substring(0,3) != "-"){
document.getElementById(objeto).value = valor.substring(0,2) + "-" + valor.substring(2,3);
}
}
if (valor.length == 6 && event.keyCode != 8 && event.keyCode >= 48 && event.keyCode <= 57){
if (valor.substring(0,6) != "-"){
document.getElementById(objeto).value = valor.substring(0,5) + "-" + valor.substring(5,6);
}
}
if (valor.substring(valor.length-2,valor.length) =="--"){
document.getElementById(objeto).value = valor.substring(0,valor.length-1)
}
}
function ConvierteaCero(campo, valor){
if (valor.length==0) {document.getElementById(campo).value=0}
}
function ConversionHectareas(campo, dato){
// al utilizar esta funcion, se deberá agregar un input con el mismo nombre del original
// anteponiendo el texto 'data_' que es donde se reflejará el formato que aqui se calcula
if (isNaN(dato)){
alert('El formato es inválido')
dato=0
document.getElementById(campo).value=0;
document.getElementById(campo).focus();
document.getElementById('data_'+campo).value='00-00-00.00';
return;
}
var h = Math.floor(dato)
var a = Math.floor((dato*100)-(h*100))
var c = Math.floor((dato*10000)-((h*10000)+(a*100)))
if (c>99) {a=a+1; c=0}
var d = (dato*10000) - ((h*10000) + (a*100) +c)
d = Math.round(d*100000)/100000
if (d==1){c=c+1; d=0}
// if (parseInt(h)<=9) {h=h;}; //if (parseInt(h)==0){h='00'};
if (parseInt(a)<=9) {a='0'+a;}; //if (parseInt(a)==0){a='00'};
if (parseInt(c)<=9) {c='0'+c;}; //if (parseInt(c)==0){c='00'};
d=parseFloat(d)*100000; if (Math.floor(d)==0) {d='00000'}
document.getElementById('data_'+campo).value=h+'-'+a+'-'+c+'.'+d
}
function mascarafecha1(objeto, valor){
tecla = (document.all) ? event.keyCode : event.which;
if ((valor.length == 2 || valor.length == 5) && event.keyCode != 8){
document.getElementById(objeto).value = valor + '/';
document.getElementById(objeto).focus();
}
if (valor.length == 3 && event.keyCode != 8 && event.keyCode >= 48 && event.keyCode <= 57){
if (valor.substring(0,3) != "/"){
document.getElementById(objeto).value = valor.substring(0,2) + "/" + valor.substring(2,3);
}
}
if (valor.length == 6 && event.keyCode != 8 && event.keyCode >= 48 && event.keyCode <= 57){
if (valor.substring(0,6) != "/"){
document.getElementById(objeto).value = valor.substring(0,5) + "/" + valor.substring(5,6);
}
}
if (valor.substring(valor.length-2,valor.length) =="//"){
document.getElementById(objeto).value = valor.substring(0,valor.length-1)
}
}
/******************************************************************************/
/*
function CargandoDatos(valor)
{
if (valor==0)
document.write("")
document.write("
![Generando listado... src=]()
Generando listado...")
document.write("
")
}
*/
var XHTMLNS = 'http://www.w3.org/1999/xhtml';
var CURRENT_NICE_TITLE;
var browser = new Browser();
function Browser(){
var ua, s, i;
this.isIE = false;
this.isNS = false;
this.version = null;
ua = navigator.userAgent;
s = 'MSIE';
if ((i = ua.indexOf(s)) >= 0){
this.isIE = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
}
s = 'Netscape6/';
if ((i = ua.indexOf(s)) >= 0){
this.isNS = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
}
s = 'Gecko';
if ((i = ua.indexOf(s)) >= 0)
{
this.isNS = true;
this.version = 6.1;
return;
}
}
var delay;
var interval = 0.60;
function makeNiceTitles(){
if (!document.createElement || !document.getElementsByTagName) return;
if (!document.createElementNS){
document.createElementNS = function(ns, elt)
{return document.createElement(elt);}
}
if (!document.links){
document.links = document.getElementsByTagName('a');}
for (var ti=0; ti STD_WIDTH) {w = h_pixels;}
else
if ((STD_WIDTH>t_pixels) && (t_pixels>h_pixels))
{w = t_pixels;}
else if ((STD_WIDTH>t_pixels) && (h_pixels>t_pixels))
{w = h_pixels;}
else {w = STD_WIDTH;}
d.style.width = w + 'px';
mpos = findPosition(lnk);
mx = mpos[0];
my = mpos[1];
d.style.left = (mx+15) + 'px';
d.style.top = (my+35) + 'px';
if (window.innerWidth && ((mx+w) > window.innerWidth))
{d.style.left = (window.innerWidth - w - 25) + 'px';}
if (document.body.scrollWidth && ((mx+w) > document.body.scrollWidth))
{d.style.left = (document.body.scrollWidth - w - 25) + 'px';}
document.getElementsByTagName('body')[0].appendChild(d);
CURRENT_NICE_TITLE = d;
}
function hideNiceTitle(e){
if (delay) clearTimeout(delay);
if (!document.getElementsByTagName) return;
if (CURRENT_NICE_TITLE){
document.getElementsByTagName('body')[0].removeChild(CURRENT_NICE_TITLE);
CURRENT_NICE_TITLE = null;
}
}
window.onload = function(e) {makeNiceTitles();}