function creaXML(){ var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp=false; } } @else xmlhttp=false @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } } if (!xmlhttp && window.createRequest) { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; } } return xmlhttp; } function loadprovincias(pais,provincias,provincia){ xmlhttpa=creaXML(); parametrourl="/core/alertas/libs/load_province_xml.cfm?id_pais="+pais; url=parametrourl; xmlhttpa.open("GET",url,false); xmlhttpa.setRequestHeader('Accept','message/x-jl-formresult'); xmlhttpa.send(null); docXML=xmlhttpa.responseXML; nodos=docXML.getElementsByTagName('pais')[0].childNodes; cprovincia=provincias; cprovincia.length=nodos.length+2; cprovincia.options[0].text = "-- Seleccionar --"; cprovincia.options[0].value = "0"; var i=0; for(i=0;i"; else comboNextCateg.options[i+1].text = nodos[i].childNodes[0].nodeValue; comboNextCateg.options[i+1].value = nodos[i].getAttribute('id'); } // sólo mostramos las listas necesarias if (comboNextCateg.options.length==1){ comboNextCateg.style.visibility="hidden"; comboNextCateg.style.display="none"; }else{ comboNextCateg.style.display=""; comboNextCateg.style.visibility="visible"; } } function loadCategoriasOpos(comboCateg, comboNextCateg, selectedCategoria, desplegaCategoria, async) { var xmlhttpa=creaXML(); parametrourl="/core/alertas/libs/load_categ_opos_xml.cfm?id_categ="+desplegaCategoria; url=parametrourl; xmlhttpa.open("GET", url, false); xmlhttpa.setRequestHeader('Accept','message/x-jl-formresult'); xmlhttpa.send(null); docXML=xmlhttpa.responseXML; nodos=docXML.getElementsByTagName('categ'); comboNextCateg.options.selectedIndex=0; comboNextCateg.length=nodos.length+1; comboNextCateg.options[0].text = "-- Seleccionar todos --"; comboNextCateg.options[0].value = "-1"; comboNextCateg.options[0].selected = true; var i=0; for(i=0;i"; else comboNextCateg.options[i+1].text = nodos[i].childNodes[0].nodeValue; comboNextCateg.options[i+1].value = nodos[i].getAttribute('id'); //if(nodos[i].getAttribute('id')==selectedCategoria){comboNextCateg.options[i+1].selected=true;} } // sólo mostramos las listas necesarias if (comboNextCateg.options.length==1){ comboNextCateg.style.visibility="hidden"; comboNextCateg.style.display="none"; }else{ comboNextCateg.style.visibility="visible"; comboNextCateg.style.display=""; } } function loadAdministracionesOpos(comboAdmin, comboNextAdmin, selectedAdmin, desplegaAdmin, async) { var xmlhttpa=creaXML(); parametrourl="/core/alertas/libs/load_admin_xml.cfm?id_admin="+desplegaAdmin url=parametrourl; xmlhttpa.open("GET", url, false); xmlhttpa.setRequestHeader('Accept','message/x-jl-formresult'); xmlhttpa.send(null); docXML=xmlhttpa.responseXML; nodos=docXML.getElementsByTagName('admin'); comboNextAdmin.options.selectedIndex=0; comboNextAdmin.length=nodos.length+1; comboNextAdmin.options[0].text = "-- Seleccionar todas --"; comboNextAdmin.options[0].value = ""; comboNextAdmin.options[0].selected = true; var i=0; for(i=0;i"; else comboNextAdmin.options[i+1].text = nodos[i].childNodes[0].nodeValue; comboNextAdmin.options[i+1].value = nodos[i].getAttribute("id"); //if(nodos[i].getAttribute("id")==selectedAdmin){comboNextAdmin.options[i+1].selected=true;alert(selectedAdmin);} } // sólo mostramos las listas necesarias if (comboNextAdmin.options.length==1) comboNextAdmin.disabled = "disabled"; else comboNextAdmin.disabled = ""; } function validNewAlert(tipoAlerta, altafrom){ if(tipoAlerta == '4'){ this.validNewAlertFc(altafrom); } if(tipoAlerta == '2'){ this.validNewAlertMa(altafrom); } if(tipoAlerta == '5'){ this.validNewAlertConv(altafrom); } if(tipoAlerta == '6'){ this.validNewAlertSub(altafrom); } } function validUpdAlert(tipoAlerta, idAlerta){ if(tipoAlerta == '4'){ this.validUpdAlertFc(idAlerta); } if(tipoAlerta == '2'){ this.validUpdAlertMa(idAlerta); } if(tipoAlerta == '5'){ this.validUpdAlertConv(idAlerta); } if(tipoAlerta == '6'){ this.validUpdAlertSub(idAlerta); } } function validNewAlertFc(altafrom) { var tipoAlerta = 4; var to=document.getElementById("advice"); //to.innerHTML=""; if( document.getElementById('frmAlertasEmail') != null ) { mail = document.getElementById('frmAlertasEmail').value; if(mail.length == 0){ var to=document.getElementById("advice"); to.innerHTML=""; alert('Por favor, introduzca un email.'); return 0; } }else{ mail = ""; } var categ1 = -1 var categ2 = -1 var categ3 = -1 var provincia = -1 if (document.getElementById('tiposeleccion').value == '0'){ categ1 = document.getElementById('idCateg1').value; categ2 = 0; categ3 = 0; } if (document.getElementById('tiposeleccion').value == '1'){ if (!document.getElementById('idCateg1').checked && !document.getElementById('idCateg2').checked && !document.getElementById('idCateg3').checked){ var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes seleccionar una categoria de curso.'); return 0; }else{ if(document.getElementById('idCateg1').checked){ categ1 = document.getElementById('idCateg1').value }else{ categ1 = 0 } if(document.getElementById('idCateg2').checked){ categ2 = document.getElementById('idCateg2').value }else{ categ2 = 0 } if(document.getElementById('idCateg3').checked){ categ3 = document.getElementById('idCateg3').value }else{ categ3 = 0 } } } if (document.getElementById('tiposeleccion').value == '2'){ categ1 = document.getElementById('categ1combo').value; if(categ1 == '' || categ1 == '0') { var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes seleccionar una categoria de curso.'); return 0; } categ2 = 0; categ3 = 0; } if (document.getElementById('tiposeleccion').value == '3'){ if(document.getElementById('categ3combo').value > '0'){ categ1 = document.getElementById('categ3combo').value; }else if(document.getElementById('categ2combo').value > '0'){ categ1 = document.getElementById('categ2combo').value; }else{ categ1 = document.getElementById('categ1combo').value; } if(categ1 == '' || categ1 == '0' || categ1 == '-1') { var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes seleccionar una categoria de curso.'); return 0; } } if(document.getElementById('provincias').value != '0'){ provincia = document.getElementById('provincias').value; } else{ var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes seleccionar un estado.'); return 0; } var pais = document.getElementById('pais').value; //Mes var mes = document.getElementById('mes').value; //Turno var turno = document.getElementById('turno').value; var segmento = document.getElementById('segmento').value; var xmlhttpa = creaXML(); url=""; subdomain=""; url="/core/alertas/libs/fnc_act_alertas.cfm"; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var itemid = xmlObj.getElementsByTagName('response')[0]; var itemerror= xmlObj.getElementsByTagName('error')[0]; var to=document.getElementById("advice"); var boxcont = document.getElementById("cjaAlertasC"); var error = itemerror.childNodes[0].nodeValue; var errtype =itemerror.getAttribute('type'); to.innerHTML=""; if( error != -1){ alert(error); if(errtype == 3){ if(document.getElementById('myalrtslnk')){ document.getElementById('myalrtslnk').style.display='inline'; } } return 0; } else{ if(altafrom == 1){ alert('Tu alerta ha sido creada correctamente'); window.location = subdomain + '/emag_users/home_usuario/alertas/index.cfm?tipoAlerta=4&segmento='+segmento; }else{ boxcont.innerHTML = itemid.childNodes[0].nodeValue; } } } else { alert('Ha ocurrido un error durante la petición: ' + xmlhttpa.status); } } }; //alert(categ1+" "+categ2+" "+categ3); xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("mail="+escape(mail)+"&categ1="+escape(categ1)+"&categ2="+escape(categ2)+"&categ3="+escape(categ3)+"&provincia="+escape(provincia)+"&pais="+escape(pais)+"&mes="+escape(mes)+"&turno="+escape(turno)+"&segmento="+escape(segmento)+"&tipoAlerta="+tipoAlerta+"&altafrom="+altafrom); } function validNewAlertMa(altafrom) { var tipoAlerta = 2; var to=document.getElementById("advice"); //to.innerHTML=""; if( document.getElementById('frmAlertasEmail') != null ) { mail = document.getElementById('frmAlertasEmail').value; if(mail.length == 0){ var to=document.getElementById("advice"); to.innerHTML=""; alert('Por favor, introduzca un email.'); return 0; } }else{ mail = ""; } var categ1 = -1 var categ2 = -1 var categ3 = -1 var provincia = -1 //alert(document.getElementById('tiposeleccion').value); if (document.getElementById('tiposeleccion').value == '0'){ categ1 = document.getElementById('idCateg1').value; categ2 = 0; categ3 = 0; } if (document.getElementById('tiposeleccion').value == '1'){ if (!document.getElementById('idCateg1').checked && !document.getElementById('idCateg2').checked && !document.getElementById('idCateg3').checked){ var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes seleccionar una categoria de curso.'); return 0; }else{ if(document.getElementById('idCateg1').checked){ categ1 = document.getElementById('idCateg1').value }else{ categ1 = 0 } if(document.getElementById('idCateg2').checked){ categ2 = document.getElementById('idCateg2').value }else{ categ2 = 0 } if(document.getElementById('idCateg3').checked){ categ3 = document.getElementById('idCateg3').value }else{ categ3 = 0 } } } if (document.getElementById('tiposeleccion').value == '2'){ categ1 = document.getElementById('categ1combo').value; if(categ1 == '' || categ1 == '0') { var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes seleccionar una categoria de curso.'); return 0; } categ2 = 0; categ3 = 0; } if (document.getElementById('tiposeleccion').value == '3'){ if(document.getElementById('categ3combo').value > '0'){ categ1 = document.getElementById('categ3combo').value; }else if(document.getElementById('categ2combo').value > '0'){ categ1 = document.getElementById('categ2combo').value; }else{ categ1 = document.getElementById('categ1combo').value; } if(categ1 == '' || categ1 == '0' || categ1 == '-1') { var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes seleccionar una categoria de curso.'); return 0; } } if(document.getElementById('provincias').value != '0'){ provincia = document.getElementById('provincias').value; }else{ var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes seleccionar una provincia.'); return 0; } //Pais var pais = document.getElementById('pais').value; var segmento = document.getElementById('segmento').value; var xmlhttpa = creaXML(); url=""; subdomain=""; url="/core/alertas/libs/fnc_act_alertas.cfm"; subdomain = ""; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var itemid = xmlObj.getElementsByTagName('response')[0]; var itemerror= xmlObj.getElementsByTagName('error')[0]; var to=document.getElementById("advice"); var boxcont = document.getElementById("cjaAlertasC"); var error = itemerror.childNodes[0].nodeValue; var errtype =itemerror.getAttribute('type'); to.innerHTML=""; if( error != -1){ alert(error); if(errtype == 3){ if(document.getElementById('myalrtslnk')){ document.getElementById('myalrtslnk').style.display='inline'; } } return 0; } else{ if(altafrom == 1){ alert('Tu alerta ha sido creada correctamente'); window.location = subdomain + '/emag_users/home_usuario/alertas/index.cfm?tipoAlerta=2&segmento='+segmento; }else{ boxcont.innerHTML = itemid.childNodes[0].nodeValue; } } } else { alert("Ha ocurrido un error durante la petición: " + xmlhttpa.status); } } }; xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("mail="+escape(mail)+"&categ1="+escape(categ1)+"&categ2="+escape(categ2)+"&categ3="+escape(categ3)+"&provincia="+escape(provincia)+"&segmento="+escape(segmento)+"&pais="+escape(pais)+"&tipoAlerta="+tipoAlerta+"&altafrom="+altafrom); } function validNewAlertConv(altafrom) { var tipoAlerta = 5; var to=document.getElementById("advice"); //to.innerHTML=""; if( document.getElementById('frmAlertasEmail') != null ) { mail = document.getElementById('frmAlertasEmail').value; if(mail.length == 0){ var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes introducir una cuenta de e-mail'); return 0; } }else{ mail = ""; } var categ1 = -1 var categ2 = -1 var categ3 = -1 var provincia = -1 var administracion = '-1' var tipoAdmin = '-1' var chkPush = '0' if (document.getElementById('tiposeleccion').value == '0'){ categ1 = document.getElementById('idCateg1').value; categ2 = 0; categ3 = 0; } if (document.getElementById('tiposeleccion').value == '1'){ if (!document.getElementById('idCateg1').checked && !document.getElementById('idCateg2').checked && !document.getElementById('idCateg2').checked){ var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes seleccionar una categoria de oposici'+String.fromCharCode(243)+'n.'); return 0; }else{ if(document.getElementById('idCateg1').checked){ categ1 = document.getElementById('idCateg1').value }else{ categ1 = 0 } if(document.getElementById('idCateg2').checked){ categ2 = document.getElementById('idCateg2').value }else{ categ2 = 0 } if(document.getElementById('idCateg3').checked){ categ3 = document.getElementById('idCateg3').value }else{ categ3 = 0 } } } if (document.getElementById('tiposeleccion').value == '2'){ categ1 = document.getElementById('categ1combo').value; if(categ1 == '' || categ1 == '0') { var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes seleccionar una categoria de de oposici'+String.fromCharCode(243)+'n.'); return 0; } categ2 = 0; categ3 = 0; } if (document.getElementById('tiposeleccion').value == '3'){ if(document.getElementById('categ3combo').value > '0'){ categ1 = document.getElementById('categ3combo').value; }else if(document.getElementById('categ2combo').value > '0'){ categ1 = document.getElementById('categ2combo').value; }else{ categ1 = document.getElementById('categ1combo').value; } if(categ1 == '' || categ1 == '-1' || categ1 == '0') { var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes seleccionar una categoria de oposici'+String.fromCharCode(243)+'n. test'); return 0; } categ2 = 0; categ3 = 0; } if(document.getElementById('admincombo').value != ''){ administracion = document.getElementById('admincombo').value; }else{ administracion = '-1'; } if(document.getElementById('tadmincombo').value != ''){ tipoAdmin = document.getElementById('tadmincombo').value; } else{ tipoAdmin = '-1'; } if(document.getElementById('frmAlertasAcademias').checked){ chkPush = '1'; }else{ chkPush = '0'; } var segmento = document.getElementById('segmento').value; var xmlhttpa = creaXML(); url="/core/alertas/libs/fnc_act_alertas.cfm"; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var itemid = xmlObj.getElementsByTagName('response')[0]; var itemerror= xmlObj.getElementsByTagName('error')[0]; var to=document.getElementById("advice"); var boxcont = document.getElementById("cjaAlertasC"); var error = itemerror.childNodes[0].nodeValue; var errtype =itemerror.getAttribute('type'); to.innerHTML=""; if( error != -1){ alert(error); if(errtype == 3){ if(document.getElementById('myalrtslnk')){ document.getElementById('myalrtslnk').style.display='inline'; } } return 0; } else{ if(altafrom == 1){ alert('Tu alerta ha sido creada correctamente'); window.location = '/emag_users/home_usuario/alertas/index.cfm?tipoAlerta=5&segmento='+segmento; }else{ boxcont.innerHTML = itemid.childNodes[0].nodeValue; } } } else { alert("Ha ocurrido un error durante la petición: " + xmlhttpa.status); } } }; xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("mail="+escape(mail)+"&categ1="+escape(categ1)+"&categ2="+escape(categ2)+"&categ3="+escape(categ3)+"&administracion="+escape(administracion)+"&tipoAdmin="+escape(tipoAdmin)+"&chkPush="+escape(chkPush)+"&altafrom="+escape(altafrom)+"&segmento="+escape(segmento)+"&tipoAlerta="+escape(tipoAlerta)); } function validNewAlertSub(altafrom) { var tipoAlerta = 6; var to=document.getElementById("advice"); //to.innerHTML=""; if( document.getElementById('frmAlertasEmail') != null ) { var mail = document.getElementById('frmAlertasEmail').value; if(mail.length == 0){ var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes introducir una cuenta de e-mail'); return 0; } }else{ mail = ""; } //caso desempleados if (document.getElementById('frmIdTipoCurso').selectedIndex==1) { var trabajador = 0; if(document.getElementById('provincias').selectedIndex == 0) { alert("Por favor, seleccione una provincia"); return false; }else{ var provincia = document.getElementById('provincias').value; } if(document.getElementById('categ1combo').selectedIndex == 0) { alert("Por favor, seleccione una categoria"); return false; }else{ var categoria = document.getElementById('categ1combo').value; } } // Caso empleados else if (document.getElementById('frmIdTipoCurso').selectedIndex==2) { var trabajador = 1; if(document.getElementById('provincias').selectedIndex == 0) { alert("Por favor, seleccione una provincia"); return false; }else{ var provincia = document.getElementById('provincias').value; } if(document.getElementById('categ1combo').selectedIndex == 0) { alert("Por favor, seleccione una categoria"); return false; }else{ var categoria = document.getElementById('categ1combo').value; } } else { alert("Por favor, selecciona tu estado laboral"); return false; } var bonificado = document.getElementById('bonificado').value; if(bonificado < 0){ alert("Por favor, selecciona un tipo de alerta"); return false; } var frmIdSector = document.getElementById('frmIdCnae').value; var segmento = document.getElementById('segmento').value; var xmlhttpa = creaXML(); url="/core/alertas/libs/fnc_act_alertas.cfm"; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var itemid = xmlObj.getElementsByTagName('response')[0]; var itemerror= xmlObj.getElementsByTagName('error')[0]; var to=document.getElementById("advice"); var boxcont = document.getElementById("cjaAlertasC"); var error = itemerror.childNodes[0].nodeValue; var errtype =itemerror.getAttribute('type'); to.innerHTML=""; if( error != -1){ alert(error); if(errtype == 3){ if(document.getElementById('myalrtslnk')){ document.getElementById('myalrtslnk').style.display='inline'; } } return 0; } else{ if(altafrom == 1){ alert('Tu alerta ha sido creada correctamente'); window.location = '/emag_users/home_usuario/alertas/index.cfm?tipoAlerta=6&segmento='+segmento; }else{ boxcont.innerHTML = itemid.childNodes[0].nodeValue; } } } else { alert("Ha ocurrido un error durante la petici"+String.fromCharCode(243)+"n: " + xmlhttpa.status); } } }; xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("mail="+escape(mail)+"&categoria="+escape(categoria)+"&provincia="+escape(provincia)+"§or="+escape(frmIdSector)+"&trabajador="+escape(trabajador)+"&altafrom="+escape(altafrom)+"&segmento="+escape(segmento)+"&tipoAlerta="+escape(tipoAlerta)+"&bonificado="+escape(bonificado)); } function editAlert(url,type){ } function scrollToCoordinates(pos) { } function validUpdAlertFc(idAlert) { var tipoalerta = 4; if(document.getElementById('categ3comboUpd').value > '0'){ var categ1 = document.getElementById('categ3comboUpd').value; }else if(document.getElementById('categ2comboUpd').value > '0'){ var categ1 = document.getElementById('categ2comboUpd').value; }else{ var categ1 = document.getElementById('categ1comboUpd').value; } if(categ1 == '' || categ1 == '-1') { alert('Debes seleccionar una categoria.'); return 0; } if(document.getElementById('paisUpd').value != '0' ){ var pais = document.getElementById('paisUpd').value; }else{ alert('Debes seleccionar un país.'); return 0; } if(document.getElementById('provinciasUpd').value != '0'){ var provincia = document.getElementById('provinciasUpd').value; } else{ alert('Debes seleccionar un estado.'); return 0; } var mes = document.getElementById('frmMesUpd').value; var turno = document.getElementById('frmTurnoUpd').value; var segmento = document.getElementById('segmentoUpd').value; var xmlhttpa = creaXML(); url = ""; subdomain = ""; url="/core/alertas/libs/fnc_upd_alertas.cfm"; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var itemid = xmlObj.getElementsByTagName('response')[0]; var itemerror= xmlObj.getElementsByTagName('error')[0]; var to=document.getElementById("advice"); var error = itemerror.childNodes[0].nodeValue; to.innerHTML=""; if( error != -1){ alert(error); return 0; } else{ window.location = subdomain + '/emag_users/home_usuario/alertas/index.cfm?tipoAlerta='+tipoalerta+'&segmento='+segmento; } } else { alert('Ha ocurrido un error durante la petición: ' + xmlhttpa.status); } } }; xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("idAlerta="+idAlert+"&categ1="+escape(categ1)+"&provincia="+escape(provincia)+"&pais="+escape(pais)+"&mes="+escape(mes)+"&turno="+escape(turno)+"&segmento="+escape(segmento)+"&tipoAlerta="+tipoalerta); } function validUpdAlertMa(idAlert) { var tipoalerta = 2; if(document.getElementById('categ3comboUpd').value > '0'){ var categ1 = document.getElementById('categ3comboUpd').value; }else if(document.getElementById('categ2comboUpd').value > '0'){ var categ1 = document.getElementById('categ2comboUpd').value; }else{ var categ1 = document.getElementById('categ1comboUpd').value; } if(categ1 == '' || categ1 == '-1') { alert('Debes seleccionar una categoria.'); return 0; } if(document.getElementById('paisUpd').value != '0' ){ var pais = document.getElementById('paisUpd').value; }else{ alert('Debes seleccionar un pais.'); return 0; } if(document.getElementById('provinciasUpd').value != '0'){ var provincia = document.getElementById('provinciasUpd').value; } else{ alert('Debes seleccionar una provincia.'); return 0; } var segmento = document.getElementById('segmentoUpd').value; var xmlhttpa = creaXML(); url = ""; subdomain = ""; url="/core/alertas/libs/fnc_upd_alertas.cfm"; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var itemid = xmlObj.getElementsByTagName('response')[0]; var itemerror= xmlObj.getElementsByTagName('error')[0]; var to=document.getElementById("advice"); var error = itemerror.childNodes[0].nodeValue; to.innerHTML=""; if( error != -1){ alert(error); return 0; } else{ window.location = subdomain + '/emag_users/home_usuario/alertas/index.cfm?tipoAlerta='+tipoalerta+'&segmento='+segmento; } } else { alert("Ha ocurrido un error durante la petición: " + xmlhttpa.status); } } }; xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("idAlerta="+idAlert+"&categ1="+escape(categ1)+"&provincia="+escape(provincia)+"&pais="+escape(pais)+"&segmento="+escape(segmento)+"&tipoAlerta="+tipoalerta); } function ocumail(){ divvmas = document.getElementById('alertVMas'); divfrmmail = document.getElementById('frmAlertasEmail'); tdtitlemail = document.getElementById('frmtitlemail'); if(GetCookie('EM_SESSIONINFO_UNI')){ divvmas.style.display='none'; divfrmmail.style.display='none'; divfrmmail.value = -1; tdtitlemail.style.display='none'; } } function validUpdAlertConv(idAlert) { var tipoalerta = 5; if(document.getElementById('categ3comboUpd').value > '0'){ var categ1 = document.getElementById('categ3comboUpd').value; }else if(document.getElementById('categ2comboUpd').value > '0'){ var categ1 = document.getElementById('categ2comboUpd').value; }else{ var categ1 = document.getElementById('categ1comboUpd').value; } if(categ1 == '' || categ1 == '-1') { alert('Debes seleccionar una categoria de oposici'+String.fromCharCode(243)+'n.'); return 0; } if(document.getElementById('adminComboUpd').value != ''){ var administracion = document.getElementById('adminComboUpd').value; }else{ var administracion = '-1'; } if(document.getElementById('tadminComboUpd').value != ''){ var tipoAdmin = document.getElementById('tadminComboUpd').value; } else{ var tipoAdmin = '-1'; } var segmento = document.getElementById('segmentoUpd').value; var xmlhttpa = creaXML(); url="/core/alertas/libs/fnc_upd_alertas.cfm"; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var itemid = xmlObj.getElementsByTagName('response')[0]; var itemerror= xmlObj.getElementsByTagName('error')[0]; var to=document.getElementById("advice"); var error = itemerror.childNodes[0].nodeValue; to.innerHTML=""; if( error != -1){ alert(error); return 0; } else{ window.location = '/emag_users/home_usuario/alertas/index.cfm?tipoAlerta='+tipoalerta+'&segmento='+segmento; } } else { alert("Ha ocurrido un error durante la petición: " + xmlhttpa.status); } } }; xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("idAlerta="+idAlert+"&categ1="+escape(categ1)+"&administracion="+escape(administracion)+"&tipoAdmin="+escape(tipoAdmin)+"&segmento="+escape(segmento)+"&tipoAlerta="+tipoalerta); } function validUpdAlertSub(idAlerta) { var tipoAlerta = 6; var to=document.getElementById("advice"); //to.innerHTML=""; if( document.getElementById('frmAlertasEmail') != null ) { var mail = document.getElementById('frmAlertasEmail').value; if(mail.length == 0){ var to=document.getElementById("advice"); to.innerHTML=""; alert('Debes introducir una cuenta de e-mail'); return 0; } }else{ var mail = ""; } //Caso desempleados if (document.getElementById('frmIdTipoCursoUpd').selectedIndex==1) { var trabajador = 0; if(document.getElementById('provinciasUpd').selectedIndex == 0) { alert("Por favor, seleccione una provincia"); return false; }else{ var provincia = document.getElementById('provinciasUpd').value; } if(document.getElementById('categ1comboUpd').selectedIndex == 0) { alert("Por favor, seleccione una categoria"); return false; }else{ var categoria = document.getElementById('categ1comboUpd').value; } if(document.getElementById('provinciasUpd').selectedIndex == 1) { alert("Lo sentimos, de momento no existen cursos online o a distancia para desempleados."); return false; } } // Caso empleados else if (document.getElementById('frmIdTipoCursoUpd').selectedIndex==2) { var trabajador = 1; if(document.getElementById('provinciasUpd').selectedIndex == 0) { alert("Por favor, seleccione una provincia"); return false; }else{ var provincia = document.getElementById('provinciasUpd').value; } if(document.getElementById('categ1comboUpd').selectedIndex == 0) { alert("Por favor, seleccione una categoria"); return false; }else{ var categoria = document.getElementById('categ1comboUpd').value; } } else { alert("Por favor, selecciona tu estado laboral"); return false; } var bonificado = document.getElementById('bonificado').value; if(bonificado < 0){ alert("Por favor, selecciona un tipo de alerta"); return false; } var frmIdSector = document.getElementById('frmIdCnaeUpd').value; var segmento = document.getElementById('segmentoUpd').value; var xmlhttpa = creaXML(); url="/core/alertas/libs/fnc_upd_alertas.cfm"; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var itemid = xmlObj.getElementsByTagName('response')[0]; var itemerror= xmlObj.getElementsByTagName('error')[0]; var to=document.getElementById("advice"); var boxcont = document.getElementById("cjaAlertasC"); var error = itemerror.childNodes[0].nodeValue; var errtype =itemerror.getAttribute('type'); to.innerHTML=""; if( error != -1){ alert(error); if(errtype == 3){ if(document.getElementById('myalrtslnk')){ document.getElementById('myalrtslnk').style.display='inline'; } } return 0; } else{ window.location = '/emag_users/home_usuario/alertas/index.cfm?tipoAlerta=6&segmento='+segmento; } } else { alert("Ha ocurrido un error durante la petici"+String.fromCharCode(243)+"n: " + xmlhttpa.status); } } }; xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("mail="+escape(mail)+"&categoria="+escape(categoria)+"&provincia="+escape(provincia)+"§or="+escape(frmIdSector)+"&trabajador="+escape(trabajador)+"&tipoAlerta="+escape(tipoAlerta)+"&segmento="+escape(segmento)+"&idAlerta="+escape(idAlerta)+"&bonificado="+escape(bonificado)); } function deleteAlerta(idAlert,tipoAlerta,segmento) { var xmlhttpa = creaXML(); url="/core/alertas/libs/fnc_del_alertas.cfm"; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var itemid = xmlObj.getElementsByTagName('response')[0]; var itemerror= xmlObj.getElementsByTagName('error')[0]; var to=document.getElementById("advice"); var error = itemerror.childNodes[0].nodeValue; to.innerHTML=""; if( error != -1){ alert(error); return 0; } else{ window.location = '/emag_users/home_usuario/alertas/index.cfm?tipoAlerta='+tipoAlerta+'&segmento='+segmento; } } else { alert('Ha ocurrido un error durante la petición:' + xmlhttpa.status); } } }; xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); if (confirm('¿Estás seguro de que quieres eliminar la alerta?')){ xmlhttpa.send("idAlerta="+idAlert); } } function deleteAlertaMail(idAlert,tipoAlerta,segmento) { var xmlhttpa = creaXML(); url="/core/alertas/libs/fnc_del_alertas.cfm"; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var itemid = xmlObj.getElementsByTagName('response')[0]; var itemerror= xmlObj.getElementsByTagName('error')[0]; var to=document.getElementById("advice"); var error = itemerror.childNodes[0].nodeValue; to.innerHTML=""; if( error != -1){ alert(error); return 0; } else{ alert('Tu alerta ha sido eliminada correctamente'); window.location = '/emag_users/home_usuario/alertas/index.cfm?tipoAlerta='+tipoAlerta+'&segmento='+segmento; } } else { alert('Ha ocurrido un error durante la petición:' + xmlhttpa.status); } } }; xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("idAlerta="+idAlert); } function showAlertsToggle(type){ divElem = document.getElementById('cjaAlertasC'); divElemTop = document.getElementById('cjaAlertasTop'); if(divElem.style.display == 'none'){ divElem.style.display = ''; divElemTop.style.borderTop = '1px solid #CCCCCC'; if(type == 4){ divElemTop.style.background = '#FEEEDC'; } if(type == 2){ divElemTop.style.background = '#FEF2F2'; } }else{ divElem.style.display = 'none'; divElemTop.style.border = '0px'; divElemTop.style.background = 'none'; } } function showAlertsToggle2(){ imgElem = document.getElementById('alerts_arrow'); divElem = document.getElementById('cjaAlertasB'); if(divElem.style.display == 'none'){ divElem.style.display = ''; imgElem.src='/emag_users/alertas/images/uarrow.gif'; }else{ divElem.style.display = 'none'; imgElem.src = '/emag_users/alertas/images/darrow.gif'; } } // Manda la alerta desde la pagina de curso, tiene diferentes validaciones function send_alert_from_curso(){ // Comprobar cada uno de los campos que se envie correctamente var form = document.alertform; var to=document.getElementById("advice"); var mail = ""; try{ mail = form.mail.value; } catch(e){ mail = ""; } if(document.getElementById('chk_precio').checked == false && document.getElementById('chk_fecha').checked == false && document.getElementById('chk_push').checked == false){ alert('Debes seleccionar un tipo de alerta.'); return 0; } else { if (document.getElementById('chk_precio').checked == true){ chkPrecio='1'; }else{ chkPrecio='0'; } if (document.getElementById('chk_fecha').checked == true){ chkFecha='1'; }else{ chkFecha='0'; } if (document.getElementById('chk_push').checked == true){ chkPush='1'; }else{ chkPush='0'; } } var suscritoPush = form.suscritoPush.value; var suscritoAlerta = form.suscritoAlerta.value; var frmIdProvincia = form.frmIdProvincia.value; var frmIdCateg = form.frmIdCateg.value; // Si todo ok -> Envio con ajax var xmlhttpa = creaXML(); url="/emag_users/alertas/act_new_alert_pcurso.cfm?"; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var itemid = xmlObj.getElementsByTagName('response')[0]; var itemerror= xmlObj.getElementsByTagName('error')[0]; var to=document.getElementById("advice"); var boxcont1 = document.getElementById("alertas"); var boxcont2 = document.getElementById("push"); var boxcont3 = document.getElementById("todo"); var boxcont4 = document.getElementById("botonsusc"); var error = itemerror.childNodes[0].nodeValue; var errtype =itemerror.getAttribute('type'); to.innerHTML=""; if( error != -1 && error != -2 && error != -3){ alert(error); return 0; } else{ if(error == -1){ //Suscripcion a las alertas if(suscritoPush == '1'){ boxcont4.style.display = 'none'; } form.suscritoAlerta.value = '1'; boxcont1.innerHTML = itemid.childNodes[0].nodeValue; } if(error == -2){ // Suscripcion al push if(suscritoAlerta == '1'){ boxcont4.style.display = 'none'; } form.suscritoPush.value = '1'; boxcont2.innerHTML = itemid.childNodes[0].nodeValue; } if(error == -3){ //Suscripcion a todo boxcont3.innerHTML = itemid.childNodes[0].nodeValue; } } } else { alert('Ha ocurrido un error durante la petición:' + xmlhttpa.status); } } }; xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("frmIdProvincia="+frmIdProvincia+"&frmIdCateg="+frmIdCateg+"&chkPrecio="+chkPrecio+"&chkFecha="+chkFecha+"&chkPush="+chkPush+"&mail="+mail); } function showNavigatorLayerAlertas(objeto,idLayer,masancho,segmento,categ,evento){ sumancho=masancho?40:0; presion(objeto); totcint=document.getElementById(idLayer).getElementsByTagName("div"); resta=(totcint[totcint.length-1].childNodes.length>1)?2:3; totcinto=totcint.length-parseInt(resta); multiplo=(document.all?135:125)+sumancho; document.getElementById(idLayer).style.display=(document.getElementById(idLayer).style.display =='none')?'':'none'; objactual=document.getElementById(idLayer) try{ if(objanterior && objanterior!=objactual){objanterior.style.display='none';} }catch(err){} objanterior=objactual; if(categ >= -1){ metrix(evento,segmento,'',categ,'','','http://metrix.emagister.com/','1','1','1','0'); } } function showFormularioAlertasAjax(objeto,idLayer){ document.getElementById(idLayer).style.display=(document.getElementById(idLayer).style.display =='none')?'':'none'; imgElem = document.getElementById('alerts_arrow'); if(document.getElementById(idLayer).style.display =='none'){ imgElem.src='/emag_users/home_usuario/alertas/images/darrow.gif'; }else{ imgElem.src = '/emag_users/home_usuario/alertas/images/uarrow.gif'; } } function showAlertListaCursos(idCateg1,idCateg2,idCateg3,prov,from,type,altafrom,pais,segmento) { //alert(idCateg1+" "+idCateg2+" "+idCateg3) ; var to=document.getElementById("cajaalertas"); var xmlhttpa = creaXML(); url="/emag_users/home_usuario/alertas/ajax/index.cfm"; xmlhttpa.open("POST", url, false); xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("categ1="+escape(idCateg1)+"&categ2="+escape(idCateg2)+"&categ3="+escape(idCateg3)+"&provincia="+escape(prov)+"&from="+escape(from)+"&tipoAlerta="+escape(type)+"&altafrom="+escape(altafrom)+"&segmento="+escape(segmento)+"&pais="+escape(pais)); if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var boxcont = document.getElementById("cajaalertas"); to.innerHTML=xmlhttpa.responseText; } else { alert('Ha ocurrido un error durante la petición:' + xmlhttpa.status); } } } function showAlertListaCursosSub(idCateg1,idCateg2,idCateg3,prov,from,type,altafrom,pais,trabajador,segmento) { //alert(idCateg1+" "+idCateg2+" "+idCateg3) ; var to=document.getElementById("cajaalertas"); var xmlhttpa = creaXML(); url="/emag_users/home_usuario/alertas/ajax/index.cfm"; xmlhttpa.open("POST", url, false); xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("categ1="+escape(idCateg1)+"&categ2="+escape(idCateg2)+"&categ3="+escape(idCateg3)+"&segmento="+escape(segmento)+"&provincia="+escape(prov)+"&from="+escape(from)+"&tipoAlerta="+escape(type)+"&altafrom="+escape(altafrom)+"&pais="+escape(pais)+"&trabajador="+escape(trabajador)); if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var boxcont = document.getElementById("cajaalertas"); to.innerHTML=xmlhttpa.responseText; } else { alert("Ha ocurrido un error durante la petición: " + xmlhttpa.status); } } } function showAlertListaCursosConv(idCateg1,idCateg2,idCateg3,prov,from,type,altafrom,pais,administracion,tipoAdmin,segmento) { //alert(idCateg1+" "+idCateg2+" "+idCateg3) ; var to=document.getElementById("cajaalertas"); var xmlhttpa = creaXML(); url="/emag_users/home_usuario/alertas/ajax/index.cfm"; xmlhttpa.open("POST", url, false); xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("categ1="+escape(idCateg1)+"&categ2="+escape(idCateg2)+"&categ3="+escape(idCateg3)+"&segmento="+escape(segmento)+"&provincia="+escape(prov)+"&from="+escape(from)+"&tipoAlerta="+escape(type)+"&altafrom="+escape(altafrom)+"&pais="+escape(pais)+"&administracion="+escape(administracion)+"&tipoAdmin="+escape(tipoAdmin)); if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { to.innerHTML=xmlhttpa.responseText; } else { alert("Ha ocurrido un error durante la petición: " + xmlhttpa.status); } } } function setfocus(){ document.getElementById("chkFechaUpd").focus(); } function metrix(evt,seg,lPuentes,idCateg,pos,totalResults,urlMetrix,idSite,x,y,z){ var imgName = "spy"+Math.round(Math.random()*1000); window[imgName]=new Image(1,1); var cPuente = GetCookie("C_ID_PUENTE"); var p=(cPuente && (lPuentes == '' || lPuentes == '-1'))?cPuente:lPuentes; var q =( (typeof(luceneQueryString)!= "undefined") ?luceneQueryString:''); if (typeof(totalResults)== "undefined") totalResults = ''; if (typeof(urlMetrix)== "undefined") urlMetrix = 'http://metrix.emagister.com/'; if (typeof(idSite)== "undefined") idSite = '1'; if (typeof(x)== "undefined") x = '1'; if (typeof(y)== "undefined") y = ''; if (typeof(y)== "undefined") z = ''; window[imgName].src=urlMetrix+'EmagStatsWebApp/stats?site='+idSite+'&evt='+evt+'&seg='+seg+'&x='+x+'&y='+y+'&z='+z+'&org='+recCooPFvalor('PFICHAORIGEN')+'&id='+p+'&q='+q+'&cat='+idCateg+"&pos="+pos+"&tr="+totalResults+"&sid="+GetCookie("CFID")+"_"+GetCookie("CFTOKEN"); return true; } function select_combos_sub(tipo){ if(tipo == 1){ if (document.getElementById('frmIdTipoCurso').selectedIndex==1) { document.getElementById('alert_trab').style.display="none"; document.getElementById('alert_trab2').style.display="none"; } else if (document.getElementById('frmIdTipoCurso').selectedIndex==2) { document.getElementById('alert_trab').style.display="block"; document.getElementById('alert_trab2').style.display="block"; } else { document.getElementById('alert_trab').style.display="none"; document.getElementById('alert_trab2').style.display="none"; } }else{ if (document.getElementById('frmIdTipoCursoUpd').selectedIndex==1) { document.getElementById('alert_trabUpd').style.display="none"; document.getElementById('alert_trab2Upd').style.display="none"; } else if (document.getElementById('frmIdTipoCursoUpd').selectedIndex==2) { document.getElementById('alert_trabUpd').style.display="block"; document.getElementById('alert_trab2Upd').style.display="block"; } else { document.getElementById('alert_trabUpd').style.display="none"; document.getElementById('alert_trab2Upd').style.display="none"; } } return true; } function validAlertCaducado(){ // Comprobar cada uno de los campos que se envie correctamente var form = document.alertformcaducados; var mail = ""; try{ mail = form.mail.value; } catch(e){ mail = ""; } if(document.getElementById('chk_visible').checked == false && document.getElementById('chk_cursos').checked == false){ alert('Debes seleccionar un tipo de alerta.'); return 0; } else { if (document.getElementById('chk_visible').checked == true){ chkVisible='1'; }else{ chkVisible='0'; } if (document.getElementById('chk_cursos').checked == true){ chkCursos='1'; }else{ chkCursos='0'; } } var frmLinkCentro = form.frmLinkCentro.value; var frmIdProvincia = form.frmIdProvincia.value; var frmIdCateg = form.frmIdCateg.value; var frmIdPuente = form.frmIdPuente.value + ""; var frmIdCentro = form.frmIdCentro.value + ""; var frmIdCurso = form.frmIdCurso.value + ""; var type = form.type.value; var tipocurso = form.tipocurso.value; var segmento = form.segmento.value; // Si todo ok -> Envio con ajax var xmlhttpa = creaXML(); url="/core/alertas/libs/fnc_act_new_alert_caducados.cfm?"; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var itemid = xmlObj.getElementsByTagName('response')[0]; var itemerror= xmlObj.getElementsByTagName('error')[0]; var to=document.getElementById("advice"); var error = itemerror.childNodes[0].nodeValue; var errtype =itemerror.getAttribute('type'); //to.innerHTML=""; if( error != -1 && error != -2 && error != -3){ alert(error); return 0; } else{ if(error == -1){ //Suscripcion a las alertas window.location = "/emag_users/solicitudes/index.cfm?action=vc_matricula_cerrada&id_centro=" + frmIdCentro + "&id_puente=" + frmIdPuente+ "&id_curso=" + frmIdCurso+ "&chk_visible=" + chkVisible+ "&chk_cursos=" + chkCursos; } } } else { alert('Ha ocurrido un error durante la petición:' + xmlhttpa.status); } } }; xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("frmIdProvincia="+frmIdProvincia+"&frmIdCateg="+frmIdCateg+"&chkVisible="+chkVisible+"&chkCursos="+chkCursos+"&mail="+mail+"&frmIdPuente="+frmIdPuente+"&type="+type+"&tipocurso="+tipocurso+"&frmIdCentro="+frmIdCentro+"&frmLinkCentro="+frmLinkCentro+"&segmento="+segmento); } function showPcursoAlertCaducado(prov,categ,idPuente,idCentro,segmento,tipocurso,descCentro,idBusquedaCentro,idCurso) { var to=document.getElementById("cajasuscripcaducado"); var xmlhttpa = creaXML(); url="/emag_users/home_usuario/alertas/ajax_caducados/index.cfm"; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var boxcont = document.getElementById("cajasuscripcaducado"); to.innerHTML=xmlhttpa.responseText; } else { alert('Ha ocurrido un error durante la petición:' + xmlhttpa.status); } } }; xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("categ="+escape(categ)+"&prov="+escape(prov)+"&segmento="+escape(segmento)+"&idPuente="+escape(idPuente)+"&idCentro="+escape(idCentro)+"&tipocurso="+escape(tipocurso)+"&descCentro="+escape(descCentro)+"&idBusquedaCentro="+escape(idBusquedaCentro)+"&idCurso="+escape(idCurso)); } function showAlertFormularioAjax(categoria,provincia,administracion,tipoadmin,tipoalerta,segmento,altafrom,mes,turno,logado,idAlerta,showMes,showTurno,action,trabajador,sector) { var to=document.getElementById("cajaformularioajax"); var xmlhttpa = creaXML(); url="/emag_users/home_usuario/alertas/ajax_formulario/index.cfm"; xmlhttpa.open("POST", url, true); xmlhttpa.onreadystatechange=function() { if(xmlhttpa.readyState == 4) { if(xmlhttpa.status == 200) { var xmlObj = xmlhttpa.responseXML; var boxcont = document.getElementById("cajaformularioajax"); to.innerHTML=xmlhttpa.responseText; } else { alert('Ha ocurrido un error durante la petición:' + xmlhttpa.status); } } }; xmlhttpa.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttpa.send("categoria="+escape(categoria)+"&provincia="+escape(provincia)+"&administracion="+escape(administracion)+"&tipoadmin="+escape(tipoadmin)+"&tipoalerta="+escape(tipoalerta)+"&segmento="+escape(segmento)+"&altafrom="+escape(altafrom)+"&mes="+escape(mes)+"&turno="+escape(turno)+"&logado="+escape(logado)+"&idAlerta="+escape(idAlerta)+"&showMes="+escape(showMes)+"&showTurno="+escape(showTurno)+"&action="+escape(action)+"&trabajador="+escape(trabajador)+"§or="+escape(sector)); }