// MENU HORIZONTAL function initPage(){ var nav = document.getElementById("nav"); if (nav){ var nodes = nav.getElementsByTagName("li"); for (var i = 0; i < nodes.length; i++){ nodes[i].onmouseover = function (){ if (this.className.indexOf("hover") == -1){this.className += " hover";} } nodes[i].onmouseout = function (){this.className = this.className.replace(" hover", "");} } } } if (window.attachEvent && !window.opera){window.attachEvent("onload", initPage);} // CHECH FORMULARIO DE CONTACTO function checkCONTACTsend(obj){ submitOk = true; var emailFilter=/^.+@.+\..{2,4}$/; if(obj.nombre.value == ""){ submitOk = false; alert("No olvide su Nombre y apellidos"); obj.nombre.focus(); } if (obj.email.value == "" && submitOk) { submitOk = false; alert("No olvide su E-mail"); obj.email.focus(); } if (!(emailFilter.test(obj.email.value)) && submitOk) { submitOk = false; alert("Su E-mail no parece válido"); obj.email.focus(); } if(obj.telefono.value == "" && submitOk){ submitOk = false; alert("No olvide su Teléfono"); obj.telefono.focus(); } if(obj.texto.value == "" && submitOk){ submitOk = false; alert("No olvide su Comentario"); obj.texto.focus(); } checkCaptcha(); return false; //return submitOk; } var xmlHttp; function checkCaptcha() { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Su browser no soporta AJAX!"); return; } var random = Math.floor(Math.random() * 50000); var url="/validatecaptcha.php?rand=" + random; var ch=document.getElementById('recaptcha_challenge_field').value; var re=document.getElementById('recaptcha_response_field').value; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("POST", url, true); xmlHttp.setRequestHeader("content-type", "application/x-www-form-urlencoded"); xmlHttp.send('recaptcha_challenge_field='+ch+'&recaptcha_response_field='+re); } function stateChanged() { console.log(xmlHttp.readyState + ' == '+ xmlHttp.readyState) if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { console.log(xmlHttp.responseText) if(xmlHttp.responseText=='OK') { document.getElementById('contact').submit(); } else { alert("Código de validación incorrecto"); Recaptcha.reload(); } } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } // NAVIGATION function initPage(){ var navRoot = document.getElementById("nav"); var lis = navRoot.getElementsByTagName("li"); for (var i=0; i