// ------------------------------------------------------------------------ // Inicio FUNCIONES GENERALES // ------------------------------------------------------------------------ // // Función general que valida un login // function validateLogin(l){ reg = /[^-_a-zA-Z0-9]/; return !reg.test(l); // TRUE si es correcto, FALSE en caso contrario } // // Función general que valida un teléfono // function validateTelephone(t){ reg = /[^0-9]/; return !reg.test(t); // TRUE si es correcto, FALSE en caso contrario } // // Función general que valida un email // function validateEmail(e){ reg = /^[-_.a-zA-Z0-9]+@[-_.a-zA-Z0-9]+\.[a-zA-Z]+(\.[a-zA-Z]+)*$/ return reg.test(e); // TRUE si es correcto, FALSE en caso contrario } // // Función general que valida un antispam // function validateAntiSpam(a, k){ if (a == k){ return true; } else { return false; } } // ------------------------------------------------------------------------ // Fin FUNCIONES GENERALES // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // Inicio FUNCIONES SECCION CONTACTOS // ------------------------------------------------------------------------ // // Funcion de la sección CONTACTOS que muestra u oculta los TR no necesarios en ese momento // function hiddeContactsTR(opcion){ TR_Incidencia = document.getElementById('ID_TR_Incidencia'); TR_Sugerencia = document.getElementById('ID_TR_Sugerencia'); idMotivo = document.getElementById('idTextoMotivo'); if (opcion.value == 'inc'){ TR_Incidencia.style.display = ''; TR_Sugerencia.style.display = 'none'; idMotivo.value = opcion.options[0].text; } else if (opcion.value == 'sug'){ TR_Incidencia.style.display = 'none'; TR_Sugerencia.style.display = ''; idMotivo.value = opcion.options[1].text; } else { TR_Incidencia.style.display = 'none'; TR_Sugerencia.style.display = 'none'; idMotivo.value = opcion.options[2].text; } } // // Función que valida los campos del formulario CONTACTOS // function validateContactForm(f){ // Validación relleno de todos los campos if (!f.login.value.length || !f.email.value.length || !f.comentarios.value.length){ // Comprobación de campos vacios alert(_JS_TEXTOS['CONTACTA_CAMPO_VACIO']); return false; } // Validación del login if (!validateLogin(f.login.value)){ alert(_JS_TEXTOS['CONTACTA_LOGIN_INCORRECTO']); document.getElementById('contacto_login_error').style.display = ''; document.getElementById('contacto_span_login_error').style.visibility = 'visible'; f.login.focus(); return false; } else { document.getElementById('contacto_login_error').style.display = 'none'; document.getElementById('contacto_span_login_error').style.visibility = 'hidden'; } // Validación de email if (!validateEmail(f.email.value)){ alert(_JS_TEXTOS['CONTACTA_EMAIL_INCORRECTO']); document.getElementById('contacto_email_error').style.display = ''; document.getElementById('contacto_span_email_error').style.visibility = 'visible'; f.email.focus(); return false; } else { document.getElementById('contacto_email_error').style.display = 'none'; document.getElementById('contacto_span_email_error').style.visibility = 'hidden'; } // Validación de teléfono if (!validateTelephone(f.telefono.value)){ // Comprobación de espacios en blanco alert(_JS_TEXTOS['CONTACTA_TELEFONO_INCORRECTO']); document.getElementById('contacto_telefono_error').style.display = ''; document.getElementById('contacto_span_telefono_error').style.visibility = 'visible'; f.telefono.focus(); return false; } else { document.getElementById('contacto_telefono_error').style.display = 'none'; document.getElementById('contacto_span_telefono_error').style.visibility = 'hidden'; } document.getElementById('contacto_boton').style.display = 'none'; document.getElementById('contacto_enviando').style.display = ''; return true; } // ------------------------------------------------------------------------ // Fin FUNCIONES SECCION CONTACTOS // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // Inicio FUNCIONES SECCION REGISTRO // ------------------------------------------------------------------------ // // Función que valida los campos del formulario REGISTRO // function validateRegisterForm(f){ // Validación relleno de todos los campos if (!f.nombre.value.length || !f.apellidos.value.length || !f.login.value.length || !f.password.value.length || !f.repassword.value.length || !f.email.value.length){ // Comprobación de campos vacios alert(_JS_TEXTOS['REGISTRO_CAMPO_VACIO']); return false; } // Validación del password y repetición de password if (f.password.value != f.repassword.value || f.password.value.length<5){ if (f.password.value != f.repassword.value){ alert(_JS_TEXTOS['REGISTRO_PASSWORDS_DISTINTOS']); } else { alert(_JS_TEXTOS['REGISTRO_PASSWORD_INCORRECTO']); } document.getElementById('registro_password_error').style.display = ''; document.getElementById('registro_span_password_error').style.visibility = 'visible'; document.getElementById('registro_span_repassword_error').style.visibility = 'visible'; f.password.value = ''; f.repassword.value = ''; f.password.focus(); return false; } else { document.getElementById('registro_password_error').style.display = 'none'; document.getElementById('registro_span_password_error').style.visibility = 'hidden'; document.getElementById('registro_span_repassword_error').style.visibility = 'hidden'; } // Validación de email if (!validateEmail(f.email.value)){ alert(_JS_TEXTOS['REGISTRO_EMAIL_INCORRECTO']); document.getElementById('registro_email_error').style.display = ''; document.getElementById('registro_span_email_error').style.visibility = 'visible'; f.email.focus(); return false; } else { document.getElementById('registro_email_error').style.display = 'none'; document.getElementById('registro_span_email_error').style.visibility = 'hidden'; } // Validación de antispam if (!validateAntiSpam(f.antispam.value, f.antispamkeys.value)){ alert(_JS_TEXTOS['REGISTRO_ANTISPAM_INCORRECTO']); document.getElementById('registro_antispam_error').style.display = ''; document.getElementById('registro_span_antispam_error').style.visibility = 'visible'; f.antispam.focus(); return false; } else { document.getElementById('registro_antispam_error').style.display = 'none'; document.getElementById('registro_span_antispam_error').style.visibility = 'hidden'; } // Validación del login if (!checkRegisterLogin(f.login.value, 0, 1)){ return false; } return true; } // // Función que valida los campos del formulario REGISTRO // function validateRegisterForm2(f){ // Validación relleno de todos los campos if (!f.login.value.length || !f.password.value.length || !f.repassword.value.length || !f.email.value.length){ // Comprobación de campos vacios alert(_JS_TEXTOS['REGISTRO_CAMPO_VACIO']); return false; } // Validación del password y repetición de password if (f.password.value != f.repassword.value || f.password.value.length<5){ if (f.password.value != f.repassword.value){ alert(_JS_TEXTOS['REGISTRO_PASSWORDS_DISTINTOS']); } else { alert(_JS_TEXTOS['REGISTRO_PASSWORD_INCORRECTO']); } f.password.value = ''; f.repassword.value = ''; f.password.focus(); return false; } if (!validateEmail(f.email.value)){ alert(_JS_TEXTOS['REGISTRO_EMAIL_INCORRECTO']); f.email.focus(); return false; } // Validación de antispam /*if (!validateAntiSpam(f.antispam.value, f.antispamkeys.value)){ alert(_JS_TEXTOS['REGISTRO_ANTISPAM_INCORRECTO']); document.getElementById('registro_antispam_error').style.display = ''; document.getElementById('registro_span_antispam_error').style.visibility = 'visible'; f.antispam.focus(); return false; } else { document.getElementById('registro_antispam_error').style.display = 'none'; document.getElementById('registro_span_antispam_error').style.visibility = 'hidden'; }*/ // Validación del login if (!checkRegisterLogin(f.login.value, 0, 1)){ return false; } return true; } // // Función que comprueba si el LOGIN es único // function checkRegisterLogin(login, showAlert, enviar){ if (login==''){ alert(_JS_TEXTOS['REGISTRO_LOGIN_VACIO']); } else { if (!validateLogin(login)){ alert(_JS_TEXTOS['REGISTRO_LOGIN_F_INCORRECTO']); document.getElementById('registro_login_error').style.display = ''; //document.getElementById('registro_span_login_error').style.visibility = 'visible'; return false; } var options = { url: '/sections/register/checkLogins.php', queryVars: {login: login}, method: 'POST', showLoading: true, loadingImg: '/img/v2/public/ajax_loader.gif', async: false, handler: showIsRegistered, handlerVars: [showAlert, enviar], responseType: 'text' }; ajaxSendRequest(options); } } // // Función que comprueba si el EMAIL es único // function checkRegisterEmail(email, showAlert, enviar){ if (email==''){ alert(_JS_TEXTOS['REGISTRO_EMAIL_VACIO']); } else { if (!validateEmail(email)){ alert(_JS_TEXTOS['REGISTRO_EMAIL_F_INCORRECTO']); return false; } var options = { url: '/sections/register/checkEmail.php', queryVars: {email: email}, method: 'POST', showLoading: true, loadingImg: '/img/v2/public/ajax_loader.gif', async: false, handler: showIsRegisteredEmail, handlerVars: [showAlert, enviar], responseType: 'text' }; ajaxSendRequest(options); } } function showIsRegistered(response, showAlert, enviar){ if (response == 'KO1'){ alert(_JS_TEXTOS['REGISTRO_LOGIN_F_INCORRECTO']); document.getElementById('f-login').value = ''; setTimeout("document.getElementById('f-login').focus()",75); //esto hay que hacerlo así pq hay un bug con firefox y netscape sino no haria falta el setTimeout //document.getElementById('registro_login_error').style.display = ''; //document.getElementById('registro_span_login_error').style.visibility = 'visible'; } else if(response == 'KO2'){ alert(_JS_TEXTOS['REGISTRO_LOGIN_CORTO']); document.getElementById('f-login').value = ''; setTimeout("document.getElementById('f-login').focus()",75); //esto hay que hacerlo así pq hay un bug con firefox y netscape sino no haria falta el setTimeout //document.getElementById('registro_login_error').style.display = ''; //document.getElementById('registro_span_login_error').style.visibility = 'visible'; } else { if (response){ alert(_JS_TEXTOS['REGISTRO_LOGIN_EXISTENTE']); document.getElementById('f-login').value = ''; setTimeout("document.getElementById('f-login').focus()",75); //document.getElementById('registro_login_error').style.display = ''; //document.getElementById('registro_span_login_error').style.visibility = 'visible'; } else { if (showAlert){ alert(_JS_TEXTOS['REGISTRO_LOGIN_NO_EXISTENTE']); } //parent.document.getElementById('registro_login_error').style.display = 'none'; //parent.document.getElementById('registro_span_login_error').style.visibility = 'hidden' if (enviar){ parent.document.getElementById('registro_boton').style.display = 'none'; parent.document.getElementById('registro_enviando').style.display = ''; parent.document.getElementById('idenviar').value='submit'; parent.document.registro.submit(); } } } } function showIsRegisteredEmail(response, showAlert, enviar){ if (response!=0){ parent.document.getElementById('f-email').value=""; alert(_JS_TEXTOS['REGISTRO_EMAIL_EXISTENTE']); setTimeout("document.getElementById('f-email').focus()",75); //idem que en la función de arriba } else { if (showAlert){ alert(_JS_TEXTOS['REGISTRO_EMAIL_NO_EXISTENTE']); } } } // ------------------------------------------------------------------------ // Fin FUNCIONES SECCION REGISTRO // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // Inicio FUNCIONES SECCION PROFILE // ------------------------------------------------------------------------ // // Función que valida el campos puntos del desafio // function validateDesafioForm(p, tus, sus,tus_cre,sus_cre,coste){ if (p.value == '' || p.value==0) { alert(_JS_TEXTOS['DESAFIOS_ERROR_PUNTOS_VACIO']); p.value = ''; p.focus(); return false; } reg = /[^0-9]/; if (reg.test(p.value)) { alert(_JS_TEXTOS['DESAFIOS_ERROR_PUNTOS']); p.value = ''; p.focus(); return false; } if (p.value>tus){ alert(_JS_TEXTOS['DESAFIOS_PUNTOS_INSUFICIENTES1']); p.value = ''; p.focus(); return false; } if (p.value>sus){ alert(_JS_TEXTOS['DESAFIOS_PUNTOS_INSUFICIENTES2']); p.value = ''; p.focus(); return false; } if (coste>tus_cre){ alert(_JS_TEXTOS['DESAFIOS_CREDITOS_INSUFICIENTES1']); p.value = ''; p.focus(); return false; } if (coste>sus_cre){ alert(_JS_TEXTOS['DESAFIOS_CREDITOS_INSUFICIENTES2']); p.value = ''; p.focus(); return false; } return true; } // // Función que valida si tienes créditos para regalar // function validateRegalarForm(p, tus){ if (p.value == '' || p.value==0) { alert(_JS_TEXTOS['PROFILE_ERROR_CREDITOS_VACIO']); p.value = ''; p.focus(); return false; } reg = /[^0-9]/; if (reg.test(p.value)) { alert(_JS_TEXTOS['PROFILE_ERROR_CREDITOS']); p.value = ''; p.focus(); return false; } if (p.value>tus){ alert(_JS_TEXTOS['PROFILE_CREDITOS_INSUFICIENTES']); p.value = ''; p.focus(); return false; } return true; } // // Función muestra el POPUP del avatar // function avatarPopup(){ if ((typeof(popup_avatar) != "undefined")){ popup_avatar.close(); } popup_avatar = window.open('/sections/profile/avatarPopup.php', 'name', 'height=160,width=450,left=100,top=100,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); } // // Función muestra el POPUP para subir imagenes al blog // function cambiarImagen(num){ if ((typeof(popup_subirImagen) != "undefined")){ popup_subirImagen.close(); } popup_subirImagen = window.open('/sections/profile/subirImagen.php?num='+num, 'name', 'height=225,width=475,left=100,top=100,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); } // // Función muestra el POPUP para eliminar una imagen del blog // function eliminarImagen(num){ if ((typeof(popup_subirImagen) != "undefined")){ popup_subirImagen.close(); } popup_subirImagen = window.open('/sections/profile/eliminarImagen.php?num='+num, 'name', 'height=160,width=450,left=100,top=100,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); } // // Función muestra el POPUP para subir mensaje al blog // function SubirMensaje(num,user,op){ if ((typeof(popup_subirImagen) != "undefined")){ popup_subirImagen.close(); } popup_subirImagen = window.open('/sections/profile/subirMensaje.php?num='+num+'&iduser='+user+'&op='+op, 'name', 'height=225,width=475,left=100,top=100,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); } // // Función muestra el POPUP del reenvio de mail // function reenvioPopup(){ if ((typeof(popup_reenvio) != "undefined")){ popup_reenvio.close(); } popup_reenvio = window.open('/sections/profile/reenviarPopup.php', 'name', 'height=160,width=450,left=100,top=100,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); } // // Función muestra el POPUP del avatar en la parte publica // function avatarpublicPopup(){ popup_avatar = window.open('/sections/profile/avatarPopup.php', 'name', 'height=160,width=450,left=100,top=100,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); } // // Función muestra el POPUP del logout // function logoutPopup(url, sesion){ window.location.href = '/sections/profile/cierraSesion.php?u=' + url + '&s=' + sesion; } // // Abre el popup para el TPV // function abrir_popup_TPV(url, ancho, alto) { var opciones="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+ancho+",height="+alto+",top=85,left=140"; window.open(url,"",opciones); } // // Función que MUESTRA u OCULTA la imagen del avatar dependiendo del CHECKBOX // function checkAvatar(user, def, nodef){ var now = new Date(); // Para evitar problemas de caché var img = document.getElementById('idProfileFoto'); var a = document.getElementById('idcheck'); var chk = document.getElementById('idcheckdefault'); var spa = document.getElementById('idspan'); if (!chk.checked){ if (!a.checked){ img.style.backgroundImage = "url('" + nodef + "?" + now.getTime() + "')"; } else { img.style.backgroundImage = "url('" + user + "?" + now.getTime() + "')"; } } else { img.style.backgroundImage = "url('" + def + "?" + now.getTime() + "')"; if (!a.checked){ img.style.backgroundImage = "url('" + nodef + "?" + now.getTime() + "')"; chk.checked = false; } } } // // Función que MUESTRA el texto de CARGANDO... // function avatarLoading(){ document.getElementById('idtexto1').style.display = "none"; document.getElementById('idtexto2').style.display = "none"; document.getElementById('idtexto3').style.display = ""; if (document.getElementById('idtexto4')){ document.getElementById('idtexto4').style.display = "none"; } if (document.getElementById('idtexto5')){ document.getElementById('idtexto5').style.display = "none"; } document.getElementById('idfichero1').style.display = "none"; document.getElementById('idboton1').style.display = "none"; document.getElementById('idboton2').style.display = "none"; document.getElementById('idboton3').style.display = ""; if (document.getElementById('idinput1')){ document.getElementById('idinput1').style.display = "none"; } if (document.getElementById('idinput2')){ document.getElementById('idinput2').style.display = "none"; } return true; } // // Función que MUESTRA el AVATAR actual // function changeAvatar(def){ var now = new Date(); // Para evitar problemas de caché var img = window.opener.document.getElementById('idProfileFoto'); if (img){ img.style.backgroundImage = "url('" + def + "?" + now.getTime() + "')"; } var img = window.opener.document.getElementById('idProfileHeadFoto'); if (img){ img.src = def + "?" + now.getTime(); } var a = window.opener.document.getElementById('idcheck'); if (a){ a.checked = true; } var chk = window.opener.document.getElementById('idcheckdefault'); if (chk){ chk.checked = false; } window.close(); } // // Función muestra el AvisoLegal y la otra el copyright, las dos en un popup // function avisoLegal(){ if ((typeof(popup) != "undefined")){ popup.close(); } popup = window.open('/sections/miscelany/avisoLegal.php', 'name', 'height=360,width=600,left=300,top=300,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no'); } function copyright(){ if ((typeof(popup) != "undefined")){ popup.close(); } popup = window.open('/sections/miscelany/copyright.php', 'name', 'height=360,width=600,left=300,top=300,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no'); } // // Función muestra el POPUP del olvido password // function olvidoPopup(){ if ((typeof(popup_olvido) != "undefined")){ popup_olvido.close(); } popup_olvido = window.open('/sections/profile/olvidoPopup.php', 'name', 'height=160,width=450,left=300,top=300,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); } // // Función muestra el POPUP del olvido password // function recomendarPopup(){ if ((typeof(popup_olvido) != "undefined")){ popup_recomendar.close(); } popup_recomendar = window.open('/sections/profile/recomendarPopup.php', 'name', 'height=160,width=450,left=300,top=300,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); } // // Función muestra el POPUP del password // function passwordPopup(){ if ((typeof(popup_password) != "undefined")){ popup_password.close(); } popup_password = window.open('/sections/profile/passwordPopup.php', 'name', 'height=160,width=450,left=300,top=300,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); } // // Función muestra el POPUP del password para el admin // function passwordPopup_all(id){ if ((typeof(popup_password) != "undefined")){ popup_password.close(); } popup_password = window.open('/sections/profile/passwordPopup_all.php?id='+id, 'name', 'height=160,width=450,left=300,top=300,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); } // // Función que valida los campos del formulario REGISTRO // function validateProfileForm(f){ // Validación de email if (!validateEmail(f.email.value)){ alert(_JS_TEXTOS['REGISTRO_EMAIL_INCORRECTO']); //document.getElementById('registro_email_error').style.display = ''; //document.getElementById('registro_span_email_error').style.visibility = 'visible'; f.email.focus(); return false; } reg = /[^0-9]/; if (f.dia.value!=""){ if (!reg.test(f.dia.value)){ if (f.dia.value<1 || f.dia.value>31){ alert(_JS_TEXTOS['PROFILE_FECHA_INCORRECTA']); //document.getElementById('registro_email_error').style.display = ''; //document.getElementById('registro_span_email_error').style.visibility = 'visible'; return false; } } else { alert(_JS_TEXTOS['PROFILE_FECHA_INCORRECTA']); return false; } } reg = /[^0-9]/; var curdate = new Date(); var curyear = curdate.getFullYear(); if (f.anyo.value!=""){ if (!reg.test(f.anyo.value)){ if (f.anyo.value<1900 || f.anyo.value>curyear){ alert(_JS_TEXTOS['PROFILE_FECHA_INCORRECTA']); //document.getElementById('registro_email_error').style.display = ''; //document.getElementById('registro_span_email_error').style.visibility = 'visible'; return false; } } else { alert(_JS_TEXTOS['PROFILE_FECHA_INCORRECTA']); return false; } } var fecha_user = new Date(parseInt(f.anyo.value), parseInt(f.mes.value)-1, parseInt(f.dia.value)); var fecha_actual = new Date(parseInt(f.anyo_actual.value), parseInt(f.mes_actual.value)-1, parseInt(f.dia_actual.value)); if (fecha_actual=5){ if (f.password.value != f.repassword.value){ alert(_JS_TEXTOS['PROFILE_PASSWORDS_DISTINTOS']); f.password.value = ''; f.repassword.value = ''; f.password.focus(); return false; } } else { alert(_JS_TEXTOS['PROFILE_PASSWORD_INCORRECTO']); f.password.focus(); return false; } } else { alert(_JS_TEXTOS['PROFILE_PASSWORD_VACIO']); f.password.focus(); return false; } if (!confirm(_JS_TEXTOS['PROFILE_SEGURO_CAMBIAR_PASSWORD'])) { return false; } else { return true; } } // ------------------------------------------------------------------------ // Fin FUNCIONES SECCION PROFILE // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // Inicio FUNCIONES HEAD // ------------------------------------------------------------------------ function isPlayingGame(){ if (document.getElementById('idempiezadesafio') != null){ if (!document.getElementById('idempiezadesafio').value){ return false; } } else { return false; } } function updateDivAmigos(response){ if (response=='NOT_LOGGED'){ window.location = '/sections/home/'; exit; } if (response){ var iddiv = document.getElementById('iddivamigos'); if (iddiv!=null){ iddiv.innerHTML = response; } } } function refrescaAmigos(iduser, pag){ var options = { url: '/sections/profile/muestra_amigos.php', queryVars: {iduser: iduser, apag: pag}, responseType: 'text', handler: updateDivAmigos }; ajaxSendRequest(options); } function actictivaMinipuntos(codjuego, minipunto){ var mini2 = document.getElementById(codjuego + '_2'); var mini3 = document.getElementById(codjuego + '_3'); var mini4 = document.getElementById(codjuego + '_4'); var mini5 = document.getElementById(codjuego + '_5'); var num = document.getElementById(codjuego + '_div'); var url_on = '/img/v2/public/minipunto_on.jpg'; var url_off = '/img/v2/public/minipunto_off.jpg'; var link_f = document.getElementById(codjuego + '_link_f'); var link_m = document.getElementById(codjuego + '_link_m'); var link_d = document.getElementById(codjuego + '_link_d'); switch(minipunto){ case 1: mini2.src = url_off; mini3.src = url_off; mini4.src = url_off; mini5.src = url_off; break; case 2: mini2.src = url_on; mini3.src = url_off; mini4.src = url_off; mini5.src = url_off; break; case 3: mini2.src = url_on; mini3.src = url_on; mini4.src = url_off; mini5.src = url_off; break; case 4: mini2.src = url_on; mini3.src = url_on; mini4.src = url_on; mini5.src = url_off; break; case 5: mini2.src = url_on; mini3.src = url_on; mini4.src = url_on; mini5.src = url_on; break; } num.innerHTML = minipunto; if (link_f){ link_f.href = '../games/training.php?g=' + codjuego + '&d=1&p=' + minipunto; } if (link_m){ link_m.href = '../games/training.php?g=' + codjuego + '&d=2&p=' + minipunto; } if (link_d){ link_d.href = '../games/training.php?g=' + codjuego + '&d=3&p=' + minipunto; } } function update_alertas_salas(idd, dificultad){ var divtext = document.getElementById('iddivsala' + dificultad); if (divtext){ divtext.innerHTML = '
' + _JS_TEXTOS['SALAS_AVISANDO_JUGAR'] + ''; } var options5 = { url: '/sections/jugar/update_alertas_salas.php', queryVars: {idd: idd, d: dificultad}, responseType: 'text' }; ajaxSendRequest(options5); } // ------------------------------------------------------------------------ // Fin FUNCIONES HEAD // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // Inicio FUNCIONES FOOT // ------------------------------------------------------------------------ function openCloseFoot() { var fc = document.getElementById('idtrfootcontent'); var me = document.getElementById('idtrmenor'); if (fc.style.display == ''){ fc.style.display = 'none'; me.style.display = ''; } else { fc.style.display = ''; me.style.display = 'none'; } var options = { url: '/sections/profile/muestra_desafios.php', queryVars: {display: fc.style.display}, responseType: 'text' }; ajaxSendRequest(options); } function openFoot(ancla) { var fc = document.getElementById('idtrfootcontent'); var me = document.getElementById('idtrmenor'); if (fc.style.display == 'none'){ fc.style.display = ''; me.style.display = 'none'; } else { fc.style.display = 'none'; me.style.display = ''; } // if (ancla){ // window.location.href = '#ancladesafios'; // } } // ------------------------------------------------------------------------ // Fin FUNCIONES FOOT // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // FUNCIONES ROLLOVER IMAGENES // ------------------------------------------------------------------------ function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i