function nuevo_registro(obje_numero,parametros,operacion){var url_modal="";if(movilidad=='1'){if(operacion==''){url_modal=encodeURIComponent("phrame.php?action=transaccion&id_objeto="+obje_numero+"&operacion=Adicionar"+parametros);window.location="phrame.php?action=transaccion&id_objeto="+obje_numero+"&operacion=Adicionar"+parametros+"&url_modal="+url_modal;}else{url_modal=encodeURIComponent("phrame.php?action="+operacion+"&operacion=Adicionar"+parametros);window.location="phrame.php?action="+operacion+"&operacion=Adicionar"+parametros+"&url_modal="+url_modal;}}else{if(operacion==''){url_modal=encodeURIComponent("phrame.php?action=transaccion&id_objeto="+obje_numero+"&operacion=Adicionar"+parametros);$('#remoteModal').on('shown.bs.modal',function(){$('#remoteModal iframe').attr("src","phrame.php?action=transaccion&id_objeto="+obje_numero+"&operacion=Adicionar"+parametros+"&url_modal="+url_modal);});$('#remoteModal').modal({show:true});}else{url_modal=encodeURIComponent("phrame.php?action="+operacion+"&operacion=Adicionar"+parametros);$('#remoteModal').on('shown.bs.modal',function(){$('#remoteModal iframe').attr("src","phrame.php?action="+operacion+"&operacion=Adicionar"+parametros+"&url_modal="+url_modal);});$('#remoteModal').modal({show:true});}}}
function lista_registro(obje_numero,parametros){var url_modal="";url_modal=encodeURIComponent("https://portalpagosempresa.claro.com.co/phrame.php?action=transaccion"+parametros+"&id_objeto="+obje_numero+"&operacion=Adicionar");location.replace("https://portalpagosempresa.claro.com.co/phrame.php?action=transaccion"+parametros+"&id_objeto="+obje_numero+"&operacion=Adicionar&url_modal="+url_modal);}
function calendarModal(Modal){$('#remoteModal').on('shown.bs.modal',function(){$('#remoteModal iframe').attr("src","phrame.php?action="+Modal);console.log($('iframe'));});$('#remoteModal').modal({show:true});}
function modalWindows(Modal,id_object){$('#remoteModal').on('shown.bs.modal',function(){$('#remoteModal iframe').attr("src","phrame.php?action="+Modal+"&id_modul="+id_object);});$('#remoteModal').modal({show:true});}
function modificar_registro(obje_numero,parametros,operacion){var url_modal="";if(movilidad=='1'){if(operacion==''){url_modal=encodeURIComponent("phrame.php?action=transaccion&id_objeto="+obje_numero+"&operacion=Modificar"+parametros);window.location="phrame.php?action=transaccion&id_objeto="+obje_numero+"&operacion=Modificar"+parametros+"&url_modal="+url_modal;}else{url_modal=encodeURIComponent("phrame.php?action="+operacion+"&operacion=Modificar"+parametros);window.location="phrame.php?action="+operacion+"&operacion=Modificar"+parametros+"&url_modal="+url_modal;}}else{if(operacion==''){url_modal=encodeURIComponent("phrame.php?action=transaccion&id_objeto="+obje_numero+"&operacion=Modificar"+parametros);$('#remoteModal').on('shown.bs.modal',function(){$('#remoteModal iframe').attr("src","phrame.php?action=transaccion&id_objeto="+obje_numero+"&operacion=Modificar"+parametros+"&url_modal="+url_modal);console.log($('iframe'));});$('#remoteModal').modal({show:true});}else{url_modal=encodeURIComponent("phrame.php?action="+operacion+"&operacion=Modificar"+parametros);$('#remoteModal').on('shown.bs.modal',function(){$('#remoteModal iframe').attr("src","phrame.php?action="+operacion+"&operacion=Modificar"+parametros+"&url_modal="+url_modal);console.log($('iframe'));});$('#remoteModal').modal({show:true});}}}
function eliminar_registro(obje_numero,parametros){showConfirm("¿?",function(){jQuery.ajax({type:'post',url:'phrame.php',data:"action=registrar&id_objeto="+obje_numero+"&operacion=Eliminar"+parametros,success:function(res){var dev=0;if(res.indexOf("----")!=-1){showAlert(res,'','#4B69C3','fa fa-file-code-o',function(){window.parent.loading();msj=res.split('*****');if(msj[1]!=""){window.parent.location=msj[1];}});}else{window.parent.loading();msj=res.split('*****');if(msj[1]!=""){window.parent.location=msj[1];}}}});});}
function validarFiltro(tipo_dato,valor,campo,etiqueta){var cab_error;cab_error="'" + etiqueta + "'";var error;var expresion;var tipo;switch(tipo_dato){case 7:case 6:case 9:expresion=/^\d+$/;tipo="";break;case 4:expresion=/^(\d{4})-(0\d|\d|[0-1][0-2])-(0\d|\d|[0-2]\d|3[0-1])$/;tipo="";break;case 5:expresion=/^(\d{4})-(0\d|\d|[0-1][0-2])-(0\d|\d|[0-2]\d|3[0-1]) (0\d|\d|1\d|2[0-3])(:(0\d|\d|[0-5][0-9])){1}$/;tipo="";break;case 8:expresion=/^(0\d|\d|1\d|2[0-3])(:(0\d|\d|[0-5][0-9])){1}$/;tipo="";break;}
if(valor){if(valor.match(expresion))
error="";else
error=cab_error+tipo;}else{error="";}
if(error!=""){showAlert(error,'','#FF0000','fa fa-exclamation-triangle');document.getElementById(campo).value='';document.getElementById(campo).focus();}}
function validaTipoPregunta(valor){document.getElementById('RESPUESTA').value='';if(valor!=3){document.getElementById('RESPUESTA').disabled=true;}else{document.getElementById('RESPUESTA').disabled=false;}}
function operacion_reporte(obje_numero,id_reporte,operacion){if(operacion=='Eliminar'){showConfirm("¿?",function(){loading();window.location="phrame.php?action=registra_reporte&id_objeto="+obje_numero+"&operacion="+operacion+"&id_reporte="+id_reporte+"&go="+document.forma.action.value;});}else if(operacion=='Visualiza'){$('#remoteModal').on('shown.bs.modal',function(){$('#remoteModal iframe').attr("src","phrame.php?action=mostrar_reporte&id_objeto="+obje_numero+"&id_reporte="+id_reporte);});$('.modal-header').append('');$('#remoteModal').on('hidden.bs.modal',function(){$('#icono_ventana').remove();});$('#remoteModal').modal({show:true});}else{loading();window.location="phrame.php?action=reportes&id_objeto="+obje_numero+"&operacion="+operacion+"&id_reporte="+id_reporte;}}
function loadjscssfile(filename,filetype){if(filetype=="js"){var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.setAttribute("src",filename)}
else if(filetype=="css"){var fileref=document.createElement("link")
fileref.setAttribute("rel","stylesheet")
fileref.setAttribute("type","text/css")
fileref.setAttribute("href",filename)}
if(typeof fileref!="undefined")
document.getElementsByTagName("head")[0].appendChild(fileref)}
function checkear_todas(campo,action)
{len=campo.length;var i=0;for(i=0;i=0){document.getElementById(list[i].id).className=document.getElementById(list[i].id).className.replace(pordefecto,'');}}}
document.getElementById(o.id).className=document.getElementById(o.id).className+' '+pordefecto;list=document.getElementById(contenedor).childNodes;for(var i=0;i');if(jQuery('#OBJE_REFERENCIA').val()==9||jQuery('#OBJE_REFERENCIA').val()==10){jQuery('#VALOR_DEFECTO').append('');}else{jQuery('#VALOR_DEFECTO').append('');}}
break;case'4':if(jQuery('#LONGITUD').val()=='')
jQuery('#LONGITUD').val(0);case'5':if(jQuery('#LONGITUD').val()=='')
jQuery('#LONGITUD').val(0);jQuery('#LIST_NUMERO').val('');jQuery('#DECIMALES').val(0);jQuery('#CONDICION_LISTA').val('');jQuery('#SEGURIDAD').val('');jQuery('#TIPO_LLAVE').val('');jQuery('#OBJE_REFERENCIA_DESC').val('');jQuery('#OBJE_REFERENCIA').val('');jQuery('#CAMP_DEPENDIENTE_DESC').val('');jQuery('#CAMP_DEPENDIENTE').val('');jQuery('#OBLIG_DEPENDIENTE').val('');jQuery('#LIST_NUMERO').attr('disabled','disabled');jQuery('#DECIMALES').attr('disabled','disabled');jQuery('#CONDICION_LISTA').attr('disabled','disabled');jQuery('#SEGURIDAD').attr('disabled','disabled');jQuery('#TIPO_LLAVE').attr('disabled','disabled');jQuery('#OBLIG_DEPENDIENTE').attr('disabled','disabled');jQuery('#VALOR_DEFECTO option').remove();jQuery('#VALOR_DEFECTO').append('');jQuery('#VALOR_DEFECTO').append('');break;case'6':if(jQuery('#LONGITUD').val()=='')
jQuery('#LONGITUD').val(10);jQuery('#DECIMALES').val(0);if(jQuery('#OBJE_REFERENCIA_DESC').val()!=''){jQuery('#LIST_NUMERO').val('');jQuery('#LIST_NUMERO').attr('disabled','disabled');jQuery('#DECIMALES').val(0);jQuery('#DECIMALES').attr('disabled','disabled');jQuery('#FORMULA').val('');jQuery('#FORMULA').attr('disabled','disabled');}
if(jQuery('#OBJE_REFERENCIA_DESC').val()==''&&jQuery('#LIST_NUMERO').val()==''){jQuery('#CONDICION_LISTA').val('');jQuery('#CONDICION_LISTA').attr('disabled','disabled');jQuery('#OBLIG_DEPENDIENTE').val('');jQuery('#OBLIG_DEPENDIENTE').attr('disabled','disabled');}
if(jQuery('#OBJE_REFERENCIA').val()!=9&&jQuery('#OBJE_REFERENCIA').val()!=10){jQuery('#SEGURIDAD').val('');jQuery('#SEGURIDAD').attr('disabled','disabled');}
if(jQuery('#OBJE_REFERENCIA').val()!=5004&&jQuery('#OBJE_REFERENCIA').val()!=9&&jQuery('#OBJE_REFERENCIA').val()!=10){jQuery('#VALOR_DEFECTO').val('');jQuery('#VALOR_DEFECTO').attr('disabled','disabled');}else{jQuery('#VALOR_DEFECTO option').remove();jQuery('#VALOR_DEFECTO').append('');if(jQuery('#OBJE_REFERENCIA').val()==9||jQuery('#OBJE_REFERENCIA').val()==10){jQuery('#VALOR_DEFECTO').append('');}else{jQuery('#VALOR_DEFECTO').append('');}}
break;case'7':jQuery('#TIPO_LLAVE').val('');jQuery('#TIPO_LLAVE').attr('disabled','disabled');jQuery('#SEGURIDAD').val('');jQuery('#SEGURIDAD').attr('disabled','disabled');if(jQuery('#LONGITUD').val()=='')
jQuery('#LONGITUD').val(10);if(jQuery('#DECIMALES').val()=='')
jQuery('#DECIMALES').val(2);case'8':jQuery('#TIPO_LLAVE').val('');jQuery('#TIPO_LLAVE').attr('disabled','disabled');jQuery('#SEGURIDAD').val('');jQuery('#SEGURIDAD').attr('disabled','disabled');if(jQuery('#LONGITUD').val()=='')
jQuery('#LONGITUD').val(10);if(jQuery('#DECIMALES').val()=='')
jQuery('#DECIMALES').val(0);case'9':jQuery('#TIPO_LLAVE').val('');jQuery('#TIPO_LLAVE').attr('disabled','disabled');jQuery('#SEGURIDAD').val('');jQuery('#SEGURIDAD').attr('disabled','disabled');if(jQuery('#LONGITUD').val()=='')
jQuery('#LONGITUD').val(10);if(jQuery('#DECIMALES').val()=='')
jQuery('#DECIMALES').val(2);jQuery('#LIST_NUMERO').val('');jQuery('#CONDICION_LISTA').val('');jQuery('#VALOR_DEFECTO').val('');jQuery('#SEGURIDAD').val('');jQuery('#TIPO_LLAVE').val('');jQuery('#OBJE_REFERENCIA_DESC').val('');jQuery('#OBJE_REFERENCIA').val('');jQuery('#CAMP_DEPENDIENTE_DESC').val('');jQuery('#CAMP_DEPENDIENTE').val('');jQuery('#OBLIG_DEPENDIENTE').val('');jQuery('#LIST_NUMERO').attr('disabled','disabled');jQuery('#CONDICION_LISTA').attr('disabled','disabled');jQuery('#VALOR_DEFECTO').attr('disabled','disabled');jQuery('#SEGURIDAD').attr('disabled','disabled');jQuery('#TIPO_LLAVE').attr('disabled','disabled');jQuery('#OBLIG_DEPENDIENTE').attr('disabled','disabled');break;default:jQuery('#VALOR_DEFECTO option').remove();jQuery('#VALOR_DEFECTO').append('');jQuery('#VALOR_DEFECTO').append('');jQuery('#VALOR_DEFECTO').append('');jQuery('#VALOR_DEFECTO').append('');jQuery('#OBJE_REFERENCIA_DESC').val('');jQuery('#OBJE_REFERENCIA').val('');jQuery('#CAMP_DEPENDIENTE_DESC').val('');jQuery('#CAMP_DEPENDIENTE').val('');jQuery('#OBLIG_DEPENDIENTE').val('');break;}
formValObj.__initiallyParseAForm(1);}else if(tipo=='2'){switch(valor){case'1':case'2':case'11':case'12':case'13':case'15':case'16':if(campo!="GRUP_NUMERO"&&campo!="CAMP_REFERENCIA"&&campo!='')
return false;break;case'4':case'5':if(campo!="GRUP_NUMERO"&&campo!="FORMULA"&&campo!="CAMP_REFERENCIA"&&campo!='')
return false;break;case'3':case'14':case'6':if(campo=="OBJE_REFERENCIA"){if(jQuery('#OBJE_REFERENCIA_DESC').val()==''){jQuery('#LIST_NUMERO').removeAttr('disabled');if(jQuery('#LIST_NUMERO').val()==''){jQuery('#CONDICION_LISTA').val('');jQuery('#CONDICION_LISTA').attr('disabled','disabled');jQuery('#OBLIG_DEPENDIENTE').val('');jQuery('#OBLIG_DEPENDIENTE').attr('disabled','disabled');}else{return false;}}else{jQuery('#LIST_NUMERO').val('');jQuery('#LIST_NUMERO').attr('disabled','disabled');jQuery('#CONDICION_LISTA').removeAttr('disabled');jQuery('#OBLIG_DEPENDIENTE').removeAttr('disabled');jQuery('#FORMULA').val('');jQuery('#FORMULA').attr('disabled','disabled');}
if(jQuery('#OBJE_REFERENCIA').val()==9||jQuery('#OBJE_REFERENCIA').val()==10){jQuery('#SEGURIDAD').removeAttr('disabled');}else{jQuery('#SEGURIDAD').val('');jQuery('#SEGURIDAD').attr('disabled','disabled');}
if(jQuery('#OBJE_REFERENCIA').val()!=5004&&jQuery('#OBJE_REFERENCIA').val()!=9&&jQuery('#OBJE_REFERENCIA').val()!=10){jQuery('#VALOR_DEFECTO').val('');jQuery('#VALOR_DEFECTO').attr('disabled','disabled');}else{jQuery('#VALOR_DEFECTO').removeAttr('disabled');jQuery('#VALOR_DEFECTO option').remove();jQuery('#VALOR_DEFECTO').append('');if(jQuery('#OBJE_REFERENCIA').val()==9||jQuery('#OBJE_REFERENCIA').val()==10){jQuery('#VALOR_DEFECTO').append('');}else{jQuery('#VALOR_DEFECTO').append('');}}}else{if(campo==''){if(jQuery('#LIST_NUMERO').val()==''){if(jQuery('#OBJE_REFERENCIA_DESC').val()==''){jQuery('#CONDICION_LISTA').val('');jQuery('#CONDICION_LISTA').attr('disabled','disabled');jQuery('#OBLIG_DEPENDIENTE').val('');jQuery('#OBLIG_DEPENDIENTE').attr('disabled','disabled');}}else{jQuery('#CONDICION_LISTA').removeAttr('disabled');jQuery('#OBLIG_DEPENDIENTE').removeAttr('disabled');jQuery('#OBJE_REFERENCIA').val('');jQuery('#OBJE_REFERENCIA_DESC').val('');}
if(jQuery('#OBJE_REFERENCIA_DESC').val()==''){jQuery('#SEGURIDAD').attr('disabled','disabled');jQuery('#SEGURIDAD').val('');jQuery('#VALOR_DEFECTO').attr('disabled','disabled');jQuery('#VALOR_DEFECTO').val('');}}}
if(campo=="CAMP_DEPENDIENTE"&&jQuery('#OBJE_REFERENCIA_DESC').val()==''&&jQuery('#LIST_NUMERO').val()=='')
return false;if(campo=="FORMULA"&&jQuery('#OBJE_REFERENCIA_DESC').val()!='')
return false;break;case'7':case'8':case'9':if(campo!="GRUP_NUMERO"&&campo!="FORMULA"&&campo!="CAMP_REFERENCIA"&&campo!='')
return false;break;default:break;}
formValObj.__initiallyParseAForm(1);return true;}else{switch(valor){case'1':case'2':case'11':case'12':case'13':case'15':case'16':if(campo!="GRUP_NUMERO"&&campo!="CAMP_REFERENCIA"&&campo!='')
return false;break;case'4':case'5':if(campo!="GRUP_NUMERO"&&campo!="FORMULA"&&campo!="CAMP_REFERENCIA"&&campo!='')
return false;break;case'3':case'14':case'6':if(campo=="OBJE_REFERENCIA"){if(jQuery('#OBJE_REFERENCIA_DESC',window.opener.document).val()==''){jQuery('LIST_NUMERO',window.opener.document).removeAttr('disabled');if(jQuery('#LIST_NUMERO',window.opener.document).val()==''){jQuery('#CONDICION_LISTA',window.opener.document).val('');jQuery('#CONDICION_LISTA',window.opener.document).attr('disabled','disabled');jQuery('#OBLIG_DEPENDIENTE',window.opener.document).val('');jQuery('#OBLIG_DEPENDIENTE',window.opener.document).attr('disabled','disabled');}else{return false;}}else{jQuery('#LIST_NUMERO',window.opener.document).val('');jQuery('#LIST_NUMERO',window.opener.document).attr('disabled','disabled');jQuery('#CONDICION_LISTA',window.opener.document).removeAttr('disabled');jQuery('#OBLIG_DEPENDIENTE',window.opener.document).removeAttr('disabled');jQuery('#FORMULA',window.opener.document).val('');jQuery('#FORMULA',window.opener.document).attr('disabled','disabled');}
if(jQuery('#OBJE_REFERENCIA',window.opener.document).val()==9||jQuery('#OBJE_REFERENCIA',window.opener.document).val()==10){jQuery('#SEGURIDAD',window.opener.document).removeAttr('disabled');}else{jQuery('#SEGURIDAD',window.opener.document).val('');jQuery('#SEGURIDAD',window.opener.document).attr('disabled','disabled');}
if(jQuery('#OBJE_REFERENCIA',window.opener.document).val()!=5004&&jQuery('#OBJE_REFERENCIA',window.opener.document).val()!=9&&jQuery('#OBJE_REFERENCIA',window.opener.document).val()!=10){jQuery('#VALOR_DEFECTO',window.opener.document).val('');jQuery('#VALOR_DEFECTO',window.opener.document).attr('disabled','disabled');}else{jQuery('#VALOR_DEFECTO',window.opener.document).removeAttr('disabled');jQuery('#VALOR_DEFECTO option',window.opener.document).remove();jQuery('#VALOR_DEFECTO',window.opener.document).append('');if(jQuery('#OBJE_REFERENCIA',window.opener.document).val()==9||jQuery('#OBJE_REFERENCIA',window.opener.document).val()==10){jQuery('#VALOR_DEFECTO',window.opener.document).append('');}else{jQuery('#VALOR_DEFECTO',window.opener.document).append('');}}}else{if(campo==''){if(jQuery('#LIST_NUMERO',window.opener.document).val()==''){if(jQuery('#OBJE_REFERENCIA_DESC',window.opener.document).val()==''){jQuery('#CONDICION_LISTA',window.opener.document).val('');jQuery('#CONDICION_LISTA',window.opener.document).attr('disabled','disabled');jQuery('#OBLIG_DEPENDIENTE',window.opener.document).val('');jQuery('#OBLIG_DEPENDIENTE',window.opener.document).attr('disabled','disabled');}}else{jQuery('#CONDICION_LISTA',window.opener.document).removeAttr('disabled');jQuery('#OBLIG_DEPENDIENTE',window.opener.document).removeAttr('disabled');jQuery('#OBJE_REFERENCIA',window.opener.document).val('');jQuery('#OBJE_REFERENCIA_DESC',window.opener.document).val('');}
if(jQuery('#OBJE_REFERENCIA_DESC',window.opener.document).val()==''){jQuery('#SEGURIDAD',window.opener.document).attr('disabled','disabled');jQuery('#SEGURIDAD',window.opener.document).val('');jQuery('#VALOR_DEFECTO',window.opener.document).attr('disabled','disabled');jQuery('#VALOR_DEFECTO',window.opener.document).val('');}}}
if(campo=="CAMP_DEPENDIENTE"&&jQuery('#OBJE_REFERENCIA_DESC',window.opener.document).val()==''&&jQuery('#LIST_NUMERO',window.opener.document).val()=='')
return false;if(campo=="FORMULA"&&jQuery('#OBJE_REFERENCIA_DESC',window.opener.document).val()!='')
return false;break;case'7':case'8':case'9':if(campo!="GRUP_NUMERO"&&campo!="FORMULA"&&campo!="CAMP_REFERENCIA"&&campo!='')
return false;break;default:break;}
window.opener.formValObj.__initiallyParseAForm(1);return true;}}
function ie8SafePreventEvent(e){if(e.preventDefault){e.preventDefault()}
e.returnValue=false;}
function visible_tabs(obj_click,e){ie8SafePreventEvent(e);var lista_ante='LIST_'+$("#obje_tab_actual").val();var objeto_ante='OBJ_'+$("#obje_tab_actual").val();var lista_actu='LIST_'+obj_click;var objeto_actu='OBJ_'+obj_click;$("#"+lista_ante).removeClass("current");$("#"+lista_ante).addClass("vacio");$("#"+lista_actu).removeClass("vacio");$("#"+lista_actu).addClass("current");$("#"+objeto_ante).hide();$("#"+objeto_actu).show();$("#obje_tab_actual").val(obj_click);$("#configurar_detalle").attr('href','phrame.php?action=detalle&id_objeto=1&campo_llave=OBJE_NUMERO&valor_llave='+obj_click+'&operacion=Detalle&obje_tab_actual='+obj_click);var cadTable=$("#"+objeto_actu).find("div").eq(1).html();$("#nuevoayuda").html(cadTable);}
function adicionar(clave,descriptor,indice){var lst_cadena=document.forma.cadena.value;var largos_array=lst_cadena.split(",");for(i=0;i