﻿var loadHelpSem=true;var loadCurrency=true;var semTransfer=true;var staticPath="/js/static_js/";var mascLoad=new Array();mascLoad.header_func=0;mascLoad.showbox=0;mascLoad.showfilters=0;function showLoadingPanel(){$("body").append('<div id="loading-cont"><div class="loading-box"><div></div><p>'+regional.Loading+"..</p></div></div>");}function hideLoadingPanel(){$("body #loading-cont").remove();}function activeTransfer(){semTransfer=true;}function errorMsg(msg){var datatotdom=document.createElement("div");var $rdatatotdom=$(datatotdom);$rdatatotdom.addClass("errorMsg");$rdatatotdom.append(msg);return $rdatatotdom;}function msieversion(){var ua=window.navigator.userAgent;var msie=ua.indexOf("MSIE ");if(msie>0){return parseInt(ua.substring(msie+5,ua.indexOf(".",msie)));}else{return 0;}}function printPage(){window.print();}function addSocialFooter(){if(vglobal.enabledSocial){$("#social_networks").append('<li class="google-plus_cont"><script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script><g:plusone size="medium"></g:plusone></li ><li class="twitter_cont"> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></li><li class="last">  <div id="fb-root" style="float:left"></div></li>');}var t=setTimeout("animateSocialFooter()",4000);}function animateSocialFooter(){$.getScript("/js/fb.js",function(data,textStatus){$("#fb-root").onefblike({appID:"119963884683252",lang:vglobal.culture});$("#social_networks_position").animate({bottom:"+=59"},1000,function(){$("#social_networks_position .remove").click(function(){$("#social_networks_position").remove();});});});}function menuapp(){$('a[rel*="showbox"]').click(function(){if(!mascLoad.showbox){mascLoad.showbox=1;var href=$(this).attr("href");$.getScript(staticPath+"jquery.showbox.js",function(data,textStatus){$("a[rel*=showbox]").showbox();if(href.match(/#/)){loadHelp();$("#faq_this_page").click(function(){loadHelp();});}else{jQuery.showbox({ajax:href});}});}return false;});$("#btnGoogleSearch").click(function(){if(!mascLoad.header_func){$.getScript(staticPath+"header-func-post.js",function(){mascLoad.header_func=1;sendGoogleSearch();});}else{sendGoogleSearch();}});$("#menu-currency").click(function(){if(!mascLoad.header_func){$.getScript(staticPath+"header-func-post.js",function(){mascLoad.header_func=1;toggleCurrency();});}else{toggleCurrency();}});$("#nav li").hover(function(){$(this).find("ul:first").css({visibility:"visible",display:"none"}).show(300);return true;},function(){$(this).find("ul:first").css({visibility:"hidden"});return true;});$("li.menu-item").hover(function(){$(this).addClass("menu-item-active");$(this).find("a:first").addClass("a-item-active");},function(){$(this).removeClass("menu-item-active");$(this).find("a:first").removeClass("a-item-active");return true;});$("li.menu-itemo").hover(function(){$(this).addClass("menu-item-activeo");$(this).find("a:first").addClass("a-item-active");return true;},function(){$(this).removeClass("menu-item-activeo");$(this).find("a:first").removeClass("a-item-active");return true;});$(".ct_lang").hover(function(){},function(){$(this).fadeOut(400);return true;});$("#menu-langs").click(function(){$(this).find(".ct_lang").toggle();return true;});$(".apartment-equipment img").tipsy({title:"alt",live:true,opacity:1});$(".comp").tipsy({fallback:regional.tooltip_comparador,gravity:"ne",html:true,fade:true,opacity:1});$("#tipbebes").tipsy({fallback:regional.searchForm_tipBebes,gravity:"w",fade:true,opacity:1});$("#menu-currency .round-input").tipsy({fallback:regional.tooltip_cambio,html:true,gravity:"ne",fade:true,opacity:1});if(vglobal.enabledBottomPanel){var t=setTimeout("addSocialFooter()",1000);}}function newWin(urlWin){window.open(urlWin,"articles");}function addtofavorites(){if(window.sidebar){window.sidebar.addPanel("Only apartments",document.location,"");}else{if(window.external){window.external.AddFavorite(document.location,"Only apartments");}}}function GetHiddenField(fieldId){var value=document.getElementById(fieldId).value;var field=document.createElement("input");field.setAttribute("type","hidden");field.setAttribute("name",fieldId);field.setAttribute("value",value);return field;}function getChildNodes(f){f.appendChild(GetHiddenField("fIdioma"));f.appendChild(GetHiddenField("fCurrency"));f.appendChild(GetHiddenField("fcal-arr"));f.appendChild(GetHiddenField("fcal-go"));f.appendChild(GetHiddenField("fPax"));f.appendChild(GetHiddenField("fPaxBabies"));f.appendChild(GetHiddenField("fidDestino"));return f;}function Search(){var f=document.createElement("form");f=getChildNodes(f);f.setAttribute("name","formSearch");f.setAttribute("action","/SearchResultList.aspx");f.setAttribute("method","POST");var field=document.createElement("input");field.setAttribute("type","hidden");field.setAttribute("name","fDestino");field.setAttribute("value","true");f.appendChild(field);document.body.appendChild(f);f.submit();}function SearchMoreApartments(){doSearch(document.getElementById("fidDestino").value,document.getElementById("fcal-arr").value,document.getElementById("fcal-go").value,document.getElementById("fPaxApt").value,document.getElementById("fPaxBabiesApt").value,document.getElementById("fIdioma").value,document.getElementById("fCurrency").value);}function doSearch(fiddestino,fcalarr,fcalgo,fpax,fkids,fbabies,fidioma,fcurrency){var f=document.createElement("form");f.setAttribute("name","formSearch");f.setAttribute("action","/SearchResultList.aspx");f.setAttribute("method","POST");var field=document.createElement("input");field.setAttribute("type","hidden");field.setAttribute("name","fDestino");field.setAttribute("value","true");f.appendChild(field);var field=document.createElement("input");field.setAttribute("type","hidden");field.setAttribute("name","fidDestino");field.setAttribute("value",fiddestino);f.appendChild(field);var field=document.createElement("input");field.setAttribute("type","hidden");field.setAttribute("name","fcal-arr");field.setAttribute("value",fcalarr);f.appendChild(field);var field=document.createElement("input");field.setAttribute("type","hidden");field.setAttribute("name","fcal-go");field.setAttribute("value",fcalgo);f.appendChild(field);var field=document.createElement("input");field.setAttribute("type","hidden");field.setAttribute("name","fPax");field.setAttribute("value",fpax);f.appendChild(field);var field=document.createElement("input");field.setAttribute("type","hidden");field.setAttribute("name","fPaxBabies");field.setAttribute("value",fbabies);f.appendChild(field);var field=document.createElement("input");field.setAttribute("type","hidden");field.setAttribute("name","fIdioma");field.setAttribute("value",fidioma);f.appendChild(field);var field=document.createElement("input");field.setAttribute("type","hidden");field.setAttribute("name","fCurrency");field.setAttribute("value",fcurrency);f.appendChild(field);document.body.appendChild(f);f.submit();}function adload(idboxload){$(idboxload).addClass("loadingicon");}function remload(idboxload){$(idboxload).removeClass("loadingicon");}
