function popUp(URL){window.open(URL,'popup','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=700,height=600')}
function flip(rid){var _d=document.getElementById(rid);if(_d){var d=_d.style;current=(d.display=='none')?'block':'none';d.display=current;}}
function expandAll(){var t=document.getElementById('datosStat');var x=t.getElementsByTagName('div');var mod,val;if(document.f1.boton.value=='Expandir todos los datos'){mod='block';val='Contraer todos los datos';}else{mod='none';val='Expandir todos los datos';}for(j=0;j<x.length;j++){if(x[j].id!="formf")x[j].style.display=mod;}document.f1.boton.value=val;return false}
function contarCaracteres(campo,contador,cont){var _f=document.forms[0];var _mostrar=false;contador.value=campo.value.length;if(contador.value>160){_mostrar=true;if(_f.valido.value.match('_'+cont+'_')==null)_f.valido.value+='_'+cont+'_'}else{_f.valido.value=_f.valido.value.replace('_'+cont+'_', '')}if(_f.valido.value!=''){document.forms[0].subBut.value='No se pueden aplicar cambios';document.forms[0].subBut.disabled=true}else{document.forms[0].subBut.value='Aplicar cambios';document.forms[0].subBut.disabled=false}var _text=document.getElementById('errores');if(_mostrar==true && _text.innerHTML.match('Atencion!!! La pregunta num. '+cont+' ha sobrepasado el limite de caracteres.')==null)document.getElementById('errores').innerHTML+='Atencion!!! La pregunta num. '+cont+' ha sobrepasado el limite de caracteres.<br>&nbsp;';else if(_mostrar==false && _text.innerHTML.match('Atencion!!! La pregunta num. '+cont+' ha sobrepasado el limite de caracteres.')!=null){_tmp=_text.innerHTML.replace('Atencion!!! La pregunta num. '+cont+' ha sobrepasado el limite de caracteres.<br>&nbsp;', '');document.getElementById('errores').innerHTML=_tmp}return}
function abrir(URL,width,height,scroll){if(scroll=='no') scrol='scrollbars=no';else scrol='scrollbars=yes';window.open(URL,'popup','width='+width+',height='+height+','+scrol+',menubar=no,location=no,resizable=no')}
function targetopener(mylink,closeme,closeonly){if(!(window.focus && window.opener))return true;window.opener.focus();if(!closeonly)window.opener.location.href=mylink;if(closeme)window.close();return false}
function selectAll(obj){var _c=document.getElementsByTagName('option');for(i=0;i<_c.length;i++)if(_c[i].disabled!=true)_c[i].selected=true}
function unselectAll(obj){var _c=document.getElementsByTagName('option');for(i=0;i<_c.length;i++)if(_c[i].disabled!=true)_c[i].selected=false}
function disablebanco(){var d=document.alta;d.banco.disabled=true;d.cuenta.disabled=true;d.direccionBanco.disabled=true}
function enablebanco(){var d=document.alta;d.banco.disabled=false;d.cuenta.disabled=false;d.direccionBanco.disabled=false}
function confirmar(mensaje,url){var answer=confirm(mensaje);if(answer)window.location=url;return true}
function mostrarInfo(rid){var _o=document.getElementById(rid).style;_o.width="175px";_o.position='absolute';_o.display="block";_o.visibility="visible";_o.height='auto'}
function ocultarInfo(rid){var _o=document.getElementById(rid).style;_o.visibility="hidden";_o.height='0px';_o.width='0px';_o.display="none"}
function ocultarSelects(){var _s=document.getElementsByTagName('select');var _o=document.getElementsByTagName('object');var _e=document.getElementsByTagName('embed');for (i=0;i<_s.length;i++) _s[i].style.visibility='hidden';for (i=0;i<_e.length;i++) _e[i].style.visibility='hidden';for (i=0;i<_o.length;i++) _o[i].style.visibility='hidden';}
function mostrarSelects(){var _s=document.getElementsByTagName('select');var _e=document.getElementsByTagName('embed');var _o=document.getElementsByTagName('object');var _div=document.getElementsByTagName('div');var _mostrar=false;for(j=0;j<_div.length;j++){if(_div[j].id.substring(0,4)=='menu' && _div[j].id!='menu1'){if(_div[j].style.visibility=='visible'){_mostrar=true;break;}}}if(_mostrar!=true){for(i=0;i<_s.length;i++) _s[i].style.visibility='visible';for(i=0;i<_e.length;i++) _e[i].style.visibility='visible';for(i=0;i<_o.length;i++) _o[i].style.visibility='visible';}}
function abreVentana(idioma){var _ffdd=document.forms[0];for(i=0;i<_ffdd.length;i++){if(_ffdd[i].name=='servicio'){if(_ffdd[i].type=='radio' && _ffdd[i].checked==true) var _sss=_ffdd[i].value;if(_ffdd[i].type=='hidden') var _sss=_ffdd[i].value;}else if(_ffdd[i].name=='cantidad') var _ccc=_ffdd[i].value;}var _string='valorMoneda.php?idioma='+idioma+'&servicio='+_sss;if(_ccc) _string=_string+'&cantidad='+_ccc;abrir(_string,600,300,'no')}
function XHConn(){var xmlhttp,bComplete=false;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){try{xmlhttp=new XMLHttpRequest()}catch(e){xmlhttp=false}}}if(!xmlhttp)return null;this.connect=function(sURL,sMethod,sVars,fnDone){if(!xmlhttp)return false;bComplete=false;sMethod=sMethod.toUpperCase();try{if(sMethod=="GET"){xmlhttp.open(sMethod,sURL+"?"+sVars,true);sVars="";}else{xmlhttp.open(sMethod,sURL,true);xmlhttp.setRequestHeader("Method","POST "+sURL+" HTTP/1.1");xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");}xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&!bComplete){bComplete=true;fnDone(xmlhttp);}};xmlhttp.send(sVars);}catch(z){return false;}return true;};return this;}
function marcarTodos(grupo,modo){var _f=document.forms[0][grupo];_c=_f.length;for(i=0;i<_c;i++)_f[i].selected=modo;}