function logError(a){console&&console.log(a)}function firstToUpperCase(a){a=trim(a);return a.charAt(0).toUpperCase()+a.substr(1)}function layerdisplaynone(a){layerdisplay(a,"none")}function layerdisplay(a,b){try{thisnewnstaus=b;if(document.getElementById)document.getElementById(a).style.display=thisnewnstaus;else if(document.all)document.all[a].style.display=thisnewnstaus;else if(document.layers)document.layers[a].style.display=thisnewnstaus}catch(c){logError("Error layerDisplay. Layer: "+a)}}
function deleteRecord(){if(confirm("Est\u00e1 a punto de eliminar el registro. \u00bfDesea continuar?")){forma.op.value="delete";forma.submit();return true}else return false}function updateRecord(){alert("");document.forma.op.value="update";_CF_checkforma(document.forma)&&document.forma.submit()}function addRecord(){document.forma.op.value="add";_CF_checkforma(document.forma)&&document.forma.submit()}
function geochange(a,b){var c;if(a==1)c=document.forma.idgeonivel1.value;else if(a==2)c=document.forma.idgeonivel2.value;else if(a==3)c=document.forma.idgeonivel3.value;else if(a==4)c=document.forma.idgeonivel4.value;else if(a==5)c=document.forma.idgeonivel5.value;else if(a==6)c=document.forma.idgeonivel6.value;document.forma.op.value="reload";document.forma.geolevel.value=a;document.forma.geovalue.value=c;document.forma.submit()}
function searchlocation(a){document.forma.searchlocation.value==""?alert("Por favor, introduzca una palabra clave."):window.open("../inc/searchloc.cfm?recordid="+a+"&keyword="+document.forma.searchlocation.value,"colors","width=500,height=600,scrollbars=1,fullscreen=0,resizable=0,status=0,toolbar=0,location=0,directories=0,menubar=0")}
function searchlocationfull(a){document.forma.searchlocation.value==""?alert("Por favor, introduzca una palabra clave."):window.open("../inc/searchlocfull.cfm?idz="+a+"&keyword="+document.forma.searchlocation.value,"colors","width=600,height=600,top=0,scrollbars=1,fullscreen=0,resizable=1,status=0,toolbar=0,location=0,directories=0,menubar=0")}function set(a,b){temp=document.forma.elements.length;for(i=0;i<temp;i++)if(document.forma.elements[i].name==b)document.forma.elements[i].checked=a}
function Invers(){temp=document.forma.elements.length;for(i=0;i<temp;i++)document.forma.elements[i].checked=document.forma.elements[i].checked==1?0:1}function popUpConverter(){CurrencyWindow=window.open("","CurrencyWindow","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,height=135,width=550");CurrencyWindow.focus();CurrencyWindow.location.href="http://www.xe.com/pca/input.cgi";history.back()}
function checkInteger(a){if(a.length==0)return true;return a.indexOf(".")<1?checkNumber(a):false}function checkNumber(a){if(a.length==0)return true;var b,c=false,d=false,e=false;b=" .+-0123456789".indexOf(a.charAt(0));if(b==1)c=true;else if(b<1)return false;for(var f=1;f<a.length;f++){b=" .0123456789".indexOf(a.charAt(f));if(b<0)return false;else if(b==1)if(c)return false;else c=true;else if(b==0){if(c||e)d=true}else if(d)return false;else e=true}return true}
function NuevaVentana(a,b,c,d){window.open(a,b,"toolbar=no,titlebar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,fullscreen=no,scrollbars=yes,top=10,left=10,width="+c+",height="+d)}function targetBlank(a){window.open(a,"","toolbar=yes,titlebar=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,copyhistory=yes,fullscreen=no,scrollbars=yes,top=10,left=10,width="+screen.availWidth+",height="+screen.availHeight)}
function vf(a){document.location="/"+a}function vfb(a){document.frmfile.action="/beaches/file.php/ref/"+a+".htm";document.frmfile.submit();return false}function viewFile(a){eval("this.document.file"+a).submit()}function viewFileInLang(a,b){eval("this.document.file"+b+"_"+a).submit()}function viewImg(a){viewImgGen("ppal",a,0)}function viewImgMap(a){viewImgGen("mapa",a,1)}
function viewImgGen(a,b,c){a=eval("this.document."+a+".src");var d=a.split("/")[6];str4=d.substring(0,d.length-6)+".jpg";if(c==1)var e=d=510;else{d=510;e=340}NuevaVentana("/houses/popUpFoto.cfm?t="+c+"&arc="+a.substring(0,a.length-6)+".jpg&an="+d+"&al="+e+"&wan="+(d+50)+"&wal="+(e+100)+"&tit="+b+"&txt="+b,"Foto",d+50,e+100)}
function pop(a,b,c,d,e){a="/inc/image.php?tit="+escape(a)+"&ref="+b+"&tp="+c+"&li="+e+"&i="+d;window.open(a,"Foto","toolbar=no,titlebar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,fullscreen=no,scrollbars=yes,top=10,left=10,width=560,height=445")}
function viewBeach(a){var b=document.ppal.src,c=b.substring(0,b.length-6)+".jpg",d=510;d+=50;var e=340;e+=100;b=b.replace("small","ori");NuevaVentana("/beaches/popUpFoto.cfm?t="+document.ppal.id+"&arc2="+c+"&arc="+b+"&an="+d+"&al="+e+"&wan="+d+"&wal="+e+"&tit="+a+"&txt=","Foto",d,e)}function viewImage(a,b,c,d,e){return viewImageEx(a,b,c,d,e,"beach")}
function viewImageEx(a,b,c,d,e,f){var g=510;g+=50;var h=340;h+=100;NuevaVentana("/beaches/popUpFoto.cfm?t="+a+"&arc2=/images/"+f+b+"/img"+c+".jpg&arc=/images/"+f+"/"+b+"/img"+c+".jpg&an=510&al=340&wan=560&wal=440&tit="+a+"&txt=&n="+d+"&d="+e+"&it="+f,"Foto",g,h)}
function chgSel(a){if(a==1){document.rangeFrm.idgeo.selectedIndex=0;if(typeof document.rangeFrm.choose!="undefined")document.rangeFrm.choose[1].checked=true}if(a==2){document.rangeFrm.idzona.selectedIndex=0;if(typeof document.rangeFrm.choose!="undefined")document.rangeFrm.choose[0].checked=true}}function getSearchCode(a,b){newcharacter=a.indexOf(b)!=-1?a.replace(b,""):a+b;(newcharacter=newcharacter.replace("s",""))||(newcharacter="s");createCookie("m",newcharacter,1);return newcharacter}
function getImageMapping(a){a=new String(a.responseText);document.getElementById("dv_image_mapping").innerHTML=a}function disableIdIfNoNValue(a,b){try{if(parseInt(b))document.getElementById(a).disabled=false;else document.getElementById(a).disabled=true}catch(c){}}function isEmail(a){return/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.(([a-z]{2,3})|(aero|coop|info|museum|name))$/i.test(a)}
function genPopUp(a){window.open(a,"Rentalia","toolbar=no,titlebar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,fullscreen=no,scrollbars=yes,top=10,left=10,width=500,height=570")}function showSearchButton(){if(document.getElementById("p").innerHTML.length!=0||document.getElementById("c").innerHTML.length!=0)document.getElementById("dv_simple_search").style.display="none";else document.getElementById("dv_simple_search").style.display=""}
function trim(a){a=a;for(var b=a.substring(0,1);b==" ";){a=a.substring(1,a.length);b=a.substring(0,1)}for(b=a.substring(a.length-1,a.length);b==" ";){a=a.substring(0,a.length-1);b=a.substring(a.length-1,a.length)}for(;a.indexOf("  ")!=-1;)a=a.substring(0,a.indexOf("  "))+a.substring(a.indexOf("  ")+1,a.length);return a}function zeroFill(a,b){res="";if(b>a.length){for(i=0;i<b-a.length;i++)res+="0";res+=a}else res=a;return res}
function CompruebaDatos(a){var b=false;a=a.toUpperCase();return b=/^[A-Za-z0-9]{9}$/.test(a)?/^[ABCDEFGHKLMNPQS]/.test(a)?true:false:false}function isCIF(a){if(!CompruebaDatos(a))return false;var b=new Array(0,2,4,6,8,1,3,5,7,9),c=0;for(i=2;i<=6;i+=2){c+=b[parseInt(a.substr(i-1,1))];c+=parseInt(a.substr(i,1))}c+=b[parseInt(a.substr(7,1))];c=10-c%10;return c==10?true:c==a.substr(8,1)?true:false}
function isNIF(a){if(a.substr(0,1).toUpperCase()=="X")return true;if(!checkInteger(a.substr(0,1)))return isCIF(a);if(a=="")return true;if(a.length<9)return false;var b=a.substring(0,8);if(!checkInteger(b))return false;if("TRWAGMYFPDXBNJZSQVHLCKET".charAt(b%23)!=a.substring(8).toUpperCase())return false;return true}function createCookie(a,b,c){if(c){var d=new Date;d.setTime(d.getTime()+c*2*60*60*1E3);c="; expires="+d.toGMTString()}else c="";document.cookie=a+"="+b+c+"; path=/"}
function deleteCookie(a){try{var b=new Date;b.setTime(b.getTime()-1);document.cookie=a+("=; expires="+b.toGMTString())}catch(c){alert("rentalia_functions, delete cookie: "+c)}}function readCookie(a){a=a+"=";for(var b=document.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];d.charAt(0)==" ";)d=d.substring(1,d.length);if(d.indexOf(a)==0)return d.substring(a.length,d.length)}return null}
function setSearchType(a,b,c){if(document.getElementById(a).innerHTML.length!=0){document.getElementById(a).innerHTML="";document.getElementById("plus_"+a).src="/images/plus_small.gif";document.getElementById(a).style.display="none"}else{document.getElementById(a).innerHTML=document.getElementById("cached_"+a).innerHTML;document.getElementById("plus_"+a).src="/images/minus_small.gif";document.getElementById(a).style.display=""}showSearchButton();return tomode(b)}
function Select_Value_Set(a,b){SelectObject=a;for(index=0;index<SelectObject.length;index++)if(SelectObject[index].value==b)SelectObject.selectedIndex=index}function getClickX(a){var b=0;if(!a)a=window.event;if(a)if(a.pageX||a.pageY)b=a.pageX;else if(a.clientX||a.clientY)b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;return b}
function getClickY(a){var b=0;if(!a)a=window.event;if(a)if(a.pageX||a.pageY)b=a.pageY;else if(a.clientX||a.clientY)b=a.clientY+document.body.scrollTop+document.documentElement.scrollTop;return b}function clickEyeTracking(a){try{var b=0,c=0;if(!a)a=window.event;b=getClickX(a);c=getClickY(a);if(readCookie("ET"))var d=readCookie("ET");else{d="w="+screen.width+"&h="+screen.height+"&posx="+b+"&posy="+c;createCookie("ET",d,1)}execAjax("/rpc/eye-tracking.php?"+d,"getEyeTracking")}catch(e){}}
function getEyeTracking(a){try{a=new String(a);createCookie("ET","",0)}catch(b){}return true}(tmpEt=readCookie("ET"))&&clickEyeTracking();
function showHelp(a,b,c,d){a=document.getElementById(a);a.onclick=function(e){var f;if(!e)e=window.event;f=getClickX(e);e=getClickY(e);layerdisplay(b,"block");document.getElementById(b).style.top=parseInt(e)-parseInt(d)-parseInt(document.getElementById(b).offsetHeight)+"px";document.getElementById(b).style.left=parseInt(f)-parseInt(c)-parseInt(document.getElementById(b).offsetWidth)+"px"}}
function addlistener(a,b,c){b=document.getElementById(b);if(b.addEventListener)b.addEventListener(a,c,false);else if(b.attachEvent)var d=b.attachEvent("on"+a,c);return d}function comprobarEmail(a){a=a.value;var b=a.indexOf("@");a=a.substring(b);a.toLowerCase()=="@hotmail.com"?layerdisplay("aviso_email","block"):layerdisplay("aviso_email","none")}function changeBG(a,b,c){a.style.backgroundColor=b;a.style.cursor=c}
function err(a,b,c){if(typeof c=="undefined")c="No defined";a="ename="+a.name+"&edescription="+a.description+"&enumber="+a.number+"&emessage="+a.message+"&p="+b+"&w="+c+"&browser="+navigator.appName+"&useragent="+navigator.userAgent;if(execAjax)execAjax("/rpc/err.php?"+a,"");else a=new Ajax.Request("/rpc/err.php",{method:"post",parameters:a})}function getTrue(a){return true}function isDefined(a){return!!document.getElementById(a)}
function isDefinedValueRadioButton(a){return isDefined(a)?document.getElementById(a).checked:false}function pg_print(){bV=parseInt(navigator.appVersion);bV>=4&&window.print()}function countcars(a,b,c,d){if(document.getElementById(a).value.length>=c){document.getElementById(b).innerHTML="<font color=red>"+d+"</font>";document.getElementById(a).value=document.getElementById(a).value.substr(0,c)}else document.getElementById(b).innerHTML=""}
function setUpdateCalendar(a,b,c){execAjax("/houses/dispo_calendario.php?id="+a+"&month="+b+"&year="+c,"getUpdateCalendar")}function getUpdateCalendar(a){document.getElementById("calendrio_disponibilidad").innerHTML=a}function findPos(a){var b=curtop=0;if(a.offsetParent){do{b+=a.offsetLeft;curtop+=a.offsetTop}while(a=a.offsetParent)}return[b,curtop]}
function getWindowHeightWidth(a){var b=0,c=0;if(typeof window.innerWidth=="number")if(a){b=parent.window.innerHeight;c=parent.window.innerWidth}else{b=window.innerHeight;c=window.innerWidth}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){b=document.documentElement.clientHeight;c=document.documentElement.clientWidth}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){b=document.body.clientHeight;c=document.body.clientWidth}return[b,
c]}
function getScrollXY(a){var b=0,c=0;if(typeof window.pageYOffset=="number")if(a){c=parent.window.pageYOffset;b=parent.window.pageXOffset}else{c=window.pageYOffset;b=window.pageXOffset}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){c=document.body.scrollTop;b=document.body.scrollLeft}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){c=document.documentElement.scrollTop;b=document.documentElement.scrollLeft}return[b,c]}
var processingcomment=Array();function fold_unfold_commentarios(a,b,c,d,e){if(processingcomment[a+b]==undefined){processingcomment[a+b]=1;document.getElementById("commentzone_"+a+b).innerHTML+="<img src='/images/animations/loader_"+e+"_small.gif' style='vertical-align: middle;'>";isownerreply=b?1:0;execAjax("/rpc/getcomment.php?id="+a+"&isownerreply="+isownerreply+"&mode="+c+"&maxchars="+d,"changeComment")}return false}
function changeComment(a){if(a!="Invalid Call..."){commentdelimiter="COMMENTSTART\n";firstbackslashn=a.indexOf("\n",0);commentstart=a.indexOf(commentdelimiter,0);idcommentario=a.substr(0,firstbackslashn);isownerreply=a.substr(firstbackslashn+1,1);cleantext=a.substr(commentstart+commentdelimiter.length,a.length);ownerreply=isownerreply=="1"?"_reply":"";document.getElementById("commentzone_"+idcommentario+ownerreply).innerHTML=cleantext;processingcomment[idcommentario+ownerreply]=undefined}}
function changeDisplay(a){var b;if(document.getElementById)b=document.getElementById(a).style.display;else if(document.all)b=document.all[a].style.display;else if(document.layers)b=document.layers[a].style.display;b=="none"?layerdisplay(a,""):layerdisplay(a,"none")}
function justNumbers(a){var b;if(window.event){if(window.event.shiftKey)return false;b=window.event.keyCode}else if(a.which){if(a.shiftKey)return false;b=a.which}return toreturn=b==8||b==46||b==39||b==37||b==144?true:b>31&&(b<48||b>57)&&(b<96||b>105)?false:true}function removeNonNumbers(a){a.value=a.value.replace(/[^0-9]+/,"");return true}var opacidad=0;function fade(a){for(var b=opacidad=0;b<11;b++)setTimeout('setOpacity("'+a+'",'+b+")",100*b)}
function fadeOut(a){for(var b=opacidad=10;b>=0;b--)setTimeout('setOpacity("'+a+'",'+b+")",100*(11-b))}function setOpacity(a,b){if(b<11&&(opacidad+1==b||opacidad-1==b)){document.getElementById(a).style.opacity=b/10;document.getElementById(a).style.filter="alpha(opacity="+b*10+")"}opacidad=b}function doSlide(a){timeToSlide=35;obj=document.getElementById(a);height=obj.offsetHeight;obj.style.height="0px";pxPerLoop=height/timeToSlide;slide(obj,0,height,pxPerLoop)}
function slide(a,b,c,d){if(b<c){a.style.height=b+"px";b+=d;setTimeout(function(){slide(a,b,c,d)},1)}else a.style.height="auto"};
