Si desitgeu sol·licitar aquest curs, per favor, indiqueu-nos les vostres dades de contacte. L’equip organitzador es posarà en contacte amb vosaltres en un termini de deu dies per tal que participeu en el procés de selecció.
function validaForm(){
var valido = 0;
if(document.getElementById("nombre").value == ""){
document.getElementById("nombre").style.background = "url('web/img/validator-x.gif') no-repeat scroll 100% 50% #d6effa";
valido++;
}else{
document.getElementById("nombre").style.background = "white";
}
if(document.getElementById("apellidos").value == ""){
document.getElementById("apellidos").style.background = "url('web/img/validator-x.gif') no-repeat scroll 100% 50% #d6effa";
valido++;
}else{
document.getElementById("apellidos").style.background = "white";
}
if(isNaN(document.getElementById("telefono").value) || document.getElementById("telefono").value == ""){
document.getElementById("telefono").style.background = "url('web/img/validator-x.gif') no-repeat scroll 100% 50% #d6effa";
valido++;
}else{
document.getElementById("telefono").style.background = "white";
}
valor = document.getElementById("email").value;
if ((valor!="" && valor!=null )&&!(RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/).test(valor))) {
document.getElementById("email").style.background = "url('web/img/validator-x.gif') no-repeat scroll 100% 50% #d6effa";
valido++;
}else{
document.getElementById("email").style.background = "white";
}
/* CANVIS EVOLUTIU CANVI NIF CERCADOR CURSOS */
/*
dni = document.getElementById("nif").value;
if(dni.length>0){
if (!(RegExp(/^(([0-9xyzXYZ]{1})+([0-9]{7})+([a-zA-Z]{1}))?/).test(dni))) {
document.getElementById("nif").style.background = "url('web/img/validator-x.gif') no-repeat scroll 100% 50% #d6effa";
valido++;
}else{
document.getElementById("nif").style.background = "white";
}
letEuropeo=dni.substr(0,1);
letraEuropeo="XYZxyz";
if(letraEuropeo.indexOf(letEuropeo)==-1){
numero = dni.substr(0,dni.length-1);
let = dni.substr(dni.length-1,1);
numero = numero % 23;
letra='TRWAGMYFPDXBNJZSQVHLCKET';
letra=letra.substring(numero,numero+1);
if (letra!=let || document.getElementById("nif") == ""){
document.getElementById("nif").style.background = "url('web/img/validator-x.gif') no-repeat scroll 100% 50% #d6effa";
valido++;
}else{
document.getElementById("nif").style.background = "white";
}
}
}
/*
else{
document.getElementById("nif").style.background = "url('web/img/validator-x.gif') no-repeat scroll 100% 50% #d6effa";
valido++;
} */
if (document.getElementById("proteccio_dades").checked == false)
{
valido++;
document.getElementById("nota_proteccio_dades").style.background = "url('web/img/validator-x.gif') no-repeat scroll 100% 50% #d6effa";
document.getElementById("consentiment").style.color = "red";
}
else
{
document.getElementById("nota_proteccio_dades").style.background = "none repeat scroll 0% 0% rgb(241, 247, 232)";
document.getElementById("consentiment").style.color = "black";
}
/*FINAL CANVIS EVOLUTIU CANVI NIF CERCADOR CURSOS*/
if(valido==0){
informaClau2();
document.getElementById("nombre").style.background = "white";
document.getElementById("apellidos").style.background = "white";
document.getElementById("telefono").style.background = "white";
document.getElementById("email").style.background = "white";
/* CANVIS EVOLUTIU CANVI NIF CERCADOR CURSOS */
//document.getElementById("nif").style.background = "white";
document.getElementById("nota_proteccio_dades").style.background = "none repeat scroll 0% 0% rgb(241, 247, 232)";
document.getElementById("consentiment").style.color = "black";
/* FINAL CANVIS EVOLUTIU CANVI NIF CERCADOR CURSOS */
}
}
function informaClau2()
{
document.getElementById("id_otg").style.background = "#FFFFFF";
document.getElementById("clau").style.background = "#FFFFFF";
if(document.getElementById("clau").value == "" && document.getElementById("id_otg").value == ""){
obrirRespostaPreinscripcio();
}else{
if(document.getElementById("clau").value != "" && document.getElementById("id_otg").value == ""){
document.getElementById("id_otg").style.background = "url('web/img/validator-x.gif') no-repeat scroll 100% 50% #d6effa";
}
else if(document.getElementById("clau").value == "" && document.getElementById("id_otg").value != ""){
document.getElementById("clau").style.background = "url('web/img/validator-x.gif') no-repeat scroll 100% 50% #d6effa";
}
else{
validarClau();
}
}
}
function obrirRespostaPreinscripcio(){
Shadowbox.open({
content: creaCadena('PreinscripcioCursos.do?'),
player: "iframe",
title: "",
height: 220,
width: 370
});
}
function creaCadena(url){
cadenaForm = url;
cadenaForm += "nom_centre=" + escape(document.getElementById("nomcentre").value);
cadenaForm += "&email_centre=" + escape(document.getElementById("destinatario").value);
cadenaForm += "&email_accio=" + escape(document.getElementById("email_accio").value);
cadenaForm += "&idcurs=" + escape(document.getElementById("idcurs").value);
cadenaForm += "&id_curs=" + escape(document.getElementById("nomcurs").value);
cadenaForm += "&desc_especialitat=" + escape(document.getElementById("desc_especialitat").value);
cadenaForm += "&referencia=" + escape(document.getElementById("referencia").value);
/* CANVIS EVOLUTIU CANVI NIF CERCADOR CURSOS */
//cadenaForm += "&nif=" + escape(document.getElementById("nif").value);
/*FINAL CANVIS EVOLUTIU CANVI NIF CERCADOR CURSOS*/
cadenaForm += "&nom_usuari=" + escape(document.getElementById("nombre").value);
cadenaForm += "&cognoms_usuari=" + escape(document.getElementById("apellidos").value);
cadenaForm += "&telefon_usuari=" + escape(document.getElementById("telefono").value);
cadenaForm += "&email_usuari=" + escape(document.getElementById("email").value);
cadenaForm += "&adre_usuari=" + escape(document.getElementById("direccion").value);
cadenaForm += "&id_otg=" + escape(document.getElementById("id_otg").value);
cadenaForm += "&cifo=" + escape(document.getElementById("cifo").value);
return cadenaForm;
}
function validarClau(){
new Ajax.Request('jsp_externes/ajax/validateClauOficine.jsp?clau=' + document.getElementById("clau").value,
{
method:'get',
onSuccess: function(transport, json){
var response = transport.responseText;
if (response == "ok"){
document.getElementById('missatgeErrorClau').style.display = "none";
obrirRespostaPreinscripcio();
return true;
}else{
document.getElementById('missatgeErrorClau').style.display = "inline";
return false;
}
},
onFailure: function(){ alert('Something went wrong...') }
});
}