
function CalculaNIF(opcionError,oEvent){var dni;var lletra;var lletra_correcta;var bOk;var ocampo;if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
if(ocampo)
{nif=ocampo.value;nif=nif.toUpperCase();bOk=true;if(nif!='')
{if(isNaN(nif))
{if((nif.length>2)&&(nif.length<10))
{dni=nif.substring(0,nif.length-1);if(!isNumber(dni))
{bOk=false;}
lletra=nif.substring(nif.length-1,nif.length);if(isNaN(dni))
{ocampo.style.color='Red';}
else
{lletra_correcta=quina_lletra(dni);if(lletra!=lletra_correcta)
{dni.concat(lletra_correcta);ocampo.value=dni;}}}
else
{bOk=false}}
else
{if((nif.length>2)&&(nif.length<10))
{if(nif.length<9)ocampo.value=nif.concat(quina_lletra(nif));else bOk=false;}
else
{bOk=false;}}}
devuelveResultado(ocampo,bOk,opcionError);}}
function ValidaNIF(opcionError,oEvent){var dni;var lletra;var lletra_correcta;var bOk;var ocampo;if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
if((ocampo.name=='WTGNUMDOC')||(ocampo.name=='WTXIPSTDO'))
{ocampoTipo=document.getElementById('WTXIPSTDO');ocampo=document.getElementById('WTGNUMDOC');}
else
{ocampoTipo=document.getElementById('WTXIPRTDO');ocampo=document.getElementById('WTXIPRDNI');}
if(ocampoTipo.value=='6-NIF')
{if(ocampo)
{nif=ocampo.value;nif=nif.toUpperCase();bOk=true;if(nif!='')
{if(isNaN(nif))
{if((nif.length>2)&&(nif.length<10))
{dni=nif.substring(0,nif.length-1);lletra=nif.substring(nif.length-1,nif.length);if(isNaN(dni))
{bOk=false;}
else
{lletra_correcta=quina_lletra(dni);if(lletra!=lletra_correcta)
{bOk=false;}}}
else
{bOk=false;}}
else
{bOk=false;}}}}
else
{bOk=true;}
devuelveResultado(ocampo,bOk,opcionError);}
function validaDecimal(opcionError,oEvent)
{if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
bOk=true;if(ocampo)
{decimal=ocampo.value;if(decimal.indexOf(',')>=0)bOk=false;if(bOk)
{separador=decimal.indexOf('.');if(separador==-1)
{if(!(validaNumeroInterno(decimal)))bOk=false;else ocampo.value=decimal+".0";}
else
{if(separador==0)
{partEntera="0";partDecimal=decimal.substring(separador+1);;}
else
{if(separador==decimal.length-1)
{partEntera=decimal.substring(0,separador);partDecimal="0";}
else
{partEntera=decimal.substring(0,separador);partDecimal=decimal.substring(separador+1);}}
if(!(validaNumeroInterno(partDecimal)))bOk=false;if(!(validaNumeroInterno(partEntera)))bOk=false;if(bOk)ocampo.value=partEntera+"."+partDecimal;}}
devuelveResultado(ocampo,bOk,opcionError);}}
function validaNumero(opcionError,oEvent)
{if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
bOk=true;if(ocampo)
{num=ocampo.value;bOk=validaNumeroInterno(num);devuelveResultado(ocampo,bOk,opcionError);}}
function validaLetras(opcionError,oEvent)
{if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
bOk=true;if(ocampo)
{cadena=ocampo.value;for(i=0;i<cadena.length;i++){if(((cadena.charAt(i)<'a')||(cadena.charAt(i)>'z'))&&((cadena.charAt(i)<'A')||(cadena.charAt(i)>'Z')))bOk=false;}
devuelveResultado(ocampo,bOk,opcionError);}}
function validaCaracters(opcionError,oEvent)
{if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
bOk=true;if(ocampo)
{cadena=ocampo.value;if(cadena!='')
{for(i=0;i<cadena.length;i++){if(((cadena.charAt(i)<'a')||(cadena.charAt(i)>'z'))&&((cadena.charAt(i)<'A')||(cadena.charAt(i)>'Z'))&&((cadena.charAt(i)<'0')||(cadena.charAt(i)>'9'))&&(cadena.charAt(i)!='.')&&(cadena.charAt(i)!='@'))bOk=false;}
devuelveResultado(ocampo,bOk,opcionError);}}}
function validaTelf(opcionError,oEvent){if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
bOk=true;if(ocampo)
{num=ocampo.value;if(num!='')
{if(num.length!=9)
{if((num.charAt(0)!='0')||(num.charAt(1)!='0'))
{bOk=false;}
else
{bOk=validaNumeroInterno(num);}}
else
{bOk=validaNumeroInterno(num);}
devuelveResultado(ocampo,bOk,opcionError);}}}
function validaCP(opcionError,oEvent)
{if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
bOk=true;if(ocampo)
{num=ocampo.value;if(num!='')
{if(num.length==5)
{bOk=validaNumeroInterno(num);}
else
{bOk=false;}
devuelveResultado(ocampo,bOk,opcionError);}}}
function validaCorreu(opcionError,oEvent)
{if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
bOk=true;if(ocampo)
{adr=ocampo.value;if(adr!='')
{if((adr.indexOf('@')>0)&&(adr.indexOf('@')<adr.lastIndexOf('.'))&&(adr.indexOf('.')!=adr.length-1)&&(adr.indexOf('@')==adr.lastIndexOf('@'))&&validaCaractersIntern(adr))
{bOk=true;}else
{bOk=false;}
devuelveResultado(ocampo,bOk,opcionError);}}}
function ValidarData(opcionError,oEvent){var bTraspas;if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
bOk=true;if(ocampo)
{sData=ocampo.value;sData=sData.split("/");if(sData.length!=3)
{bOk=false;}
else
{if((sData[0].length!=2)||(sData[1].length!=2)||(sData[2].length!=4))
{bOk=false;;}
else
{if((sData[2]<1900)||(sData[2]>2100))
{bOk=false;}
else
{if((sData[1]==1)||(sData[1]==3)||(sData[1]==5)||(sData[1]==7)||(sData[1]==8)||(sData[1]==10)||(sData[1]==12))
{if((sData[0]<1)||(sData[0]>31))
{bOk=false;}}
else
{if((sData[1]==4)||(sData[1]==6)||(sData[1]==9)||(sData[1]==11))
{if((sData[0]<1)||(sData[0]>30))bOk=false;}
else
{if(sData[1]==2)
{bTraspas=Traspas(sData[2]);if((bTraspas)&&((sData[0]<1)||(sData[0]>29)))
bOk=false;else if((!bTraspas)&&((sData[0]<1)||(sData[0]>28)))
bOk=false;}
else bOk=false;}}}}}
devuelveResultado(ocampo,bOk,opcionError);}}
function TransformarData(opcionError,oEvent){var iDia;var iMes;var iAny;if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
bOk=true;if(ocampo)
{sData=ocampo.value;sData=sData.split("/");if(sData.length!=3)bOk=false;else{if(sData[0].length==1)iDia="0"+sData[0];else iDia=sData[0];if(sData[1].length==1)iMes="0"+sData[1];else iMes=sData[1];if(sData[2].length==2){if(sData[2][0]>=6)iAny="19"+sData[2];else iAny="20"+sData[2];}
else iAny=sData[2];}
if(!ValidarDataInterno(iDia+"/"+iMes+"/"+iAny))bOk=false;else
{ocampo.value=(iDia+"/"+iMes+"/"+iAny);}
devuelveResultado(ocampo,bOk,opcionError);}}
function ValidarObligatori(opcionError,oEvent)
{if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
bOk=true;if(ocampo)
{s=ocampo.value;bOk=!((s==null)||(s.lenght==0)||s=='')
devuelveResultado(ocampo,bOk,opcionError);}}
function ValidaMes(opcionError,oEvent)
{if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
bOk=false;if(ocampo)
{if(validaNumeroInterno(ocampo.value))
{s=parseInt(ocampo.value,10);if(!isNaN(s))
bOk=((s>0)&&(s<13))}
devuelveResultado(ocampo,bOk,opcionError);}}
function ValidarDocVisat(oEvent)
{var bOk,oCampoDoc,aCampos,sURL,sIdCol,sAssumeix;bOk=true;if(NavegadorIE())oCampoDoc=oEvent.srcElement;else oCampoDoc=oEvent.target;if(oCampoDoc.value.length>0)
{aCampos=document.getElementsByName('WTXCAMPRO');sIdCol=aCampos.item(0).value;if(oCampoDoc.name=='WTXREFASS')sAssumeix='S';else sAssumeix='N';sURL='/ABSIS/Web/Acciones/SrvAcciones.asmx/ValidarDocVisat?idCol='+sIdCol+'&idDoc='+oCampoDoc.value+'&assumeix='+sAssumeix;if(NavegadorIE())xmlHttpReq=new ActiveXObject("MSXML2.XMLHTTP");else xmlHttpReq=new XMLHttpRequest();xmlHttpReq.open("GET",sURL,false);xmlHttpReq.send("");if(xmlHttpReq.responseXML!=null)
{if(NavegadorIE())bOk=(xmlHttpReq.responseXML.documentElement.nodeTypedValue=='S');else bOk=(xmlHttpReq.responseXML.documentElement.textContent=='S');}
else bOk=false;}
formateaCampoResult(oCampoDoc,bOk);if(!bOk)
{alert(strRefDocIncorrecta);oCampoDoc.focus();}}
function recalcularCampos()
{var result=0;var num1=0;var num2=0;if(document.getElementById('WTXNUMER1').value)
{num1=parseInt(document.getElementById('WTXNUMER1').value);}
if(document.getElementById('WTXNUMER2').value)
{num2=parseInt(document.getElementById('WTXNUMER2').value);}
result=num1+num2;document.getElementById('WTXRESULT').value=result;}
function CalculaImportNet()
{var importeBrut=0;var percIva=0;var percDte=0;var importNet=0;var result=0;if(document.getElementById('WTXIMPBRU').value)
{if(ValidaDecimalIntern(document.getElementById('WTXIMPBRU').value))
importeBrut=parseFloat(document.getElementById('WTXIMPBRU').value);}
if(document.getElementById('WTXPORDTO').value)
{if(ValidaPercentatgeIntern(document.getElementById('WTXPORDTO').value))
percDte=parseInt(document.getElementById('WTXPORDTO').value);}
if(document.getElementById('WTXPORIVA').value)
{if(ValidaPercentatgeIntern(document.getElementById('WTXPORIVA').value))
percIva=parseInt(document.getElementById('WTXPORIVA').value);}
result=importeBrut-(importeBrut*percDte/100);document.getElementById('WTXIMPNET').value=roundNumber(result+(result*percIva/100),2);}
function ValidaPercentatge(opcionError,oEvent)
{if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
var bOk=true;var num;if(ocampo)
{num=ocampo.value;bOk=ValidaPercentatgeIntern(num);devuelveResultado(ocampo,bOk,opcionError);}}
function ValidaPercentatgeIntern(num)
{if(validaNumeroInterno(num))
{return((num>=0)&&(num<=100));}
else return false;}
function ValidaDecimalIntern(decimal){var bOk=true;var separador;var partEntera;var partDecimal;if(decimal.indexOf(',')>=0)bOk=false;if(bOk)
{separador=decimal.indexOf('.');if(separador==-1)
{if(!(validaNumeroInterno(decimal)))bOk=false;}
else
{if(separador==0)
{partEntera="0";partDecimal=decimal.substring(separador+1);}
else
{if(separador==decimal.length-1)
{partEntera=decimal.substring(0,separador);partDecimal="0";}
else
{partEntera=decimal.substring(0,separador);partDecimal=decimal.substring(separador+1);}}
if(!(validaNumeroInterno(partDecimal)))bOk=false;if(!(validaNumeroInterno(partEntera)))bOk=false;}}
return bOk;}
function textoEvento(oEvent)
{if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
var sTexto;sTexto='Se ha provocado el evento '+oEvent.type+' sobre el campo '+ocampo.name
alert(sTexto);}
function mostrarPopupTextoClick()
{alert('Se ha provocado un click sobre un campo de texto');}
function mostrarPopupTexto()
{alert('Se ha provocado un evento sobre un evento texto');}
function Traspas(iAny){if((iAny%4)==0){if((iAny%100)==0){if((iAny%400)==0)return(true);else return(false);}
else return(true);}
else return(false);}
function quina_lletra(Dni){var lletra=new Array("T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E");if(isNaN(Dni))return false;else return(lletra[Dni%23]);}
function validaCaractersIntern(cadena)
{bOk=true;if(cadena!='')
{for(i=0;i<cadena.length;i++){if(((cadena.charAt(i)<'a')||(cadena.charAt(i)>'z'))&&((cadena.charAt(i)<'A')||(cadena.charAt(i)>'Z'))&&((cadena.charAt(i)<'0')||(cadena.charAt(i)>'9'))&&(cadena.charAt(i)!='.')&&(cadena.charAt(i)!='@')&&(cadena.charAt(i)!='Ç')&&(cadena.charAt(i)!='Ñ')&&(cadena.charAt(i)!='ç')&&(cadena.charAt(i)!='ñ')&&(cadena.charAt(i)!='_')&&(cadena.charAt(i)!='-'))
bOk=false;}}
return bOk;}
function roundNumber(number,decimals){return Math.round(number*Math.pow(10,decimals))/Math.pow(10,decimals);}
function validaNumeroInterno(num)
{for(i=0;i<num.length;i++){if(num.charAt(i)<'0'||num.charAt(i)>'9')return false;}
return true;}
function ValidarDataInterno(sData){var bTraspas;sData=sData.split("/");if(sData.length!=3)
{return(false);}
else
{if((sData[0].length!=2)||(sData[1].length!=2)||(sData[2].length!=4))
{return(false);}
else
{if((sData[2]<1900)||(sData[2]>2100))
{return(false);}
else
{if((sData[1]==1)||(sData[1]==3)||(sData[1]==5)||(sData[1]==7)||(sData[1]==8)||(sData[1]==10)||(sData[1]==12))
{if((sData[0]<1)||(sData[0]>31))
{return false;}}
else
{if((sData[1]==4)||(sData[1]==6)||(sData[1]==9)||(sData[1]==11))
{if((sData[0]<1)||(sData[0]>30))return(false);}
else
{if(sData[1]==2)
{bTraspas=Traspas(sData[2]);if((bTraspas)&&((sData[0]<1)||(sData[0]>29)))
return(false);else if((!bTraspas)&&((sData[0]<1)||(sData[0]>28)))
return(false);}
else return false;}}}}}
return(true);}
function devuelveResultado(ocampo,resultado,opcionError,sMensaje)
{if(opcionError=='rojo')
{formateaCampoResult(ocampo,resultado);}
else if(opcionError=='mensaje'&&!resultado)
{if(!sMensaje)sMensaje="Campo no válido";alert(sMensaje);}}
function formateaCampoResult(ocampo,resultado)
{if(resultado)
{ocampo.style.color='Black';if(ocampo.style.backgroundColor=='Red'||ocampo.style.backgroundColor=='red')
{ocampo.style.backgroundColor="";}}
else
{if(ocampo.value.length==0)
{ocampo.style.color='White';ocampo.style.backgroundColor='Red';}
else
{ocampo.style.color='Red';ocampo.style.backgroundColor="";}}}
function CopiarEmail(opcionError,oEvent)
{if(oEvent==null){ocampo=document.getElementById(event.srcElement.name);}else{if(NavegadorIE())ocampo=oEvent.srcElement;else ocampo=oEvent.target;}
if(document.getElementById('WTGMAINOT')!=null){document.getElementById('WTGMAINOT').value=ocampo.value;}}
function CerrarVentana(){window.close();}
function insertAutoCompleteDestinatario(){if(document.getElementById("WTXNOMDES")){var sNomCampo='WTXNOMDES';}else{var sNomCampo='FIL_WUSNOMBRE';}
var urlASP='../../forms_base/lstusu.asp'
var idtargetDIV='targetLst_'+sNomCampo;var htmltargetDiv='<div id="'+idtargetDIV+'" class="auto_complete" ></div>';var getItemUpdate=function(resp){var oNode=document.getElementById(resp.id);var sNombre=oNode.getAttribute("WUSNOMBRE");var sApell1=oNode.getAttribute("WUSAPELL1");var sApell2=oNode.getAttribute("WUSAPELL2");if(oNode.getAttribute("WUSDIRMAI")){var sDirmail=oNode.getAttribute("WUSDIRMAI");}
var oNombre,oApell1,oApell2,oDirmail;if(document.getElementById("WTXNOMDES")){oNombre=document.getElementById("WTXNOMDES");oNombre.value=sNombre;oApell1=document.getElementById("WTXAP1DES");oApell1.value=sApell1;oApell2=document.getElementById("WTXAP2DES");oApell2.value=sApell2;if(document.getElementById("WTGMAINOT")){oDirmail=document.getElementById("WTGMAINOT");oDirmail.value=sDirmail;}}else{oNombre=document.getElementById("FIL_WUSNOMBRE");oNombre.value=sNombre;oApell1=document.getElementById("FIL_WUSAPELL1");oApell1.value=sApell1;oApell2=document.getElementById("FIL_WUSAPELL2");oApell2.value=sApell2;}}
new Insertion.After(sNomCampo,htmltargetDiv);new Ajax.Autocompleter(sNomCampo,idtargetDIV,urlASP,{updateElement:getItemUpdate});}
var colorAvisoCampoVacio="red";function BorrarCampos(oInput){var oForm=document.getElementById(oInput.form.id);var aTipos=new Array("input","textarea","select");var intALength=aTipos.length;if(confirm(strBorrarCampos)){for(var x=0;x<intALength;x++){var cItems=oForm.getElementsByTagName(aTipos[x]);var intCItemsLength=cItems.length;for(var i=0;i<intCItemsLength;i++){if(!cItems.item(i).id==""&&cItems.item(i).type!="hidden"&&!cItems.item(i).readOnly&&cItems.item(i).type!="submit"){EstablecerValorCampo(window.document,cItems.item(i).id,'','=');if(document.getElementById(cItems.item(i).id).selectedIndex)
document.getElementById(cItems.item(i).id).selectedIndex="-1";if(document.getElementById(cItems.item(i).id+"_parent"))
tinyMCE.activeEditor.setContent("");}}}}}
function isNumber(s)
{var i;var dotAppeared;dotAppeared=false;if(isEmpty(s))
if(isNumber.arguments.length==1)return defaultEmptyOK;else return(isNumber.arguments[1]==true);for(i=0;i<s.length;i++)
{var c=s.charAt(i);if(i!=0){if(c=="."){if(!dotAppeared)
dotAppeared=true;else
return false;}else
if(!isDigit(c))return false;}else{if(c=="."){if(!dotAppeared)
dotAppeared=true;else
return false;}else
if(!isDigit(c)&&(c!="-")||(c=="+"))return false;}}
return true;}
function isEmpty(s)
{return((s==null)||(s.length==0))}
function isDigit(c)
{return((c>="0")&&(c<="9"))}<!-----IQUA----->function insertLogoIQUA()
{var iqua_id=1536;var iqua_lang=1;var dir_remoto="../img/logos/";var lang1=new Array(3);var lang2=new Array(3);lang1[1]="segell";lang2[1]="L'Agència de la Qualitat d'Internet";lang1[2]="sello";lang2[2]="La Agencia de Calidad de Internet";lang1[3]="seal";lang2[3]="The Internet Quality Agency";document.write("<a href=\"http://www.iqua.net/segell/?id="+iqua_id+"&lang="+iqua_lang+"&url="+document.location.href+"\" onclick=\"iqua_open(this.href,'iqua','600','450','no');return false;\"><img src=\""+dir_remoto+"segelliqua.gif\" width=\"63\" height=\"49\" border=\"0\" alt=\""+lang2[iqua_lang]+"\"></a>");}
function iqua_open(mypage,myname,w,h,scroll){winl=(screen.width-w)/2;wint=(screen.height-h)/2;winprops='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no'
win=window.open(mypage,myname,winprops)
if(parseInt(navigator.appVersion)>=4){win.window.focus();}}
function GetValorCampo(patronIdentificador)
{var iCodigo;var textoPagina=document.documentElement.innerText;var indiceInicio=textoPagina.indexOf("{"+patronIdentificador)+patronIdentificador.length+1;var indiceFinal=textoPagina.indexOf(patronIdentificador+"}");var descripcion=textoPagina.substring(indiceInicio,indiceFinal);return descripcion;}
function EsDelPuebloEnValidacion()
{var bEsDelPueblo=false;bEsDelPueblo=GetValorCampo('WTXIPSCPO')=='08185';return bEsDelPueblo;}
function EsDelPueblo()
{var bEsDelPueblo=false;bEsDelPueblo=document.getElementById('WTXIPSCPO').value=='08185';return bEsDelPueblo;}
function getElementosDeClase(sClase)
{var vectorDivs;vectorDivs=document.getElementsByTagName('div');for(i=0;i<vectorDivs.length;i++){if(vectorDivs[i].getAttribute("className")==sClase)
{return vectorDivs[i];}}}
function getElementosDeClaseByTag(sClase,sTag)
{var vectorDivs;vectorDivs=document.getElementsByTagName(sTag);for(i=0;i<vectorDivs.length;i++){if(vectorDivs[i].getAttribute("className")==sClase)
{return vectorDivs[i];}}}
function getElementosRadioButton()
{var vectorDivs;var sClase="campo_lista";var vectorResultado=new Array();var i;var elemInput;var codigo;vectorDivs=document.getElementsByClassName(sClase);for(i=0;i<vectorDivs.length;i++)
{elemInput=vectorDivs[i].getElementsByTagName('input');if(elemInput.length>0)
{elemInput=elemInput[0];if(elemInput.type=='radio')
{codigo=elemInput.id;codigo=codigo.substring(0,9);vectorResultado.push(codigo);}}}
return vectorResultado;}
function EsVisible(elem)
{if(!elem)
{return true;}
if(elem.style)
{if(elem.style.display!="")
{return false;}}
return EsVisible(elem.parentNode);}
function MarcaCamposSeccionNoObligatorios()
{var i;var j;var boton=document.getElementsByClassName("botAceptar");var padreCampo;var vectorHijosInput;var valor;if(typeof boton=='undefined')
{return;}
else if(boton.length==0)
{return;}
boton=boton[0];var theForm=boton.form;for(i=0;i<theForm.length;i++)
{if(!EsVisible(theForm.elements[i]))
{if((theForm.elements[i].onblur+' ').indexOf('CampoObligatorio')>=0)
{theForm.elements[i].onblur=function(){};}
padreCampo=theForm.elements[i].parentNode;vectorHijosInput=padreCampo.getElementsByTagName("input");for(j=0;j<vectorHijosInput.length;j++)
{valor=vectorHijosInput[j].value;valor=valor.toLowerCase();if(valor=="not null")
{vectorHijosInput[j].value="null";theForm.elements[i].value="";}}}}}
function VisualizaDatosSeccion(claseSeccion,bVisible)
{var oElem=getElementosDeClase(claseSeccion);if(!oElem)return;if(bVisible)
{oElem.style.display="";}
else
{oElem.style.display="none";}
return;}
function ActualizarValuesLista()
{var vectorDivs=getElementosRadioButton();var i;var radio;var j;for(i=0;i<vectorDivs.length;i++)
{j=0;radio=document.getElementById(vectorDivs[i]+j);while(radio)
{radio.value=radio.parentNode.getElementsByTagName("label")[0].innerHTML;j=j+1;radio=document.getElementById(vectorDivs[i]+j);}}}
function ValidarValuesLista()
{ActualizarValuesLista();MarcaCamposSeccionNoObligatorios();}
function EsDocumentoModificacion()
{var bResultado=false;var vectorDocumentoValidacion=document.getElementsByTagName("form");var documentoValidacion;var i;for(i=0;i<vectorDocumentoValidacion.length;i++)
{if(vectorDocumentoValidacion[i].getAttribute("name")=="frmConfirmacion")
{return true;}}
return bResultado;}
function EsDocumentoValidacion()
{return GetPagina()=='D6D47FAB98314F90A38A9C36717A0214';var bResultado=false;var vectorDocumentoValidacion=document.getElementsByClassName("botAceptar");var documentoValidacion;var i;for(i=0;i<vectorDocumentoValidacion.length;i++)
{bResultado=true;alert(vectorDocumentoValidacion[i].type);}
return bResultado;}
function ModificandoDocumento()
{var idEntorno=window.location.search;idEntorno=idEntorno.toUpperCase();return idEntorno.indexOf("?PROCEDENCIA=CONFIRMACION")>=0;}
function AnadirValidarListas()
{var prue=getElementosDeClaseByTag("botAceptar","input");var FuncionOnclick=prue.getAttribute("onclick");var sFuncionOnclick=FuncionOnclick.toString();sFuncionOnclick=sFuncionOnclick.replace("{","{ValidarValuesLista();");sFuncionOnclick=sFuncionOnclick.split("{")[1];sFuncionOnclick=sFuncionOnclick.split("}")[0];sFuncionOnclick=sFuncionOnclick+";"
if(FuncionOnclick.toString().indexOf("eval(")<=0)
{prue.onclick=function(){eval(sFuncionOnclick);};}}
function GetPagina()
{var aTmp=window.location.pathname.split('/');var idPagina=aTmp[aTmp.length-1].substring(0,32);return idPagina;}
function RecuperaDatosListaOpciones()
{var vScriptsEstablecer=document.getElementsByTagName("script");var sScripts=vScriptsEstablecer[vScriptsEstablecer.length-1].innerHTML;eval(sScripts);}
function InicializaTramiteRocodromo(elem)
{var seccion="DatosBanco";var bModificacionConformacion=EsDocumentoModificacion();var bValidacion=EsDocumentoValidacion();var bModificandoDatos=ModificandoDocumento();if(bModificacionConformacion)
{var elemLicencia=document.getElementsByName('WTXLICFED')[0];var bVisualizaDatosBanco=!(EsDelPueblo()&&elemLicencia.value=="Sí");VisualizaDatosSeccion(seccion,bVisualizaDatosBanco);}
else if(bValidacion)
{var pagina=document.getElementById("pagina");var bVisualizaDatosBanco=!(EsDelPuebloEnValidacion()&&GetValorCampo('WTXLICFED')=="Sí");VisualizaDatosSeccion(seccion,bVisualizaDatosBanco);VisualizaDatosSeccion("#ValoresCampos#",false);}
else
{if(bModificandoDatos)
{ActualizarValuesLista();RecuperaDatosListaOpciones();}
else
{}
AnadirValidarListas()
VisualizaDatosBancariosLlisar(document.getElementById('WTXLICFED'));}}
function VisualizaDatosBancariosLlisar(elem)
{var elemaseguranza=document.getElementById('WTXDESASS');var elemaseguranzaSi=document.getElementById('WTXDESASS0');var elemaseguranzaNo=document.getElementById('WTXDESASS1');var bVisualizaDatosBanco;var seccion="DatosBanco";if(!elem.id)
{return;}
var elemLicenciaSi=document.getElementById('WTXLICFED0');var elemLicenciaNo=document.getElementById('WTXLICFED1');elemaseguranzaSi.checked=!elemLicenciaSi.checked;elemaseguranzaNo.checked=elemLicenciaSi.checked;bVisualizaDatosBanco=!(EsDelPueblo()&&elemLicenciaSi.checked);VisualizaDatosSeccion(seccion,bVisualizaDatosBanco);}