function pon_favoritos(){ // Texto de agradecimiento si el usuario // nos incluye en sus favoritos var agra_txt="Gracias por añadirnos a sus favoritos"; // Tomamos el nombre y version // del navegador del visitante var navegador= navigator.appVersion; var version= navigator.appVersion; if ((navegador.indexOf("MSIE") > 0) && (parseInt(version) >= 4)) { // Titulo de nuestra pagina var titulo=document.title; // URL de nuestra pagina var url=document.location.href; window.external.AddFavorite(url,titulo); alert(agra_txt); } else { alert("Esta opción sólo está disponible para Internet Explorer 4 o superior"); } } function ventanaSecundaria (URL){ window.open(URL,"ventana1","width=420,height=400,scrollbars=YES") } function sendtoafriend(idcurso){ day = new Date(); id = day.getTime(); eval("page" + id + " = window.open('enviaraunamigo.php?idcurso=' + idcurso, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=150,left = 390,top = 412');"); } function trim(cadena) { for(i=0; i=0; i=cadena.length-1) { if(cadena.charAt(i)==" ") cadena=cadena.substring(0,i); else break; } return cadena; } function sendtoafriend2(idcurso){ day = new Date(); id = day.getTime(); eval("page" + id + " = window.open('../enviaraunamigo.php?idcurso=' + idcurso, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=150,left = 390,top = 412');"); } function testform(){ var inicialmen ='LOS SIGUIENTES CAMPOS HAN DE SER CUMPLIMENTADOS:\n'; var mensaje ='\nSE HAN DETECTADO LOS SIGUIENTES ERRORES: \n'; var check=0; var check2=0; var necesarios=''; var imprime=''; var campopai =document.getElementById('d-16'); var pai = campopai.value; var obj = document.getElementById('d-1'); var campo =obj.value; campo=trim(campo); if(campo){ }else{ var necesarios = necesarios + "NOMBRE,"; var check2=1; } var obj = document.getElementById('d-2'); var campo =obj.value; campo=trim(campo); if(campo){ }else{ var necesarios = necesarios + "APELLIDOS,"; var check2=1; } var obj = document.getElementById('d-10'); var campo =obj.value; campo=trim(campo); if(campo){ }else{ var necesarios = necesarios + "DIRECCIóN,"; var check2=1; } var obj = document.getElementById('d-11'); var campo =obj.value; campo=trim(campo); if(campo){ }else{ var necesarios = necesarios + "NúMERO,"; var check2=1; } var obj = document.getElementById('d-15'); var campo =obj.value; campo=trim(campo); if(campo){ }else{ var necesarios = necesarios + "LOCALIDAD,"; var check2=1; } var obj = document.getElementById('d-3'); var campo =obj.checked; var obj2 = document.getElementById('d-4'); var campo2 =obj2.checked; if(campo || campo2){ }else{ var necesarios = necesarios + "SEXO,"; var check2=1; } var obj = document.getElementById('d-5'); var campo =obj.value; var obj2 = document.getElementById('d-6'); var campo2 =obj2.value; var obj3 = document.getElementById('d-7'); var campo3 =obj3.value; if(campo && campo2 && campo3){ }else{ var necesarios = necesarios + "FECHA DE NACIMIENTO,"; var check2=1; } var obj = document.getElementById('d-8'); var campo =obj.value; var numer =isEmail(campo); if(campo){ if(numer){ }else{ var mensaje = mensaje + 'El campo E-MAIL no tiene formato de E-mail valido.\n'; var check=1; } }else{ var necesarios = necesarios + "E-MAIL,"; var check2=1; } var obj = document.getElementById('d-9'); var campo =obj.value; var campo=campo.replace(/ /g,''); var numer =IsNumeric(campo); if(pai == 8){ var campopro =document.getElementById('d-17'); var p = campopro.value; var counttel = campo.length; if(p==0){ var pretel = true; }else{ var pretel =compruebaTelefonoProvinciaEspanola(p, campo); } if (!campo){var necesarios = necesarios + "TELéFONO,";var check2=1;}else{ if (!numer){var mensaje = mensaje + 'El campo TELéFONO ha de ser un valor numérico.\n';var check=1;}else{ if (counttel!=9){var mensaje = mensaje + 'El campo TELéFONO ha de ser un valor numérico de 9 cifras.\n';var check=1;}else{ if (!pretel){var mensaje = mensaje + 'TELéFONO no corresponde a la provincia selecionada.\n';var check=1;}else{ }}} } } var obj = document.getElementById('d-14'); var campo =obj.value; var numer =IsNumeric(campo); if(pai == 8){ var campopro =document.getElementById('d-17'); var p = campopro.value; var counttel = campo.length; var pretel =compruebaCpProvinciaEspanola(p, campo); if (!campo){var necesarios = necesarios + "C.P.,";var check2=1;}else{ if (!numer){var mensaje = mensaje + 'El campo C.P. ha de ser un valor numérico.\n';var check=1;}else{ if (counttel!=5){var mensaje = mensaje + 'El campo C.P. ha de ser un valor numérico de 5 cifras.\n';var check=1;}else{ if (!pretel){var mensaje = mensaje + 'C.P. no corresponde a la provincia selecionada.\n';var check=1;}else{ }}} } } var obj = document.getElementById('d-16'); var campo =obj.value; if(campo){ }else{ var necesarios = necesarios + "PAIS,"; var check2=1; } var obj = document.getElementById('d-17'); var campo =obj.value; if(campo==0){ var necesarios = necesarios + "PROVINCIA,"; var check2=1; } var obj = document.getElementById('d-18'); var campo =obj.value; if(campo){ }else{ var necesarios = necesarios + "NIVEL DE ESTUDIOS,"; var check2=1; } if(check2){var imprime=inicialmen + necesarios + '\n';} if(check){var imprime=imprime + mensaje;} if(imprime){ alert(imprime); return false; } } function isEmail(string) { if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) return true; else return false; } function IsNumeric(strString) // check for valid numeric strings { var strValidChars = "0123456789.-"; var strChar; var blnResult = true; if (strString.length == 0) return false; // test strString consists of valid characters listed above for (i = 0; i < strString.length && blnResult == true; i++) { strChar = strString.charAt(i); if (strValidChars.indexOf(strChar) == -1) { blnResult = false; } } return blnResult; } function findPos(obj){ var curleft = curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft curtop = obj.offsetTop while (obj = obj.offsetParent) { curleft += obj.offsetLeft curtop += obj.offsetTop } } return [curleft,curtop];} function alerta(posicion,capa){ var obj=document.getElementById(posicion); setLyr(obj,capa); if (document.getElementById(capa).style.display == 'none'){ var idcombo='d-' + '1'; document.getElementById(idcombo).focus(); document.getElementById(capa).style.display = 'block'; for (var idvi=1;idvi<26;idvi++){ var idborro='d-' + idvi; document.getElementById(idborro).style.visibility = 'hidden'; } document.getElementById('botonenvio').style.visibility = 'hidden'; }else{ document.getElementById(capa).style.display = 'none'; for (var idvi=1;idvi<26;idvi++){ var idpongo='d-' + idvi; document.getElementById(idpongo).style.visibility = 'visible'; } document.getElementById('botonenvio').style.visibility = 'visible'; cambiacomentarios(capa); } } function setLyr(obj,lyr){ var coors = findPos(obj); if (lyr == 'testP') coors[1] -= 50; var x = document.getElementById(lyr); var topcor=coors[1] - 3; var leftcor=coors[0] - 3; x.style.top = topcor + 'px'; x.style.left = leftcor + 'px'; } function sugerirestudios(){ var idcampo='d-' +'18'; var selObj = document.getElementById(idcampo); var selIndex = selObj.selectedIndex; var valorprovi = selObj.options[selIndex].value; var nomprovi = selObj.options[selIndex].text; var nomprovi2 =nomprovi.toLowerCase(); var nomprovi2 =nomprovi2.replace(/ /g,'-'); var url='../' + nomprovi2 + '/cursos-distancia-de-internet-cat22132-pag1.htm1.htm'; parent.location.href =url; } function sugerir(){ var idcampo='d-' +'17'; var selObj = document.getElementById(idcampo); var selIndex = selObj.selectedIndex; var valorprovi = selObj.options[selIndex].value; var nomprovi = selObj.options[selIndex].text; if(nomprovi == 'Seleccione'){ var nomprovi = 'a distancia'; } var nomprovi2 =nomprovi.toLowerCase(); var nomprovi2 =nomprovi2.replace(/ /g,'-'); var nomprovi2 =nomprovi2.replace(/ñ/g,'n'); var url='../' + nomprovi2 + '/cursos-distancia-de-internet-cat22132-pag1.htm'; parent.location.href =url; } function cambiacomentarios(capa){ if (capa == 'alerta'){var idcampo='d-' +'17';} if (capa == 'alertapais'){var idcampo='d-' +'16';} if (capa == 'nivelestudios'){var idcampo='d-' +'18';} var selObj = document.getElementById(idcampo); var selIndex = selObj.selectedIndex; var nomprovi = selObj.options[selIndex].text; var idcomentarios='d-' +'19'; var comentarios = document.getElementById(idcomentarios); var inicial = comentarios.value; var inicial = doublenewlines(inicial); var noexcel = document.getElementById('noexcel'); if (capa == 'alerta'){ var inicial = inicial.replace(/Aunque actualmente este curso no se imparte donde resido, me interesearía recibir iguálmente información sobre este curso.\n/,''); var inicial = doublenewlines(inicial); comentarios.value='Aunque actualmente este curso no se imparte donde resido, me interesearía recibir iguálmente información sobre este curso.\n'+ inicial; noexcel.value='1'; } if (capa == 'alertapais'){ var inicial = inicial.replace(/Aunque actualmente este curso no se imparte donde resido, me interesearía recibir iguálmente información sobre este curso.\n/,''); var inicial = doublenewlines(inicial); comentarios.value='Aunque actualmente este curso no se imparte donde resido, me interesearía recibir iguálmente información sobre este curso.\n'+ inicial; noexcel.value='1'; } if (capa == 'nivelestudios'){ var inicial = inicial.replace(/Aunque actualmente mi nivel de estudios no es el minimo requerido, me interesearía recibir iguálmente información sobre este curso.\n/,''); var inicial = doublenewlines(inicial); comentarios.value='Aunque actualmente mi nivel de estudios no es el minimo requerido, me interesearía recibir iguálmente información sobre este curso.\n'+inicial; } } function checknivelestudios(idnivel){ var nivelminimo='0'; nivel=idnivel.value; if(nivel