function callAjaxPOST(callback, func, data, xmlhttp){ var urlServlet = "/common/servlets/projectServlet.php?func="+func; if(xmlhttp==null){ xmlhttp = newAjax(); }else{ xmlhttp.abort(); } xmlhttp.open("POST", urlServlet); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { if(callback!=null) callback(xmlhttp); } } xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.send(data); } //BOTONES function buttonOver(element){ if(element.className != "inactiu"){ element.className = "pitjat"; } var divPrediccio = document.getElementById("prediccio"); if (divPrediccio){ divPrediccio.style.display = "none"; } } function buttonOut(element){ if(element.className != "inactiu"){ element.className = "normal"; } } // //CHECKS function checkboxOnClick(element, linkElementName){ var linkElement = document.getElementById(linkElementName); if(!linkElement || !linkElement.disabled){ if(element.className == "checkbox"){ element.className = "checkbox checked"; }else{ element.className = "checkbox"; } } } function setCheckboxValue(elementElement, value){ var element = document.getElementById(elementElement); if(element){ if(value == 1){ element.className = "checkbox checked"; }else{ element.className = "checkbox"; } } } function getCheckboxValue(elementElement, target){ if(target==null) target = document; var element = target.getElementById(elementElement); if(element){ return (element.className == "checkbox checked"); } } function getCheckboxValueNUM(elementElement){ if(getCheckboxValue(elementElement)){ return 1; }else{ return 0; } } // function butoPDFAction(){ var childWindow = window.open("/03_pop-up13.html", "_blank", "height=100,width=410,status=no,scrollbars=no,toolbar=no,menubar=no,location=no"); if (childWindow.opener == null){ childWindow.opener = self; } } function buto01Action(){ var childWindow = window.open("/cartasDeMoroso.html", "_blank"); if (childWindow.opener == null){ childWindow.opener = self; } /* var idParticipante = document.getElementById("idParticipante").value; if(idParticipante!=""){ var esMoroso = (document.getElementById("divEsMoroso").style.display == "block"); if(esMoroso){ var childWindow = window.open("/cartaMoroso.html?idParticipante="+idParticipante, "_blank", "height=500,width=800,status=no,scrollbars=yes,toolbar=no,menubar=no,location=no"); }else{ alert("El participante seleccionado no tiene facturas pendientes de pago."); } }else{ alert("Selecciona primero un participante."); } */ } function buto30Action(){ var element = document.getElementById("buto30"); if(element.className != "inactiu"){ var childWindow = window.open("/seguimientoPagos.html", "_blank"); if (childWindow.opener == null){ childWindow.opener = self; } } } function buto02Action(){ var childWindow = window.open("/03_pop-up12.html", "_blank", "height=100,width=250,status=no,scrollbars=no,toolbar=no,menubar=no,location=no"); if (childWindow.opener == null){ childWindow.opener = self; } } function buto03Action(){ var childWindow = window.open("/03_pop-up02.html", "_blank", "height=270,width=500,status=no,scrollbars=no,toolbar=no,menubar=no,location=no"); if (childWindow.opener == null){ childWindow.opener = self; } } function buto04Action(){ var childWindow = window.open("/03_pop-up05.html", "_blank", "height=100,width=410,status=no,scrollbars=no,toolbar=no,menubar=no,location=no"); if (childWindow.opener == null){ childWindow.opener = self; } } function buto05Action(){ var childWindow = window.open("/informes.html", "_blank", "height=260,width=220,status=no,scrollbars=no,toolbar=no,menubar=no,location=no"); if (childWindow.opener == null){ childWindow.opener = self; } } //Botonera Inscripciones function buto12Action(){ showEditarInscripciones(true); setDisabledParticipant(true); } function buto13Action(){ deleteSelectedInscripcion(); } function buto14Action(){ var childWindow = window.open("/03_pop-up03.html", "_blank", "height=280,width=800,status=no,scrollbars=no,toolbar=no,menubar=no,location=no"); if (childWindow.opener == null){ childWindow.opener = self; } } //Botonera facturas function buto15Action(){ var element = document.getElementById("buto15"); if(element.className != "inactiu"){ factIndividual(); } } function buto15SASAction(){ var element = document.getElementById("buto15SAS"); if(element.className != "inactiu"){ factSASPopup(); } } function buto16Action(){ var element = document.getElementById("buto16"); if(element.className != "inactiu"){ imprimirFactura(); } } function buto16SASAction(){ var element = document.getElementById("buto16SAS"); if(element.className != "inactiu"){ imprimirFacturaSAS(); } } function buto17Action(){ var element = document.getElementById("buto17"); if(element.className != "inactiu"){ eliminarFactura(); } } function buto17SASAction(){ var element = document.getElementById("buto17SAS"); if(element.className != "inactiu"){ eliminarFacturaSAS(); } } function buto42Action(){ var element = document.getElementById("buto42"); if(element.className != "inactiu"){ cambiarFecha(); } } function buto42SASAction(){ var element = document.getElementById("buto42SAS"); if(element.className != "inactiu"){ editarFacturaSAS(); } } //Botonera pagos function buto18Action(){ var element = document.getElementById("buto18"); if(element.className != "inactiu"){ altaPago(); } } function buto18SASAction(){ var element = document.getElementById("buto18SAS"); if(element.className != "inactiu"){ altaPagoSAS(); } } function buto19Action(){ var element = document.getElementById("buto19"); if(element.className != "inactiu"){ modificarPago(); } } function buto19SASAction(){ var element = document.getElementById("buto19SAS"); if(element.className != "inactiu"){ modificarPagoSAS(); } } function buto20Action(){ var element = document.getElementById("buto20"); if(element.className != "inactiu"){ eliminarPago(); } } function buto20SASAction(){ var element = document.getElementById("buto20SAS"); if(element.className != "inactiu"){ eliminarPagoSAS(); } } function guardaDeudaClinic(){ if (!checkNumber("importeInput")){ alert ("La deuda debe ser un número"); }else{ var urlServlet = "/common/servlets/projectServlet.php"; var data = "deudaClinic="+document.getElementById("importeInput").value; callAjaxPOST(guardaDeudaClinicCallback, "deudaClinic", data); } } function guardaDeudaClinicCallback(xmlhttp){ alert("Deuda Clinic generada correctamente."); //self.close(); } function checkCif(formObjectId){ var formObject = document.getElementById(formObjectId); var value = formObject.value; while (value.indexOf(" ")>-1){ value = value.replace(" ", ""); } while (value.indexOf("-")>-1){ value = value.replace("-", ""); } document.getElementById(formObjectId).value = value; if(value.length<8){ return false; }else{ return true; } }