// JavaScript Document function plomo() { alert('Hola papita'); } function nuevoAjax() { var xmlhttp = false; try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(E) { xmlhttp = false; } } if(!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); } return xmlhttp; } function enjava(cual) { var contenedor,cual; contenedor = document.getElementById('contenedor'); ajax=nuevoAjax(); ajax.open("GET","galeria.php?enjava=s&gal="+cual,true); ajax.onreadystatechange = function() { if(ajax.readyState==4) { contenedor.innerHTML = ajax.responseText } } ajax.send(null) } function mailear() { var nombre,email,asunto,mensaje,contenedor,accion,boton; contenedor = document.getElementById('contenedor'); nombre = escape(document.getElementById('nombre').value); email = document.getElementById('email').value; asunto = escape(document.getElementById('titulo').value); mensaje = escape(document.enviador.comentario.value); boton = document.getElementById('boton'); accion = "plomo"; if(nombre.length<3) { alert("Debes ingresar tu nombre") document.getElementById('nombre').focus(); } else if(email.length<8 || email.indexOf("@") == -1 || email.indexOf(".") == -1) { alert("Verifica e introduce un correo valido!") document.getElementById('email').focus(); } else if(asunto.length<3) { alert("Escribe un titulo!") document.getElementById('titulo').focus(); } else if(mensaje.length<3 || mensaje.indexOf('undefined')!= -1) { alert("Escribe tu mensaje!") document.enviador.comentario.focus(); } else { ajax=nuevoAjax(); ajax.open("POST","comenta.php?envia=1",true); ajax.onreadystatechange = function() { if(ajax.readyState==4) { contenedor.innerHTML = ajax.responseText boton.disabled = true; } } ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); ajax.send("accion="+accion+"&nombre="+nombre+"&email="+email+"&asunto="+asunto+"&mensaje="+mensaje) } } function sala(anio,mes) { var anio,mes,contenedor; contenedor = document.getElementById('contenedor'); ajax=nuevoAjax(); ajax.open("POST","sala.php",true); ajax.onreadystatechange = function() { if(ajax.readyState==4) { contenedor.innerHTML = ajax.responseText } } ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); ajax.send("jahr="+anio+"&monat="+mes) }