!function(a){"use strict";function e(){return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(|\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg(g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v)|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v)|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|)|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)))}!function(){for(var a=0,e=["ms","moz","webkit","o"],t=0;ti.right||t.bottomi.bottom)},a.fn.parallaxBackground=function(t){return this.each(function(){function i(a){return m=a.outerWidth(),p=a.outerHeight(),f=z.height(),k=z.width(),e()&&(q=2),"left"!==j.parallaxDirection&&"right"!==j.parallaxDirection||(m+=q*(k*Math.abs(parseFloat(j.parallaxSpeed)))),"up"!==j.parallaxDirection&&"down"!==j.parallaxDirection||(p+=q*(f*Math.abs(parseFloat(j.parallaxSpeed)))),[m,p]}function n(a,e){switch(w=parseInt(a.css("padding-left").replace("px","")),u=parseInt(a.css("padding-right").replace("px","")),g=parseInt(a.css("padding-top").replace("px","")),x=parseInt(a.css("padding-bottom").replace("px","")),h=(e[1]-a.outerHeight())/2,b=(e[0]-a.outerWidth())/2,j.parallaxDirection){case"up":case"down":y=-w,D=-(h+g),S=0;break;case"left":case"right":y=-(b+w),D=-g,S=0}return[y,D,S]}var r,o,l,p,s,c,d,m,g,x,w,u,h,b,f,k,v=a(this),z=a(window),y=0,D=0,S=0,A=0,F=0,q=1,B={parallaxBgImage:"",parallaxBgPosition:"center center",parallaxBgRepeat:"no-repeat",parallaxBgSize:"cover",parallaxSpeed:.5,parallaxDirection:"up"},T=v.data(),j=a.extend({},B,t,T);j.parallaxSpeed>1?j.parallaxSpeed=1:j.parallaxSpeed<0&&(j.parallaxSpeed=0),v.find(".parallax-inner").length<1&&v.prepend('
'),r=v.find(".parallax-inner"),o=i(v),l=n(v,o),v.css({position:"relative",background:"transparent",overflow:"hidden","z-index":"1"}),r.css({position:"absolute","background-image":"url("+j.parallaxBgImage+")","background-position":j.parallaxBgPosition,"background-repeat":j.parallaxBgRepeat,"background-size":j.parallaxBgSize,width:o[0],height:o[1],transform:"translate3d("+l[0]+"px, "+l[1]+"px, "+l[2]+"px)",transition:"transform 100ms","z-index":"-1"}),z.on("resize",function(){o=i(v),l=n(v,o),r.css({width:o[0],height:o[1],transform:"translate3d("+l[0]+"px, "+l[1]+"px, "+l[2]+"px)"})}),"left"!==j.parallaxDirection&&"right"!==j.parallaxDirection||(s=0,c=l[0]),"up"!==j.parallaxDirection&&"down"!==j.parallaxDirection||(s=0,c=l[1]),v.isOnScreen()&&(A=z.scrollTop()),z.on("scroll",function(){F=z.scrollTop()-A,A=z.scrollTop(),s=F*(parseFloat(j.parallaxSpeed)/4),v.isOnScreen()?("up"===j.parallaxDirection&&(c+=-s,d="translate3d("+l[0]+"px, "+c+"px, "+l[2]+"px)"),"down"===j.parallaxDirection&&(c+=s,d="translate3d("+l[0]+"px, "+c+"px, "+l[2]+"px)"),"left"===j.parallaxDirection&&(d="translate3d("+(c+=s)+"px, "+l[1]+"px, "+l[2]+"px)"),"right"===j.parallaxDirection&&(d="translate3d("+(c+=-s)+"px, "+l[1]+"px, "+l[2]+"px)"),r.css({width:o[0],height:o[1],transform:d})):r.css({width:o[0],height:o[1],transform:"translate3d("+l[0]+"px, "+l[1]+"px, "+l[2]+"px)"})})})}}(jQuery); !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){var e=-1,o=-1,n=function(t){return parseFloat(t)||0},a=function(e){var o=1,a=t(e),i=null,r=[];return a.each(function(){var e=t(this),a=e.offset().top-n(e.css("margin-top")),s=r.length>0?r[r.length-1]:null;null===s?r.push(e):Math.floor(Math.abs(i-a))<=o?r[r.length-1]=s.add(e):r.push(e),i=a}),r},i=function(e){var o={ byRow:!0,property:"height",target:null,remove:!1};return"object"==typeof e?t.extend(o,e):("boolean"==typeof e?o.byRow=e:"remove"===e&&(o.remove=!0),o)},r=t.fn.matchHeight=function(e){var o=i(e);if(o.remove){var n=this;return this.css(o.property,""),t.each(r._groups,function(t,e){e.elements=e.elements.not(n)}),this}return this.length<=1&&!o.target?this:(r._groups.push({elements:this,options:o}),r._apply(this,o),this)};r.version="0.7.2",r._groups=[],r._throttle=80,r._maintainScroll=!1,r._beforeUpdate=null, r._afterUpdate=null,r._rows=a,r._parse=n,r._parseOptions=i,r._apply=function(e,o){var s=i(o),h=t(e),l=[h],c=t(window).scrollTop(),p=t("html").outerHeight(!0),u=h.parents().filter(":hidden");return u.each(function(){var e=t(this);e.data("style-cache",e.attr("style"))}),u.css("display","block"),s.byRow&&!s.target&&(h.each(function(){var e=t(this),o=e.css("display");"inline-block"!==o&&"flex"!==o&&"inline-flex"!==o&&(o="block"),e.data("style-cache",e.attr("style")),e.css({display:o,"padding-top":"0", "padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),l=a(h),h.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||"")})),t.each(l,function(e,o){var a=t(o),i=0;if(s.target)i=s.target.outerHeight(!1);else{if(s.byRow&&a.length<=1)return void a.css(s.property,"");a.each(function(){var e=t(this),o=e.attr("style"),n=e.css("display");"inline-block"!==n&&"flex"!==n&&"inline-flex"!==n&&(n="block");var a={ display:n};a[s.property]="",e.css(a),e.outerHeight(!1)>i&&(i=e.outerHeight(!1)),o?e.attr("style",o):e.css("display","")})}a.each(function(){var e=t(this),o=0;s.target&&e.is(s.target)||("border-box"!==e.css("box-sizing")&&(o+=n(e.css("border-top-width"))+n(e.css("border-bottom-width")),o+=n(e.css("padding-top"))+n(e.css("padding-bottom"))),e.css(s.property,i-o+"px"))})}),u.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||null)}),r._maintainScroll&&t(window).scrollTop(c/p*t("html").outerHeight(!0)), this},r._applyDataApi=function(){var e={};t("[data-match-height], [data-mh]").each(function(){var o=t(this),n=o.attr("data-mh")||o.attr("data-match-height");n in e?e[n]=e[n].add(o):e[n]=o}),t.each(e,function(){this.matchHeight(!0)})};var s=function(e){r._beforeUpdate&&r._beforeUpdate(e,r._groups),t.each(r._groups,function(){r._apply(this.elements,this.options)}),r._afterUpdate&&r._afterUpdate(e,r._groups)};r._update=function(n,a){if(a&&"resize"===a.type){var i=t(window).width();if(i===e)return;e=i; }n?o===-1&&(o=setTimeout(function(){s(a),o=-1},r._throttle)):s(a)},t(r._applyDataApi);var h=t.fn.on?"on":"bind";t(window)[h]("load",function(t){r._update(!1,t)}),t(window)[h]("resize orientationchange",function(t){r._update(!0,t)})}); !function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):b("object"==typeof exports?require("jquery"):a.jQuery)}(this,function(a){"use strict";function b(a){var b,c,d,e,f,g,h,i={};for(f=a.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,",").split(","),h=0,g=f.length;h').on("load",d),a('').on("load",d),a('').on("load",d),a('').on("load",d)}function e(c,d,e){if(this.$element=a(c),"string"==typeof d&&(d=b(d)),e?"string"==typeof e&&(e=b(e)):e={},"string"==typeof d)d=d.replace(/\.\w*$/,"");else if("object"==typeof d)for(var f in d)d.hasOwnProperty(f)&&(d[f]=d[f].replace(/\.\w*$/,""));this.settings=a.extend({},g,e),this.path=d;try{this.init()}catch(i){if(i.message!==h)throw i}}var f="vide",g={volume:1,playbackRate:1,muted:!0,loop:!0,autoplay:!0,position:"50% 50%",posterType:"detect",resizing:!0,bgColor:"transparent",className:""},h="Not implemented";e.prototype.init=function(){var b,e,f=this,g=f.path,i=g,j="",k=f.$element,l=f.settings,m=c(l.position),n=l.posterType;e=f.$wrapper=a("
").addClass(l.className).css({position:"absolute","z-index":-1,top:0,left:0,bottom:0,right:0,overflow:"hidden","-webkit-background-size":"cover","-moz-background-size":"cover","-o-background-size":"cover","background-size":"cover","background-color":l.bgColor,"background-repeat":"no-repeat","background-position":m.x+" "+m.y}),"object"==typeof g&&(g.poster?i=g.poster:g.mp4?i=g.mp4:g.webm?i=g.webm:g.ogv&&(i=g.ogv)),"detect"===n?d(i,function(a){e.css("background-image","url("+a+")")}):"none"!==n&&e.css("background-image","url("+i+"."+n+")"),"static"===k.css("position")&&k.css("position","relative"),k.prepend(e),"object"==typeof g?(g.mp4&&(j+=''),g.webm&&(j+=''),g.ogv&&(j+=''),b=f.$video=a("")):b=f.$video=a('');try{b.prop({autoplay:l.autoplay,loop:l.loop,volume:l.volume,muted:l.muted,defaultMuted:l.muted,playbackRate:l.playbackRate,defaultPlaybackRate:l.playbackRate})}catch(o){throw new Error(h)}b.css({margin:"auto",position:"absolute","z-index":-1,top:m.y,left:m.x,"-webkit-transform":"translate(-"+m.x+", -"+m.y+")","-ms-transform":"translate(-"+m.x+", -"+m.y+")","-moz-transform":"translate(-"+m.x+", -"+m.y+")",transform:"translate(-"+m.x+", -"+m.y+")",visibility:"hidden",opacity:0}).one("canplaythrough.vide",function(){f.resize()}).one("playing.vide",function(){b.css({visibility:"visible",opacity:1}),e.css("background-image","none")}),k.on("resize.vide",function(){l.resizing&&f.resize()}),e.append(b)},e.prototype.getVideoObject=function(){return this.$video[0]},e.prototype.resize=function(){if(this.$video){var a=this.$wrapper,b=this.$video,c=b[0],d=c.videoHeight,e=c.videoWidth,f=a.height(),g=a.width();g/e>f/d?b.css({width:g+2,height:"auto"}):b.css({width:"auto",height:f+2})}},e.prototype.destroy=function(){delete a[f].lookup[this.index],this.$video&&this.$video.off(f),this.$element.off(f).removeData(f),this.$wrapper.remove()},a[f]={lookup:[]},a.fn[f]=function(b,c){var d;return this.each(function(){d=a.data(this,f),d&&d.destroy(),d=new e(this,b,c),d.index=a[f].lookup.push(d)-1,a.data(this,f,d)}),this},a(document).ready(function(){var b=a(window);b.on("resize.vide",function(){for(var b,c=a[f].lookup.length,d=0;d.theiaStickySidebar:after {content: ""; display: table; clear: both;}')); } $that.each(function (){ var o={}; o.sidebar=$(this); o.options=options||{}; o.container=$(o.options.containerSelector); if(o.container.length==0){ o.container=o.sidebar.parent(); } o.sidebar.parents().css('-webkit-transform', 'none'); o.sidebar.css({ 'position': o.options.defaultPosition, 'overflow': 'visible', '-webkit-box-sizing': 'border-box', '-moz-box-sizing': 'border-box', 'box-sizing': 'border-box' }); o.stickySidebar=o.sidebar.find('.theiaStickySidebar'); if(o.stickySidebar.length==0){ var javaScriptMIMETypes=/(?:text|application)\/(?:x-)?(?:javascript|ecmascript)/i; o.sidebar.find('script').filter(function (index, script){ return script.type.length===0||script.type.match(javaScriptMIMETypes); }).remove(); o.stickySidebar=$('
').addClass('theiaStickySidebar').append(o.sidebar.children()); o.sidebar.append(o.stickySidebar); } o.marginBottom=parseInt(o.sidebar.css('margin-bottom')); o.paddingTop=parseInt(o.sidebar.css('padding-top')); o.paddingBottom=parseInt(o.sidebar.css('padding-bottom')); var collapsedTopHeight=o.stickySidebar.offset().top; var collapsedBottomHeight=o.stickySidebar.outerHeight(); o.stickySidebar.css('padding-top', 1); o.stickySidebar.css('padding-bottom', 1); collapsedTopHeight -=o.stickySidebar.offset().top; collapsedBottomHeight=o.stickySidebar.outerHeight() - collapsedBottomHeight - collapsedTopHeight; if(collapsedTopHeight==0){ o.stickySidebar.css('padding-top', 0); o.stickySidebarPaddingTop=0; }else{ o.stickySidebarPaddingTop=1; } if(collapsedBottomHeight==0){ o.stickySidebar.css('padding-bottom', 0); o.stickySidebarPaddingBottom=0; }else{ o.stickySidebarPaddingBottom=1; } o.previousScrollTop=null; o.fixedScrollTop=0; resetSidebar(); o.onScroll=function (o){ if(!o.stickySidebar.is(":visible")){ return; } if($('body').width() < o.options.minWidth){ resetSidebar(); return; } if(o.options.disableOnResponsiveLayouts){ var sidebarWidth=o.sidebar.outerWidth(o.sidebar.css('float')=='none'); if(sidebarWidth + 50 > o.container.width()){ resetSidebar(); return; }} var scrollTop=$(document).scrollTop(); var position='static'; if(scrollTop >=o.sidebar.offset().top + (o.paddingTop - o.options.additionalMarginTop)){ var offsetTop=o.paddingTop + options.additionalMarginTop; var offsetBottom=o.paddingBottom + o.marginBottom + options.additionalMarginBottom; var containerTop=o.sidebar.offset().top; var containerBottom=o.sidebar.offset().top + getClearedHeight(o.container); var windowOffsetTop=0 + options.additionalMarginTop; var windowOffsetBottom; var sidebarSmallerThanWindow=(o.stickySidebar.outerHeight() + offsetTop + offsetBottom) < $(window).height(); if(sidebarSmallerThanWindow){ windowOffsetBottom=windowOffsetTop + o.stickySidebar.outerHeight(); }else{ windowOffsetBottom=$(window).height() - o.marginBottom - o.paddingBottom - options.additionalMarginBottom; } var staticLimitTop=containerTop - scrollTop + o.paddingTop; var staticLimitBottom=containerBottom - scrollTop - o.paddingBottom - o.marginBottom; var top=o.stickySidebar.offset().top - scrollTop; var scrollTopDiff=o.previousScrollTop - scrollTop; if(o.stickySidebar.css('position')=='fixed'){ if(o.options.sidebarBehavior=='modern'){ top +=scrollTopDiff; }} if(o.options.sidebarBehavior=='stick-to-top'){ top=options.additionalMarginTop; } if(o.options.sidebarBehavior=='stick-to-bottom'){ top=windowOffsetBottom - o.stickySidebar.outerHeight(); } if(scrollTopDiff > 0){ top=Math.min(top, windowOffsetTop); }else{ top=Math.max(top, windowOffsetBottom - o.stickySidebar.outerHeight()); } top=Math.max(top, staticLimitTop); top=Math.min(top, staticLimitBottom - o.stickySidebar.outerHeight()); var sidebarSameHeightAsContainer=o.container.height()==o.stickySidebar.outerHeight(); if(!sidebarSameHeightAsContainer&&top==windowOffsetTop){ position='fixed'; } else if(!sidebarSameHeightAsContainer&&top==windowOffsetBottom - o.stickySidebar.outerHeight()){ position='fixed'; } else if(scrollTop + top - o.sidebar.offset().top - o.paddingTop <=options.additionalMarginTop){ position='static'; }else{ position='absolute'; }} if(position=='fixed'){ var scrollLeft=$(document).scrollLeft(); o.stickySidebar.css({ 'position': 'fixed', 'width': getWidthForObject(o.stickySidebar) + 'px', 'transform': 'translateY(' + top + 'px)', 'left': (o.sidebar.offset().left + parseInt(o.sidebar.css('padding-left')) - scrollLeft) + 'px', 'top': '0px' }); } else if(position=='absolute'){ var css={}; if(o.stickySidebar.css('position')!='absolute'){ css.position='absolute'; css.transform='translateY(' + (scrollTop + top - o.sidebar.offset().top - o.stickySidebarPaddingTop - o.stickySidebarPaddingBottom) + 'px)'; css.top='0px'; } css.width=getWidthForObject(o.stickySidebar) + 'px'; css.left=''; o.stickySidebar.css(css); } else if(position=='static'){ resetSidebar(); } if(position!='static'){ if(o.options.updateSidebarHeight==true){ o.sidebar.css({ 'min-height': o.stickySidebar.outerHeight() + o.stickySidebar.offset().top - o.sidebar.offset().top + o.paddingBottom }); }} o.previousScrollTop=scrollTop; }; o.onScroll(o); $(document).on('scroll.' + o.options.namespace, function (o){ return function (){ o.onScroll(o); };}(o)); $(window).on('resize.' + o.options.namespace, function (o){ return function (){ o.stickySidebar.css({'position': 'static'}); o.onScroll(o); };}(o)); if(typeof ResizeSensor!=='undefined'){ new ResizeSensor(o.stickySidebar[0], function (o){ return function (){ o.onScroll(o); };}(o)); } function resetSidebar(){ o.fixedScrollTop=0; o.sidebar.css({ 'min-height': '1px' }); o.stickySidebar.css({ 'position': 'static', 'width': '', 'transform': 'none' }); } function getClearedHeight(e){ var height=e.height(); e.children().each(function (){ height=Math.max(height, $(this).height()); }); return height; }}); } function getWidthForObject(object){ var width; try { width=object[0].getBoundingClientRect().width; } catch (err){ } if(typeof width==="undefined"){ width=object.width(); } return width; } return this; }})(jQuery); !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(s){var u,l,c,d,t,p,h,g,i,e,b,a,o,f,m,y,n,r,v,x,C="ui-effects-",w=s;function _(t,e,n){var r=g[e.type]||{};return null==t?n||!e.def?null:e.def:(t=r.floor?~~t:parseFloat(t),isNaN(t)?e.def:r.mod?(t+r.mod)%r.mod:t<0?0:r.max")[0],b=u.each,e.style.cssText="background-color:rgba(1,1,1,.5)",i.rgba=-1a.mod/2?r+=a.mod:r-o>a.mod/2&&(r-=a.mod)),c[n]=_((o-r)*i+r,e)))}),this[e](c)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),n=e.pop(),r=p(t)._rgba;return p(u.map(e,function(t,e){return(1-n)*r[e]+n*t}))},toRgbaString:function(){var t="rgba(",e=u.map(this._rgba,function(t,e){return null==t?2
").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:n.width(),height:n.height()},o=document.activeElement;try{o.id}catch(t){o=document.body}return n.wrap(t),n[0]!==o&&!s.contains(n[0],o)||s(o).focus(),t=n.parent(),"static"===n.css("position")?(t.css({position:"relative"}),n.css({position:"relative"})):(s.extend(r,{position:n.css("position"),zIndex:n.css("z-index")}),s.each(["top","left","bottom","right"],function(t,e){r[e]=n.css(e),isNaN(parseInt(r[e],10))&&(r[e]="auto")}),n.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),n.css(e),t.css(r).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!s.contains(t[0],e)||s(e).focus()),t},setTransition:function(r,t,o,a){return a=a||{},s.each(t,function(t,e){var n=r.cssUnit(e);0",options:{disabled:!1,create:null},_createWidget:function(t,e){e=h(e||this.defaultElement||this)[0],this.element=h(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=h(),this.hoverable=h(),this.focusable=h(),e!==this&&(h.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=h(e.style?e.ownerDocument:e.document||e),this.window=h(this.document[0].defaultView||this.document[0].parentWindow)),this.options=h.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:h.noop,_getCreateEventData:h.noop,_create:h.noop,_init:h.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(h.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:h.noop,widget:function(){return this.element},option:function(t,e){var i,n,s,o=t;if(0===arguments.length)return h.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(n=o[t]=h.widget.extend({},this.options[t]),s=0;s=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}); !function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],e):e(jQuery)}(function(r){return r.widget("ui.slider",r.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,t,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a=[];for(t=i.values&&i.values.length||1,s.length>t&&(s.slice(t).remove(),s=s.slice(0,t)),e=s.length;e");this.handles=s.add(r(a.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){r(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,t="";e.range?(!0===e.range&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:r.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=r("
").appendTo(this.element),t="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(t+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var t,i,s,a,n,h,l,o=this,u=this.options;return!u.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var t=Math.abs(i-o.values(e));(t=this._valueMax())return this._valueMax();var t=0=t&&(s+=0
'; $('body').append(process_modal); $('#homey_modal').modal(); } var homey_processing_modal_close=function(){ $('#homey_modal').modal('hide'); } var homey_timeStamp_2=function(str){ var myDate=str.split("-"); var newDate=myDate[1]+"/"+myDate[0]+"/"+myDate[2]; return new Date(newDate).getTime(); }; if(window.devicePixelRatio==2){ if(is_tansparent){ if(retina_logo_splash!=''){ $(".transparent-header .homey_logo img").attr("src", retina_logo_splash); } if(retina_logo_mobile_splash!=''){ $(".mobile-logo img").attr("src", retina_logo_mobile_splash); }}else{ if(retina_logo!=''){ $(".homey_logo img").attr("src", retina_logo); } if(retina_logo_mobile!=''){ $(".mobile-logo img").attr("src", retina_logo_mobile); }} } var currencySwitcherList=$('#homey-currency-switcher-list'); if(currencySwitcherList.length > 0){ $('#homey-currency-switcher-list > li').on('click', function(e){ e.stopPropagation(); currencySwitcherList.slideUp(200); var selectedCurrencyCode=$(this).data('currency-code'); if(selectedCurrencyCode){ $('.homey-selected-currency span').html(selectedCurrencyCode); homey_processing_modal(' '+currency_updating_msg); $.ajax({ url: ajaxurl, dataType: 'JSON', method: 'POST', data: { 'action':'homey_currency_converter', 'currency_to_converter':selectedCurrencyCode, }, success: function (res){ if(res.success){ window.location.reload(); }else{ console.log(res); }}, error: function (xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); }}); } $('.homey-currency-switcher').on('change', function(e){ var selectedCurrencyCode=$(this).val(); if(selectedCurrencyCode){ homey_processing_modal(' '+currency_updating_msg); $.ajax({ url: ajaxurl, dataType: 'JSON', method: 'POST', data: { 'action':'homey_currency_converter', 'currency_to_converter':selectedCurrencyCode, }, success: function (res){ if(res.success){ window.location.reload(); }else{ console.log(res); }}, error: function (xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); }}); var listings_module_section=$('#listings_module_section'); if(listings_module_section.length > 0){ $("body").on('click', '.homey-loadmore a', function(e){ e.preventDefault(); var $this=$(this); var $wrap=$this.closest('#listings_module_section').find('#module_listings'); var limit=$this.data('limit'); var paged=$this.data('paged'); var style=$this.data('style'); var type=$this.data('type'); var roomtype=$this.data('roomtype'); var country=$this.data('country'); var state=$this.data('state'); var city=$this.data('city'); var area=$this.data('area'); var featured=$this.data('featured'); var offset=$this.data('offset'); var sortby=$this.data('sortby'); var booking_type=$this.data('booking_type'); var author=$this.data('author'); var authorid=$this.data('authorid'); $.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'homey_loadmore_listings', 'limit': limit, 'paged': paged, 'style': style, 'type': type, 'roomtype': roomtype, 'country': country, 'state': state, 'city': city, 'area': area, 'featured': featured, 'sort_by': sortby, 'offset': offset, 'booking_type': booking_type, 'author': author, 'authorid': authorid, }, beforeSend: function(){ $this.find('i').css('display', 'inline-block'); }, success: function (data){ if(data=='no_result'){ $this.closest('#listings_module_section').find('.homey-loadmore').text(no_more_listings); return; } $wrap.append(data); $this.data("paged", paged+1); homey_init_add_favorite(ajaxurl, userID, is_singular_listing); homey_init_remove_favorite(ajaxurl, userID, is_singular_listing); compare_for_ajax(); }, complete: function(){ $this.find('i').css('display', 'none'); }, error: function (xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); }); } homey_init_add_favorite(ajaxurl, userID, is_singular_listing); homey_init_remove_favorite(ajaxurl, userID, is_singular_listing); var compare_for_ajax=function(){ var listings_compare=homeyGetCookie('homey_compare_listings'); var limit_item_compare=4; add_to_compare(compare_url, add_compare, remove_compare, compare_limit, listings_compare, limit_item_compare); remove_from_compare(listings_compare, add_compare, remove_compare); } $('#homey_complete_order').on('click', function(e){ e.preventDefault(); var hform, payment_gateway, listing_id, is_upgrade; payment_gateway=$("input[name='homey_payment_type']:checked").val(); is_upgrade=$("input[name='is_upgrade']").val(); listing_id=$('#listing_id').val(); if(payment_gateway=='paypal'){ homey_processing_modal(paypal_connecting); homey_paypal_payment(listing_id, is_upgrade); }else if(payment_gateway=='stripe'){ var hform=$(this).parents('.dashboard-area'); hform.find('.homey_stripe_simple button').trigger("click"); } return; }); var homey_paypal_payment=function(listing_id, is_upgrade){ $.ajax({ type: 'post', url: ajaxurl, data: { 'action': 'homey_listing_paypal_payment', 'listing_id': listing_id, 'is_upgrade': is_upgrade, }, success: function(response){ window.location.href=response; }, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); } if($('#add_review').length > 0){ $('#add_review').on('click', function(e){ e.preventDefault(); var $this=$(this); var rating=$('#rating').val(); var review_action=$('#review_action').val(); var review_content=$('#review_content').val(); var review_reservation_id=$('#review_reservation_id').val(); var security=$('#review-security').val(); var parentDIV=$this.parents('.user-dashboard-right'); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_add_review', 'rating': rating, 'review_action': review_action, 'review_content': review_content, 'review_reservation_id': review_reservation_id, 'security': security }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ parentDIV.find('.alert').remove(); if(data.success){ $this.attr("disabled", true); window.location.reload(); }else{ parentDIV.find('.dashboard-area').prepend(''); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }); } if($('#add_guest_review').length > 0){ $('#add_guest_review').on('click', function(e){ e.preventDefault(); var $this=$(this); var rating=$('#rating').val(); var review_action=$('#review_guest_action').val(); var review_content=$('#review_content').val(); var review_guest_reservation_id=$('#review_guest_reservation_id').val(); var security=$('#review-security').val(); var parentDIV=$this.parents('.user-dashboard-right'); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_add_guest_review', 'rating': rating, 'review_action': review_action, 'review_content': review_content, 'review_guest_reservation_id': review_guest_reservation_id, 'security': security }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ parentDIV.find('.alert').remove(); if(data.success){ $this.attr("disabled", true); window.location.reload(); }else{ parentDIV.find('.dashboard-area').prepend(''); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }); } var listing_review_ajax=function(sortby, listing_id, paged){ var review_container=$('#homey_reviews'); $.ajax({ type: 'post', url: ajaxurl, data: { 'action': 'homey_ajax_review', 'sortby': sortby, 'listing_id': listing_id, 'paged': paged }, beforeSend: function(){ }, success: function(data){ review_container.empty(); review_container.html(data); }, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ }}); } if($('#sort_review').length > 0){ $('#sort_review').on('change', function(){ var sortby=$(this).val(); var listing_id=$('#review_listing_id').val(); var paged=$('#review_paged').val(); listing_review_ajax(sortby, listing_id, paged); return; }); } if($('#review_next').length > 0){ $('#review_next').on('click', function(e){ e.preventDefault(); $('#review_prev').removeAttr('disabled'); var sortby=$('#page_sort').val(); var total_pages=$('#total_pages').val(); var listing_id=$('#review_listing_id').val(); var paged=$('#review_paged').val(); paged=Number(paged)+1; $('#review_paged').val(paged); if(paged==total_pages){ $(this).attr('disabled', true); } listing_review_ajax(sortby, listing_id, paged); return; }); } if($('#review_prev').length > 0){ $('#review_prev').on('click', function(e){ e.preventDefault(); $('#review_next').removeAttr('disabled'); var sortby=$('#page_sort').val(); var listing_id=$('#review_listing_id').val(); var paged=$('#review_paged').val(); paged=Number(paged)-1; $('#review_paged').val(paged); if(paged <=1){ $(this).attr('disabled', true); } listing_review_ajax(sortby, listing_id, paged); return; }); } var homey_convert_date=function(date){ if(date==''){ return ''; } var d_format, return_date; d_format=homey_date_format.toUpperCase(); var changed_date_format=d_format.replace("YY", "YYYY"); var return_date=moment(date, changed_date_format).format('YYYY-MM-DD'); return return_date; } var homey_calculate_booking_cost=function(check_in_date, check_out_date, guests, listing_id, security, extra_options){ var $this=$(this); var notify=$('.homey_notification'); notify.find('.notify').remove(); if(check_in_date===''||check_out_date===''){ $('#homey_booking_cost, .payment-list').empty(); return; } $.ajax({ type: 'post', url: ajaxurl, data: { 'action': 'homey_calculate_booking_cost', 'check_in_date': check_in_date, 'check_out_date': check_out_date, 'guests': guests, 'extra_options': extra_options, 'listing_id': listing_id, 'security': security }, beforeSend: function(){ $('#homey_booking_cost, .payment-list').empty(); $this.children('i').remove(); $this.prepend(''); notify.find('.homey_preloader').show(); }, success: function(data){ $('#homey_booking_cost, .payment-list').empty().html(data); }, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); notify.find('.homey_preloader').hide(); var clearprice=parseFloat(jQuery('#homey_remove_on_mobile .sidebar-booking-module-header .item-price').data('clearprice')).toFixed(2); var new_price=parseFloat(jQuery('#homey_booking_cost .homey_price_first spanx').data('prcpn')).toFixed(2); if(!isNaN(new_price)){ if(clearprice > new_price){ jQuery('.sidebar-booking-module-header .item-price').html('$' + clearprice + '$' + new_price + '/ night'); }else{ jQuery('.sidebar-booking-module-header .item-price').html('$' + new_price + '/ night'); }} }}); } var homey_calculate_hourly_booking_cost=function(check_in_date, start_hour, end_hour, guests, listing_id, security, extra_options){ var $this=$(this); var notify=$('.homey_notification'); notify.find('.notify').remove(); if(check_in_date===''||start_hour===''||end_hour===''){ $('#homey_booking_cost, .payment-list').empty(); return; } $.ajax({ type: 'post', url: ajaxurl, data: { 'action': 'homey_calculate_hourly_booking_cost', 'check_in_date': check_in_date, 'start_hour': start_hour, 'end_hour': end_hour, 'guests': guests, 'extra_options': extra_options, 'listing_id': listing_id, 'security': security }, beforeSend: function(){ $('#homey_booking_cost, .payment-list').empty(); $this.children('i').remove(); $this.prepend(''); notify.find('.homey_preloader').show(); }, success: function(data){ $('#homey_booking_cost, .payment-list').empty().html(data); }, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); notify.find('.homey_preloader').hide(); }}); } var check_booking_availability_on_date_change=function(check_in_date, check_out_date, listing_id, security){ var $this=$(this); var notify=$('.homey_notification'); notify.find('.notify').remove(); $('.homey_extra_price input').each(function(){ $(this).prop("checked", false); }); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'check_booking_availability_on_date_change', 'check_in_date': check_in_date, 'check_out_date': check_out_date, 'listing_id': listing_id, 'security': security }, beforeSend: function(){ $('#homey_booking_cost, .payment-list').empty(); notify.find('.homey_preloader').show(); }, success: function(data){ if(data.success){ $('#request_for_reservation, #request_for_reservation_mobile').removeAttr("disabled"); $('#instance_reservation, #instance_reservation_mobile').removeAttr("disabled"); notify.prepend('
'+data.message+'
'); }else{ notify.prepend('
'+data.message+'
'); $('#request_for_reservation, #request_for_reservation_mobile').attr("disabled", true); $('#instance_reservation, #instance_reservation_mobile').attr("disabled", true); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ notify.find('.homey_preloader').hide(); }}); } var check_booking_availability_on_hour_change=function(check_in_date, start_hour, end_hour, listing_id, security){ var $this=$(this); var notify=$('.homey_notification'); notify.find('.notify').remove(); $('.homey_extra_price input').each(function(){ $(this).prop("checked", false); }); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'check_booking_availability_on_hour_change', 'check_in_date': check_in_date, 'start_hour': start_hour, 'end_hour': end_hour, 'listing_id': listing_id, 'security': security }, beforeSend: function(){ $('#homey_booking_cost, .payment-list').empty(); notify.find('.homey_preloader').show(); }, success: function(data){ if(data.success){ $('#request_hourly_reservation, #request_hourly_reservation_mobile').removeAttr("disabled"); $('#instance_hourly_reservation, #instance_hourly_reservation_mobile').removeAttr("disabled"); notify.prepend('
'+data.message+'
'); }else{ notify.prepend('
'+data.message+'
'); $('#request_hourly_reservation, #request_hourly_reservation_mobile').attr("disabled", true); $('#instance_hourly_reservation, #instance_hourly_reservation_mobile').attr("disabled", true); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ notify.find('.homey_preloader').hide(); }}); } $("#single-listing-date-range input").on('focus click touchstart', function(){ $('.single-listing-booking-calendar-js').css("display", "block"); $('.single-listing-booking-calendar-js').addClass("arrive_active"); $('.single-form-guests-js').css("display", "none"); focusedInput_2=$(this).attr('name'); $('.single-listing-booking-calendar-js').removeClass('arrive_active depart_active').addClass(focusedInput_2+'_active'); }); $(".single-guests-js input").on('focus', function(){ $(this).prev("label").css("display", "block"); $(this).addClass("on-focus"); $('.single-form-guests-js').css("display", "block"); }); var numClicks=0; var fromTimestamp_2, toTimestamp_2=0; var homey_booking_dates=function(){ $('.single-listing-booking-calendar-js ul li').on('click', function(){ var $this=$(this); if($this.hasClass('past-day')||$this.hasClass('homey-not-available-for-booking')){ if(!$this.hasClass('reservation_start')){ return false; }} numClicks +=1; var vl=$this.data('formatted-date'); var timestamp=$this.data('timestamp'); if(focusedInput_2=='depart'&×tamp > fromTimestamp_2){ $('.single-listing-calendar-wrap ul').find('li.to-day').removeClass('selected') .siblings().removeClass('to-day in-between'); numClicks=2; } if(numClicks==1){ fromTimestamp_2=timestamp; $('.single-listing-calendar-wrap ul li').removeClass('to-day from-day selected in-between'); $this.addClass('from-day selected'); $('.single-listing-booking-calendar-js').removeClass('arrive_active').addClass('depart_active'); $('input[name="arrive"]').val(vl); $('input[name="depart"]').val(''); if(homey_booking_type!='per_hour'){ homey_calculate_price_checkin(); }}else if(numClicks==2){ toTimestamp_2=timestamp; $this.addClass('to-day selected'); $('.single-listing-booking-calendar-js').removeClass('depart_active').addClass('arrive_active'); var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_timeStamp_2(check_in_date); var check_out_date=homey_timeStamp_2(vl); if(check_in_date >=check_out_date){ fromTimestamp_2=timestamp; toTimestamp_2=0; $('.single-listing-calendar-wrap ul li').removeClass('to-day from-day selected in-between'); $this.addClass('from-day selected'); $('.single-listing-booking-calendar-js').removeClass('arrive_active').addClass('depart_active'); $('input[name="arrive"]').val(vl); numClicks=1; }else{ setInBetween_2(fromTimestamp_2, toTimestamp_2); $('input[name="depart"]').val(vl); $('#single-booking-search-calendar, #single-overlay-booking-search-calendar').hide(); if(homey_booking_type!='per_hour'){ homey_calculate_price_checkout(); }} } if(numClicks==2){ numClicks=0; }}); } if(homey_booking_type!='per_hour'){ homey_booking_dates(); $('.single-listing-calendar-wrap ul li').on('hover', function (){ var ts=$(this).data('timestamp'); if(numClicks==1){ setInBetween_2(fromTimestamp_2, ts); }}); var setInBetween_2=function(fromTime, toTime){ $('.single-listing-calendar-wrap ul li').removeClass('in-between') .filter(function (){ var currentTs=$(this).data('timestamp'); return currentTs > fromTime&¤tTs < toTime; }).addClass('in-between'); } var homey_calculate_price_checkin=function(){ var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var check_out_date=$('input[name="depart"]').val(); check_out_date=homey_convert_date(check_out_date); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); homey_calculate_booking_cost(check_in_date, check_out_date, guests, listing_id, security); } if(is_singular_listing=='yes'){ homey_calculate_price_checkin(); } var homey_calculate_price_checkout=function(){ var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var check_out_date=$('input[name="depart"]').val(); check_out_date=homey_convert_date(check_out_date); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); homey_calculate_booking_cost(check_in_date, check_out_date, guests, listing_id, security); check_booking_availability_on_date_change(check_in_date, check_out_date, listing_id, security); } $('.apply_guests').on('click', function (){ var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var check_out_date=$('input[name="depart"]').val(); check_out_date=homey_convert_date(check_out_date); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); homey_calculate_booking_cost(check_in_date, check_out_date, guests, listing_id, security); check_booking_availability_on_date_change(check_in_date, check_out_date, listing_id, security); }); $('.homey_extra_price input').on('click', function(){ var extra_options=[]; var temp_opt; $('.homey_extra_price input').each(function(){ if(($(this).is(":checked"))){ var extra_name=$(this).data('name'); var extra_price=$(this).data('price'); var extra_type=$(this).data('type'); temp_opt=''; temp_opt=extra_name; temp_opt=temp_opt + '|' + extra_price; temp_opt=temp_opt + '|' + extra_type; extra_options.push(temp_opt); }}); var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var check_out_date=$('input[name="depart"]').val(); check_out_date=homey_convert_date(check_out_date); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); homey_calculate_booking_cost(check_in_date, check_out_date, guests, listing_id, security, extra_options); }); } if(homey_booking_type=='per_hour'){ $('.hourly-js-desktop ul li').on('click', function (){ var $this=$(this); var vl=$this.data('formatted-date'); $('input[name="arrive"]').val(vl); $('.single-listing-hourly-calendar-wrap ul li').removeClass('selected'); $this.addClass('selected'); $('#single-booking-search-calendar, #single-overlay-booking-search-calendar').hide(); var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var start_hour=$('select[name="start_hour"]').val(); var end_hour=$('select[name="end_hour"]').val(); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); homey_calculate_hourly_booking_cost(check_in_date, start_hour, end_hour, guests, listing_id, security); if(check_in_date===''||start_hour===''||end_hour==='') return; check_booking_availability_on_hour_change(check_in_date, start_hour, end_hour, listing_id, security); }); $('#start_hour').on('change', function (){ var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var start_hour=$('select[name="start_hour"]').val(); var end_hour=$('select[name="end_hour"]').val(); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); homey_calculate_hourly_booking_cost(check_in_date, start_hour, end_hour, guests, listing_id, security); if(check_in_date===''||start_hour===''||end_hour==='') return; check_booking_availability_on_hour_change(check_in_date, start_hour, end_hour, listing_id, security); }); $('#end_hour').on('change', function (){ var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var start_hour=$('select[name="start_hour"]').val(); var end_hour=$('select[name="end_hour"]').val(); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); homey_calculate_hourly_booking_cost(check_in_date, start_hour, end_hour, guests, listing_id, security); check_booking_availability_on_hour_change(check_in_date, start_hour, end_hour, listing_id, security); }); $('.hourly-js-mobile ul li').on('click', function (){ var $this=$(this); var vl=$this.data('formatted-date'); $('input[name="arrive"]').val(vl); $('.single-listing-hourly-calendar-wrap ul li').removeClass('selected'); $this.addClass('selected'); $('#single-booking-search-calendar, #single-overlay-booking-search-calendar').hide(); var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var start_hour=$('#start_hour_overlay').val(); var end_hour=$('#end_hour_overlay').val(); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); homey_calculate_hourly_booking_cost(check_in_date, start_hour, end_hour, guests, listing_id, security); if(check_in_date===''||start_hour===''||end_hour==='') return; check_booking_availability_on_hour_change(check_in_date, start_hour, end_hour, listing_id, security); }); $('#start_hour_overlay').on('change', function (){ var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var start_hour=$('#start_hour_overlay').val(); var end_hour=$('#end_hour_overlay').val(); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); homey_calculate_hourly_booking_cost(check_in_date, start_hour, end_hour, guests, listing_id, security); if(check_in_date===''||start_hour===''||end_hour==='') return; check_booking_availability_on_hour_change(check_in_date, start_hour, end_hour, listing_id, security); }); $('#end_hour_overlay').on('change', function (){ var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var start_hour=$('#start_hour_overlay').val(); var end_hour=$('#end_hour_overlay').val(); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); homey_calculate_hourly_booking_cost(check_in_date, start_hour, end_hour, guests, listing_id, security); check_booking_availability_on_hour_change(check_in_date, start_hour, end_hour, listing_id, security); }); $('.apply_guests').on('click', function (){ var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var start_hour=$('select[name="start_hour"]').val(); var end_hour=$('select[name="end_hour"]').val(); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); homey_calculate_hourly_booking_cost(check_in_date, start_hour, end_hour, guests, listing_id, security); check_booking_availability_on_hour_change(check_in_date, start_hour, end_hour, listing_id, security); }); $('#apply_guests_hourly').on('click', function (){ var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var start_hour=$('#start_hour_overlay').val(); var end_hour=$('#end_hour_overlay').val(); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); homey_calculate_hourly_booking_cost(check_in_date, start_hour, end_hour, guests, listing_id, security); check_booking_availability_on_hour_change(check_in_date, start_hour, end_hour, listing_id, security); }); $('.homey_extra_price input').on('click', function(){ var extra_options=[]; var temp_opt; $('.homey_extra_price input').each(function(){ if(($(this).is(":checked"))){ var extra_name=$(this).data('name'); var extra_price=$(this).data('price'); var extra_type=$(this).data('type'); temp_opt=''; temp_opt=extra_name; temp_opt=temp_opt + '|' + extra_price; temp_opt=temp_opt + '|' + extra_type; extra_options.push(temp_opt); }}); var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var start_hour=$('select[name="start_hour"]').val(); var end_hour=$('select[name="end_hour"]').val(); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); homey_calculate_hourly_booking_cost(check_in_date, start_hour, end_hour, guests, listing_id, security, extra_options); }); } var single_listing_guests=function(){ $('.adult_plus').on('click', function(e){ e.preventDefault(); var guests=parseInt($('input[name="guests"]').val())||0; var adult_guest=parseInt($('input[name="adult_guest"]').val()); var child_guest=parseInt($('input[name="child_guest"]').val()); adult_guest++; $('.homey_adult').text(adult_guest); $('input[name="adult_guest"]').val(adult_guest); var total_guests=adult_guest + child_guest; if((allow_additional_guests!='yes')&&(total_guests==allowed_guests_num)){ $('.adult_plus').attr("disabled", true); $('.child_plus').attr("disabled", true); }else if((allow_additional_guests=='yes')&&(total_guests==allowed_guests_plus_additional)){ if(num_additional_guests!==''){ $('.adult_plus').attr("disabled", true); $('.child_plus').attr("disabled", true); }} $('input[name="guests"]').val(total_guests); }); $('.adult_minus').on('click', function(e){ e.preventDefault(); var guests=parseInt($('input[name="guests"]').val())||0; var adult_guest=parseInt($('input[name="adult_guest"]').val()); var child_guest=parseInt($('input[name="child_guest"]').val()); if(adult_guest==0) return; adult_guest--; $('.homey_adult').text(adult_guest); $('input[name="adult_guest"]').val(adult_guest); var total_guests=adult_guest + child_guest; $('input[name="guests"]').val(total_guests); $('.adult_plus').removeAttr("disabled"); $('.child_plus').removeAttr("disabled"); }); $('.child_plus').on('click', function(e){ e.preventDefault(); var guests=parseInt($('input[name="guests"]').val()); var child_guest=parseInt($('input[name="child_guest"]').val()); var adult_guest=parseInt($('input[name="adult_guest"]').val()); child_guest++; $('.homey_child').text(child_guest); $('input[name="child_guest"]').val(child_guest); var total_guests=child_guest + adult_guest; if((allow_additional_guests!='yes')&&(total_guests==allowed_guests_num)){ $('.adult_plus').attr("disabled", true); $('.child_plus').attr("disabled", true); }else if((allow_additional_guests=='yes')&&(total_guests==allowed_guests_plus_additional)){ if(num_additional_guests!==''){ $('.adult_plus').attr("disabled", true); $('.child_plus').attr("disabled", true); }} $('input[name="guests"]').val(total_guests); }); $('.child_minus').on('click', function(e){ e.preventDefault(); var guests=parseInt($('input[name="guests"]').val()); var child_guest=parseInt($('input[name="child_guest"]').val()); var adult_guest=parseInt($('input[name="adult_guest"]').val()); if(child_guest==0) return; child_guest--; $('.homey_child').text(child_guest); $('input[name="child_guest"]').val(child_guest); var total_guests=child_guest + adult_guest; $('input[name="guests"]').val(total_guests); $('.adult_plus').removeAttr("disabled"); $('.child_plus').removeAttr("disabled"); }); } single_listing_guests(); $('#request_for_reservation, #request_for_reservation_mobile').on('click', function(e){ e.preventDefault(); var $this=$(this); var extra_options=[]; var temp_opt; var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var check_out_date=$('input[name="depart"]').val(); check_out_date=homey_convert_date(check_out_date); var guest_message=$('textarea[name="guest_message"]').val(); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); var notify=$this.parents('.homey_notification'); notify.find('.notify').remove(); $('.homey_extra_price input').each(function(){ if(($(this).is(":checked"))){ var extra_name=$(this).data('name'); var extra_price=$(this).data('price'); var extra_type=$(this).data('type'); temp_opt=''; temp_opt=extra_name; temp_opt=temp_opt + '|' + extra_price; temp_opt=temp_opt + '|' + extra_type; extra_options.push(temp_opt); }}); if(parseInt(userID, 10)===0){ $('#modal-login').modal('show'); }else{ $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_add_reservation', 'check_in_date': check_in_date, 'check_out_date': check_out_date, 'guests': guests, 'listing_id': listing_id, 'extra_options': extra_options, 'guest_message': guest_message, 'security': security }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ if(data.success){ $('.check_in_date, .check_out_date').val(''); notify.prepend('
'+data.message+'
'); }else{ notify.prepend('
'+data.message+'
'); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }}); $('#request_hourly_reservation').on('click', function(e){ e.preventDefault(); var $this=$(this); var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var guest_message=$('textarea[name="guest_message"]').val(); var start_hour=$('select[name="start_hour"]').val(); var end_hour=$('select[name="end_hour"]').val(); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); var notify=$this.parents('.homey_notification'); notify.find('.notify').remove(); var extra_options=[]; var temp_opt; $('.homey_extra_price input').each(function(){ if(($(this).is(":checked"))){ var extra_name=$(this).data('name'); var extra_price=$(this).data('price'); var extra_type=$(this).data('type'); temp_opt=''; temp_opt=extra_name; temp_opt=temp_opt + '|' + extra_price; temp_opt=temp_opt + '|' + extra_type; extra_options.push(temp_opt); }}); if(parseInt(userID, 10)===0){ $('#modal-login').modal('show'); }else{ $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_add_hourly_reservation', 'check_in_date': check_in_date, 'start_hour': start_hour, 'end_hour': end_hour, 'guests': guests, 'extra_options': extra_options, 'guest_message': guest_message, 'listing_id': listing_id, 'security': security }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ if(data.success){ $('.check_in_date, .check_out_date').val(''); notify.prepend('
'+data.message+'
'); }else{ notify.prepend('
'+data.message+'
'); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }}); $('#request_hourly_reservation_mobile').on('click', function(e){ e.preventDefault(); var $this=$(this); var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var guest_message=$('textarea[name="guest_message"]').val(); var start_hour=$('#start_hour_overlay').val(); var end_hour=$('#end_hour_overlay').val(); var guests=$('input[name="guests"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); var notify=$this.parents('.homey_notification'); notify.find('.notify').remove(); var extra_options=[]; var temp_opt; $('.homey_extra_price input').each(function(){ if(($(this).is(":checked"))){ var extra_name=$(this).data('name'); var extra_price=$(this).data('price'); var extra_type=$(this).data('type'); temp_opt=''; temp_opt=extra_name; temp_opt=temp_opt + '|' + extra_price; temp_opt=temp_opt + '|' + extra_type; extra_options.push(temp_opt); }}); if(parseInt(userID, 10)===0){ $('#modal-login').modal('show'); }else{ $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_add_hourly_reservation', 'check_in_date': check_in_date, 'start_hour': start_hour, 'end_hour': end_hour, 'guests': guests, 'extra_options': extra_options, 'guest_message': guest_message, 'listing_id': listing_id, 'security': security }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ if(data.success){ $('.check_in_date, .check_out_date').val(''); notify.prepend('
'+data.message+'
'); }else{ notify.prepend('
'+data.message+'
'); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }}); $('#reserve_period_host').on('click', function(e){ e.preventDefault(); var $this=$(this); var check_in_date=$('#period_start_date').val(); var check_out_date=$('#period_end_date').val(); var listing_id=$('#period_listing_id').val(); var period_note=$('#period_note').val(); var security=$('#period-security').val(); var notify=$('.homey_notification'); notify.find('.notify').remove(); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_reserve_period_host', 'check_in_date': check_in_date, 'check_out_date': check_out_date, 'period_note': period_note, 'listing_id': listing_id, 'security': security }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ if(data.success){ notify.prepend('
'+data.message+'
'); window.location.href=calendar_link; }else{ notify.prepend('
'+data.message+'
'); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }); var homey_hourly_availability_calendar=function(){ var today=new Date(); var listing_booked_dates=[]; var listing_pending_dates=[]; for (var key in booked_hours_array){ if(booked_hours_array.hasOwnProperty(key)&&key!==''){ var temp_book=[]; temp_book['title']=HOMEY_ajax_vars.hc_reserved_label, temp_book ['start']=moment.unix(key).utc().format(), temp_book ['end']=moment.unix(booked_hours_array[key]).utc().format(), temp_book ['editable']=false; temp_book ['color']='#fdd2d2'; temp_book ['textColor']='#444444'; listing_booked_dates.push(temp_book); }} for (var key_pending in pending_hours_array){ if(pending_hours_array.hasOwnProperty(key_pending)&&key_pending!==''){ var temp_pending=[]; temp_pending['title']=HOMEY_ajax_vars.hc_pending_label, temp_pending ['start']=moment.unix(key_pending).utc().format(), temp_pending ['end']=moment.unix(pending_hours_array[key_pending]).utc().format(), temp_pending ['editable']=false; temp_pending ['color']='#ffeedb'; temp_pending ['textColor']='#333333'; listing_pending_dates.push(temp_pending); }} var hours_slot=$.merge(listing_booked_dates, listing_pending_dates); var calendarEl=document.getElementById('homey_hourly_calendar'); var calendar=new FullCalendar.Calendar(calendarEl, { locale: HOMEY_ajax_vars.homey_current_lang, timeZone: HOMEY_ajax_vars.homey_timezone, plugins: [ 'timeGrid' ], defaultView: 'timeGridWeek', slotDuration:'00:30:00', minTime: booking_start_hour, maxTime: booking_end_hour, events: hours_slot, defaultDate: today, selectHelper: true, selectOverlap:false, footer: false, nowIndicator: true, allDayText: HOMEY_ajax_vars.hc_hours_label, weekNumbers: false, weekNumbersWithinDays: true, weekNumberCalculation: 'ISO', editable: false, eventLimit: true, unselectAuto: false, isRTL: homey_is_rtl, buttonText: { today: HOMEY_ajax_vars.hc_today_label }}); calendar.render(); } if(homey_booking_type=='per_hour'&&is_listing_detail=='yes'){ if($('#homey_hourly_calendar').length > 0){ homey_hourly_availability_calendar(); }} $('#instance_reservation, #instance_reservation_mobile').on('click', function(e){ e.preventDefault(); var extra_options=[]; var temp_opt; var $this=$(this); var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); var check_out_date=$('input[name="depart"]').val(); check_out_date=homey_convert_date(check_out_date); var guests=$('input[name="guests"]').val(); var guest_message=$('textarea[name="guest_message"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); var notify=$this.parents('.homey_notification'); notify.find('.notify').remove(); $('.homey_extra_price input').each(function(){ if(($(this).is(":checked"))){ var extra_name=$(this).data('name'); var extra_price=$(this).data('price'); var extra_type=$(this).data('type'); temp_opt=''; temp_opt=extra_name; temp_opt=temp_opt + '|' + extra_price; temp_opt=temp_opt + '|' + extra_type; extra_options.push(temp_opt); }}); if(guests==0){ notify.prepend('
Please choose guests
'); } else if(parseInt(userID, 10)===0){ $('#modal-login').modal('show'); var currentURL=window.location.href; localStorage.setItem('latest_url', currentURL); var adult_guest=parseInt(jQuery('input[name="adult_guest"]').val()); if(adult_guest > 0){ jQuery.cookie('adult_guest', adult_guest); } var child_guest=parseInt(jQuery('input[name="child_guest"]').val()); if(child_guest > 0){ jQuery.cookie('child_guest', child_guest); } var guests=parseInt(jQuery('input[name="guests"]').val()); if(guests > 0){ jQuery.cookie('guests', guests); } if(guests > 0||guests > 0||child_guest > 0){ jQuery.cookie('redirect_to_booking', 1); }}else{ $.ajax({ type: 'POST', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_instance_booking', 'check_in_date': check_in_date, 'check_out_date': check_out_date, 'guests': guests, 'extra_options': extra_options, 'guest_message': guest_message, 'listing_id': listing_id, 'security': security }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function (data){ if(data.success){ $('.check_in_date, .check_out_date').val(''); var check_in=check_in_date; var check_out=check_out_date; var renter_message=''; var listing_name=$('h1.listing-title').text(); var listing_image=$('h1.listing-title').data('thumb'); var extra_options=[]; $.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'homey_instant_reservation_woo_pay', 'listing_name': listing_name, 'listing_image': listing_image, 'check_in': check_in, 'check_out': check_out, 'guests': guests, 'extra_options': extra_options, 'listing_id': listing_id, 'renter_message': renter_message, }, success: function(data){ if(data.success!=false){ window.location.href="/checkout/"; }else{ $('#homey_modal').modal('hide'); }}, error: function(errorThrown){ }}); }else{ notify.prepend('
'+data.message+'
'); }}, error: function(xhr, status, error){ alert('Error! Page will be reload! Please try again!'); location.reload(true); var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }}); if($('.page-template-dashboard-profile').length){ var latest_url=localStorage.getItem('latest_url'); if(latest_url){ localStorage.removeItem('latest_url'); window.location.assign(latest_url); } if(typeof latest_url2!=='undefined'){ window.location.assign(latest_url2); }} $('#instance_hourly_reservation, #instance_hourly_reservation_mobile').on('click', function(e){ e.preventDefault(); var $this=$(this); var start_hour; var end_hour; var check_in_date=$('input[name="arrive"]').val(); check_in_date=homey_convert_date(check_in_date); start_hour=$('select[name="start_hour"]').val(); end_hour=$('select[name="end_hour"]').val(); var guests=$('input[name="guests"]').val(); var guest_message=$('textarea[name="guest_message"]').val(); var listing_id=$('#listing_id').val(); var security=$('#reservation-security').val(); var notify=$this.parents('.homey_notification'); notify.find('.notify').remove(); if(homey_is_mobile||homey_window_width < 991){ start_hour=$('#start_hour_overlay').val(); end_hour=$('#end_hour_overlay').val(); } var extra_options=[]; var temp_opt; $('.homey_extra_price input').each(function(){ if(($(this).is(":checked"))){ var extra_name=$(this).data('name'); var extra_price=$(this).data('price'); var extra_type=$(this).data('type'); temp_opt=''; temp_opt=extra_name; temp_opt=temp_opt + '|' + extra_price; temp_opt=temp_opt + '|' + extra_type; extra_options.push(temp_opt); }}); $.ajax({ type: 'POST', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_instance_hourly_booking', 'check_in_date': check_in_date, 'start_hour': start_hour, 'end_hour': end_hour, 'guests': guests, 'extra_options': extra_options, 'listing_id': listing_id, 'guest_message': guest_message, 'security': security }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function (data){ if(data.success){ $('.check_in_date, .start_hour, .end_hour').val(''); notify.prepend('
'+data.message+'
'); window.location.href=data.instance_url; }else{ notify.prepend('
'+data.message+'
'); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }); $('.confirm-reservation').on('click', function(e){ e.preventDefault(); var $this=$(this); var reservation_id=$this.data('reservation_id'); var parentDIV=$this.parents('.user-dashboard-right'); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_confirm_reservation', 'reservation_id': reservation_id }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ parentDIV.find('.alert').remove(); if(data.success){ parentDIV.find('.dashboard-area').prepend(data.message); $this.remove(); }else{ parentDIV.find('.dashboard-area').prepend(data.message); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }); $('.confirm-offsite-reservation').on('click', function(e){ e.preventDefault(); var $this=$(this); var reservation_id=$this.data('reservation_id'); var parentDIV=$this.parents('.user-dashboard-right'); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_confirm_offsite_reservation', 'reservation_id': reservation_id }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ parentDIV.find('.alert').remove(); if(data.success){ parentDIV.find('.dashboard-area').prepend(data.message); $this.remove(); }else{ parentDIV.find('.dashboard-area').prepend(data.message); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }); $('#guest_paid_button').on('click', function(e){ e.preventDefault(); var $this=$(this); var parentDIV=$this.parents('.user-dashboard-right'); var reservation_id=$('#reservation_id').val(); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_guest_made_payment', 'reservation_id': reservation_id }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ parentDIV.find('.alert').remove(); if(data.success){ parentDIV.find('.dashboard-area').prepend(data.message); $this.remove(); }else{ parentDIV.find('.dashboard-area').prepend(data.message); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }); $('#decline').on('click', function(e){ e.preventDefault(); var $this=$(this); var reservation_id=$('#reservationID').val(); var reason=$('#reason22').val(); var parentDIV=$this.parents('.user-dashboard-right'); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_decline_reservation', 'reservation_id': reservation_id, 'reason': reason }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ parentDIV.find('.alert').remove(); if(data.success){ $this.attr("disabled", true); window.location.reload(); }else{ parentDIV.find('.dashboard-area').prepend(''); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }); $('#decline_hourly').on('click', function(e){ e.preventDefault(); var $this=$(this); var reservation_id=$('#reservationID').val(); var reason=$('#reason').val(); var parentDIV=$this.parents('.user-dashboard-right'); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_decline_hourly_reservation', 'reservation_id': reservation_id, 'reason': reason }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ parentDIV.find('.alert').remove(); if(data.success){ $this.attr("disabled", true); window.location.reload(); }else{ parentDIV.find('.dashboard-area').prepend(''); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }); $('#cancelled').on('click', function(e){ e.preventDefault(); var $this=$(this); var reservation_id=$('#reservationID').val(); var reason=$('#reason').val(); var host_cancel=$('#host_cancel').val(); var parentDIV=$this.parents('.user-dashboard-right'); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_cancelled_reservation', 'reservation_id': reservation_id, 'host_cancel': host_cancel, 'reason': reason }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ parentDIV.find('.alert').remove(); if(data.success){ $this.attr("disabled", true); window.location.reload(); }else{ parentDIV.find('.dashboard-area').prepend(''); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }); $('#cancelled_hourly').on('click', function(e){ e.preventDefault(); var $this=$(this); var reservation_id=$('#reservationID').val(); var reason=$('#reason').val(); var host_cancel=$('#host_cancel').val(); var parentDIV=$this.parents('.user-dashboard-right'); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_cancelled_hourly_reservation', 'reservation_id': reservation_id, 'host_cancel': host_cancel, 'reason': reason }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ parentDIV.find('.alert').remove(); if(data.success){ $this.attr("disabled", true); window.location.reload(); }else{ parentDIV.find('.dashboard-area').prepend(''); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }); var homey_booking_paypal_payment=function($this, reservation_id, security){ $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_booking_paypal_payment', 'reservation_id': reservation_id, 'security': security, }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); $('#homey_notify').html(''); }, success: function(data){ if(data.success){ window.location.href=data.payment_execute_url; }else{ $('#homey_notify').html(''); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); } var homey_hourly_booking_paypal_payment=function($this, reservation_id, security){ $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_hourly_booking_paypal_payment', 'reservation_id': reservation_id, 'security': security, }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); $('#homey_notify').html(''); }, success: function(data){ if(data.success){ window.location.href=data.payment_execute_url; }else{ $('#homey_notify').html(''); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); } $('#make_booking_payment').on('click', function(e){ e.preventDefault(); var $this=$(this); var reservation_id=$('#reservation_id').val(); var security=$('#checkout-security').val(); var payment_gateway=$("input[name='payment_gateway']:checked").val(); if(payment_gateway==undefined){ $('#homey_notify').html(''); } if(payment_gateway==='paypal'){ homey_booking_paypal_payment($this, reservation_id, security); }else if(payment_gateway==='stripe'){ var hform=$(this).parents('.dashboard-area'); hform.find('.homey_stripe_simple button').trigger("click"); $('#homey_notify').html(''); } return; }); $('#make_hourly_booking_payment').on('click', function(e){ e.preventDefault(); var $this=$(this); var reservation_id=$('#reservation_id').val(); var security=$('#checkout-security').val(); var payment_gateway=$("input[name='payment_gateway']:checked").val(); if(payment_gateway==undefined){ $('#homey_notify').html(''); } if(payment_gateway==='paypal'){ homey_hourly_booking_paypal_payment($this, reservation_id, security); }else if(payment_gateway==='stripe'){ var hform=$(this).parents('.dashboard-area'); hform.find('.homey_stripe_simple button').trigger("click"); $('#homey_notify').html(''); } return; }); var homey_instance_booking_paypal_payment=function($this, check_in, check_out, guests, extra_options, listing_id, renter_message, security){ $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_instance_booking_paypal_payment', 'check_in': check_in, 'check_out': check_out, 'guests': guests, 'extra_options': extra_options, 'listing_id': listing_id, 'renter_message': renter_message, 'security': security, }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); $('#instance_noti').html(''); }, success: function(data){ if(data.success){ window.location.href=data.payment_execute_url; }else{ $('#instance_noti').html(''); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); } var homey_hourly_instance_booking_paypal_payment=function($this, check_in, check_in_hour, check_out_hour, start_hour, end_hour, guests, extra_options, listing_id, renter_message, security){ $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_hourly_instance_booking_paypal_payment', 'check_in': check_in, 'check_in_hour': check_in_hour, 'check_out_hour': check_out_hour, 'start_hour': start_hour, 'end_hour': end_hour, 'guests': guests, 'extra_options': extra_options, 'listing_id': listing_id, 'renter_message': renter_message, 'security': security, }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); $('#instance_noti').html(''); }, success: function(data){ if(data.success){ window.location.href=data.payment_execute_url; }else{ $('#instance_noti').html(''); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); } $('#make_instance_booking_payment').on('click', function(e){ e.preventDefault(); var $this=$(this); var check_in=$('#check_in_date').val(); var check_out=$('#check_out_date').val(); var guests=$('#guests').val(); var listing_id=$('#listing_id').val(); var renter_message=$('#renter_message').val(); var security=$('#checkout-security').val(); var extra_options=[]; var temp_opt; $('.homey_extra_price').each(function(){ var extra_name=$(this).data('name'); var extra_price=$(this).data('price'); var extra_type=$(this).data('type'); temp_opt=''; temp_opt=extra_name; temp_opt=temp_opt + '|' + extra_price; temp_opt=temp_opt + '|' + extra_type; extra_options.push(temp_opt); }); $('#instance_noti').empty(); var payment_gateway=$("input[name='payment_gateway']:checked").val(); if(payment_gateway==undefined){ $('#instance_noti').html(''); } if(payment_gateway==='paypal'){ homey_instance_booking_paypal_payment($this, check_in, check_out, guests, extra_options, listing_id, renter_message, security); }else if(payment_gateway==='stripe'){ var hform=$(this).parents('form'); hform.find('.homey_stripe_simple button').trigger("click"); } return; }); $('#make_hourly_instance_booking_payment').on('click', function(e){ e.preventDefault(); var $this=$(this); var check_in=$('#check_in_date').val(); var check_in_hour=$('#check_in_hour').val(); var check_out_hour=$('#check_out_hour').val(); var start_hour=$('#start_hour').val(); var end_hour=$('#end_hour').val(); var guests=$('#guests').val(); var listing_id=$('#listing_id').val(); var renter_message=$('#renter_message').val(); var security=$('#checkout-security').val(); var extra_options=[]; var temp_opt; $('.homey_extra_price').each(function(){ var extra_name=$(this).data('name'); var extra_price=$(this).data('price'); var extra_type=$(this).data('type'); temp_opt=''; temp_opt=extra_name; temp_opt=temp_opt + '|' + extra_price; temp_opt=temp_opt + '|' + extra_type; extra_options.push(temp_opt); }); $('#instance_noti').empty(); var payment_gateway=$("input[name='payment_gateway']:checked").val(); if(payment_gateway==undefined){ $('#instance_noti').html(''); } if(payment_gateway==='paypal'){ homey_hourly_instance_booking_paypal_payment($this, check_in, check_in_hour, check_out_hour, start_hour, end_hour, guests, extra_options, listing_id, renter_message, security); }else if(payment_gateway==='stripe'){ var hform=$(this).parents('form'); hform.find('.homey_stripe_simple button').trigger("click"); } return; }); $('button.homey-booking-step-1').on('click', function(e){ e.preventDefault(); var $this=$(this); var first_name=$('#first-name').val(); var last_name=$('#last-name').val(); var phone=$('#phone').val(); var renter_message=$('#renter_message').val(); if($("#agree").is(':checked')){ }else{ alert('Please! check Terms and Conditions!'); return false; } $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_instance_step_1', 'first_name': first_name, 'last_name': last_name, 'phone': phone, }, beforeSend: function(){ $this.children('i').remove(); $('.homey-booking-block-body-1 .continue-block-button p.error').remove(); $this.prepend(''); }, success: function(data){ if(data.success){ $('.homey-booking-block-title-2').removeClass('inactive mb-0'); $('.homey-booking-block-body-2').slideDown('slow'); $('.homey-booking-block-title-1').addClass('mb-0'); $('.homey-booking-block-body-1').slideUp('slow'); $('.homey-booking-block-title-1 .text-success, .homey-booking-block-title-1 .edit-booking-form').removeClass('hidden'); $('.homey-booking-block-title-1 .text-success, .homey-booking-block-title-1 .edit-booking-form').show(); $('#guest_message').val(renter_message); }else{ $('.homey-booking-block-body-1 .continue-block-button').prepend('

'+ data.message +'

'); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }); $('button.homey-booking-step-2').on('click', function(e){ e.preventDefault(); var agreement=$("input[name='agreement']:checked").val(); $('.homey-booking-block-body-2 .continue-block-button p.error').remove(); if(agreement!=undefined){ $('.homey-booking-block-title-3').removeClass('inactive mb-0'); $('.homey-booking-block-body-3').slideDown('slow'); $('.homey-booking-block-title-2').addClass('mb-0'); $('.homey-booking-block-body-2').slideUp('slow'); $('.homey-booking-block-title-2 .text-success, .homey-booking-block-title-2 .edit-booking-form').removeClass('hidden'); $('.homey-booking-block-title-2 .text-success, .homey-booking-block-title-2 .edit-booking-form').show(); }else{ $('.homey-booking-block-body-2 .continue-block-button').prepend('

'+ agree_term_text +'

'); }}); $('.homey-booking-block-title-1 .edit-booking-form').on('click', function(e){ e.preventDefault(); $('.homey-booking-block-title-2, .homey-booking-block-title-3').addClass('mb-0'); $('.homey-booking-block-body-2, .homey-booking-block-body-3').slideUp('slow'); $('.homey-booking-block-title-1').removeClass('mb-0'); $('.homey-booking-block-body-1').slideDown('slow'); }); $('.homey-booking-block-title-2 .edit-booking-form').on('click', function(e){ e.preventDefault(); $('.homey-booking-block-title-1, .homey-booking-block-title-3').addClass('mb-0'); $('.homey-booking-block-body-1, .homey-booking-block-body-3').slideUp('slow'); $('.homey-booking-block-title-2').removeClass('mb-0'); $('.homey-booking-block-body-2').slideDown('slow'); }); $('.contact_listing_host').on('click', function(e){ e.preventDefault(); var $this=$(this); var $host_contact_wrap=$this.parents('.host-contact-wrap'); var $form=$this.parents('form'); var $messages=$host_contact_wrap.find('.homey_contact_messages'); $.ajax({ url: ajaxurl, data: $form.serialize(), method: $form.attr('method'), dataType: "JSON", beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(response){ if(response.success){ $messages.empty().append(response.msg); $form.find('input').val(''); $form.find('textarea').val(''); }else{ $messages.empty().append(response.msg); $this.children('i').removeClass(process_loader_spinner); } if(homey_reCaptcha==1){ homeyReCaptchaReset(); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); $this.children('i').addClass(success_icon); }}); }); $('#host_detail_contact').on('click', function(e){ e.preventDefault(); var current_element=$(this); var $this=$(this); var $form=$this.parents('form'); $.ajax({ type: 'post', url: ajaxurl, data: $form.serialize(), method: $form.attr('method'), dataType: "JSON", beforeSend: function(){ current_element.children('i').remove(); current_element.prepend(''); }, success: function(res){ current_element.children('i').removeClass(process_loader_spinner); if(res.success){ $('#form_messages').empty().append(res.msg); current_element.children('i').addClass(success_icon); }else{ $('#form_messages').empty().append(res.msg); } if(homey_reCaptcha==1){ homeyReCaptchaReset(); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); }); if($('#homey-print').length > 0){ $('#homey-print').on('click', function (e){ e.preventDefault(); var listingID, printWindow; listingID=$(this).attr('data-listing-id'); printWindow=window.open('', 'Print Me', 'width=850 ,height=842'); $.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'homey_create_print', 'listing_id': listingID, }, success: function (data){ printWindow.document.write(data); printWindow.document.close(); printWindow.focus(); }, error: function (xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); }); } $('.homey_login_button').on('click', function(e){ e.preventDefault(); var current=$(this); homey_login(current); }); $('.homey-register-button').on('click', function(e){ e.preventDefault(); var current=$(this); homey_register(current); }); var homey_login=function(current){ var $form=current.parents('form'); var $messages=$('.homey_login_messages'); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: $form.serialize(), beforeSend: function (){ $messages.empty().append('

'+ login_sending +'

'); }, success: function(response){ if(response.success){ $messages.empty().append('

'+ response.msg +'

'); if(login_redirect_type=='same_page'){ window.location.reload(true); }else{ window.location.href=login_redirect; }}else{ $messages.empty().append('

'+ response.msg +'

'); } if(homey_reCaptcha==1){ homeyReCaptchaReset(); }}, error: function(xhr, status, error){ alert('Error! This page will be reloaded! Please try login again!'); location.reload(true); }}) } var homey_register=function(currnt){ var $form=currnt.parents('form'); var $messages=$('.homey_register_messages'); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: $form.serialize(), beforeSend: function (){ $messages.empty().append('

'+ login_sending +'

'); }, success: function(response){ if(response.success){ $messages.empty().append('

'+ response.msg +'

'); $('.homey_login_messages').empty().append('

'+ response.msg +'

'); $('#modal-register').modal('hide'); $('#modal-login').modal('show'); }else{ $messages.empty().append('

'+ response.msg +'

'); } if(homey_reCaptcha==1){ homeyReCaptchaReset(); } if(homey_reCaptcha==1){ homeyReCaptchaReset(); }}, error: function(xhr, status, error){ alert('Error! This page will be reloaded! Please try register again!'); location.reload(true); }}); } $('#homey_forgetpass').on('click', function(e){ e.preventDefault(); var user_login=$('#user_login_forgot').val(), security=$('#homey_resetpassword_security').val(); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_reset_password', 'user_login': user_login, 'security': security }, beforeSend: function (){ $('#homey_msg_reset').empty().append('

'+ login_sending +'

'); }, success: function(response){ if(response.success){ $('#homey_msg_reset').empty().append('

'+ response.msg +'

'); }else{ $('#homey_msg_reset').empty().append('

'+ response.msg +'

'); }}, error: function(xhr, status, error){ alert('Error! This page will be reloaded! Please try restore password again!'); location.reload(true); }}); }); if($('#homey_reset_password').length > 0){ $('#homey_reset_password').on('click', function(e){ e.preventDefault(); var $this=$(this); var rg_login=$('input[name="rp_login"]').val(); var rp_key=$('input[name="rp_key"]').val(); var new_pass=$('input[name="new_password"]').val(); var security=$('input[name="homey_resetpassword_security"]').val(); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_reset_password_2', 'rq_login': rg_login, 'password': new_pass, 'rp_key': rp_key, 'security': security }, beforeSend: function(){ $this.children('i').remove(); $this.prepend(''); }, success: function(data){ if(data.success){ $('#password_reset_msgs, .homey_login_messages').empty().append('

'+ data.msg +'

'); $('#new_password').val(''); $('#modal-login').modal('show'); }else{ $('#password_reset_msgs').empty().append('

'+ data.msg +'

'); }}, error: function(errorThrown){ }, complete: function(){ $this.children('i').removeClass(process_loader_spinner); }}); }); } $('.homey-facebook-login').on('click', function(){ var current=$(this); homey_login_via_facebook(current); }); var homey_login_via_facebook=function(current){ var $form=current.parents('form'); var $messages=$('.homey_login_messages'); $.ajax({ type: 'POST', url: ajaxurl, data: { 'action':'homey_facebook_login_oauth' }, beforeSend: function (){ $messages.empty().append('

'+ login_sending +'

'); }, success: function (data){ window.location.href=data; }, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); } $('.homey-yahoo-login').on('click', function (){ var current=$(this); homey_login_via_yahoo(current); }); var homey_login_via_yahoo=function(current){ var $form=current.parents('form'); var $messages=$('.homey_login_messages'); $.ajax({ type: 'POST', url: ajaxurl, data: { 'action':'homey_yahoo_login' }, beforeSend: function (){ $messages.empty().append('

'+ login_sending +'

'); }, success: function (data){ window.location.href=data; }, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); } $('.homey-google-login').on('click', function (){ var current=$(this); homey_login_via_google(current); }); var homey_login_via_google=function(current){ var $form=current.parents('form'); var $messages=$('.homey_login_messages'); $.ajax({ type: 'POST', url: ajaxurl, data: { 'action':'homey_google_login_oauth' }, beforeSend: function (){ $messages.empty().append('

'+ login_sending +'

'); }, success: function (data){ window.location.href=data; }, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); } var homey_message_notifications=function (){ $.ajax({ url: ajaxurl, data: { action:'homey_chcek_messages_notifications' }, method: "POST", dataType: "JSON", beforeSend: function(){ }, success: function(response){ if(response.success){ if(response.notification){ $('.user-alert').show(); $('.msg-alert').show(); }else{ $('.user-alert').hide(); $('.msg-alert').hide(); }} }}); }; $(document).ready(function(){ homey_message_notifications(); if(parseInt(userID, 10)!=0){ setInterval(function(){ homey_message_notifications(); }, 60000); }}); $('.btn_extra_expense').on('click', function(e){ e.preventDefault(); var reservation_id=$('#resrv_id').val(); }); $('.homey-woocommerce-featured-pay').on('click', function(e){ e.preventDefault(); let listID=$(this).data('listid'); let is_featured=$(this).data('featured'); homey_processing_modal(processing_text); $.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'homey_featured_woo_pay', 'listing_id': listID, 'is_featured': is_featured, }, success: function(data){ if(data.success!=false){ window.location.href=HOMEY_ajax_vars.woo_checkout_url; }else{ $('#homey_modal').modal('hide'); }}, error: function(errorThrown){ }}); }); $('.homey-woo-reservation-pay').on('click', function(e){ e.preventDefault(); let reservation_id=$(this).data('reservation_id'); homey_processing_modal(processing_text); $.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'homey_reservation_woo_pay', 'reservation_id': reservation_id, }, success: function(data){ if(data.success!=false){ window.location.href=HOMEY_ajax_vars.woo_checkout_url; }else{ $('#homey_modal').modal('hide'); }}, error: function(errorThrown){ }}); }); $('#make_woocommerce_instant_booking_payment').on('click', function(e){ e.preventDefault(); homey_processing_modal(processing_text); var $this=$(this); var check_in=$('#check_in_date').val(); var check_out=$('#check_out_date').val(); var guests=$('#guests').val(); var listing_id=$('#listing_id').val(); var renter_message=$('#renter_message').val(); var security=$('#checkout-security').val(); var listing_name=$('#listing_name').val(); var listing_image=$('#listing_image').val(); var extra_options=[]; var temp_opt; $('.homey_extra_price').each(function(){ var extra_name=$(this).data('name'); var extra_price=$(this).data('price'); var extra_type=$(this).data('type'); temp_opt=''; temp_opt=extra_name; temp_opt=temp_opt + '|' + extra_price; temp_opt=temp_opt + '|' + extra_type; extra_options.push(temp_opt); }); $.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'homey_instant_reservation_woo_pay', 'listing_name': listing_name, 'listing_image': listing_image, 'check_in': check_in, 'check_out': check_out, 'guests': guests, 'extra_options': extra_options, 'listing_id': listing_id, 'renter_message': renter_message, }, success: function(data){ if(data.success!=false){ window.location.href="/checkout/"; }else{ $('#homey_modal').modal('hide'); }}, error: function(errorThrown){ }}); }); $('#make_hourly_woocommerce_instant_booking_payment').on('click', function(e){ e.preventDefault(); homey_processing_modal(processing_text); var $this=$(this); var check_in=$('#check_in_date').val(); var check_in_hour=$('#check_in_hour').val(); var check_out_hour=$('#check_out_hour').val(); var start_hour=$('#start_hour').val(); var end_hour=$('#end_hour').val(); var guests=$('#guests').val(); var listing_id=$('#listing_id').val(); var renter_message=$('#renter_message').val(); var security=$('#checkout-security').val(); var extra_options=[]; var temp_opt; $('.homey_extra_price').each(function(){ var extra_name=$(this).data('name'); var extra_price=$(this).data('price'); var extra_type=$(this).data('type'); temp_opt=''; temp_opt=extra_name; temp_opt=temp_opt + '|' + extra_price; temp_opt=temp_opt + '|' + extra_type; extra_options.push(temp_opt); }); $('#instance_noti').empty(); $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { 'action': 'homey_instant_hourly_reservation_woo_pay', 'check_in': check_in, 'check_in_hour': check_in_hour, 'check_out_hour': check_out_hour, 'start_hour': start_hour, 'end_hour': end_hour, 'guests': guests, 'extra_options': extra_options, 'listing_id': listing_id, 'renter_message': renter_message, 'security': security, }, success: function(data){ if(data.success!=false){ window.location.href=HOMEY_ajax_vars.woo_checkout_url; }else{ $('#homey_modal').modal('hide'); }}, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); }); }}); (function($){ "use strict"; var current_month=1; var stickySidebarTop=0; var adminBarHeight=0; var searchCalClick=0; var fromTimestamp, toTimestamp=0; var timestamp; var homey_is_dashboard=HOMEY_ajax_vars.homey_is_dashboard; var homey_calendar_months=HOMEY_ajax_vars.homey_calendar_months; var homey_date_format=HOMEY_ajax_vars.homey_date_format; var search_position=HOMEY_ajax_vars.search_position; var geo_country_limit=HOMEY_ajax_vars.geo_country_limit; var geocomplete_country=HOMEY_ajax_vars.geocomplete_country; var replytocom=HOMEY_ajax_vars.replytocom; var compare_url=HOMEY_ajax_vars.compare_url; var add_compare=HOMEY_ajax_vars.add_compare; var remove_compare=HOMEY_ajax_vars.remove_compare; var compare_limit=HOMEY_ajax_vars.compare_limit; var homey_is_transparent=HOMEY_ajax_vars.homey_is_transparent; var is_tansparent=HOMEY_ajax_vars.homey_tansparent; var is_top_header=HOMEY_ajax_vars.homey_is_top_header; var simple_logo=HOMEY_ajax_vars.simple_logo; var mobile_logo=HOMEY_ajax_vars.mobile_logo; var retina_logo=HOMEY_ajax_vars.retina_logo; var custom_logo_splash=HOMEY_ajax_vars.custom_logo_splash; var retina_logo_splash=HOMEY_ajax_vars.retina_logo_splash; var retina_logo_mobile=HOMEY_ajax_vars.retina_logo_mobile; var custom_logo_mobile_splash=HOMEY_ajax_vars.custom_logo_mobile_splash; var retina_logo_mobile_splash=HOMEY_ajax_vars.retina_logo_mobile_splash; var current_month2=2; var $win=$(window); var body_width=$('body').innerWidth(); var header_area=$('.nav-area'); var header_nav=$('.header-nav'); var main_content_area=$('.main-content-area'); var section_body=$('#section-body'); var homey_main_search=$('#homey-main-search'); var homey_main_search_height=homey_main_search.innerHeight(); var homey_nav_sticky=$('#homey_nav_sticky'); var homey_nav_sticky_height=homey_nav_sticky.innerHeight(); var dashboard_header=$('.dashboard-page-title'); var footer_area=$('.footer-area'); var user_dashboard_left=$('.user-dashboard-left'); var top_banner_wrap=$('.top-banner-wrap '); var top_banner_wrap_height=top_banner_wrap.innerHeight(); var header_area_height=header_area.innerHeight(); var header_area_outer_height=header_area.outerHeight(); var dashboard_header_height=dashboard_header.innerHeight(); var footer_area_height=footer_area.innerHeight(); var search_area_height=$('.header-search').innerHeight(); var listing_nav_area_height=$('.listing-nav').innerHeight(); var focusedInput=null; var homey_is_rtl=HOMEY_ajax_vars.homey_is_rtl; if(homey_is_rtl=='yes'){ homey_is_rtl=true; }else{ homey_is_rtl=false; } if(listing_nav_area_height==undefined){ listing_nav_area_height=0; } var make_search_sticky_position=header_area_height; var searchStickyPlus=20; if(search_position=='under_banner'){ make_search_sticky_position=header_area_height + top_banner_wrap_height; searchStickyPlus=0; } var homey_is_mobile=false; if(/Android|webOS|iPhone|iPad|iPod|tablet|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ homey_is_mobile=true; } console.log(homey_is_mobile); var homey_is_android=false; if(/Android|Opera Mini/i.test(navigator.userAgent)){ homey_is_android=true; } console.log(homey_is_android); var only_nav_sticky=homey_nav_sticky.data('sticky'); var only_search_sticky=homey_main_search.data('sticky'); if(only_nav_sticky===1){ stickySidebarTop=homey_nav_sticky_height; } if(only_search_sticky===1){ stickySidebarTop=homey_main_search_height; } if(only_nav_sticky===1&&only_search_sticky===1){ stickySidebarTop=homey_nav_sticky_height + homey_main_search_height; } var componentForm={ establishment: 'long_name', street_number: 'short_name', locality: 'long_name', administrative_area_level_1: 'long_name', country: 'long_name', postal_code: 'short_name', postal_code_prefix:'short_name', neighborhood: 'long_name', sublocality_level_1: 'long_name' }; $('.mobile-main-nav').on('click', function(){ $('#user-nav').removeClass('in'); }); $('.user-mobile-nav').on('click', function(){ $('#mobile-nav').removeClass('in'); }); if($('.homey-matchHeight-needed .homey-matchHeight').length){ $('.homey-matchHeight').matchHeight({ remove: true }); $('.homey-matchHeight').matchHeight(); } function parseInt10(val){ return parseInt(val, 10); } if($('.comments-form').length > 0){ $('.comments-form .comment-respond').removeAttr('id', 'respond'); if(replytocom!=''){ $('html, body').animate({ scrollTop: $("#comments-form").offset().top - 320 }, 1000); }} var popover_ele=$('[data-toggle="popover"]'); popover_ele.popover({ trigger: "hover", html: true }); var data_tooltip=$('[data-toggle="tooltip"]'); data_tooltip.tooltip(); function click_doc_hide(ele){ $(document).mouseup(function(e){ if(!$(ele).is(e.target) && $(ele).has(e.target).length===0 ){ $(ele).fadeOut(); }}); } var select_picker=$('.selectpicker'); if(select_picker.length > 0){ select_picker.selectpicker({ dropupAuto: false }); } var isChrome=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor); var isSafari=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor); $('.navi ul li').each(function(){ $(this).has('ul').not('.homey-megamenu li').addClass('has-child') }); $(".navi ul .has-child").on({ mouseenter: function(){ $(this).addClass('active'); }, mouseleave: function(){ $(this).removeClass('active'); }}); function homy_megamenu(){ if($(window).width() > 991){ var container=$('.container'); var header=$('.header-type-1,.header-type-1'); var containWidth=container.innerWidth(); var windowWidth=$win.width(); var containOffset=container.offset(); if($('.navi ul li').hasClass('homey-megamenu')){ $('.navi ul .homey-megamenu').each(function(){ $("> .sub-menu", this).wrap("
"); var thisOffset=$(this).offset(); if(header.children('.container').length > 0){ $("> .homey-megamenu-wrap", this).css({ width: containWidth, left: -(thisOffset.left - containOffset.left) }); }else{ $("> .homey-megamenu-wrap", this).css({ width: windowWidth, left: -thisOffset.left }); }}); }} } homy_megamenu(); $win.on('resize', function(){ homy_megamenu(); }); $win.bind('load', function(){ homy_megamenu(); }); function accountDropdown(){ $(".account-loggedin").on({ mouseenter: function(){ $(this).addClass('active'); }, mouseleave: function(){ $(this).removeClass('active'); }}); } accountDropdown(); function mobileMenu(menu_html, menu_place){ var siteMenu=$(menu_html).html(); $(menu_place).html(siteMenu); $(menu_place + ' ul li').each(function(){ $(this).has('ul').addClass('has-child'); }); $(menu_place + ' ul .has-child').append(''); $(menu_place + ' .expand-me').on('click', function(){ var parent=$(this).parent('li'); if(parent.hasClass('active')==true){ parent.removeClass('active'); parent.children('ul').slideUp(); }else{ parent.addClass('active'); parent.children('ul').slideDown(); }}); } mobileMenu('.main-nav', '.main-nav-dropdown'); $('.nav-trigger').on('click', function(){ if($(this).hasClass('mobile-open')){ $(this).removeClass('mobile-open'); }else{ $(this).addClass('mobile-open'); }}); if(matchMedia){ var mq=window.matchMedia("(max-width: 991px)"); mq.addListener(WidthChange); WidthChange(mq); } function WidthChange(mq){ if(mq.matches){ $('.dashboard-page-title').css({ "top": 60 }); $('.user-dashboard-right').css({ "padding-top": 131 }); }else{ $('.dashboard-sidebar').css({ "top": header_area_height + dashboard_header_height + 34 }); $('.user-dashboard-left').css({ "top": header_area_height }); $('.user-dashboard-right').css({ "padding-top": header_area_height + dashboard_header_height + 4 }); $('.dashboard-page-title').css({ "top": header_area_height }); }} function sticky_block(){ if($win.width() > 991){ var stickySidebar=$('.dashboard-view-block'); var scroll_area=$(".dashboard-content-area"); if(stickySidebar.length > 0){ var stickyHeight=stickySidebar.height(), sidebarTop=stickySidebar.offset().top; sidebarTop=(sidebarTop - dashboadr_header_height) - header_area_height - 30; } scroll_area.scroll(function(){ if($win.width() > 991){ if(stickySidebar.length > 0){ var scrollTop=scroll_area.scrollTop(); if(sidebarTop < scrollTop){ stickySidebar.css('top', scrollTop - sidebarTop); var sidebarBottom=stickySidebar.offset().top + stickyHeight, stickyStop=sticky_content.offset().top + sticky_content.height(); if(stickyStop < sidebarBottom){ var stopPosition=sticky_content.height() - stickyHeight; stickySidebar.css('top', stopPosition); }}else{ stickySidebar.css('top', '0'); }} }else{ return false; }}); $win.resize(function(){ if(stickySidebar.length > 0){ stickyHeight=stickySidebar.height(); }}); }else{ return false; }} sticky_block(); $win.on('resize', function(){ sticky_block(); }); if(window.devicePixelRatio==2){ if(is_tansparent){ if(retina_logo_splash!=''){ custom_logo_splash=retina_logo_splash; } if(retina_logo!=''){ simple_logo=retina_logo; } if(retina_logo_mobile!=''){ mobile_logo=retina_logo_mobile; } if(retina_logo_mobile_splash!=''){ custom_logo_mobile_splash=retina_logo_mobile_splash; }} } function homey_sticky_nav(){ $(window).scroll(function(){ var scroll=$(window).scrollTop(); var admin_nav=$('#wpadminbar').height(); var thisHeight=header_nav.outerHeight(); if(only_nav_sticky===0){ return; } if(is_tansparent){ $('.homey_logo img').attr('src', simple_logo); $('.mobile-logo img').attr('src', mobile_logo); } if(admin_nav=='null'){ admin_nav=0; } if(scroll > header_area_height){ header_nav.addClass('sticky-nav-area'); header_nav.css('top', admin_nav); if(is_tansparent){ header_area.removeClass('transparent-header'); } if(scroll >=header_area_height + 20){ header_nav.addClass('homey-in-view'); if(is_top_header||!homey_is_transparent){ section_body.css('padding-top',thisHeight); }} }else{ header_nav.removeClass('sticky-nav-area'); header_nav.removeAttr("style"); if(is_tansparent){ header_area.addClass('transparent-header'); setTransparentHeaderMarginBottom(); $('.homey_logo img').attr('src', custom_logo_splash); $('.mobile-logo img').attr('src', custom_logo_mobile_splash); } if(scroll <=header_area_height + 20){ header_nav.removeClass('homey-in-view'); } if(is_top_header||!homey_is_transparent){ section_body.css('padding-top',0); }} }); } function homey_sticky_search(){ $(window).scroll(function(){ var scroll=$(window).scrollTop(); var admin_nav=$('#wpadminbar').height(); var thisHeight=$('.main-search').outerHeight(); if(only_search_sticky===0){ return; } if(admin_nav=='null'){ admin_nav=0; } if(scroll >=make_search_sticky_position){ homey_main_search.addClass('sticky-search-area'); homey_main_search.css('top', admin_nav); if(scroll >=make_search_sticky_position + searchStickyPlus){ homey_main_search.addClass('homey-in-view'); if(is_top_header||!homey_is_transparent){ section_body.css('padding-top',thisHeight); }} }else{ homey_main_search.removeClass('sticky-search-area'); homey_main_search.removeAttr("style"); if(scroll <=make_search_sticky_position + 20){ homey_main_search.removeClass('homey-in-view'); } if(is_top_header||!homey_is_transparent){ section_body.css('padding-top',0); }} }); } function homey_sticky_nav_search(){ $(window).scroll(function(){ var scroll=$(window).scrollTop(); var thisHeight=header_nav.outerHeight(); var admin_nav=$('#wpadminbar').height(); if(admin_nav=='null'){ admin_nav=0; } if(scroll >=header_area_height){ header_area.addClass('sticky-nav-area'); header_area.css('top', admin_nav); if(scroll >=header_area_height + 20){ header_area.addClass('homey-in-view'); if(is_top_header||!homey_is_transparent){ section_body.css('padding-top',thisHeight); }} }else{ header_area.removeClass('sticky-nav-area'); header_area.removeAttr("style"); if(scroll <=header_area_height + 20){ header_area.removeClass('homey-in-view'); } if(is_top_header||!homey_is_transparent){ section_body.css('padding-top',0); }} }); } if(!homey_is_mobile&&homey_is_dashboard!=1){ if(only_nav_sticky===1&&only_search_sticky===1){ homey_sticky_nav_search(); }else if(only_nav_sticky===1){ homey_sticky_nav(); }else if(only_search_sticky===1){ homey_sticky_search(); }} $(document).ready(function(){ adminBarHeight=$('#wpadminbar').innerHeight(); if(adminBarHeight!=null){ stickySidebarTop=stickySidebarTop + adminBarHeight; } if($(window).width()<992){ $('.homey-sticky-map').theiaStickySidebar({ additionalMarginTop: stickySidebarTop, updateSidebarHeight: false }); }else{ $('.homey-sticky-map').theiaStickySidebar({ additionalMarginTop: stickySidebarTop + 30, updateSidebarHeight: false }); } $('.homey_sticky').theiaStickySidebar({ additionalMarginTop: stickySidebarTop + listing_nav_area_height, minWidth: 768, updateSidebarHeight: false }); }); $(document).scroll(function(){ var y=$(this).scrollTop(); var homey_listing_nav=$('.listing-nav'); homey_listing_nav.css('top', stickySidebarTop); if(y > 200){ $('.listing-nav').fadeIn(250); }else{ $('.listing-nav').fadeOut(0); }}); $('a[href*="#"]:not(.carousel-control)') .not('[href="#"]') .not('[href="#0"]') .on('click', function(event){ if(location.pathname.replace(/^\//, '')==this.pathname.replace(/^\//, '') && location.hostname==this.hostname ){ var target=$(this.hash); target=target.length ? target:$('[name=' + this.hash.slice(1) + ']'); if(target.length){ event.preventDefault(); $('html, body').animate({ scrollTop: target.offset().top - (stickySidebarTop + listing_nav_area_height), }, 1000, 'easeOutExpo', function(){ }); }} }); $('a[data-toggle="tab"]').on('shown.bs.tab', function(e){ var this_e=e; this_e.target this_e.relatedTarget }); function homey_tabers(ele_tab, ele_tab_content, ele_delay){ var tab=$(ele_tab); var tab_content=$(ele_tab_content); tab.on('click', function(){ var this_tab=$(this); if(this_tab.hasClass('active')==false){ tab.removeClass('active'); this_tab.addClass('active'); tab_content.removeClass('active in'); tab_content.eq(this_tab.index()).addClass('active').delay(ele_delay).queue(function(next){ tab_content.eq(this_tab.index()).addClass('in'); next(); }); }}); } $(document).ready(function(){ $('.swipebox').swipebox({ useCSS:true, useSVG:true, initialIndexOnArray:0, hideCloseButtonOnMobile:false, removeBarsOnMobile:false, hideBarsDelay:3000, }); }) $(document).ready(function(){ $('.listing-slider').slick({ rtl: homey_is_rtl, lazyLoad: 'ondemand', slidesToShow: 1, slidesToScroll: 1, arrows: false, fade: false, asNavFor: '.listing-slider-nav', }); $('.listing-slider-nav').slick({ rtl: homey_is_rtl, lazyLoad: 'ondemand', slidesToShow: 6, slidesToScroll: 1, asNavFor: '.listing-slider', dots: false, focusOnSelect: true, variableWidth: true, arrows: false, }); }); $(document).ready(function(){ $('.listing-slider-variable-width').slick({ rtl: homey_is_rtl, lazyLoad: 'ondemand', infinite: true, autoplay:true, speed: 300, slidesToShow: 1, centerMode: true, variableWidth: true, arrows: true, adaptiveHeight: true, }); }); $(document).ready(function(){ $('.header-slider').slick({ rtl: homey_is_rtl, lazyLoad: 'ondemand', infinite: true, speed: 300, slidesToShow: 1, arrows: true, adaptiveHeight: true, }); }); var extended_menu_btn=$('.extended-menu-btn'); var extended_menu=$('.header-extended-menu'); extended_menu_btn.on('click', function(){ if($(this).hasClass('active')==true){ $(this).parents('.header-wrap').find('.header-extended-menu').slideUp().removeClass('menu-open'); $(this).removeClass('active'); }else{ $(this).addClass('active'); $(this).parents('.header-wrap').find('.header-extended-menu').slideDown().addClass('menu-open'); }}); var search_filter_btn=$('.search-filter-btn'); var search_filter=$('.search-filter'); search_filter_btn.on('click', function(){ if($(this).hasClass('active')==true){ $(this).parents('form').find('.search-filter').removeClass('search-filter-open'); $(this).removeClass('active'); }else{ $(this).addClass('active'); $(this).parents('form').find('.search-filter').addClass('search-filter-open'); }}); var search_reset_btn=$('.search-reset-btn'); search_reset_btn.on('click', function(e){ e.preventDefault(); var filters=$(this).parents('.search-filter-wrap'); $(this).closest('form').find("input[type=text], textarea").val(""); $(this).parents('.half-map-wrap').find("input[type=text], textarea").val(""); $('.search-destination').find("input[type=hidden]").val(""); filters.find('select').removeAttr('selected'); filters.find('select').selectpicker('val', ''); filters.find('select').selectpicker('refresh'); filters.find('input[type=checkbox]').removeAttr('checked'); }); var search_filter_mobile_btn=$('.search-filter-mobile-btn'); var search_filter_mobile=$('.search-filter'); search_filter_mobile_btn.on('touchstart', function(){ if($(this).hasClass('active')==true){ $(this).parents('.search-button').find('.search-filter').removeClass('search-filter-open'); $(this).removeClass('active'); }else{ $(this).addClass('active'); $(this).parents('.search-button').find('.search-filter').addClass('search-filter-open'); }}); function auto_complete(){ var search_input=$(".input-search"); var auto_complete_box=$(".search-auto-complete"); search_input.on('keyup', function(){ var this_input=$(this); var value=this_input.val(); var closest_search=this_input.closest("form").find(auto_complete_box); if(value.length > 3){ if(auto_complete_box.is(":hidden")){ closest_search.fadeIn(0); }}else{ closest_search.fadeOut(0); }}); $(document).mouseup(function(e){ var input_plus_auto_complete=$('.input-search,.search-auto-complete'); if(!input_plus_auto_complete.is(e.target) && input_plus_auto_complete.has(e.target).length===0 ){ auto_complete_box.fadeOut(0); }}); } auto_complete(); function setSectionHeight(){ var window_height=$(window).innerHeight(); var sections_height=window_height - header_area_height; if($(window).width() >=767){ $('.half-map-left-wrap, .half-map-right-wrap').css('height', sections_height); }else{ var sections_height=(window_height - header_area_height)/2; $('.map-on-right .half-map-right-wrap').css('height', sections_height); $('.map-on-right .half-map-left-wrap').css('height', 'auto'); $('.map-on-left .half-map-right-wrap').css('height', sections_height); $('.map-on-left .half-map-left-wrap').css('height', 'auto'); }} setSectionHeight(); $win.on('resize', function(){ setSectionHeight(); }); function setTransparentHeaderMarginBottom(){ var desktop_transparent_header_height=$('.transparent-header .header-nav.hidden-sm').innerHeight(); var mobile_transparent_header_height=$('.transparent-header .header-nav.hidden-md').innerHeight(); if($(window).width() >=991){ $('.transparent-header .header-nav.hidden-sm').css('margin-bottom', -desktop_transparent_header_height); }else{ $('.transparent-header .header-nav.hidden-md').css('margin-bottom', -mobile_transparent_header_height); }} setTransparentHeaderMarginBottom(); $win.on('resize', function(){ setTransparentHeaderMarginBottom(); }); function fullscreenBanner(){ var window_height=$(window).innerHeight(); var desktop_header_height=$('.header-nav.hidden-sm').innerHeight(); var mobile_header_height=$('.header-nav.hidden-md').innerHeight(); if($(window).width() >=767){ $('.top-banner-wrap-fullscreen').css('height', window_height - desktop_header_height); $('.transparent-header + .top-banner-wrap-fullscreen').css('height', window_height); $('.top-banner-wrap-fullscreen .slick-list, .top-banner-wrap-fullscreen .header-slider-item').css('height', window_height - desktop_header_height); $('.transparent-header + .top-banner-wrap-fullscreen .slick-list, .transparent-header + .top-banner-wrap-fullscreen .header-slider-item').css('height', window_height); }else{ $('.top-banner-wrap-fullscreen').css('height', window_height - mobile_header_height); $('.transparent-header + .top-banner-wrap-fullscreen').css('height', window_height); $('.top-banner-wrap-fullscreen .slick-list, .top-banner-wrap-fullscreen .header-slider-item').css('height', window_height - mobile_header_height); $('.transparent-header + .top-banner-wrap-fullscreen .slick-list, .transparent-header + .top-banner-wrap-fullscreen .header-slider-item').css('height', window_height); }} fullscreenBanner(); $win.on('resize', function(){ fullscreenBanner(); }); $(document).ready(function (){ $('.parallax').parallaxBackground({ parallaxBgPosition: "center center", parallaxBgRepeat: "no-repeat", parallaxBgSize: "cover", parallaxSpeed: "0.25", }); }); $(document).ready(function(){ $("#trigger-overlay-booking-form, .overlay-booking-module-close").on('click', function(){ $("#overlay-booking-module").toggleClass("open"); }); }); $(document).ready(function(){ $(".main-search .search-banner-mobile, .search-banner-mobile, .half-map-search .search-banner-mobile, .overlay-search-module-close").on('click', function(){ $("#overlay-search-advanced-module").toggleClass("open"); }); }); $(document).ready(function(){ $('.side-nav-trigger').on('click', function(){ $(this).toggleClass('active'); $('.side-nav-active').toggleClass('side-nav-active-push-toright'); $('#side-nav-panel').toggleClass('side-nav-panel-open'); }); }); $(document).ready(function(){ $('.compare-property-label').on('click', function(){ $(this).toggleClass('active'); $('.compare-property-active').addClass('compare-property-active-push-toleft'); $('#compare-property-panel').addClass('compare-property-panel-open'); }); $('.close-compare-panel').on('click', function(){ $(this).toggleClass('active'); $('.compare-property-active').removeClass('compare-property-active-push-toleft'); $('#compare-property-panel').removeClass('compare-property-panel-open'); }); var listings_compare=homeyGetCookie('homey_compare_listings'); var limit_item_compare=4; add_to_compare(compare_url, add_compare, remove_compare, compare_limit, listings_compare, limit_item_compare); remove_from_compare(listings_compare, add_compare, remove_compare); }); if($('#commentform').length > 0){ $('#commentform #submit').addClass('btn btn-primary'); } if($('ul.comments-list').length > 0){ $('ul.comments-list ul').addClass('list-unstyled'); } if($('.input_date').length > 0){ $(".input_date").datepicker(); } if($('.search-date').length > 0){ $(".search-date").datepicker(); } function calendar_next_prev(main_div, acdiv, is_next, singleMonth){ $('.'+acdiv).on('click', function (e){ e.preventDefault(); var next_prev_m=homey_calendar_months; var next_prev_m1=homey_calendar_months-1; var next_prev_m2=homey_calendar_months-2; if(singleMonth){ if(is_next){ if(current_month < next_prev_m1){ current_month=current_month + 1; }else{ current_month=next_prev_m; }}else{ if(current_month > 1){ current_month=current_month - 1; }else{ current_month=1; }} $('.'+main_div).hide(); $('.'+main_div).each(function (){ var month=parseInt($(this).attr('data-month'), 10); if(month===current_month){ $(this).fadeIn(); }}); }else{ if(is_next){ if(current_month2 < next_prev_m2){ current_month2=current_month2 + 1; }else{ current_month2=next_prev_m1; }}else{ if(current_month2 > 3){ current_month2=current_month2 - 1; }else{ current_month2=2; }} if(is_next){ $('.'+main_div).hide(); $('.'+main_div).each(function (){ var month=parseInt($(this).attr('data-month'), 10); if(month===current_month2||month===current_month2+1){ $(this).fadeIn(); }}); }else{ $('.'+main_div).hide(); $('.'+main_div).each(function (){ var month=parseInt($(this).attr('data-month'), 10); if(month===current_month2||month===current_month2-1){ $(this).fadeIn(); }}); }} if(singleMonth){ if(current_month==next_prev_m){ $(this).addClass('disabled'); }else{ $('.homey-next-month, .listing-cal-next, .search-cal-next').removeClass('disabled'); } if(current_month==1){ $(this).addClass('disabled'); }else{ $('.homey-prev-month, .listing-cal-prev, .search-cal-prev').removeClass('disabled'); }}else{ if(current_month2==next_prev_m1){ $(this).addClass('disabled'); }else{ $('.homey-next-month, .listing-cal-next, .search-cal-next').removeClass('disabled'); } if(current_month2==2){ $(this).addClass('disabled'); }else{ $('.homey-prev-month, .listing-cal-prev, .search-cal-prev').removeClass('disabled'); }} }); } calendar_next_prev('homey_month_wrap', 'homey-next-month', true, true); calendar_next_prev('homey_month_wrap', 'homey-prev-month', false, true); calendar_next_prev('single-listing-calendar-wrap', 'listing-cal-next', true, false); calendar_next_prev('single-listing-calendar-wrap', 'listing-cal-prev', false, false); calendar_next_prev('single-listing-hourly-calendar-wrap', 'listing-cal-next', true, true); calendar_next_prev('single-listing-hourly-calendar-wrap', 'listing-cal-prev', false, true); calendar_next_prev('main-search-calendar-wrap', 'search-cal-next', true, false); calendar_next_prev('main-search-calendar-wrap', 'search-cal-prev', false, false); calendar_next_prev('main-search-hourly-calendar-wrap', 'search-cal-next', true, true); calendar_next_prev('main-search-hourly-calendar-wrap', 'search-cal-prev', false, true); $(document).ready(function(){ $(".search-banner input").on('focus', function(){ $(this).prev("label").css("display", "block"); $(this).addClass("on-focus"); }); $(".search-destination input").on('focus', function(){ $('.search-destination .clear-input-btn').css("display", "block"); }); $('.clear-input-btn, .btn-clear-calendar').on('click', function(e){ e.preventDefault(); $('.search-destination label, .search-destination .clear-input-btn').css("display", "none"); $('.search-calendar-main').removeClass("depart_active").addClass('arrive_active'); focusedInput='arrive'; $('.main-search-calendar-wrap ul li').removeClass('in-between to-day from-day selected'); searchCalClick=0; timestamp=0; $('.search-destination input').removeClass("on-focus"); $('.search-destination input').val(''); }); $(".search-destination input").on('focus', function(){ $('.search-calendar').css("display", "none"); $('.search-guests-wrap').css("display", "none"); }); $(".search-guests input").on('focus', function(){ $('.single-listing-booking-calendar-js, .search-calendar-main, .search-hourly-calendar-main').css("display", "none"); }); $('.search-hours-range-js').on('click', function(){ $('.search-calendar').css("display", "none"); $('.search-guests-wrap').css("display", "none"); }); $('.btn-clear-calendar').on('click', function(){ $('.search-date-range input').val(''); $('.search-date-range label').css("display", "none"); $('.search-date-range input').removeClass("on-focus"); }); $('.guest-apply-btn .btn').on('click', function(){ $('.search-guests-wrap').css("display", "none"); }); $(".main-search-date-range-js input").on('focus', function(){ $('.search-calendar-main').css("display", "block"); $('.search-calendar-main').addClass("arrive_active"); $('.search-guests-wrap-js').css("display", "none"); focusedInput=$(this).attr('name'); $('.search-calendar-main').removeClass('arrive_active depart_active').addClass(focusedInput+'_active'); $('.search-hourly-calendar-main').css("display", "block"); }); var countTo=0; var clearToVar; $("div").on('click', function(){ countTo++; if(countTo==1){ var classNames=$(this).parent().attr('class'); if(!$("input[name='guest']").is(':focus') && !$("input[name='guests']").is(':focus') && classNames.indexOf('map-search')==-1 && classNames.indexOf('search-guests')==-1 && classNames.indexOf('pets-calculator')==-1 ){ $('.search-guests-wrap-js').css("display", "none"); $('.single-form-guests-js').css("display", "none"); }} clearToVar=setInterval(function(){ countToReset(); }, 1000); }); function countToReset(){ countTo=0; clearInterval(clearToVar); } $(".search-guests-js input").on('focus', function(){ $(this).prev("label").css("display", "block"); $(this).addClass("on-focus"); $('.search-guests-wrap-js').css("display", "block"); }); $(".halfmap-search-date-range-js input").on('focus', function(){ $('.search-calendar-main').css("display", "block"); $('.search-calendar-main').addClass("arrive_active"); $('.search-guests-wrap-js').css("display", "none"); focusedInput=$(this).attr('name'); $('.search-calendar-main').removeClass('arrive_active depart_active').addClass(focusedInput+'_active'); $('.search-hourly-calendar-main').css("display", "block"); }); if(!homey_is_android){ var box=document.querySelector('.search-date-range input') document.addEventListener('click', function (e){ if(!e.target.closest('.search-date-range input')&&!e.target.closest('.search-calendar')){ $('.search-calendar-main').css("display", "none"); $('.single-listing-booking-calendar-js').css("display", "none"); }}); }}); function setCalendarCellHeight(){ var calendarCellWidth=$('.availability-section .search-calendar li').innerWidth(); $('.availability-section .search-calendar li').css('height', calendarCellWidth); $('.availability-section .search-calendar li').css('line-height', calendarCellWidth + 'px'); } setCalendarCellHeight(); $win.on('resize', function(){ setCalendarCellHeight(); }); /*function homey_timeStamp(str){ return new Date(str.replace(/^(\d{2}\-)(\d{2}\-)(\d{4})$/, '$2$1$3')).getTime(); };*/ function homey_timeStamp(str){ var myDate=str.split("-"); var newDate=myDate[1]+"/"+myDate[0]+"/"+myDate[2]; return new Date(newDate).getTime(); }; $('.main-search-calendar-wrap ul li').on('click', function (){ var $this=$(this); if($this.hasClass('day-disabled')){ return false; } searchCalClick +=1; var vl=$this.data('formatted-date'); timestamp=$this.data('timestamp'); if(focusedInput=='depart'&×tamp > fromTimestamp){ $('.main-search-calendar-wrap ul').find('li.to-day').removeClass('selected') .siblings().removeClass('to-day in-between'); searchCalClick=2; } if(searchCalClick==1){ fromTimestamp=timestamp; $('.main-search-calendar-wrap ul li').removeClass('to-day from-day selected in-between'); $this.addClass('from-day selected'); $('.search-calendar').removeClass('arrive_active').addClass('depart_active'); $('input[name="arrive"]').val(vl).triggerHandler('focus'); $('input[name="depart"]').val('').triggerHandler('focus'); }else if(searchCalClick==2){ toTimestamp=timestamp; $this.addClass('to-day selected'); $('.search-calendar').removeClass('depart_active').addClass('arrive_active'); var arrive_val=$('input[name="arrive"]').val(); arrive_val=homey_timeStamp(arrive_val); var depart_val=homey_timeStamp(vl); if(arrive_val >=depart_val){ fromTimestamp=timestamp; toTimestamp=0; $('.main-search-calendar-wrap ul li').removeClass('to-day from-day selected in-between'); $this.addClass('from-day selected'); $('.search-calendar').removeClass('arrive_active').addClass('depart_active'); $('input[name="arrive"]').val(vl); searchCalClick=1; }else{ setInBetween(fromTimestamp, toTimestamp); $('input[name="depart"]').val(vl); $('.search-calendar').hide(); $('.search-guests-wrap-js').css("display", "block"); $('input[name="guest"]').triggerHandler('focus'); }} if(searchCalClick==2){ searchCalClick=0; }}); $('.main-search-calendar-wrap ul li').on('hover', function (){ var ts=$(this).data('timestamp'); if(searchCalClick==1){ setInBetween(fromTimestamp, ts); }}); function setInBetween(fromTime, toTime){ $('.main-search-calendar-wrap ul li').removeClass('in-between') .filter(function (){ var currentTs=$(this).data('timestamp'); return currentTs > fromTime&¤tTs < toTime; }).addClass('in-between'); } $('.main-search-hourly-calendar-wrap ul li').on('click', function (){ var $this=$(this); if($this.hasClass('day-disabled')){ return false; } var vl=$this.data('formatted-date'); $('input[name="arrive"]').val(vl); $('.search-calendar').hide(); }); var search_guests_and_pets=function(){ $('.search_adult_plus').on('click', function(e){ e.preventDefault(); var guests=parseInt($('#guests').val())||0; var adult_guest=parseInt($('.search_adult_guest').val()); var child_guest=parseInt($('.search_child_guest').val()); adult_guest++; $('.search_homey_adult').text(adult_guest); $('.search_adult_guest').val(adult_guest); var total_guests=adult_guest + child_guest; $('input[name="guest"]').val(total_guests); }); $('.search_adult_minus').on('click', function(e){ e.preventDefault(); var guests=parseInt($('#guests').val())||0; var adult_guest=parseInt($('.search_adult_guest').val()); var child_guest=parseInt($('.search_child_guest').val()); if(adult_guest==0) return; adult_guest--; $('.search_homey_adult').text(adult_guest); $('.search_adult_guest').val(adult_guest); var total_guests=adult_guest + child_guest; $('input[name="guest"]').val(total_guests); $('.search_adult_plus').removeAttr("disabled"); $('.search_child_plus').removeAttr("disabled"); }); $('.search_child_plus').on('click', function(e){ e.preventDefault(); var guests=parseInt($('#guests').val()); var child_guest=parseInt($('.search_child_guest').val()); var adult_guest=parseInt($('.search_adult_guest').val()); child_guest++; $('.search_homey_child').text(child_guest); $('.search_child_guest').val(child_guest); var total_guests=child_guest + adult_guest; $('input[name="guest"]').val(total_guests); }); $('.search_child_minus').on('click', function(e){ e.preventDefault(); var guests=parseInt($('#guests').val()); var child_guest=parseInt($('.search_child_guest').val()); var adult_guest=parseInt($('.search_adult_guest').val()); if(child_guest==0) return; child_guest--; $('.search_homey_child').text(child_guest); $('.search_child_guest').val(child_guest); var total_guests=child_guest + adult_guest; $('input[name="guest"]').val(total_guests); $('.search_adult_plus').removeAttr("disabled"); $('.search_child_plus').removeAttr("disabled"); }); } search_guests_and_pets(); function insertParam(key, value){ key=encodeURI(key); value=encodeURI(value); var qrp=document.location.search.substr(1).split('&'); var i=qrp.length; var j; while (i--){ j=qrp[i].split('='); if(j[0]==key){ j[1]=value; qrp[i]=j.join('='); break; }} if(i < 0){ qrp[qrp.length]=[key, value].join('='); } document.location.search=qrp.join('&'); } $('#sort_listings').on('change', function(){ var key='sortby'; var value=$(this).val(); insertParam(key, value); }); function homey_UTC_addDays(date, days){ var result=new Date(date); var now_utc=new Date(result.getUTCFullYear(), result.getUTCMonth(), result.getUTCDate(), result.getUTCHours(), result.getUTCMinutes(), result.getUTCSeconds()); var new_day=parseFloat(result.getUTCDate())+1 + parseFloat(days); now_utc.setDate(new_day); return now_utc; } function homey_period_checkin_checkout(start_date, end_date){ var today, prev_date,selected_date,selected_min_days,who_is; today=new Date(); var check_in_date=$('#'+start_date); check_in_date.datepicker({ dateFormat:"mm/dd/yy", minDate: today, }); check_in_date.change(function (){ prev_date=new Date(jQuery('#'+start_date).val()); selected_min_days=1; if(selected_min_days>0){ prev_date=homey_UTC_addDays(jQuery('#'+start_date).val(),selected_min_days-1); }else{ prev_date=homey_UTC_addDays(jQuery('#'+start_date).val(),0); } jQuery("#"+end_date).val(''); jQuery("#"+end_date).removeAttr('disabled'); jQuery("#"+end_date).datepicker("destroy"); jQuery("#"+end_date).datepicker({ dateFormat:"mm/dd/yy", minDate: prev_date, }); }); } homey_period_checkin_checkout('period_start_date', 'period_end_date'); homey_period_checkin_checkout('cus_start_date', 'cus_end_date'); })(jQuery); function homeySetCookie(cname, cvalue, exdays){ var d=new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires="expires="+ d.toUTCString(); document.cookie=cname + "=" + cvalue + ";" + expires + ";path=/"; }; function homeyGetCookie(cname){ var name=cname + "="; var decodedCookie=decodeURIComponent(document.cookie); var ca=decodedCookie.split(';'); for(var i=0; i '); }, success: function(data){ if(data.added){ curnt.children('i').remove(); curnt.text(data.response); var fav_count=parseInt(jQuery('header .favorite a span').text()); jQuery('header .favorite a span').html(fav_count + 1); if(is_singular_listing=='yes'){ curnt.prepend(' '); }}else{ curnt.children('i').remove(); curnt.text(data.response); var fav_count=parseInt(jQuery('header .favorite a span').text()); jQuery('header .favorite a span').html(fav_count - 1); if(is_singular_listing=='yes'){ curnt.prepend(' '); }} }, complete: function(){ }, error: function(xhr, status, error){ var err=eval("(" + xhr.responseText + ")"); console.log(err.Message); }}); }} function add_to_compare(compare_url, add_compare, remove_compare, compare_limit, listings_compare, limit_item_compare){ jQuery('a.compare-btn').attr('href', compare_url + '?ids=' + homeyGetCookie('homey_compare_listings')); var listings_compare=homeyGetCookie('homey_compare_listings'); if(listings_compare.length > 0){ jQuery('.compare-property-label').fadeIn(1000); } if(listings_compare&&listings_compare.length){ listings_compare=listings_compare.split(','); if(listings_compare.length){ for(var i=0 ; i < listings_compare.length; i++){ jQuery('.homey_compare[data-listing_id="'+listings_compare[i]+'"]').text(remove_compare); } jQuery('.compare-property-label').find('.compare-count').html(listings_compare.length); }}else{ listings_compare=[]; } jQuery('.homey_compare').on('click', function(e){ e.preventDefault(); var listings_compare=homeyGetCookie('homey_compare_listings'); if(listings_compare&&listings_compare.length){ listings_compare=listings_compare.split(','); }else{ listings_compare=[]; } var listing_id=jQuery(this).data('listing_id'); var index=listings_compare.indexOf(listing_id.toString()); var image_div=jQuery(this).parents('.item-wrap'); var thumb_url=image_div.find('.item-media-thumb img').attr('src'); if(index==-1){ if(listings_compare.length >=limit_item_compare){ alert(compare_limit); }else{ jQuery('.compare-wrap').append('
Thumb
'); jQuery(this).text(remove_compare); listings_compare.push(listing_id.toString()); homeySetCookie('homey_compare_listings', listings_compare.join(','), 30); jQuery('.compare-property-label').find('.compare-count').html(listings_compare.length); jQuery('a.compare-btn').attr('href', compare_url + '?ids=' + homeyGetCookie('homey_compare_listings')); jQuery('.compare-property-label').fadeIn(1000); jQuery(this).toggleClass('active'); jQuery('.compare-property-active').addClass('compare-property-active-push-toleft'); jQuery('#compare-property-panel').addClass('compare-property-panel-open'); remove_from_compare(listings_compare, add_compare, remove_compare); }}else{ jQuery('div.remove-'+listing_id).remove(); jQuery(this).text(add_compare); listings_compare.splice(index, 1); homeySetCookie('homey_compare_listings', listings_compare.join(','), 30); jQuery('.compare-property-label').find('.compare-count').html(listings_compare.length); jQuery('a.compare-btn').attr('href', compare_url + '?ids=' + homeyGetCookie('homey_compare_listings')); if(listings_compare.length > 0){ jQuery('.compare-property-label').fadeIn(1000); jQuery(this).toggleClass('active'); jQuery('.compare-property-active').addClass('compare-property-active-push-toleft'); jQuery('#compare-property-panel').addClass('compare-property-panel-open'); }else{ jQuery('.compare-property-label').fadeOut(1000); }} return false; }); } function remove_from_compare(listings_compare, add_compare, remove_compare){ jQuery('.remove-compare').on('click', function(e){ e.preventDefault(); if(typeof listings_compare=='object'){ listings_compare=listings_compare.toString(); } if(listings_compare&&listings_compare.length){ listings_compare=listings_compare.split(','); if(listings_compare.length){ for(var i=0 ; i < listings_compare.length; i++){ jQuery('.homey_compare[data-listing_id="'+listings_compare[i]+'"]').text(remove_compare); } jQuery('.compare-property-label').find('.compare-count').html(listings_compare.length); }}else{ listings_compare=[]; } var listing_id=jQuery(this).data('listing_id'); var index=listings_compare.indexOf(listing_id.toString()); listings_compare.splice(index, 1); homeySetCookie('homey_compare_listings', listings_compare.join(','), 30); jQuery('.compare-property-label').find('.compare-count').html(listings_compare.length); jQuery('.compare-'+listing_id).text(add_compare); jQuery(this).parents('.compare-item').remove(); }); }; !function(d,l){"use strict";var e=!1,o=!1;if(l.querySelector)if(d.addEventListener)e=!0;if(d.wp=d.wp||{},!d.wp.receiveEmbedMessage)if(d.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){var r,a,i,s,n,o=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),c=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]');for(r=0;r=$tabs.tabs("length")&&(index=0),$tabs.tabs("select",index)):(index=$tabs.tabs("option","active"),length=$tabs.find(".wpb_tab").length,index=jQuery(this).parent().hasClass("wpb_next_slide")?length<=index+1?0:index+1:index-1<0?length-1:index-1,$tabs.tabs("option","active",index))})}))}),"function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){jQuery(".wpb_accordion").each(function(index){var $this=jQuery(this),active_tab=($this.attr("data-interval"),!isNaN(jQuery(this).data("active-tab"))&&0 div > h3",autoHeight:!1,heightStyle:"content",active:active_tab,collapsible:collapsible,navigation:!0,activate:vc_accordionActivate,change:function(event,ui){void 0!==jQuery.fn.isotope&&ui.newContent.find(".isotope").isotope("layout"),vc_carouselBehaviour(ui.newPanel)}});!0===$this.data("vcDisableKeydown")&&($tabs.data("uiAccordion")._keydown=function(){})})}),"function"!=typeof window.vc_teaserGrid&&(window.vc_teaserGrid=function(){var layout_modes={fitrows:"fitRows",masonry:"masonry"};jQuery(".wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)").each(function(){var $container=jQuery(this),$thumbs=$container.find(".wpb_thumbnails"),layout_mode=$thumbs.attr("data-layout-mode");$thumbs.isotope({itemSelector:".isotope-item",layoutMode:void 0===layout_modes[layout_mode]?"fitRows":layout_modes[layout_mode]}),$container.find(".categories_filter a").data("isotope",$thumbs).on("click",function(e){e&&e.preventDefault&&e.preventDefault();var $thumbs=jQuery(this).data("isotope");jQuery(this).parent().parent().find(".active").removeClass("active"),jQuery(this).parent().addClass("active"),$thumbs.isotope({filter:jQuery(this).attr("data-filter")})}),jQuery(window).bind("load resize",function(){$thumbs.isotope("layout")})})}),"function"!=typeof window.vc_carouselBehaviour&&(window.vc_carouselBehaviour=function($parent){($parent?$parent.find(".wpb_carousel"):jQuery(".wpb_carousel")).each(function(){var carousel_li,fluid_ul,$this=jQuery(this);!0!==$this.data("carousel_enabled")&&$this.is(":visible")&&($this.data("carousel_enabled",!0),getColumnsCount(jQuery(this)),jQuery(this).hasClass("columns_count_1"),(carousel_li=jQuery(this).find(".wpb_thumbnails-fluid li")).css({"margin-right":carousel_li.css("margin-left"),"margin-left":0}),(fluid_ul=jQuery(this).find("ul.wpb_thumbnails-fluid")).width(fluid_ul.width()+300),jQuery(window).on("resize",function(){screen_size!=(screen_size=getSizeName())&&window.setTimeout(function(){location.reload()},20)}))})}),"function"!=typeof window.vc_slidersBehaviour&&(window.vc_slidersBehaviour=function(){jQuery(".wpb_gallery_slides").each(function(index){var $imagesGrid,sliderTimeout,this_element=jQuery(this);this_element.hasClass("wpb_slider_nivo")?(0===(sliderTimeout=1e3*this_element.attr("data-interval"))&&(sliderTimeout=9999999999),this_element.find(".nivoSlider").nivoSlider({effect:"boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse",slices:15,boxCols:8,boxRows:4,animSpeed:800,pauseTime:sliderTimeout,startSlide:0,directionNav:!0,directionNavHide:!0,controlNav:!0,keyboardNav:!1,pauseOnHover:!0,manualAdvance:!1,prevText:"Prev",nextText:"Next"})):this_element.hasClass("wpb_image_grid")&&(jQuery.fn.imagesLoaded?$imagesGrid=this_element.find(".wpb_image_grid_ul").imagesLoaded(function(){$imagesGrid.isotope({itemSelector:".isotope-item",layoutMode:"fitRows"})}):this_element.find(".wpb_image_grid_ul").isotope({itemSelector:".isotope-item",layoutMode:"fitRows"}))})}),"function"!=typeof window.vc_prettyPhoto&&(window.vc_prettyPhoto=function(){try{jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto&&jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({animationSpeed:"normal",hook:"data-rel",padding:15,opacity:.7,showTitle:!0,allowresize:!0,counter_separator_label:"/",hideflash:!1,deeplinking:!1,modal:!1,callback:function(){-1')}),vc_initVideoBackgrounds(),callSkrollInit=!1,window.vcParallaxSkroll&&window.vcParallaxSkroll.destroy(),$(".vc_parallax-inner").remove(),$("[data-5p-top-bottom]").removeAttr("data-5p-top-bottom data-30p-top-bottom"),$("[data-vc-parallax]").each(function(){var skrollrSize,skrollrStart,$parallaxElement,parallaxImage,youtubeId;callSkrollInit=!0,"on"===$(this).data("vcParallaxOFade")&&$(this).children().attr("data-5p-top-bottom","opacity:0;").attr("data-30p-top-bottom","opacity:1;"),skrollrSize=100*$(this).data("vcParallax"),($parallaxElement=$("
").addClass("vc_parallax-inner").appendTo($(this))).height(skrollrSize+"%"),parallaxImage=$(this).data("vcParallaxImage"),(youtubeId=vcExtractYoutubeId(parallaxImage))?insertYoutubeVideoAsBackground($parallaxElement,youtubeId):void 0!==parallaxImage&&$parallaxElement.css("background-image","url("+parallaxImage+")"),skrollrStart=-(skrollrSize-100),$parallaxElement.attr("data-bottom-top","top: "+skrollrStart+"%;").attr("data-top-bottom","top: 0%;")}),callSkrollInit&&window.skrollr&&(vcSkrollrOptions={forceHeight:!1,smoothScrolling:!1,mobileCheck:function(){return!1}},window.vcParallaxSkroll=skrollr.init(vcSkrollrOptions),window.vcParallaxSkroll)}),"function"!=typeof window.vc_gridBehaviour&&(window.vc_gridBehaviour=function(){jQuery.fn.vcGrid&&jQuery("[data-vc-grid]").vcGrid()}),"function"!=typeof window.getColumnsCount&&(window.getColumnsCount=function(el){for(var find=!1,i=1;!1===find;){if(el.hasClass("columns_count_"+i))return find=!0,i;i++}});var screen_size=getSizeName();function getSizeName(){var screen_w=jQuery(window).width();return 1170
').find(".inner");new YT.Player($container[0],{width:"100%",height:"100%",videoId:youtubeId,playerVars:{playlist:youtubeId,iv_load_policy:3,enablejsapi:1,disablekb:1,autoplay:1,controls:0,showinfo:0,rel:0,loop:1,wmode:"transparent"},events:{onReady:function(event){event.target.mute().setLoop(!0)}}}),vcResizeVideoBackground($element),jQuery(window).bind("resize",function(){vcResizeVideoBackground($element)})}),"function"!=typeof window.vcResizeVideoBackground&&(window.vcResizeVideoBackground=function($element){var iframeW,iframeH,marginLeft,marginTop,containerW=$element.innerWidth(),containerH=$element.innerHeight();containerW/containerH<16/9?(iframeW=containerH*(16/9),iframeH=containerH,marginLeft=-Math.round((iframeW-containerW)/2)+"px",marginTop=-Math.round((iframeH-containerH)/2)+"px"):(iframeH=(iframeW=containerW)*(9/16),marginTop=-Math.round((iframeH-containerH)/2)+"px",marginLeft=-Math.round((iframeW-containerW)/2)+"px"),iframeW+="px",iframeH+="px",$element.find(".vc_video-bg iframe").css({maxWidth:"1000%",marginLeft:marginLeft,marginTop:marginTop,width:iframeW,height:iframeH})}),"function"!=typeof window.vcExtractYoutubeId&&(window.vcExtractYoutubeId=function(url){if(void 0===url)return!1;var id=url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);return null!==id&&id[1]}),"function"!=typeof window.vc_googleMapsPointer&&(window.vc_googleMapsPointer=function(){var $=window.jQuery,$wpbGmapsWidget=$(".wpb_gmaps_widget");$wpbGmapsWidget.on("click",function(){$("iframe",this).css("pointer-events","auto")}),$wpbGmapsWidget.on("mouseleave",function(){$("iframe",this).css("pointer-events","none")}),$(".wpb_gmaps_widget iframe").css("pointer-events","none")}),"function"!=typeof window.vc_setHoverBoxPerspective&&(window.vc_setHoverBoxPerspective=function(hoverBox){hoverBox.each(function(){var $this=jQuery(this),perspective=4*$this.width()+"px";$this.css("perspective",perspective)})}),"function"!=typeof window.vc_setHoverBoxHeight&&(window.vc_setHoverBoxHeight=function(hoverBox){hoverBox.each(function(){var $this=jQuery(this),hoverBoxInner=$this.find(".vc-hoverbox-inner");hoverBoxInner.css("min-height",0);var frontHeight=$this.find(".vc-hoverbox-front-inner").outerHeight(),backHeight=$this.find(".vc-hoverbox-back-inner").outerHeight(),hoverBoxHeight=backHeight'+prev_text+'', nextArrow: '', responsive: [ { breakpoint: 992, settings: { slidesToShow: 2, slidesToScroll: 2 }}, { breakpoint: 769, settings: { slidesToShow: 1, slidesToScroll: 1 }}] }); }); }); !function(a,b,c){"use strict";function d(c){if(e=b.documentElement,f=b.body,T(),ha=this,c=c||{},ma=c.constants||{},c.easing)for(var d in c.easing)W[d]=c.easing[d];ta=c.edgeStrategy||"set",ka={beforerender:c.beforerender,render:c.render,keyframe:c.keyframe},la=c.forceHeight!==!1,la&&(Ka=c.scale||1),na=c.mobileDeceleration||y,pa=c.smoothScrolling!==!1,qa=c.smoothScrollingDuration||A,ra={targetTop:ha.getScrollTop()},Sa=(c.mobileCheck||function(){return/Android|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent||navigator.vendor||a.opera)})(),Sa?(ja=b.getElementById(c.skrollrBody||z),ja&&ga(),X(),Ea(e,[s,v],[t])):Ea(e,[s,u],[t]),ha.refresh(),wa(a,"resize orientationchange",function(){var a=e.clientWidth,b=e.clientHeight;(b!==Pa||a!==Oa)&&(Pa=b,Oa=a,Qa=!0)});var g=U();return function h(){$(),va=g(h)}(),ha}var e,f,g={get:function(){return ha},init:function(a){return ha||new d(a)},VERSION:"0.6.29"},h=Object.prototype.hasOwnProperty,i=a.Math,j=a.getComputedStyle,k="touchstart",l="touchmove",m="touchcancel",n="touchend",o="skrollable",p=o+"-before",q=o+"-between",r=o+"-after",s="skrollr",t="no-"+s,u=s+"-desktop",v=s+"-mobile",w="linear",x=1e3,y=.004,z="skrollr-body",A=200,B="start",C="end",D="center",E="bottom",F="___skrollable_id",G=/^(?:input|textarea|button|select)$/i,H=/^\s+|\s+$/g,I=/^data(?:-(_\w+))?(?:-?(-?\d*\.?\d+p?))?(?:-?(start|end|top|center|bottom))?(?:-?(top|center|bottom))?$/,J=/\s*(@?[\w\-\[\]]+)\s*:\s*(.+?)\s*(?:;|$)/gi,K=/^(@?[a-z\-]+)\[(\w+)\]$/,L=/-([a-z0-9_])/g,M=function(a,b){return b.toUpperCase()},N=/[\-+]?[\d]*\.?[\d]+/g,O=/\{\?\}/g,P=/rgba?\(\s*-?\d+\s*,\s*-?\d+\s*,\s*-?\d+/g,Q=/[a-z\-]+-gradient/g,R="",S="",T=function(){var a=/^(?:O|Moz|webkit|ms)|(?:-(?:o|moz|webkit|ms)-)/;if(j){var b=j(f,null);for(var c in b)if(R=c.match(a)||+c==c&&b[c].match(a))break;if(!R)return void(R=S="");R=R[0],"-"===R.slice(0,1)?(S=R,R={"-webkit-":"webkit","-moz-":"Moz","-ms-":"ms","-o-":"O"}[R]):S="-"+R.toLowerCase()+"-"}},U=function(){var b=a.requestAnimationFrame||a[R.toLowerCase()+"RequestAnimationFrame"],c=Ha();return(Sa||!b)&&(b=function(b){var d=Ha()-c,e=i.max(0,1e3/60-d);return a.setTimeout(function(){c=Ha(),b()},e)}),b},V=function(){var b=a.cancelAnimationFrame||a[R.toLowerCase()+"CancelAnimationFrame"];return(Sa||!b)&&(b=function(b){return a.clearTimeout(b)}),b},W={begin:function(){return 0},end:function(){return 1},linear:function(a){return a},quadratic:function(a){return a*a},cubic:function(a){return a*a*a},swing:function(a){return-i.cos(a*i.PI)/2+.5},sqrt:function(a){return i.sqrt(a)},outCubic:function(a){return i.pow(a-1,3)+1},bounce:function(a){var b;if(.5083>=a)b=3;else if(.8489>=a)b=9;else if(.96208>=a)b=27;else{if(!(.99981>=a))return 1;b=91}return 1-i.abs(3*i.cos(a*b*1.028)/b)}};d.prototype.refresh=function(a){var d,e,f=!1;for(a===c?(f=!0,ia=[],Ra=0,a=b.getElementsByTagName("*")):a.length===c&&(a=[a]),d=0,e=a.length;e>d;d++){var g=a[d],h=g,i=[],j=pa,k=ta,l=!1;if(f&&F in g&&delete g[F],g.attributes){for(var m=0,n=g.attributes.length;n>m;m++){var p=g.attributes[m];if("data-anchor-target"!==p.name)if("data-smooth-scrolling"!==p.name)if("data-edge-strategy"!==p.name)if("data-emit-events"!==p.name){var q=p.name.match(I);if(null!==q){var r={props:p.value,element:g,eventType:p.name.replace(L,M)};i.push(r);var s=q[1];s&&(r.constant=s.substr(1));var t=q[2];/p$/.test(t)?(r.isPercentage=!0,r.offset=(0|t.slice(0,-1))/100):r.offset=0|t;var u=q[3],v=q[4]||u;u&&u!==B&&u!==C?(r.mode="relative",r.anchors=[u,v]):(r.mode="absolute",u===C?r.isEnd=!0:r.isPercentage||(r.offset=r.offset*Ka))}}else l=!0;else k=p.value;else j="off"!==p.value;else if(h=b.querySelector(p.value),null===h)throw'Unable to find anchor target "'+p.value+'"'}if(i.length){var w,x,y;!f&&F in g?(y=g[F],w=ia[y].styleAttr,x=ia[y].classAttr):(y=g[F]=Ra++,w=g.style.cssText,x=Da(g)),ia[y]={element:g,styleAttr:w,classAttr:x,anchorTarget:h,keyFrames:i,smoothScrolling:j,edgeStrategy:k,emitEvents:l,lastFrameIndex:-1},Ea(g,[o],[])}}}for(Aa(),d=0,e=a.length;e>d;d++){var z=ia[a[d][F]];z!==c&&(_(z),ba(z))}return ha},d.prototype.relativeToAbsolute=function(a,b,c){var d=e.clientHeight,f=a.getBoundingClientRect(),g=f.top,h=f.bottom-f.top;return b===E?g-=d:b===D&&(g-=d/2),c===E?g+=h:c===D&&(g+=h/2),g+=ha.getScrollTop(),g+.5|0},d.prototype.animateTo=function(a,b){b=b||{};var d=Ha(),e=ha.getScrollTop(),f=b.duration===c?x:b.duration;return oa={startTop:e,topDiff:a-e,targetTop:a,duration:f,startTime:d,endTime:d+f,easing:W[b.easing||w],done:b.done},oa.topDiff||(oa.done&&oa.done.call(ha,!1),oa=c),ha},d.prototype.stopAnimateTo=function(){oa&&oa.done&&oa.done.call(ha,!0),oa=c},d.prototype.isAnimatingTo=function(){return!!oa},d.prototype.isMobile=function(){return Sa},d.prototype.setScrollTop=function(b,c){return sa=c===!0,Sa?Ta=i.min(i.max(b,0),Ja):a.scrollTo(0,b),ha},d.prototype.getScrollTop=function(){return Sa?Ta:a.pageYOffset||e.scrollTop||f.scrollTop||0},d.prototype.getMaxScrollTop=function(){return Ja},d.prototype.on=function(a,b){return ka[a]=b,ha},d.prototype.off=function(a){return delete ka[a],ha},d.prototype.destroy=function(){var a=V();a(va),ya(),Ea(e,[t],[s,u,v]);for(var b=0,d=ia.length;d>b;b++)fa(ia[b].element);e.style.overflow=f.style.overflow="",e.style.height=f.style.height="",ja&&g.setStyle(ja,"transform","none"),ha=c,ja=c,ka=c,la=c,Ja=0,Ka=1,ma=c,na=c,La="down",Ma=-1,Oa=0,Pa=0,Qa=!1,oa=c,pa=c,qa=c,ra=c,sa=c,Ra=0,ta=c,Sa=!1,Ta=0,ua=c};var X=function(){var d,g,h,j,o,p,q,r,s,t,u,v;wa(e,[k,l,m,n].join(" "),function(a){var e=a.changedTouches[0];for(j=a.target;3===j.nodeType;)j=j.parentNode;switch(o=e.clientY,p=e.clientX,t=a.timeStamp,G.test(j.tagName)||a.preventDefault(),a.type){case k:d&&d.blur(),ha.stopAnimateTo(),d=j,g=q=o,h=p,s=t;break;case l:G.test(j.tagName)&&b.activeElement!==j&&a.preventDefault(),r=o-q,v=t-u,ha.setScrollTop(Ta-r,!0),q=o,u=t;break;default:case m:case n:var f=g-o,w=h-p,x=w*w+f*f;if(49>x){if(!G.test(d.tagName)){d.focus();var y=b.createEvent("MouseEvents");y.initMouseEvent("click",!0,!0,a.view,1,e.screenX,e.screenY,e.clientX,e.clientY,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,0,null),d.dispatchEvent(y)}return}d=c;var z=r/v;z=i.max(i.min(z,3),-3);var A=i.abs(z/na),B=z*A+.5*na*A*A,C=ha.getScrollTop()-B,D=0;C>Ja?(D=(Ja-C)/B,C=Ja):0>C&&(D=-C/B,C=0),A*=1-D,ha.animateTo(C+.5|0,{easing:"outCubic",duration:A})}}),a.scrollTo(0,0),e.style.overflow=f.style.overflow="hidden"},Y=function(){var a,b,c,d,f,g,h,j,k,l,m,n=e.clientHeight,o=Ba();for(j=0,k=ia.length;k>j;j++)for(a=ia[j],b=a.element,c=a.anchorTarget,d=a.keyFrames,f=0,g=d.length;g>f;f++)h=d[f],l=h.offset,m=o[h.constant]||0,h.frame=l,h.isPercentage&&(l*=n,h.frame=l),"relative"===h.mode&&(fa(b),h.frame=ha.relativeToAbsolute(c,h.anchors[0],h.anchors[1])-l,fa(b,!0)),h.frame+=m,la&&!h.isEnd&&h.frame>Ja&&(Ja=h.frame);for(Ja=i.max(Ja,Ca()),j=0,k=ia.length;k>j;j++){for(a=ia[j],d=a.keyFrames,f=0,g=d.length;g>f;f++)h=d[f],m=o[h.constant]||0,h.isEnd&&(h.frame=Ja-h.offset+m);a.keyFrames.sort(Ia)}},Z=function(a,b){for(var c=0,d=ia.length;d>c;c++){var e,f,i=ia[c],j=i.element,k=i.smoothScrolling?a:b,l=i.keyFrames,m=l.length,n=l[0],s=l[l.length-1],t=ks.frame,v=t?n:s,w=i.emitEvents,x=i.lastFrameIndex;if(t||u){if(t&&-1===i.edge||u&&1===i.edge)continue;switch(t?(Ea(j,[p],[r,q]),w&&x>-1&&(za(j,n.eventType,La),i.lastFrameIndex=-1)):(Ea(j,[r],[p,q]),w&&m>x&&(za(j,s.eventType,La),i.lastFrameIndex=m)),i.edge=t?-1:1,i.edgeStrategy){case"reset":fa(j);continue;case"ease":k=v.frame;break;default:case"set":var y=v.props;for(e in y)h.call(y,e)&&(f=ea(y[e].value),0===e.indexOf("@")?j.setAttribute(e.substr(1),f):g.setStyle(j,e,f));continue}}else 0!==i.edge&&(Ea(j,[o,q],[p,r]),i.edge=0);for(var z=0;m-1>z;z++)if(k>=l[z].frame&&k<=l[z+1].frame){var A=l[z],B=l[z+1];for(e in A.props)if(h.call(A.props,e)){var C=(k-A.frame)/(B.frame-A.frame);C=A.props[e].easing(C),f=da(A.props[e].value,B.props[e].value,C),f=ea(f),0===e.indexOf("@")?j.setAttribute(e.substr(1),f):g.setStyle(j,e,f)}w&&x!==z&&("down"===La?za(j,A.eventType,La):za(j,B.eventType,La),i.lastFrameIndex=z);break}}},$=function(){Qa&&(Qa=!1,Aa());var a,b,d=ha.getScrollTop(),e=Ha();if(oa)e>=oa.endTime?(d=oa.targetTop,a=oa.done,oa=c):(b=oa.easing((e-oa.startTime)/oa.duration),d=oa.startTop+b*oa.topDiff|0),ha.setScrollTop(d,!0);else if(!sa){var f=ra.targetTop-d;f&&(ra={startTop:Ma,topDiff:d-Ma,targetTop:d,startTime:Na,endTime:Na+qa}),e<=ra.endTime&&(b=W.sqrt((e-ra.startTime)/qa),d=ra.startTop+b*ra.topDiff|0)}if(sa||Ma!==d){La=d>Ma?"down":Ma>d?"up":La,sa=!1;var h={curTop:d,lastTop:Ma,maxTop:Ja,direction:La},i=ka.beforerender&&ka.beforerender.call(ha,h);i!==!1&&(Z(d,ha.getScrollTop()),Sa&&ja&&g.setStyle(ja,"transform","translate(0, "+-Ta+"px) "+ua),Ma=d,ka.render&&ka.render.call(ha,h)),a&&a.call(ha,!1)}Na=e},_=function(a){for(var b=0,c=a.keyFrames.length;c>b;b++){for(var d,e,f,g,h=a.keyFrames[b],i={};null!==(g=J.exec(h.props));)f=g[1],e=g[2],d=f.match(K),null!==d?(f=d[1],d=d[2]):d=w,e=e.indexOf("!")?aa(e):[e.slice(1)],i[f]={value:e,easing:W[d]};h.props=i}},aa=function(a){var b=[];return P.lastIndex=0,a=a.replace(P,function(a){return a.replace(N,function(a){return a/255*100+"%"})}),S&&(Q.lastIndex=0,a=a.replace(Q,function(a){return S+a})),a=a.replace(N,function(a){return b.push(+a),"{?}"}),b.unshift(a),b},ba=function(a){var b,c,d={};for(b=0,c=a.keyFrames.length;c>b;b++)ca(a.keyFrames[b],d);for(d={},b=a.keyFrames.length-1;b>=0;b--)ca(a.keyFrames[b],d)},ca=function(a,b){var c;for(c in b)h.call(a.props,c)||(a.props[c]=b[c]);for(c in a.props)b[c]=a.props[c]},da=function(a,b,c){var d,e=a.length;if(e!==b.length)throw"Can't interpolate between \""+a[0]+'" and "'+b[0]+'"';var f=[a[0]];for(d=1;e>d;d++)f[d]=a[d]+(b[d]-a[d])*c;return f},ea=function(a){var b=1;return O.lastIndex=0,a[0].replace(O,function(){return a[b++]})},fa=function(a,b){a=[].concat(a);for(var c,d,e=0,f=a.length;f>e;e++)d=a[e],c=ia[d[F]],c&&(b?(d.style.cssText=c.dirtyStyleAttr,Ea(d,c.dirtyClassAttr)):(c.dirtyStyleAttr=d.style.cssText,c.dirtyClassAttr=Da(d),d.style.cssText=c.styleAttr,Ea(d,c.classAttr)))},ga=function(){ua="translateZ(0)",g.setStyle(ja,"transform",ua);var a=j(ja),b=a.getPropertyValue("transform"),c=a.getPropertyValue(S+"transform"),d=b&&"none"!==b||c&&"none"!==c;d||(ua="")};g.setStyle=function(a,b,c){var d=a.style;if(b=b.replace(L,M).replace("-",""),"zIndex"===b)isNaN(c)?d[b]=c:d[b]=""+(0|c);else if("float"===b)d.styleFloat=d.cssFloat=c;else try{R&&(d[R+b.slice(0,1).toUpperCase()+b.slice(1)]=c),d[b]=c}catch(e){}};var ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa=g.addEvent=function(b,c,d){var e=function(b){return b=b||a.event,b.target||(b.target=b.srcElement),b.preventDefault||(b.preventDefault=function(){b.returnValue=!1,b.defaultPrevented=!0}),d.call(this,b)};c=c.split(" ");for(var f,g=0,h=c.length;h>g;g++)f=c[g],b.addEventListener?b.addEventListener(f,d,!1):b.attachEvent("on"+f,e),Ua.push({element:b,name:f,listener:d})},xa=g.removeEvent=function(a,b,c){b=b.split(" ");for(var d=0,e=b.length;e>d;d++)a.removeEventListener?a.removeEventListener(b[d],c,!1):a.detachEvent("on"+b[d],c)},ya=function(){for(var a,b=0,c=Ua.length;c>b;b++)a=Ua[b],xa(a.element,a.name,a.listener);Ua=[]},za=function(a,b,c){ka.keyframe&&ka.keyframe.call(ha,a,b,c)},Aa=function(){var a=ha.getScrollTop();Ja=0,la&&!Sa&&(f.style.height=""),Y(),la&&!Sa&&(f.style.height=Ja+e.clientHeight+"px"),Sa?ha.setScrollTop(i.min(ha.getScrollTop(),Ja)):ha.setScrollTop(a,!0),sa=!0},Ba=function(){var a,b,c=e.clientHeight,d={};for(a in ma)b=ma[a],"function"==typeof b?b=b.call(ha):/p$/.test(b)&&(b=b.slice(0,-1)/100*c),d[a]=b;return d},Ca=function(){var a,b=0;return ja&&(b=i.max(ja.offsetHeight,ja.scrollHeight)),a=i.max(b,f.scrollHeight,f.offsetHeight,e.scrollHeight,e.offsetHeight,e.clientHeight),a-e.clientHeight},Da=function(b){var c="className";return a.SVGElement&&b instanceof a.SVGElement&&(b=b[c],c="baseVal"),b[c]},Ea=function(b,d,e){var f="className";if(a.SVGElement&&b instanceof a.SVGElement&&(b=b[f],f="baseVal"),e===c)return void(b[f]=d);for(var g=b[f],h=0,i=e.length;i>h;h++)g=Ga(g).replace(Ga(e[h])," ");g=Fa(g);for(var j=0,k=d.length;k>j;j++)-1===Ga(g).indexOf(Ga(d[j]))&&(g+=" "+d[j]);b[f]=Fa(g)},Fa=function(a){return a.replace(H,"")},Ga=function(a){return" "+a+" "},Ha=Date.now||function(){return+new Date},Ia=function(a,b){return a.frame-b.frame},Ja=0,Ka=1,La="down",Ma=-1,Na=Ha(),Oa=0,Pa=0,Qa=!1,Ra=0,Sa=!1,Ta=0,Ua=[];"function"==typeof define&&define.amd?define([],function(){return g}):"undefined"!=typeof module&&module.exports?module.exports=g:a.skrollr=g}(window,document);