function fValidarDatosBuscador (){
if(document.frmBuscar.txtFecha.value!=""){
if(!fValidarDia(document.frmBuscar.txtFecha.value)){return;}
}
document.frmBuscar.submit();
}
function fRellenarSocios (strForm){
intAsociado = eval('document.'+strForm+'.cboAsociado.value');
fQuitarTodos(strForm+'.cboSocio');
fQuitarTodos(strForm+'.cboSocio');
if (intAsociado != 0){
strArray1="aSocio"+intAsociado;
strArray2="aNombreSocio"+intAsociado;
intLongArray = eval(strArray1+".length");
for (i=0;i<intLongArray;i++){
eval('document.'+strForm+'.cboSocio.options[i]=new Option('+strArray2+'[i],'+strArray1+'[i])');
}
}
}
function sRellenarDatosSocio (strForm){
texto="";
intAsociado = eval('document.'+strForm+'.cboAsociado.value');
intSocio = eval('document.'+strForm+'.cboSocio.value');
intLongArray = eval('aSocio'+intAsociado+'.length');
for (i=0;i<intLongArray;i++){
if (eval('aSocio'+intAsociado+'[i]')==intSocio){
texto = "&nbsp;&nbsp;" + fM("Socio") + ": <b>" + eval('aNombreSocio'+intAsociado+'[i]') + "</b><br>&nbsp;&nbsp;" + fM("Telefono") +": <b>" + eval('aTlfSocio'+intAsociado+'[i]') + "</b>";
}
}
if(document.layers)
{   document.dSocio.document.write(texto+"&nbsp;&nbsp;");
document.dSocio.document.close();
document.dSocio.visibility="visible"
}
if(document.all)
{   document.all("dSocio").innerHTML=texto+"&nbsp;&nbsp;";
document.all("dSocio").style.visibility="visible"
}
if(document.getElementById)
{   document.getElementById("dSocio").innerHTML=texto+"&nbsp;&nbsp;";
document.getElementById("dSocio").style.visibility="visible"
}
return;
}
function fRellenarPeritos (strForm){
intAsociado = eval('document.'+strForm+'.cboAsociado.value');
fQuitarTodos(strForm+'.cboPerito');
fQuitarTodos(strForm+'.cboPerito');
if (intAsociado != 0){
strArray1="aPerito";
strArray2="aNombrePerito";
strArray3="aAsociadoPerito";
intLongArray = eval(strArray1+".length");
eval('document.'+strForm+'.cboPerito.options[0]=new Option("",0)');
x=1;
for (i=0;i<intLongArray;i++){
if(eval(strArray3+'[i]')!=intAsociado){
eval('document.'+strForm+'.cboPerito.options[x]=new Option('+strArray2+'[i],'+strArray1+'[i])');
x++;
}
}
}
}
function sRellenarDatosPerito (strForm){
texto="";
intPerito = eval('document.'+strForm+'.cboPerito.value');
intLongArray = aPerito.length;
for (i=0;i<intLongArray;i++){
if (aPerito[i]==intPerito){
texto = "&nbsp;&nbsp;" + fM("Perito") + ": <b>" + aNombrePerito[i] + "</b>";
}
}
if(document.layers)
{   document.dPerito.document.write(texto+"&nbsp;&nbsp;");
document.dPerito.document.close();
document.dPerito.visibility="visible"
}
if(document.all)
{   document.all("dPerito").innerHTML=texto+"&nbsp;&nbsp;";
document.all("dPerito").style.visibility="visible"
}
if(document.getElementById)
{   document.getElementById("dPerito").innerHTML=texto+"&nbsp;&nbsp;";
document.getElementById("dPerito").style.visibility="visible"
}
return;
}
function fRellenarMotivos (strForm){
intTipo = eval('document.'+strForm+'.cboTipo.value');
fQuitarTodos(strForm+'.cboMotivo');
fQuitarTodos(strForm+'.cboMotivo');
if (intTipo != 0){
strArray1="aMotivo"+intTipo;
strArray2="aNombreMotivo"+intTipo;
sw=1;
intLongArray = eval(strArray1+".length");
for (i=0;i<intLongArray;i++){
eval('document.'+strForm+'.cboMotivo.options[i]=new Option('+strArray2+'[i],'+strArray1+'[i])');
}
}
}
function fSeleccionarSocio (intSocio){
document.frmNueva.cboSocio.value=intSocio;
}
function fSeleccionarPerito (intPerito){
document.frmNueva.cboPerito.value=intPerito;
}
function fSeleccionarMotivo (intMotivo){
document.frmNueva.cboMotivo.value=intMotivo;
}
function fVerTiposPeritacion (){
if (document.frmNueva.chkPeritacion.checked){
MM_showHideLayers ('dPeritacion','','show');
}else{
MM_showHideLayers ('dPeritacion','','hidden');
}
}
function fValidarDatosAccion (){
if (document.frmNueva.cboAsociado.value=="0"){alert(fM("SeleccioneAsociado"));return;}
if (document.frmNueva.txtNum.value==""){alert(fM("IntroduzcaNumExp"));return;}
if (document.frmNueva.txtFecha.value==""){alert(fM("IntroduzcaFechaAlta"));return;}
else{if(!fValidarDia(document.frmNueva.txtFecha.value)){return;}}
if (document.frmNueva.txtResolucion.value!=""){
if(!fValidarDia(document.frmNueva.txtResolucion.value)){return;}
if(!fValidarFechas(document.frmNueva.txtFecha.value,document.frmNueva.txtResolucion.value)){return;}
}
if (document.frmNueva.cboTipo.value=="0"){alert(fM("SeleccioneTipoAccion"));return;}
if (document.frmNueva.txtDescripcion.value==""){alert(fM("IntroduzcaDescripcion"));return;}
if (document.frmNueva.cboSocio.value=="0"){alert(fM("SeleccioneSocio"));return;}
if (document.frmNueva.txtCliente.value==""){alert(fM("IntroduzcaCliente"));return;}
if (document.frmNueva.txtApellidos.value==""){alert(fM("IntroduzcaApellidos"));return;}
if (document.frmNueva.cboEstado.value=="0"){alert(fM("SeleccioneEstado"));return;}
document.frmNueva.submit();
}
function fValidarDatosDoc(intNuevo){
if (document.frmNuevo.txtCodigo.value==""){alert(fM("IntroduzcaCodigo"));return;}
if (document.frmNuevo.txtNombre.value==""){alert(fM("IntroduzcaNombre"));return;}
if (intNuevo == "1"){
if (document.frmNuevo.txtFichero.value==""){alert(fM("IntroduzcaFichero"));return;}
}
document.frmNuevo.submit();
}
function fAseguraBorrarAcciones (){
intCuantos=document.frmLista.Cuantos.value;
i=0;
sw=0;
strAcciones="";
if (intCuantos=="1"){
if (document.frmLista.chkAccion.checked){
sw=1;
strAcciones = document.frmLista.chkAccion.value;
}
}else{
while (i<intCuantos){
if (document.frmLista.chkAccion[i].checked){
if (sw==0){
strAcciones = document.frmLista.chkAccion[i].value;
}else{
strAcciones = strAcciones + "," + document.frmLista.chkAccion[i].value;
}
sw=1;
}
i++;
}
}
document.frmLista.hdnAcciones.value = strAcciones;
if (sw=="1"){
if (confirm(fM("SeguroBorrarAcciones"))){document.frmLista.submit();}
else{return;}
}else{alert(fM("SeleccioneAccionesBorrar"));return;}	
}
function fAsegurarBorrarAccion (){
if (confirm(fM("SeguroBorrarDocumento"))){
document.frmNueva.action="index.php?pg=4"		
document.frmNueva.submit();
}else{return;}
}
function fAseguraBorrarDocumentos (){
intCuantos=document.frmLista.Cuantos.value;
i=0;
sw=0;
strDocumentos="";
if (intCuantos=="1"){
if (document.frmLista.chkDoc.checked){
sw=1;
strDocumentos = document.frmLista.chkDoc.value;
}
}else{
while (i<intCuantos){
if (document.frmLista.chkDoc[i].checked){
if (sw==0){
strDocumentos = document.frmLista.chkDoc[i].value;
}else{
strDocumentos = strDocumentos + "," + document.frmLista.chkDoc[i].value;
}
sw=1;
}
i++;
}
}
document.frmLista.hdnDocumentos.value = strDocumentos;
if (sw=="1"){
if (confirm(fM("SeguroBorrarDocumentos"))){document.frmLista.submit();}
else{return;}
}else{alert(fM("SeleccioneDocumentosBorrar"));return;}	
}
function fAsegurarBorrarDoc (intCodDocumento,intCodAccion){
if (confirm(fM("SeguroBorrarDocumento"))){
location.href='index.php?pg=9&CodDocumento='+intCodDocumento+'&CodAccion='+intCodAccion;
}else{return;}
}

