function retry(n,t){var u=0,f=50,e=10,i=!1,r=window.setInterval(function(){n()&&(window.clearInterval(r),t(i)),u++>f&&(window.clearInterval(r),i=!0,t(i))},10)}function isIE10OrLater(n){var t=n.toLowerCase(),i;return t.indexOf("msie")===0&&t.indexOf("trident")===0?!1:(i=/(?:msie|rv:)\s?([\d\.]+)/.exec(t),i&&parseInt(i[1],10)>=10)?!0:!1}function detectPrivateMode(n){var t,i;if(window.webkitRequestFileSystem)window.webkitRequestFileSystem(window.TEMPORARY,1,function(){t=!1},function(n){console.log(n),t=!0});else if(window.indexedDB&&/Firefox/.test(window.navigator.userAgent)){try{i=window.indexedDB.open("test")}catch(r){t=!0}typeof t=="undefined"&&retry(function(){return i.readyState==="done"?!0:!1},function(n){n||(t=i.result?!1:!0)})}else if(isIE10OrLater(window.navigator.userAgent)){t=!1;try{window.indexedDB||(t=!0)}catch(r){t=!0}}else if(window.localStorage&&/Safari/.test(window.navigator.userAgent)){try{window.localStorage.setItem("test",1)}catch(r){t=!0}typeof t=="undefined"&&(t=!1,window.localStorage.removeItem("test"))}retry(function(){return typeof t!="undefined"?!0:!1},function(){n(t)})}function GetCookie(){var n="varCook";return document.cookie.indexOf(n)==-1?!1:(cookieStart=document.cookie.indexOf(n),cookieValStart=document.cookie.indexOf("=",cookieStart)+1,cookieValEnd=document.cookie.indexOf(";",cookieStart),cookieValEnd==-1&&(cookieValEnd=document.cookie.length),cookieValue=document.cookie.substring(cookieValStart,cookieValEnd),(cookieValue="True")?"True":void 0)}function SetCookie(n,t,i,r,u,f){var e=GetDNS();return document.cookie=n+"="+escape(t)+(i?";expires="+i.toGMTString()+12e5:"")+(r?";path="+r:"")+(u?";domain="+e:"")+(f?";secure":""),!0}function GetDNS(){cookieDomain=document.location.hostname}function closeBrowserSettingAlert(){$(".mobileCookiePopup").css("display","none"),$(".cookiePopup").css("display","none"),window.name="False"}$(document).ready(function(){var i=$(document).height(),r=$(document).width(),t=$(window).height(),n=$(window).width();$(".pageLoader").css("height",i),$(".pageLoader img").css({top:t/2,left:n/2}),$(window).scroll(function(){var n=$(window).scrollTop();$(".pageLoader img").css("top",t/2+n)}),$(".mobileHeader").css("width",$(document).width()),$(".mainMenu").css({width:n-69,left:-(n-69)}),$("#menuSlide").click(function(){$(this).attr("openclose")=="closeMenu"?($(this).attr("openclose","openMenu"),$(".container").animate({"margin-left":n-49},"fast"),$(".mainMenu").animate({left:"0"},"fast"),$(".mainMenu").css("display","block")):($(this).attr("openclose","closeMenu"),$(".container").animate({"margin-left":"0"},"fast"),$(".mainMenu").css("display","none"),$(".mainMenu").animate({left:-(n-69)},"fast"))}),$(".language").click(function(){$("#languageLsts").slideToggle(function(){$(this).is(":visible")?$(".language").removeClass("open").addClass("close"):$(".language").removeClass("close").addClass("open")})}),$(".newInsights").click(function(){$("#newsInsightsLsts").slideToggle(function(){$(this).is(":visible")?$(".newInsights").removeClass("open").addClass("close"):$(".newInsights").removeClass("close").addClass("open")})}),$(".currency").click(function(){$("#currencyLsts").slideToggle(function(){$(this).is(":visible")?$(".currency").removeClass("open").addClass("close"):$(".currency").removeClass("close").addClass("open")})}),$(document).click(function(){$("#dvLogin").hide()}),$("#lnkLoginOption").click(function(n){n.stopPropagation(),$("#dvLogin").css("display")=="block"?$("#dvLogin").css("display","none"):$("#dvLogin").css("display","")}),$("#lnkHongkongSaleTab").click(function(){buildSearchForm_HK("","","0","","","2","","","")}),$("#lnkHongkongLeaseTab").click(function(){buildSearchForm_HK("","","0","","","1","","","")}),$(function(){if($("#monthlyPayment, #downPayment").selectmenu({width:150}),$("#drpPriceMin, #drpPriceMax, #drpBeds").selectmenu({width:70}),$("#drpSize").selectmenu({width:100}),$("#drpFeatures").selectmenu({width:103}),$("#drpCurrency").selectmenu({width:55}),$(document).click(function(){$(".districtArea").slideUp()}),$(".bkmark").length>0){var n=$(".bkmark"),i=$(".bkmark").offset().top,r=$(window),t=$("<div/>").css("height","5px").css("top","0").css("left","0").css("width","100%").css("z-index","99990").css("position","fixed").css("background-color","#7A2727").css("display","none");$(".bkmark").append(t),r.bind("scroll resize",function(){var u=r.scrollTop();u>i&&n.css("position")!="fixed"?(n.css("top","5px").css("left",n.offset().left).css("position","fixed").css("z-index","99990"),n.addClass("home"),t.css("display","block")):u<=i&&n.css("position")=="fixed"&&(n.css("top","auto").css("left","auto").css("position","relative").css("z-index","1"),n.removeClass("home"),t.css("display","none"))})}})}),window.onload=function(){document.getElementsByTagName("body")[0].setAttribute("id","main-body")},detectPrivateMode(function(n){var t,i;if(isPrivate=typeof n=="undefined"?!1:n,BrowserSettingsFlag=="true"&&currntCheckStatus=="true"){if(t="",String(isPrivate)=="true")t="error";else{i="stest",storage=window.sessionStorage;try{storage.setItem(i,"test"),storage.removeItem(i)}catch(r){t="error"}SetCookie("varCook","True","","/","",""),GetCookie()=="True"||(t="error")}t=="error"?isMobile=="True"?$(".mobileCookiePopup").css("display","block"):$(".cookiePopup").css("display","block"):$(".cookiePopup").css("display","none")}else $(".cookiePopup").css("display","none")})