var historyBlocked=false;var isMobile=false;var cache;function getParameterByName(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c=new RegExp("[\\?&]"+a+"=([^&#]*)"),b=c.exec(location.search);return b===null?"":decodeURIComponent(b[1].replace(/\+/g," "))}$(function(){if($('meta[name="ismobile"]').length>0){isMobile=true}var i=function(){$("body").removeClass("no-touch");$("body").unbind("touchstart",i)};$("body").bind("touchstart",i);var a=$("body>.container>.cwrapper").data("class"),k=null;cache=Cache($("body>.cache"));$.get("/service.json",function(l){cache.setPageList(l)},"json");var f=function(){var l=document.location.pathname.replace(/(\/[^\/]*)[\/$].*/i,"$1")+"/";if(l==="//"){l="/"}$(".menu li").removeClass("active");$('.menu li a[href="'+l+'"]').each(function(){$(this).parent().addClass("active")})};if(a!==undefined&&a!==""&&window[a]!==undefined){k=new window[a]($("body>.container>.cwrapper"))}f();if(k!==null){k.load()}preloadImages($("body"),function(){},false,false);if(k!==null){k.loaded()}cache.start();var g=function(){};var b=function(){};var e=function(n){if(n!==undefined&&n!==null&&n!==""){f();var m=$(n);a=m.data("class");$("body>.container").append(m);$("body>.container>.cwrapper:last").addClass("justadded");if(k!==null){k.unload()}k=null;if(a!==undefined&&a!==""&&window[a]!==undefined){k=new window[a](m)}if(k!==null){k.load()}var l=function(){b();setTimeout(function(){$("body>.container>.cwrapper:first").addClass("off");$("body>.container>.cwrapper:last").removeClass("justadded").addClass("new");setTimeout(function(){$("body>.container>.cwrapper:first").remove();$("body>.container>.cwrapper").removeClass("new");if(k!==null){k.loaded()}cache.start()},700)},200)};preloadImages($("body>.container>.cwrapper:last"),function(){},false,false);l()}else{History.go(-1);b();cache.start()}};var j=document.location.pathname;History.Adapter.bind(window,"statechange",function(){var m=History.getState();ga("send","pageview",m.url);var l="/"+m.url.replace(/^(?:\/\/|[^\/]+)*\//,"");l=l.replace(/\?.*/,"");if(j===l){if(k!==null&&k!==undefined&&k.update!==undefined){k.update()}return}if(historyBlocked){f();historyBlocked=false;return}j=l;cache.pause();g();if(cache.isReady(l)>0){e(cache.getCache(l))}else{$.get(m.url.replace(/\?.*/,"")+"?ajax",{},e,"html")}});$(window).resize(function(){if(k!==null){k.resize()}});$(document).on("click",'a[target!="_blank"]',function(l){if($(this).attr("href").indexOf("http")===0||$(this).attr("href").indexOf("mailto")===0||$(this).hasClass("special")){return}l.stopPropagation();l.preventDefault();historyBlocked=false;History.pushState({},"Cadus",$(this).attr("href"))});var d=null;var h=function(){if(d){clearTimeout(d);d=null}$(".pfilters").addClass("active").css({left:$('.menu a[href="/portfolio/"]').offset().left+"px"})};var c=function(){d=setTimeout(function(){$(".pfilters").removeClass("active").addClass("off");setTimeout(function(){$(".pfilters").removeClass("off")},400)},300)};$('.menu a[href="/portfolio/"]').parent().hover(h,c);$(".pfilters").hover(h,c)});var queue=(function(){var g=0,f=0,b=[],h=0;var e;var c=function(j,k){var i=setInterval(function(){if(j.get(0).complete){clearInterval(i);j.remove();h--;k()}},100)};var a=function(){e=setInterval(function(){if(f===1||g===1||h>3){return}f=1;if(b.length>0){var i=b.shift();h++;var j=$("");j.attr("src",i[0]).css({position:"absolute",top:"-100000px",left:"-100000px",opacity:".00001","z-index":0});$("body").append(j);if(j.get(0).complete){h--;j.remove();if(i[1]!==undefined){i[1]()}}else{c(j,i[1])}}else{clearInterval(e);f=2;d()}f=0},10)};var d=function(){e=setInterval(function(){if(b.length>0){clearInterval(e);f=0;a()}},2000)};a();return{addImage:function(i,j){b.push([i,j])},pause:function(){g=1},resume:function(){g=0}}})();var preloadImages=function(g,o,k,n){var c=0;var m=[];$("*",g).each(function(){if($(this).prop("tagName").toLowerCase()==="img"){if($(this).attr("src")!==undefined&&$(this).attr("src")!==null&&$(this).attr("src")!==""&&$(this).data("preload")!=="no"){c++;m.push($(this).attr("src"))}}if($(this).css("background-image")!==undefined&&$(this).css("background-image")!==null&&$(this).css("background-image")!==""){var i=/url *\( *['"]?([^'""]*)['"]? *\) *;?.*/gi;if(i.test($(this).css("background-image"))){c++;m.push($(this).css("background-image").replace(i,"$1"))}}if(k===true&&$(this).attr("data-image")!==undefined&&$(this).attr("data-image")!==null&&$(this).attr("data-image")!==""){c++;m.push($(this).attr("data-image"))}});var j=c;var d=setInterval(function(){if(c<=0){clearInterval(d);o()}},100);var f=function(i,p,q){if(m[i]!==""){c--;p.remove();m[i]=""}};var l=function(i){return function(){if(m[i]!==""){c--;m[i]=""}}};var e=function(q,p){var i=setInterval(function(){if(p.get(0).complete){clearInterval(i);f(q,p,1)}},100)};for(var h=0;h");a.attr("src",m[b]).css({position:"absolute",top:"-100000px",left:"-100000px",opacity:".00001","z-index":0});$("body").append(a);if(a.get(0).complete){f(b,a,2)}else{e(b,a)}}}};var Cache=function(i){var j=-1,b=i,e=0,d=[];var f=null;var h=function(c){if(f===null){f=c}};var a=function(){if(d.length<=0){setTimeout(a,1000);return}if(j===0){if(e>0){}if(e<=0||f.isReady(d[e-1])===2){g(d[e]);e++}if(e");k.addClass("cached");k.attr("data-url",c);k.html(l.replace(/ id=/ig," data-cached-id="));b.append(k);k.data("ready",0);preloadImages(k,function(){k.data("ready",1)},true,true)}},"html")};return{pause:function(){j=1;queue.pause()},start:function(){h(this);if(j===-1){j=0;a()}else{j=0}queue.resume()},isReady:function(k){var c=0;if($('.cached[data-url="'+k+'"]',b).length>0){c=1;if($('.cached[data-url="'+k+'"]',b).data("ready")===1){c=2}}return c},getCache:function(c){var k="";if(this.isReady(c)>0){k=$('.cached[data-url="'+c+'"]',b).html().replace(/ data-cached-id=/ig," id=")}return k},setPageList:function(c){if(c!==undefined&&c!==null&&c.length>0){d=c}}}};var beautify=function(c,a){var d=0;var b=$("body>.container>.cwrapper:last");$(".beautify.onscroll",b).each(function(){if($(this).hasClass("special")&&c!==true){return}var g=$(this);if($(this).hasClass("numbflip")||$(this).hasClass("numbflipbig")){g=g.parent()}d++;var i=g.offset().top-$(window).scrollTop();var f=g.outerHeight();if(f>$(window).height()/2){f=$(window).height()/2}var h=false;if($(this).parents().filter(function(){return $(this).css("display")==="none"}).length>0){h=true}if((!h&&i+g.outerHeight()>0&&($(window).height()-i)/f>=0.2)||(a!==undefined&&$(this).parents(a).length>0)){var j=Math.random()*1.2+0.3;var e=Math.random()*0.3;if($(this).hasClass("numbflip")||$(this).hasClass("numbflipbig")){j+=0.7;e+=0.1}$(this).css({"animation-duration":j+"s","-webkit-animation-duration":j+"s","-moz-animation-duration":j+"s"});$(this).css({"animation-delay":e+"s","-webkit-animation-delay":e+"s","-moz-animation-delay":e+"s"});$(this).addClass("on")}else{$(this).removeClass("on")}});$("body>.container>.cwrapper:last .beautify:not(.onscroll):not(.on)").each(function(){$(this).addClass("on")})};$(window).scroll(beautify);var mainpage=function(a){return{load:function(){this.resize()},loaded:function(){this.resize()},unload:function(){},resize:function(){}}};var portfoliopage=function(a){return{load:function(){this.update();this.resize()},loaded:function(){this.resize()},update:function(){$(".project",a).removeClass("hide");var d=document.location.search.replace(/\?/ig,"").split("&");for(var b=0;b=k.length){B=0}p(B,z,A)});$(".gleft",y).click(function(C){C.stopPropagation();var B=$(".point.active",A).data("image")-1;if(B<0){B=k.length-1}p(B,z,A)});z.click(function(C){C.stopPropagation();var B=$(".point.active",A).data("image");x(B)})};var n=function(z){z.html("");for(var y=0;y')}};var p=function(A,y,z){$(".point",z).removeClass("active");$(".point",z).eq(A).addClass("active");$(".image",y).removeClass("active").addClass("old");y.append('
");setTimeout(function(){$(".image.new",y).addClass("active")},10);setTimeout(function(){$(".image.old",y).remove();$(".image.new",y).removeClass("new")},410)};var v=function(){$("body").append('
');var y=$("."+b);var A=$("."+b+" .bgselector");var z=$("."+b+" .bgimage");n(A);$(".point",A).click(function(B){B.stopPropagation();p($(this).data("image"),z,A)});$(".bgright",y).click(function(C){C.stopPropagation();var B=$(".point.active",A).data("image")+1;if(B>=k.length){B=0}p(B,z,A)});$(".bgleft",y).click(function(C){C.stopPropagation();var B=$(".point.active",A).data("image")-1;if(B<0){B=k.length-1}p(B,z,A)});$(".bgclose",y).click(function(){j()})};var x=function(A){var y=$("."+b+" .bgimage");var z=$("."+b+" .bgselector");$("."+b).removeClass("close").addClass("show");p(A,y,z)};var j=function(){$("."+b).removeClass("show").addClass("close");setTimeout(function(){$("."+b).removeClass("close")},700)};var h=function(){$("."+b).remove()};var l=null;$(".location",o).click(function(){$(".gmap",o).removeClass("close").addClass("show");o.scrollTop(0);if(l===null){google.maps.event.trigger(u,"resize");u.setCenter(w);l=s(g.data("lat"),g.data("lon"),g.data("name"));console.log(l)}else{google.maps.event.trigger(u,"resize");u.setCenter(w);c(l)}});$(".gmap .gmclose",o).click(function(){$(".gmap",o).removeClass("show").addClass("close");setTimeout(function(){$(".gmap",o).removeClass("close")},700)});var g=$(".gmap",o);var i=$(".map",g);var w=new google.maps.LatLng(g.data("lat"),g.data("lon"));var t={center:w,zoom:18,tilt:0,minZoom:5,mapTypeId:google.maps.MapTypeId.SATELLITE,disableDefaultUI:true,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]}]};var u=new google.maps.Map(i.get(0),t);var d=function(B){var A=1<");z.addClass("marker").html('
'+y+"
").data("lat",B).data("long",A);g.append(z);return z};var s=function(B,A,y){var z=a(B,A,y);c(z);return z};var c=function(y){var A=new google.maps.LatLng(y.data("lat"),y.data("long"));var z=d(A);y.css({top:(z.y-48)+"px",left:(z.x-47)+"px"})};google.maps.event.addDomListener(window,"resize",function(){google.maps.event.trigger(u,"resize")});google.maps.event.addDomListener(u,"bounds_changed",function(){if(l!==null){c(l)}});$(".scalein",o).click(function(){u.setZoom(u.getZoom()+1)});$(".scaleout",o).click(function(){u.setZoom(u.getZoom()-1)});$(".floorplan").click(function(){o.scrollTop(0);$(".plans",o).removeClass("close").addClass("show")});$(".plans .pclose",o).click(function(y){y.stopPropagation();$(".plans",o).removeClass("show").addClass("close");setTimeout(function(){$(".plans",o).removeClass("close")},700)});var m=function(){f();r(0);var A={x:$(".viewport .plan",o).offset().left,y:$(".viewport .plan",o).offset().top};$(".pselector",o).on("click",".point",function(E){r($(this).data("plan"))});var D=false,y=false,C=0,B=0,z=false;$(".viewport",o).on("click",".plan",function(G){if(z){return}G.stopPropagation();if($(this).hasClass("big")){if(!D){z=true;var H=-($(this).offset().left-A.x)/2;var F=-($(this).offset().top-A.y)/2;$(this).css({"-moz-transform-origin":H+"px "+F+"px","transform-origin":H+"px "+F+"px","-ms-transform-origin":H+"px "+F+"px","-webkit-transform-origin":H+"px "+F+"px",top:"",left:""}).removeClass("big");setTimeout(function(){z=false},800)}else{D=false}}else{if($(this).offset().left<0||$(this).offset().left>$(".viewport",o).width()||$(this).offset().top<0||$(this).offset().top>$(".viewport",o).height()){return}z=true;A.x=$(this).offset().left;A.y=$(this).offset().top;var E=G.pageX-$(this).offset().left,I=(G.pageY-$(this).offset().top);var H=3*E/2-$(this).width()/4;var F=3*I/2-$(this).height()/4;$(this).css({"-moz-transform-origin":H+"px "+F+"px","transform-origin":H+"px "+F+"px","-ms-transform-origin":H+"px "+F+"px","-webkit-transform-origin":H+"px "+F+"px"}).addClass("big");setTimeout(function(){z=false},800)}}).on("mousedown",".plan",function(E){if(z){return}if($(this).hasClass("big")){y=true;$(this).addClass("grab");D=false;C=E.pageX;B=E.pageY}}).on("mousemove",".plan",function(H){if(z){return}if($(this).hasClass("big")&&y){H.stopPropagation();D=true;var F=H.pageX-C,E=H.pageY-B;var I=$(this).offset().left+F;var G=$(this).offset().top+E;$(this).offset({top:G,left:I});C=H.pageX;B=H.pageY}}).on("mouseup",".plan",function(E){if(z){return}y=false;$(this).removeClass("grab");C=0;B=0;if($(this).hasClass("big")&&D){E.stopPropagation()}})};var f=function(){$(".plans .pselector .pswrapper",o).html("");for(var y=0;y'+e.eq(y).data("caption")+"")}};var r=function(A){var z=$(".pselector .pswrapper",o);var y=$(".viewport",o);$(".point",z).removeClass("active");$(".point",z).eq(A).addClass("active");$(".plan",y).removeClass("active").addClass("old");y.append('
");setTimeout(function(){$(".plan.new",y).addClass("active")},10);setTimeout(function(){$(".plan.old",y).remove();$(".plan.new",y).removeClass("new")},410)};return{load:function(){q();v();m();this.resize()},loaded:function(){this.resize()},unload:function(){h()},resize:function(){}}};var legalpage=function(a){return{load:function(){this.resize()},loaded:function(){this.resize()},unload:function(){},resize:function(){}}};var investorspage=function(a){return{load:function(){this.resize()},loaded:function(){this.resize()},unload:function(){},resize:function(){}}};var contactpage=function(b){var c={assetsUrl:"/assets/components/ajaxform/",actionUrl:"/assets/components/ajaxform/action.php",formSelector:$(".contactusform",b)};var a={initialize:function(){if(!jQuery().ajaxForm){$("body").append('