function contacta() { NewWindow('../../presentacion/comun/clausula.php?formulario=contacta',350,450) } function comprueba_contacta() { f=document.form; //comprobación email valido=1; var Patron=/^(.+)@(.+)$/; var matchArray=(f.email.value).match(Patron); if (matchArray == null) valido=0; if ((f.nombre.value=="") || (f.email.value=="") || (Trim(f.comentarios.value)=="") || (valido==0)) alert("Debe rellenar correctamente los campos obligatorios"); else contacta(); } function comprueba_evento() { f=document.form; //comprobación email valido=1; var Patron=/^(.+)@(.+)$/; var matchArray=(f.email.value).match(Patron); if (matchArray == null) valido=0; if ((f.empresa.value=="") || (f.telefono.value=="") || (f.email.value=="") || (f.contacto.value=="") || (valido==0) ) alert("Debe rellenar correctamente los campos obligatorios"); else contacta(); } function comprueba_bodas() { f=document.form; //comprobación email valido=1; var Patron=/^(.+)@(.+)$/; var matchArray=(f.email.value).match(Patron); if (matchArray == null) valido=0; if ((f.novio.value=="") || (f.novia.value=="") || (f.telefono1.value=="") || (f.email.value=="") || (f.fecha1.value=="") || (valido==0) ) alert("Debe rellenar correctamente los campos obligatorios"); else contacta(); } function envia_contacta() { document.form.submit(); } function newsletter() { NewWindow('../../presentacion/comun/clausula.php?formulario=newsletter',350,450) } function comprueba_newsletter() { f=document.form; if ((f.nombre.value=="") || (f.email.value=="") || ((!f.ocio.checked) && (!f.negocio.checked)) || ((!f.idioma[0].checked) && (!f.idioma[1].checked)) ) alert("Debe rellenar los campos obligatorios"); else { f.npais.value=f.pais.options[f.pais.selectedIndex].text; newsletter(); } } function envia_newsletter() { document.form.submit(); } function Trim(inputString) { if (typeof inputString != "string") return inputString; while (inputString.indexOf("´")!=-1) inputString=inputString.replace("´","'"); while (inputString.indexOf("%95")!=-1) inputString=inputString.replace("%95","·"); while (inputString.indexOf("%92")!=-1) inputString=inputString.replace("%92","'"); return inputString //clear leading spaces and empty lines .replace(/^(\s|\n|\r)*((.|\n|\r)*?)(\s|\n|\r)*$/g,"$2") //take consecutive spaces down to one .replace(/(\s(?!(\n|\r))(?=\s))+/g,"") //take consecutive lines breaks down to one .replace(/(\n|\r)+/g,"\n\r") //remove spacing at the beginning of a line .replace(/(\n|\r)\s/g,"$1") //remove spacing at the end of a line .replace(/\s(\n|\r)/g,"$1"); } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&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&&i15) { alert("Sólo se admite un máximo de 15 noches"); d.fechafin.value="12/03/2010"; } else if (noches<1) { alert("Asegúrese que la fecha de salida es posterior a la de entrada"); d.fechafin.value="12/03/2010"; } else d.noches.value=noches; } function validafecha() { var d=document.form; var fechaini=d.fechaini.value; fechaini=fechaini.substring(3,5)+"/"+fechaini.substring(0,2)+"/"+fechaini.substring(6,10); f1=new Date(fechaini); alert(f1); } function reservas() { } function mouseOver() { document.getElementById('flashlateral').style.zIndex = 3; } function mouseOut() { document.getElementById('flashlateral').style.zIndex = 1; } function cambia_idioma(loc, idioma) { var p=loc.lastIndexOf("/"); if (loc.indexOf("/editar.php")==-1) { loc=loc.substring(p+1); document.location.href="../"+idioma+"/"+loc; } else { document.location.href="cambia_idioma.php?loc="+escape(loc)+"&idioma="+idioma; } } function visita(url, idioma) { if (document.location.href.indexOf("index.php")!=-1) url="presentacion/"+idioma+"/"+url; document.location.href=url; } function iniciaTexto() { // preload images MM_preloadImages('../../presentacion/imgs/idioma_esp_on.gif','../../presentacion/imgs/idioma_eng_on.gif','../../presentacion/imgs/idioma_cat_on.gif'); var tam=getCookie("tam"); if (tam==null || tam=="") tam="1"; var regular=new String(8+parseInt(tam)*2)+"px"; var regular2=new String(9+parseInt(tam)*2)+"px"; //var regular3=new String(10+parseInt(tam)*2)+"px"; if (document.all) { if (document.styleSheets[0]!=null) { document.styleSheets[0].rules[1].style.fontSize=regular; document.styleSheets[0].rules[2].style.fontSize=regular2; document.styleSheets[0].rules[3].style.fontSize=regular2; } } else { document.styleSheets[0].cssRules[1].style.fontSize=regular; document.styleSheets[0].cssRules[2].style.fontSize=regular2; document.styleSheets[0].cssRules[3].style.fontSize=regular2; } } function font(tam) { var cookie=document.cookie; var expi = new Date(); expi.setTime(expi.getTime() + (24 * 1000 * 60 * 60 )); setCookie("tam", tam, expi); document.location.reload(); } function setCookie(name, value, expires) { document.cookie = name + "=" + value + ((expires == null) ? "" : "; expires=" + expires.toGMTString()); } function getCookie(name) { var f=document.cookie; var pos=f.indexOf(name + "="); if (pos!=-1) return f.substring(pos+name.length+1); else return ""; } function imprimir() { window.print(); } String.prototype.trim = function(x) { if (x=='left') return this.replace(/^\s*/,''); if (x=='right') return this.replace(/\s*$/,''); if (x=='normalize') return this.replace(/\s{2,}/g,' ').trim(); return this.trim('left').trim('right'); } function validar() { // Validador estándar de formularios var d=document.form; var bien=true; if (d.obligatoris!=undefined) { var obl=d.obligatoris.value+","; var oblarray=obl.split(","); var etqs=d.etqobligatoris.value+","; var etqsarray=obl.split(","); for (var i=0; i