function DetectaPlugin(descripcion_plugin, extension_plugin, mime_plugin) { //Comprueba todos los navegadores que tienen una array de plug-ins //(como Netscape) y establece las variables //Definicion de variables var i, detectado=0, daPlugin = new Object() //Si tiene un array de plug-ins o tipos mime, lo examinamos if(navigator.plugins) { numPlugins = navigator.plugins.length if (numPlugins > 1) { if (navigator.mimeTypes && navigator.mimeTypes[mime_plugin] && navigator.mimeTypes[mime_plugin].enabledPlugin && (navigator.mimeTypes[mime_plugin].suffixes.indexOf(extension_plugin) != -1)) { //Comprueba la version if ((navigator.appName == 'Netscape') && (navigator.appVersion.indexOf('4.0') != -1)) { //Netscape no permite referenciar al array de plug-ins directamente usando numeros for(i in navigator.plugins) { if ((navigator.plugins[i].description.indexOf(descripcion_plugin) != -1) || (i.indexOf(descripcion_plugin) != -1)) { // some versions of quicktime have no description. feh! detectado = 1 break } } } else { for (i = 0; i < numPlugins; i++) { daPlugin = navigator.plugins[i] if ((daPlugin.description.indexOf(descripcion_plugin) != -1) || (daPlugin.name.indexOf(descripcion_plugin) != -1)) { detectado = 1 break } } } //Para Mac usamos el array mimeTypes if (navigator.mimeTypes[mime_plugin] == null) { detectado = 0 } } return detectado } else { return 0 } } else { return 0 } } //Deteccion de los plug-ins mas comunes function CompruebaPlugins() { var agt = navigator.userAgent.toLowerCase() var esNAV = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1)) if ( !esNAV ) { //alert( "Su Navegador no es compatible"); } else { if ( DetectaPlugin('Flash', 'swf', 'application/x-shockwave-flash', 'ShockwaveFlash.ShockwaveFlash') ) flash = "Flash: SI
" else flash = "Flash: NO
" if ( DetectaPlugin('Shockwave', 'dcr', 'application/x-director', 'SWCtl.SWCtl.1') ) shockwave = "Director: SI
" else shockwave = "Director: NO
" if ( DetectaPlugin('QuickTime', 'mov', 'video/quicktime', '') ) quicktime = "QuickTime: SI
" else quicktime = "QuickTime: NO
" if ( (DetectaPlugin('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin', 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)')) || (DetectaPlugin('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','rmocx.RealPlayer G2 Control')) || (DetectaPlugin('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)')) || (DetectaPlugin('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','RealVideo.RealVideo(tm) ActiveX Control (32-bit)')) ) realplayer = "RealPlayer: SI
" else realplayer = "RealPlayer NO" //document.write( '

Plug-ins:
' + flash + shockwave + quicktime + realplayer ) if(realplayer=="RealPlayer NO") return realplayer; } } //******************************************************************** var Xmd=""; var Ymd=""; var isNav = (navigator.appName.indexOf("Netscape") !=-1); function handlerMD(e){ Xmd = (isNav) ? e.pageX : event.clientX Ymd = (isNav) ? e.pageY : event.clientY } if (isNav){ //document.captureEvents(Event.MOUSEMOVE); document.captureEvents(Event.MOUSEDOWN); //document.captureEvents(Event.MOUSEOVER); //document.captureEvents(Event.MOUSEUP); //document.captureEvents(Event.DBLCLICK); } //document.onmouseover = handlerMO; document.onmousedown = handlerMD; //document.onmouseup = handlerMU; //document.onmousemove = handlerMM; //document.ondblclick = handlerDC; //************************************************************************************** function NuevoCodigo(div,pagina){ var capa=document.getElementById(div); //capa.innerHTML=""; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/REGISTRO/codigo.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("opcion=nuevo"); ajax.onreadystatechange=function(){ if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } /*******************************************************/ function borra_texto(ctrl,texto){ if(texto!=""){ if(document.getElementById(ctrl).value==texto){ document.getElementById(ctrl).value=""; } } else{ document.getElementById(ctrl).value=""; } } /**********************************************/ var cadena=""; function controla_letras(div,max,muestra){ if(!muestra) muestra="numero_caracteres"; maximo=max; var cad=document.getElementById(div).value; if(cad.length>max){ document.getElementById(div).value=cadena; } else{ cadena=cad; document.getElementById(muestra).innerHTML="(Act: " +cad.length +")"; } } function validarero(abc){ dni=abc.substring(0,abc.length-1); let=abc.charAt(abc.length-1); if (!isNaN(let)){ alert('Falta la letra'); document.getElementById("nif").focus(); //document.frm_nuevo.nif.focus(); enrojece("nif"); return false; } else{ cadena="TRWAGMYFPDXBNJZSQVHLCKET"; posicion = dni % 23; letra = cadena.substring(posicion,posicion+1); if (letra!=let.toUpperCase()){ alert("Nif no válido"); document.getElementById("nif").focus(); //document.frm_nuevo.nif.focus(); enrojece("nif"); return false; } } //alert("Nif válido"); } function cif(cif){ par = 0 non = 0 letras="ABCDEFGHKLMNPQS"; let=cif.charAt(0); if (!isNaN(let)){ nif=cif; validarero(nif); return false; } if (cif.length!=9){ alert('El Cif debe tener 9 dígitos'); document.getElementById("nif").focus(); //document.frm_nuevo.nif.focus(); enrojece("nif"); return false; } if (letras.indexOf(let.toUpperCase())==-1){ alert("El comienzo del Cif no es válido"); document.getElementById("nif").focus(); //document.frm_nuevo.nif.focus(); enrojece("nif"); return false; } for(zz=2;zz<8;zz+=2){ par=par+parseInt(cif.charAt(zz)); } for (zz=1;zz<9;zz+=2){ nn = 2*parseInt(cif.charAt(zz)); if (nn > 9) nn = 1+(nn-10); non = non+nn; } parcial = par + non; control = (10 - ( parcial % 10)); if (control!=cif.charAt(8)){ alert("El Cif no es válido"); document.getElementById("nif").focus(); //document.frm_nuevo.nif.focus(); enrojece("nif"); return false; } //alert("El Cif es válido"); } var textoAnterior = ""; function cumpleReglas(simpleTexto){ var expresion = new RegExp("^(|([0-9]{1,4}(\\.([0-9]{1,2})?)?))$"); if(expresion.test(simpleTexto)) return true; else return false; } function solo_decimales(textItem) { if(textItem.value.substring(0,1) == ".") textItem.value = "0" + textItem.value; if(!cumpleReglas(textItem.value)) textItem.value = ""; else textoAnterior = textItem.value; } /************************************************************************/ function pon_provincias(pais){ if(pais!="España"){ var capa=document.getElementById("provincias"); //capa.innerHTML=""; var ajax=nuevoAjax(); ajax.open("POST", "FUNCIONES/localidades.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("opcion=sinprovincias"); ajax.onreadystatechange=function(){ if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } else{ var capa=document.getElementById("provincias"); //capa.innerHTML=""; var ajax=nuevoAjax(); ajax.open("POST", "FUNCIONES/localidades.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("opcion=conprovincias"); ajax.onreadystatechange=function(){ if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } } function pon_ciudades(provincia,div,donde){ //alert(provincia); var capa=document.getElementById(div); capa.innerHTML="Buscando localidades...."; var ajax=nuevoAjax(); ajax.open("POST", "FUNCIONES/localidades.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("opcion=ponciudades&provincia="+provincia+"&donde="+donde+"&div="+div+""); ajax.onreadystatechange=function(){ if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } /**********************************************************************************************/ function nuevoAjax(){ var xmlhttp=false; try { // Creacion del objeto AJAX para navegadores no IE xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { // Creacion del objet AJAX para IE xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch(E) { xmlhttp=false; } } if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); } return xmlhttp; } /**********************************************************************************************/ /**************FUNCIONES DE REGISTRO VIA CONFIMRACION MAIL*************************************/ /**************************************************************/ //function aviso(div) { // document.getElementById(div).style.background="#00CC33"; // document.getElementById(div).style.color="#FFFFFF"; // } function blanco(div){ document.getElementById(div).style.background='#FFFFFF' } function enrojece(div){ document.getElementById(div).style.background="#FF0000"; document.getElementById(div).style.color="#FFFFFF"; document.getElementById(div).focus(); //document.getElementById(div).addEventListener("click", blanco(div), false); } hexadecimal = new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"); color_decimal_1 = 17; color_decimal_2 = 69; color_decimal_3 = 45; function degradado(){ color_decimal_1=color_decimal_1+10; color_decimal_2=color_decimal_2+10; color_decimal_3=color_decimal_3+10; if(color_decimal_1>255) color_decimal_1=255; if(color_decimal_2>255) color_decimal_2=255; if(color_decimal_3>255) color_decimal_3=255; color_hexadecimal_1 = convierteHexadecimal(color_decimal_1); color_hexadecimal_2 = convierteHexadecimal(color_decimal_2); color_hexadecimal_3 = convierteHexadecimal(color_decimal_3); document.bgColor = color_hexadecimal_1 + color_hexadecimal_2 + color_hexadecimal_3; //document.getElementById("contenedor").style.background=color_hexadecimal + color_hexadecimal + color_hexadecimal; //la llamo con un retardo if (color_decimal_1 < 255 || color_decimal_2 < 255 || color_decimal_3 < 255) setTimeout("degradado()",10); } function convierteHexadecimal(num){ var hexaDec = Math.floor(num/16); var hexaUni = num - (hexaDec * 16); return hexadecimal[hexaDec] + hexadecimal[hexaUni]; } function oscurece(zona){ document.getElementById("fantasma").innerHTML=""; document.getElementById("fantasma").style.visibility="visible"; document.getElementById("contenedor").style.filter="alpha(opacity=30)"; document.getElementById("contenedor").style.opacity="0.3"; //document.bgColor="#176945"; //document.getElementById("contenedor").style.background="#000000"; document.getElementById("contenedor").disabled="true"; } function abrillanta(ventana){ if(ventana) document.getElementById(ventana).innerHTML=""; document.getElementById("contenedor").disabled=false; document.getElementById("fantasma").style.visibility="hidden"; document.getElementById("contenedor").style.filter="alpha(opacity=100)"; document.getElementById("contenedor").style.opacity="1";//mozilla //degradado(); color_decimal_1=17; color_decimal_2=69; color_decimal_3=45; } function loguinea(avisando){ oscurece(); var capa=document.getElementById("fantasma"); //capa.innerHTML=""; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/REGISTRO/loguinea.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("opcion=recupera"); ajax.onreadystatechange=function(){ if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function valida(){ var v_usr=document.getElementById("user").value; var v_psw=document.getElementById("psw").value; //var dominio_amigo=document.getElementById("dominio_amigo").value; if(v_usr==""){ alert("Debe indicar un eMail"); enrojece("user"); } else { if(v_psw==""){ alert("Debe indicar una clave de acceso"); enrojece("psw"); } else{ var capa=document.getElementById("fantasma"); var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/REGISTRO/valida.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); //ajax.send("usr="+v_usr+"&psw="+v_psw+"&dominio_amigo="+dominio_amigo+"&accion=valida"); ajax.send("usr="+v_usr+"&psw="+v_psw+"&accion=valida"); ajax.onreadystatechange=function() { if (ajax.readyState==4){ var respuesta=ajax.responseText; var error="0"; var patron=/ADMINVALIDADO/; var resp=respuesta.search(patron); if(resp!="-1"){ window.location.href="dolor-de-espalda-la-web-del-cuidado-de-la-espalda-profesionales-de-la-espalda"; error="1"; } else{ var patron=/USERVALIDADO/; var resp=respuesta.search(patron); if(resp!="-1"){ window.location.href="dolor-de-espalda-la-web-del-cuidado-de-la-espalda-profesionales-de-la-espalda?acc=validado"; error="1"; } } } if(error=="0" ){ capa.innerHTML=ajax.responseText; } } } } } /************************************************************************/ /**************************************************************/ function recupera(){ oscurece(); var capa=document.getElementById("fantasma"); capa.innerHTML=""; var ajax=nuevoAjax(); capa.innerHTML=""; ajax.open("POST", "INCLUDES/REGISTRO/rec.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("opcion=recupera"); ajax.onreadystatechange=function(){ if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } //**************************************************************** function recupera_seleccionado(){ var mail=document.getElementById("MAIL").value; var capa=document.getElementById("fantasma"); var ajax=nuevoAjax(); capa.innerHTML=""; ajax.open("POST", "INCLUDES/REGISTRO/rec.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("opcion=EnviaMail&mail="+mail+""); ajax.onreadystatechange=function(){ if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function logout(pagina){ //window.location.reload(); //document.getElementById("derecha").innerHTML=""; //var capa=document.getElementById("fantasma"); //capa.innerHTML=""; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/REGISTRO/valida.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("accion=logout"); ajax.onreadystatechange=function() { if (ajax.readyState==4) { //capa.innerHTML=ajax.responseText; window.open('dolor-de-espalda-la-web-del-cuidado-de-la-espalda-profesionales-de-la-espalda?log=out','_self'); } } } /************************************************************************/ function registro_1(){ oscurece("completo"); //document.getElementById("centro").style.background="#999999"; //document.getElementById("izquierda_izquierda").innerHTML=""; //document.getElementById("zona_banner").innerHTML=""; var capa=document.getElementById("fantasma"); //capa.innerHTML=""; var ajax=nuevoAjax(); capa.innerHTML=""; ajax.open("POST", "INCLUDES/REGISTRO/registro.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("accion=nuevo_paso_1"); ajax.onreadystatechange=function() { if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } /************************************************************************/ function registro_2(){ var ctrl=document.prof.profesional; for(i=0;iAcceso a GoogleMaps"; document.getElementById('mapa').style.height="0px"; document.getElementById('mapa').innerHTML=""; document.getElementById('sub_mapa').innerHTML=""; } else { //1. escribimos las coordenadas en la página coordenadas_txt="Las coordenadas (latitud,longitud) son: "+point.lat()+","+point.lng(); //2. Pintamos en punto en el mapa document.getElementById('mapa').style.height="300px"; map.setCenter(point, 15); var marker = new GMarker(point); map.addOverlay(marker); //document.getElementById('sub_mapa').innerHTML="',' '); coordenadas=coordenadas.replace('
',' '); coordenadas=coordenadas.replace('

',' '); coordenadas=coordenadas.replace(/[&]/gi,' '); coordenadas=coordenadas.replace(/[;]/gi,' '); coordenadas=coordenadas.replace(/[+]/gi,' '); coordenadas=coordenadas.replace(/nbsp/gi,' '); //alert(coordenadas); inicializar(); obtenerCoordenadas(coordenadas); } function subir_youtube(){ if(document.getElementById("archivo").value == ""){ alert("Debe seleccionar un archivo"); return false; } else{ document.getElementById("mensaje_envio").innerHTML="SUBIENDO VIDEO..... Tenga paciencia, por favor

"; document.getElementById("btn_enviar").disabled="true"; return true; } } function subir_imagen(){ if(document.getElementById("archivo").value == ""){ alert("Debe seleccionar un archivo"); return false; } else{ document.getElementById("enviar").disabled="true"; document.getElementById("subiendo_img").innerHTML="SUBIENDO IMAGEN... Tenga paciencia

"; return true; } } function nuevo_favorito(div,id,idanuncio){ var capa=document.getElementById(div); capa.innerHTML="actualizando..."; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/USUARIO/ctrl_favoritos.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("accion=pon_favorito&div="+div+"&id="+id+"&idanuncio="+idanuncio+""); ajax.onreadystatechange=function() { if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function quita_favorito(div,id,idanuncio){ var capa=document.getElementById(div); capa.innerHTML="actualizando..."; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/USUARIO/ctrl_favoritos.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("accion=quita_favorito&div="+div+"&id="+id+"&idanuncio="+idanuncio+""); ajax.onreadystatechange=function() { if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function nuevo_favorito_articulo(div,id,idarticulo){ var capa=document.getElementById(div); capa.innerHTML="actualizando..."; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/USUARIO/ctrl_favoritos.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("accion=pon_favorito_articulo&div="+div+"&id="+id+"&idarticulo="+idarticulo+""); ajax.onreadystatechange=function() { if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function quita_favorito_articulo(div,id,idarticulo){ var capa=document.getElementById(div); capa.innerHTML="actualizando..."; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/USUARIO/ctrl_favoritos.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("accion=quita_favorito_articulo&div="+div+"&id="+id+"&idarticulo="+idarticulo+""); ajax.onreadystatechange=function() { if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function envia_favoritos(id,busca){ if(busca!=""){ var busca=document.getElementById("busca_user").value; } var capa=document.getElementById("derecha"); capa.innerHTML=""; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/USUARIO/ctrl_favoritos.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("busca="+busca+"&accion=envia_favoritos&id="+id+""); ajax.onreadystatechange=function() { if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function envia_mail_favoritos(id){ var existe="SI"; var cont=0; var mail=""; while(document.getElementById(cont) != undefined){ if(document.getElementById(cont).checked) mail=mail + "&mail" + cont + "=" + document.getElementById(cont).value; else mail=mail + "&mail" + cont + "=X"; cont=cont+1; } //alert("accion=envia_mail_favoritos&id="+id+mail+""); var capa=document.getElementById("derecha"); capa.innerHTML=""; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/USUARIO/ctrl_favoritos.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("accion=envia_mail_favoritos&id="+id+mail+""); ajax.onreadystatechange=function() { if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function aceptar_favoritos(id,div){ var capa=document.getElementById(div); capa.innerHTML=""; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/USUARIO/ctrl_favoritos.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("accion=favoritos_aceptar&id="+id+"&div="+div+""); ajax.onreadystatechange=function() { if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function aceptar_favoritos_2(id,resp,idenviante,div_int,div){ var capa=document.getElementById(div_int); capa.innerHTML="..."; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/USUARIO/ctrl_favoritos.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("accion=favoritos_aceptar_2&id="+id+"&div="+div+"&idenviante="+idenviante+"&resp="+resp+""); ajax.onreadystatechange=function() { if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; //if(resp=="SI") //window.open('dolor-de-espalda-la-web-del-cuidado-de-la-espalda-profesionales-de-la-espalda?acc=anuncios&modo=favoritos','_self'); } } } function aviso_leido(id,idaviso,div){ var capa=document.getElementById(div); capa.style.border=""; capa.style.background=""; capa.innerHTML=""; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/USUARIO/pon_textos.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("accion=aviso_leido&id="+id+"&idaviso="+idaviso+""); ajax.onreadystatechange=function() { if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function toma_link(div,texto,icono){ if(document.getElementById(div).contentEditable=="true"){ document.getElementById(div).innerHTML=document.getElementById(div).innerHTML + "
" + texto; //capa.innerHTML=texto; //window.clipboardData.setData("Text", texto); } else{ //alert("Debe tener la zona activa en modo edición (haga click sobre el mismo)"); document.getElementById(div).contentEditable="true"; document.getElementById(div).style.border="#00FF00 1px solid"; document.getElementById(div).style.background="#EFFFFE"; control_div=div; document.getElementById(div).innerHTML=document.getElementById(div).innerHTML + "
" + texto; document.getElementById(div).contentEditable="false"; } icono_guardar(icono); document.getElementById(icono).click(); //reinicia("2000"); } function envio_amigo(id,visita){ oscurece(); var capa=document.getElementById("fantasma"); //capa.innerHTML=""; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/acciones.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("id="+id+"&visita="+visita+"&opcion=recomendacion"); ajax.onreadystatechange=function(){ if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function envio_amigo_2(form,id,visita){ var mail=document.getElementById("mail").value; if(control_mail(mail)){ alert("Mail incorrecto"); mail.focus(); return false; } if(form.USER.value!=form.REAL.value){ //alert(form.USER.value); //alert(form.REAL.value); alert("El código de control no coincide"); form.USER.focus(); enrojece("USER"); return false; } var texto=document.getElementById("msj").value; texto=encodeURIComponent(texto); var capa=document.getElementById("fantasma"); var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/acciones.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("id="+id+"&visita="+visita+"&mail="+mail+"&texto="+texto+"&opcion=envia_recomendacion"); ajax.onreadystatechange=function(){ if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function envio_admin(id,peticion){ oscurece(); var capa=document.getElementById("fantasma"); //capa.innerHTML=""; var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/acciones.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); if(peticion=="nueva_categoria"){ ajax.send("id="+id+"&opcion=peticion_categoria_1"); } ajax.onreadystatechange=function(){ if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function peticion_categoria_2(form,id,visita){ if(form.USER.value!=form.REAL.value){ alert("El código de control no coincide"); form.USER.focus(); enrojece("USER"); return false; } var texto=document.getElementById("msj").value; texto=encodeURIComponent(texto); var capa=document.getElementById("fantasma"); var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/acciones.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("id="+id+"&texto="+texto+"&opcion=peticion_categoria_2"); ajax.onreadystatechange=function(){ if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; } } } function envia_contactar(visita){ var mail=document.getElementById("mail").value; if(control_mail(mail)){ alert("Mail incorrecto"); document.getElementById("mail").style.background="#FF0000"; document.getElementById("mail").style.color="#FFFFFF"; document.getElementById("mail").focus(); } else{ if(document.getElementById("USER").value!=document.getElementById("REAL").value){ alert("El código de control no coincide"); document.getElementById("USER").focus(); enrojece("USER"); } else{ texto=encodeURIComponent(document.getElementById("msj").value); var capa=document.getElementById("peticion"); var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/acciones.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("texto="+texto+"&mail="+mail+"&visita="+visita+"&opcion=contacto"); ajax.onreadystatechange=function(){ if (ajax.readyState==4){ capa.innerHTML=ajax.responseText; } } } } } function borrar_articulo(div,idarticulo,id){ var capa=document.getElementById(div); var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/USUARIO/pon_textos.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("idarticulo="+idarticulo+"&div="+div+"&id="+id+"&accion=borra_articulo"); ajax.onreadystatechange=function() { if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; //window.location.reload(); } } } function borrar_articulo_confirmado(div,idarticulo,id){ var capa=document.getElementById(div); var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/USUARIO/pon_textos.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("idarticulo="+idarticulo+"&div="+div+"&id="+id+"&accion=borra_articulo_confirmado"); ajax.onreadystatechange=function() { if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; document.getElementById("art_eliminacion").innerHTML=""; alert("Artículo eliminado"); //window.location.reload(); } } } function borrar_video(visita,modo,div,video,sesion,id){ var capa=document.getElementById(div); var ajax=nuevoAjax(); ajax.open("POST", "INCLUDES/USUARIO/pon_textos.php", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("video="+video+"&div="+div+"&visita="+visita+"&modo="+modo+"&sesion="+sesion+"&id="+id+"&accion=borra_video"); ajax.onreadystatechange=function() { if (ajax.readyState==4) { capa.innerHTML=ajax.responseText; //window.location.reload(); } } }