var commonComment,isLoggedIn,socialmedia;$().ready(function(){$(document).on("keyup","#comment",function(){var n=$(this).data("entity-id");$(this).val().length===0?$(".btn-post-comment-"+n).addClass("disabled"):$(".btn-post-comment-"+n).removeClass("disabled")});$(document).on("keyup","#answer",function(){var n=$(this).data("entity-id");$(this).val().length===0?$(".btn-post-answer-"+n).addClass("disabled"):$(".btn-post-answer-"+n).removeClass("disabled")});$(document).on("keyup","#reply",function(){var n=$(this).data("entity-id");$(this).val().length===0?$(".btn-post-reply-"+n).addClass("disabled"):$(".btn-post-reply-"+n).removeClass("disabled")});$(document).on("click",".btn-add-comment",function(n){n.preventDefault();var i=$(this).data("entity-id"),t=".comment-thread-"+i;$(t).find(".rl-cmnt-textarea").first().css("display","block");$(t).find("#comment").focus()});$(document).on("click",".btn-post-comment",function(n){n.preventDefault();var i=this,t=$(this).data("entity-id"),r=$(this).data("comment-type"),u=$(this).data("auto-dismiss"),e=$(".comment-thread-"+t).find("#comment").val();let f={id:t,commentType:r,comment:e};if(!isAuthenticated){let n={Comment:f,SessionId:"Comment"};showNotLoggedInModal(n);return}$.ajax({url:"/Common/SaveComment",data:f,type:"POST",beforeSend:function(){$(i).addClass("disabled");$(i).text("Submitting...")},success:function(){$.ajax({url:"/Common/GetComments",data:{id:t,commentType:r,autoDismiss:u},type:"GET",success:function(n){toastr.success("Your comment has been posted.","Success!",{timeOut:5e3});$(".comment-thread-"+t).empty();$(".comment-thread-"+t).html(n.html);$(".comment-thread-"+t).find("#comment").focus();$(".badge-comment-"+t).text(n.TotalCommentCount);u==="True"&&$(".comment-thread-"+t).find(".rl-cmnt-textarea").first().css("display","none")}})}})});$(document).on("submit",".save-comment-homepage-form",function(n){n.preventDefault();$(this).find(".btn-post-comment-activity").trigger("click")});$(document).on("click",".btn-post-comment-activity",function(n){var u;n.preventDefault();var t=this,i=$(t).data("parent-id"),e=$(t).data("post-type"),f=$(t).closest("#save-comment-form-"+i),r=f.serialize();if(!isAuthenticated){u={};$(f.serializeArray()).each(function(n,t){u[t.name]=t.value});let n={Comment:u,SessionId:"Comment"};showNotLoggedInModal(n);return}$.ajax({type:"POST",url:"/Common/SaveComment",data:r,beforeSend:function(){$(t).addClass("disabled");$(t).text("Submitting...")},success:function(){$.ajax({type:"GET",url:"/Home/ReviewCommentFeeds",data:r,success:function(n){var t=".box-comment-container-"+e+"-"+i;$(t).html(n);$(t).find(".text-comment").focus()}});$.ajax({type:"GET",url:"/Common/CountComment",data:r,success:function(n){$(".comment-count-display-"+i).text(n.CommentCount+" comments")}})},error:function(){$(t).removeClass("disabled");$(t).text("Submit")}})});$(document).on("click",".btn-post-answer",function(n){n.preventDefault();var i=this,t=$(this).data("entity-id"),r=$(this).data("answer-type"),u=$(this).data("question-type"),e=$(this).data("is-load-comment"),o=$(".answer-thread-"+t).find("#answer").val();let f={id:t,answerType:r,answer:o};if(!isAuthenticated){let n={Answer:f,SessionId:"Answer"};showNotLoggedInModal(n);return}$.ajax({url:"/Common/SaveAnswer",data:f,type:"POST",beforeSend:function(){$(i).addClass("disabled");$(i).text("Submitting...")},success:function(){$.ajax({url:"/Common/GetAnswers",data:{id:t,answerType:r},type:"GET",success:function(n){if(toastr.success("Your answer has been posted!","Success!",{timeOut:5e3}),$(".answer-thread-"+t).empty(),$(".answer-thread-"+t).html(n.html),$(".answer-thread-"+t).find("#answer").focus(),$(".badge-answer-"+t).text(n.TotalAnswerCount),e&&$(".answer-thread-"+t).find(".answer-comment-container").each(function(){var t=this,n=$(t).data("entity-id");$.ajax({type:"GET",url:"/Common/CommentThread",data:{id:n,CommentType:"Answer",autoDismiss:!0},success:function(i){$(t).html(i);$(".comment-thread-"+n).find(".rl-cmnt-textarea").css("display","none")}});$.ajax({type:"GET",url:"/Common/CountComment",data:{id:n,CommentType:"Answer"},success:function(t){$(".badge-comment-"+n).text(t.CommentCount)}})}),u){const n="/questions/details/"+t+"?type="+u;socialmedia.fbShare(window.location.protocol+"//"+window.location.hostname+n)}}})}})});$(document).on("keyup",".text-answer",function(n){if(n.preventDefault(),n.keyCode==13){var t=$(this).closest(".btn-post-answer-activity");console.log("parent id "+$(t).data("parent-id"))}});$(document).on("submit",".save-answer-homepage-form",function(n){n.preventDefault();$(this).find(".btn-post-answer-activity").trigger("click")});$(document).on("click",".btn-post-answer-activity",function(n){var i;n.preventDefault();var t=this,r=$(t).data("parent-id"),e=$(t).data("post-type"),u=$(t).closest("#save-answer-form-"+r),f=u.serialize();if(!isAuthenticated){i={};$(u.serializeArray()).each(function(n,t){i[t.name]=t.value});let n={Answer:i,SessionId:"Answer"};showNotLoggedInModal(n);return}$.ajax({type:"POST",url:"/Common/SaveAnswer",data:f,beforeSend:function(){$(t).addClass("disabled");$(t).text("Submitting...")},success:function(){$.ajax({type:"GET",url:"/Home/QuestionAnswerFeeds",data:f,success:function(n){var i=".box-answer-container-"+r;$(t).closest(i).html(n);$(i).find(".text-answer").focus()}})},error:function(){$(t).removeClass("disabled");$(t).text("Submit")}})});$(document).on("click",".btn-post-reply",function(n){n.preventDefault();var r=this,t=$(this).data("entity-id"),i=$(this).data("reply-type"),u=$(this).data("for-agent"),f=$(this).data("for-manager"),e=$(".reply-thread-"+t).find("#reply").val();$.ajax({url:"/Common/SaveReply",data:{id:t,replyType:i,reply:e},type:"POST",beforeSend:function(){$(r).addClass("disabled");$(r).text("Submitting...")},success:function(){f?$.ajax({type:"GET",url:"/Managers/GetManagerReplies",data:{id:t,replyType:i},success:function(n){toastr.success("Your reply has beed posted!","Success!",{timeOut:3e3});var i=".reply-thread-"+t+"[name=manager-reply]";$(i).html(n.html);$(i).find("#reply").focus()},error:function(){toastr.error("Something went wrong!","Error",{timeOut:5e3})}}):u?$.ajax({type:"GET",url:"/Common/GetAgentReplies",data:{id:t,replyType:i},success:function(n){toastr.success("Your reply has beed posted!","Success!",{timeOut:3e3});var i=".reply-thread-"+t+"[name=agent-reply]";$(i).html(n.html);$(i).find("#reply").focus()},error:function(){toastr.error("Something went wrong!","Error",{timeOut:5e3})}}):$.ajax({type:"GET",url:"/Common/GetReplies",data:{id:t,replyType:i},success:function(n){toastr.success("Your reply has been posted!","Success!",{timeOut:3e3});$(".reply-thread-"+t).empty();$(".reply-thread-"+t).html(n.html);$(".reply-thread-"+t).find("#reply").focus();$(".badge-reply-"+t).text(n.TotalReplyCount)}})}})});$(document).on("click",".btn-show-reply",function(n){n.preventDefault();var t=".reply-area-"+$(this).data("entity-id");$(t).css("display",$(t).css("display")==="none"?"block":"none");$(t).find("#reply").focus()});$(document).on("click",".btn-show-report",function(n){n.preventDefault()});$(document).ajaxComplete(function(){$(".btn-show-report").popover({animation:!0,title:"Option",placement:"top",trigger:"clickover",html:!0,content:function(){var n=$(this).data("entity-id"),u=$(this).data("source-id"),f=$(this).data("is-currentuser"),t=$(this).data("edit-type"),e=$(this).data("can-edit"),o=$(this).data("can-delete"),i,r;return f==="True"?(i="",r="",e=="True"&&(i=' <a href="" class="btn btn-default btn-edit rlbtn-nobrdr popover-option"  style="font-size:12px;margin:0px"  data-source-id= '+u+" data-entity-id= "+n+" data-edit-type= "+t+' >  <i class="fa fa-pencil-square-o"> <\/i> Edit   <\/a> '),o=="True"&&(r=' <a href="" class="btn btn-default btn-delete-review rlbtn-nobrdr popover-option"  style="font-size:12px;margin:0px"  data-source-id= '+u+" data-entity-id= "+n+" data-edit-type= "+t+' >  <i class="fa fa-trash-o"> <\/i> Delete   <\/a> '),i+" "+r):' <a href="#" class="btn btn-default btn-issue rlbtn-nobrdr popover-option"  style="font-size:12px;margin:0px"  data-entity-id= '+n+" data-issuedreport-type= "+t+' > <i class="fa fa-external-link"> <\/i> Flag/Report <\/a>'}})});$(document).on("click",".btn-issue",function(n){var i,r,t;if(n.preventDefault(),!isAuthenticated){i={};showNotLoggedInModal(i);return}r=$(this).data("entity-id");t=$(this).data("issuedreport-type");BootstrapDialog.show({title:"Why is this "+t+" inappropriate?",message:$("<div><\/div>").load("/Common/GetIssueReport/"+r+"?issuedReportType="+t),onshown:function(){$("#Description").focus()},type:BootstrapDialog.TYPE_PRIMARY,buttons:[{label:"Send Report",cssClass:"btn btn-info",action:function(n){let i=$("#issue-report-form #Description").val(),t=$("#issue-report-form");(t.validate(),t.removeData("validator"),t.removeData("unobtrusiveValidation"),$.validator.unobtrusive.parse(t),t.valid())&&(this.disable(),this.spin(),$.ajax({url:"/Common/SaveIssueReport",data:t.serialize(),type:"POST",success:function(){toastr.success("Your report has been submitted.","Success!",{timeOut:1e4});n.close()}}))}}],complete:function(){$("#issue-report-form").find("#Description").focus()}})});$(document).on("click",".btn-delete-comment",function(n){n.preventDefault();var t=this,i=$(this).data("entity-id");BootstrapDialog.show({title:"Confirmation",message:"Do you want to delete comment?",type:BootstrapDialog.TYPE_PRIMARY,buttons:[{label:"Yes",cssClass:"btn btn-info",action:function(n){n.enableButtons(!1);n.setClosable(!1);$.ajax({url:"/Common/DeleteComment",data:{id:i},type:"POST",success:function(i){i.success?(toastr.success("Successfully Done!","",{timeOut:3e3}),$(t).closest(".rl-comment-item").remove(),$(t).prev(".rl-comment-item").remove()):toastr.warning(i.message,i.error,{timeOut:3e3});n.close()},error:function(){button.stopSpin();button.enable();n.enableButtons(!0);n.setClosable(!0)}})}},{label:"Cancel",cssClass:"btn btn-danger",action:function(n){button.stopSpin();button.enable();n.close()}}]})});$(document).on("click",".btn-delete-review",function(n){n.preventDefault();var r=this,i=$(this).data("edit-type"),t=$(this).data("entity-id");console.log("id "+t);BootstrapDialog.show({title:"Confirmation",message:"Are you sure do you want to delete this review?",type:BootstrapDialog.TYPE_PRIMARY,buttons:[{label:"Yes",cssClass:"btn btn-info",action:function(n){n.enableButtons(!1);n.setClosable(!1);$.ajax({url:"/Common/DeleteReview",data:{editType:i,id:t},type:"POST",success:function(i){i.success?(toastr.success("Successfully Done!","Success!",{timeOut:5e3}),$(".btn-show-report[data-entity-id="+t+"]").closest(".rl-message-item").remove()):toastr.warning(i.error,"Warning",{timeOut:5e3});n.close()},error:function(){button.stopSpin();button.enable();n.enableButtons(!0);n.setClosable(!0)}})}},{label:"Cancel",cssClass:"btn btn-danger",action:function(n){n.close()}}]})})});commonComment={};$().ready(function(){$(document).on("click",".btn-edit",function(n){n.preventDefault();var f=this,t=$(this).data("entity-id"),r=$(this).data("source-id"),i=$(this).data("edit-type"),u=$(this).data("for-admin");"GeneralQuestion"===i?window.location="/Questions/Post/"+t+"?type=general&questionId="+t:"UserQuestion"===i?window.location="/Questions/Post/"+t+"?type=user&questionId="+t:"StreetQuestion"===i?window.location="/Questions/Post/"+r+"?type=street&questionId="+t:"SuburbQuestion"===i?window.location="/Questions/Post/"+r+"?type=suburb&questionId="+t:"StreetReview"===i?window.location="/Street/AddReview/"+r+"?reviewId="+t:"SuburbReview"===i?window.location="/Suburb/AddReview/"+r+"?reviewId="+t:"PropertyReview"===i?window.location="/properties/newreview/"+r+"?reviewId="+t+(u==!0?"&FromAdmin=true":""):"AgentReview"===i?window.location="/Agents/AddReview/"+r+"?reviewId="+t:BootstrapDialog.show({title:"Edit "+i,message:$("<div><\/div>").load("/Common/GetEditDetails/"+t+"?editType="+i),onshown:function(){$("#Details").focus()},type:BootstrapDialog.TYPE_PRIMARY,cssClass:"",buttons:[{label:"Update",cssClass:"btn btn-info",action:function(n){var i=n,t=this,r=$("#edit-details-form").serialize();BootstrapDialog.show({title:"Confirmation",message:"Do you want to continue?",type:BootstrapDialog.TYPE_PRIMARY,buttons:[{label:"Yes",cssClass:"btn btn-info",action:function(n){n.enableButtons(!1);n.setClosable(!1);$.ajax({url:"/Common/EditDetails",data:r,autospin:!0,type:"POST",success:function(t){t.success?(toastr.success("Successfully edited!","Success",{timeOut:3e3}),n.close(),i.close(),$(t.container).text(t.edited)):(toastr.warning(t.error,"",{timeOut:3e3}),n.close(),i.close())},error:function(){t.stopSpin();t.enable();n.enableButtons(!0);n.setClosable(!0)}})}},{label:"Cancel",cssClass:"btn btn-danger",action:function(n){t.stopSpin();t.enable();n.close()}}]})}},{label:"Cancel",cssClass:"btn btn-danger",action:function(n){n.close()}}]})});$(document).on("click",".btn-edit-helpful-vote",function(n){n.preventDefault();var t=$(this).data("entity-id"),i=$(this).data("vote-type"),r=BootstrapDialog.show({title:"Helpful Votes",message:$("<div><\/div>").load("/Common/GetEditHelpfulDetails/"+t+"?voteType="+i),type:BootstrapDialog.TYPE_PRIMARY,cssClass:""})});$(document).on("click",".btn-remove-vote",function(){var n=this,t=$(n).data("entity-id");BootstrapDialog.show({title:"Remove Confirmation",message:"Are you sure you want to remove?",type:BootstrapDialog.TYPE_PRIMARY,buttons:[{label:"Yes",cssClass:"btn-primary btn-sm",action:function(i){$.ajax({url:"/Common/DeleteVotes",data:{id:t},type:"POST",success:function(t){t.success&&($(n).closest("tr").remove(),i.close())}})}},{label:"No",cssClass:"btn-danger btn-sm",action:function(n){n.close()}}]})})});$().ready(function(){socialmedia.initFB();socialmedia.initTwitter();$(document).on("click",".btn-share-fb",function(n){n.preventDefault();var t=$(this).data("url");socialmedia.fbShare(t);$("#social-media-share-modal").modal("hide")});$(document).on("click",".btn-share-twitter",function(n){n.preventDefault();var h=$(this).data("title"),r=$(this).data("description"),u=$(this).data("url"),t=575,i=400,f=($(window).width()-t)/2,e=($(window).height()-i)/2,o="https://twitter.com/share?url="+u+"&text="+r+".",s="status=1,width="+t+",height="+i+",top="+e+",left="+f;return window.open(o,"twitter",s),!1})});socialmedia={fbShare:function(n,t){return n||(n=window.location.href),FB.ui({method:"share",href:n},function(n){console.log("response");console.log(n);t&&t(n)})},initFB:function(){window.fbAsyncInit=function(){FB.init({appId:"258334384707588",xfbml:!0,version:"v2.12"});FB.AppEvents.logPageView()},function(n,t,i){var r,u=n.getElementsByTagName(t)[0];n.getElementById(i)||(r=n.createElement(t),r.id=i,r.src="//connect.facebook.net/en_US/sdk.js",u.parentNode.insertBefore(r,u))}(document,"script","facebook-jssdk")},initTwitter:function(){},IsUserLoggedIn:function(){$.ajax({url:"/account/isloggedin",type:"get",success:function(n){isLoggedIn=n.success?!0:!1},error:function(){}})},showShareModal:function(n){$.ajax({type:"GET",url:"/Common/SocialMediaShareModal",data:{url:n},success:function(n){$("#share-modal-container").html(n);$("#social-media-share-modal").modal("show")}})}};$().ready(function(){$(document).on("click",".btn-vote",function(n){n.preventDefault();var t=this,i=$(t).data("entity-id"),r=$(t).data("vote-type"),u=$(t).data("vote-status");let f={id:i,voteType:r,voteStatus:u};if(!isAuthenticated){let n={Vote:f,SessionId:"Helpful"};showNotLoggedInModal(n);return}$.ajax({url:"/Common/SaveVote",data:f,type:"POST",success:function(){$.ajax({url:"/Common/CountVotes",type:"GET",data:{id:i,voteType:r,voteStatus:u},success:function(n){$(t).data("vote-count",n.HelpfulVotes);$(t).empty();n.HasHelpfulVote?($(t).data("has-helpful-vote","True"),$(t).append('<span class="fa fa-thumbs-up"> <\/span> '),$(t).append('<span class="hidden-xs" data-marked-helpful="True"> Helpful <\/span>')):($(t).data("has-helpful-vote","False"),$(t).append('<span class="fa fa-thumbs-o-up"> <\/span> '),$(t).append('<span class="hidden-xs" data-marked-helpful="False"> Helpful <\/span>'));$(t).append('<span class="badge"> '+n.HelpfulVotes+"<\/span>")}})}})});$(document).on("click",".btn-follow",function(n){n.preventDefault();var t=this,i=$(t).data("entity-id"),r=$(t).data("follow-type"),u=$(t).data("follow-status");let f={id:i,followType:r,followStatus:u};if(!isAuthenticated){let n={Followed:f,SessionId:"Follow"};showNotLoggedInModal(n);return}$.ajax({url:"/Common/SaveFollow",data:f,async:!1,type:"POST",success:function(){$.ajax({url:"/Common/CountFollowed",type:"GET",data:{id:i,followType:r,followStatus:u},success:function(n){$(t).data("follow-count",n.CountFollowed);n.IsFollowing?($(t).data("is-following","True"),$(t).text("Following "),$(t).css("color","#337ab7")):($(t).data("is-following","False"),$(t).text("Follow "),$(t).css("color","#333"));$(t).append('<span class="badge">'+n.CountFollowed+"<\/span>")}})}})});$(document).on("mouseenter",".btn-follow",function(){var n=this,i=$(n).data("is-following"),t=$(n).data("follow-count"),r=$(n).data("entity-id");i==="True"?($(n).text("UnFollow "),$(n).append('<span class="badge">'+t+"<\/span>")):($(n).text("Follow "),$(n).append('<span class="badge">'+t+"<\/span>"))});$(document).on("mouseleave",".btn-follow",function(){var n=this,i=$(n).data("is-following"),t=$(n).data("follow-count"),r=$(n).data("entity-id");i==="True"?($(n).text("Following "),$(n).append('<span class="badge">'+t+"<\/span>")):($(n).text("Follow "),$(n).append('<span class="badge">'+t+"<\/span>"))})});"use strict";let allFeedTabPageNumber=1,reviewTabPageNumber=1,questionTabPageNumber=1,prevAllFeedsFunc,prevReviewFunc,prevQuestionFunc;const pageSize=50;let btnShowMoreReview,btnShowMoreQuestion,btnShowMoreAll;$().ready(function(){function n(){var n=document.getElementById("tab-header"),t=document.getElementById("feeds").offsetTop;window.pageYOffset>t?n.classList.add("sticky"):n.classList.remove("sticky")}$(document).on("click",".tab",function(){var n=this;$(n).addClass("selected");$(".tabs").find(".tab").each(function(){n!==this&&$(this).removeClass("selected")})});$(document).on("click",".btn-show-comment",function(n){n.preventDefault();var t=$(this).data("entity-id"),i=$(this).data("post-type");landing.LoadComments(t,i)});$(document).on("click",".btn-show-answer",function(n){n.preventDefault();var t=$(this).data("entity-id"),i=$(this).data("post-type");landing.LoadAnswers(t,i)});$(document).on("click",".btn-show-more-all",function(n){n.preventDefault();const t=$(this);allFeedTabPageNumber+=1;landing.LoadAllFeeds(allFeedTabPageNumber)});$(document).on("click",".btn-show-more-review",function(n){n.preventDefault();const t=$(this);reviewTabPageNumber+=1;landing.LoadReviews(reviewTabPageNumber)});$(document).on("click",".btn-show-more-question",function(n){n.preventDefault();const t=$(this);questionTabPageNumber+=1;landing.LoadQuestions(questionTabPageNumber)});btnShowMoreReview=$(".btn-show-more-review");btnShowMoreQuestion=$(".btn-show-more-question");btnShowMoreAll=$(".btn-show-more-all");landing.LoadAllFeeds(allFeedTabPageNumber);landing.LoadReviews(reviewTabPageNumber);landing.LoadQuestions(questionTabPageNumber);window.onscroll=function(){n()}});var reviews={get:function(n){$.ajax({type:"GET",url:"/home/reviewsection",success:function(t){n(t)}})}},landing={IsUserLoggedIn:function(){$.ajax({url:"/account/isloggedin",type:"get",success:function(n){isLoggedIn=n.success;home.InitAllPostsHomepageFeed()},error:function(){}})},NotLoggedInDialog:function(){var n=window.location.pathname+window.location.search;BootstrapDialog.show({title:"You are not logged in",message:"You need to login first. Not a member yet? <a href='/account/register'>Sign up here<\/a> or <a href='/account/login?returnUrl="+n+"'>Login<\/a>",type:"type-default"})},InitRelevantPosts:function(){$.ajax({url:"/home/getrelevantfeed",dataType:"html",beforeSend:function(){$(".relevant-activity-feed-container").html('<h3 class="text-center">Loading feed...<\/h3>')},success:function(n){if(n==="")home.InitAllPostsHomepageFeed();else{$(".relevant-activity-feed-container").html(n);$(document).on("click",".btn-facebook-share",function(n){if(!isLoggedIn)return home.NotLoggedInDialog(),!1;var t=$(n.target).data("redirect-url");FB.ui({method:"share",display:"popup",href:"http://realia.com.au"+t},function(){})})}}})},InitHomepageFeed:function(){$.ajax({url:"/home/getfeed",dataType:"html",success:function(n){$(".activity-feed-container").html(n)}})},InitAllPostsHomepageFeed:function(){$.ajax({url:"/home/getallposts",dataType:"html",success:function(n){$(".all-activity-feed-container").html(n);$(document).on("click",".btn-facebook-share",function(n){if(!isLoggedIn)return home.NotLoggedInDialog(),!1;var t=$(n.target).data("redirect-url");FB.ui({method:"share",display:"popup",href:"http://realia.com.au"+t},function(){})})}})},InitCurrentUserHomepageFeed:function(){$.ajax({url:"/home/getuserposts",dataType:"html",success:function(n){$(".current-user-activity-feed-container").html(n)}})},InitAgentAutocomplete:function(){$("#agent-search-input").autocomplete({source:function(n,t){$.ajax({url:"/home/agentsearchautocomplete",dataType:"json",data:{agentQuery:n.term},success:function(n){t(n)}})},minLength:2,select:function(n,t){window.location.replace("/agents/details/"+t.item.id)},response:function(n,t){if(t.content.length===0){var i=$("#agent-search-input").val();$.ajax({url:"/Home/HomepageSearch",type:"get",data:{agentQuery:i,searchAction:action},beforeSend:function(){$(".search-results-container").html('<div class="search-indeterminate-loading"><div class="progress"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"><\/div><\/div><\/div>')},success:function(n){$(".search-results-container").html(n.html)},error:function(){}})}else $(".search-results-container").html("")}})},InitActivityFeeds:function(){$.ajax({type:"GET",url:"/Home/ActivityFeeds",success:function(n){$(".activity-feed-container").html(n)}})},LoadComments:function(n,t){$.ajax({type:"GET",url:"/Home/ReviewCommentFeeds",data:{id:n,commentType:t},beforeSend:function(){$(".loading-comment-"+n).css("display","block")},success:function(i){var r=".box-comment-container-"+t+"-"+n;$(r).html(i);$(r).find(".text-comment").focus()}})},LoadAnswers:function(n){$.ajax({type:"GET",url:"/Home/QuestionAnswerFeeds",data:{id:n,answerType:"Question"},beforeSend:function(){$(".loading-answer-"+n).css("display","block")},success:function(t){var i=".box-answer-container-"+n;$(i).html(t);$(i).find(".text-answer").focus()}})},LoadReviews:function(n){$.ajax({type:"GET",url:"/Home/Feeds",data:{includeReview:!0,pageNumber:n},success:function(t){n==1?$(".review-feeds-container").html(t.Feeds):$(".review-feeds-container").append(t.Feeds);n*pageSize>=t.TotalRecords?btnShowMoreReview.hide():btnShowMoreReview.show()}})},LoadQuestions:function(n){$.ajax({type:"GET",url:"/Home/Feeds",data:{includeQuestion:!0,pageNumber:n},success:function(t){n==1?$(".question-feeds-container").html(t.Feeds):$(".question-feeds-container").append(t.Feeds);n*pageSize>=t.TotalRecords?btnShowMoreQuestion.hide():btnShowMoreQuestion.show()}})},LoadAllFeeds:function(n){return $.ajax({type:"GET",url:"/Home/Feeds",data:{includeQuestion:!0,includeReview:!0,pageNumber:n},success:function(t){n==1?$(".all-feeds-container").html(t.Feeds):$(".all-feeds-container").append(t.Feeds);n*pageSize>=t.TotalRecords?btnShowMoreAll.hide():btnShowMoreAll.show()}})}},question={SavePropertyAnswer:function(n,t){$.ajax({url:"/Properties/SavePropertyAnswer",type:"post",data:$(t).serialize(),beforeSend:function(){$(n).prop("disabled",!0);$(n).text("Posting...")},success:function(t){if(t.success){var i=$(n).data("entity-id");$("textarea").val("");$(".feed-question-details-answer-container-"+i).html(t.html);$(n).prop("disabled",!1);$(n).text("Post answer")}},error:function(){$(n).prop("disabled",!1);$(n).text("Post answer")}})},SaveAnswer:function(n,t){$(t).valid()&&$.ajax({url:"/common/saveanswer",type:"post",data:$(t).serialize(),beforeSend:function(){$(n).prop("disabled",!0);$(n).text("Posting...")},success:function(t){if(t.success){var i=$(n).data("entity-id");$.ajax({type:"GET",url:"/Questions/FeedQuestionAnswer",data:{questionId:i},success:function(t){t.success?($("textarea").val(""),$(".feed-question-details-answer-container-"+i).html(t.html),$(n).prop("disabled",!1),$(n).text("Post answer")):($(n).prop("disabled",!1),$(n).text("Post answer"))},error:function(){$(n).prop("disabled",!1);$(n).text("Post answer")}})}},error:function(){$(n).prop("disabled",!1);$(n).text("Post answer")}})},SaveAnswerComment:function(n,t){$(t).valid()&&$.ajax({url:"/questions/saveanswercomment/",type:"post",data:$(t).serialize(),beforeSend:function(){$(n).prop("disabled",!0);$(n).text("Posting...")},success:function(t){t.success&&($("textarea").val(""),$(".feed-question-details-answer-container").html(t.html),$(n).prop("disabled",!1),$(n).text("Post answer"))},error:function(){$(n).prop("disabled",!1);$(n).text("Post answer")}})}};(function(){var n,f,i,r,u,t=function(n,t){return function(){return n.apply(t,arguments)}},e=[].indexOf||function(n){for(var t=0,i=this.length;i>t;t++)if(t in this&&this[t]===n)return t;return-1};f=function(){function n(){}return n.prototype.extend=function(n,t){var i,r;for(i in t)r=t[i],null==n[i]&&(n[i]=r);return n},n.prototype.isMobile=function(n){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(n)},n.prototype.createEvent=function(n,t,i,r){var u;return null==t&&(t=!1),null==i&&(i=!1),null==r&&(r=null),null!=document.createEvent?(u=document.createEvent("CustomEvent"),u.initCustomEvent(n,t,i,r)):null!=document.createEventObject?(u=document.createEventObject(),u.eventType=n):u.eventName=n,u},n.prototype.emitEvent=function(n,t){return null!=n.dispatchEvent?n.dispatchEvent(t):t in(null!=n)?n[t]():"on"+t in(null!=n)?n["on"+t]():void 0},n.prototype.addEvent=function(n,t,i){return null!=n.addEventListener?n.addEventListener(t,i,!1):null!=n.attachEvent?n.attachEvent("on"+t,i):n[t]=i},n.prototype.removeEvent=function(n,t,i){return null!=n.removeEventListener?n.removeEventListener(t,i,!1):null!=n.detachEvent?n.detachEvent("on"+t,i):delete n[t]},n.prototype.innerHeight=function(){return"innerHeight"in window?window.innerHeight:document.documentElement.clientHeight},n}();i=this.WeakMap||this.MozWeakMap||(i=function(){function n(){this.keys=[];this.values=[]}return n.prototype.get=function(n){var t,u,i,f,r;for(r=this.keys,t=i=0,f=r.length;f>i;t=++i)if(u=r[t],u===n)return this.values[t]},n.prototype.set=function(n,t){var i,f,r,e,u;for(u=this.keys,i=r=0,e=u.length;e>r;i=++r)if(f=u[i],f===n)return void(this.values[i]=t);return this.keys.push(n),this.values.push(t)},n}());n=this.MutationObserver||this.WebkitMutationObserver||this.MozMutationObserver||(n=function(){function n(){"undefined"!=typeof console&&null!==console&&console.warn("MutationObserver is not supported by your browser.");"undefined"!=typeof console&&null!==console&&console.warn("WOW.js cannot detect dom mutations, please call .sync() after loading new content.")}return n.notSupported=!0,n.prototype.observe=function(){},n}());r=this.getComputedStyle||function(n){return this.getPropertyValue=function(t){var i;return"float"===t&&(t="styleFloat"),u.test(t)&&t.replace(u,function(n,t){return t.toUpperCase()}),(null!=(i=n.currentStyle)?i[t]:void 0)||null},this};u=/(\-([a-z]){1})/g;this.WOW=function(){function u(n){null==n&&(n={});this.scrollCallback=t(this.scrollCallback,this);this.scrollHandler=t(this.scrollHandler,this);this.resetAnimation=t(this.resetAnimation,this);this.start=t(this.start,this);this.scrolled=!0;this.config=this.util().extend(n,this.defaults);null!=n.scrollContainer&&(this.config.scrollContainer=document.querySelector(n.scrollContainer));this.animationNameCache=new i;this.wowEvent=this.util().createEvent(this.config.boxClass)}return u.prototype.defaults={boxClass:"wow",animateClass:"animated",offset:0,mobile:!0,live:!0,callback:null,scrollContainer:null},u.prototype.init=function(){var n;return this.element=window.document.documentElement,"interactive"===(n=document.readyState)||"complete"===n?this.start():this.util().addEvent(document,"DOMContentLoaded",this.start),this.finished=[]},u.prototype.start=function(){var t,i,u,r;if(this.stopped=!1,this.boxes=function(){var n,u,i,r;for(i=this.element.querySelectorAll("."+this.config.boxClass),r=[],n=0,u=i.length;u>n;n++)t=i[n],r.push(t);return r}.call(this),this.all=function(){var n,u,i,r;for(i=this.boxes,r=[],n=0,u=i.length;u>n;n++)t=i[n],r.push(t);return r}.call(this),this.boxes.length)if(this.disabled())this.resetStyle();else for(r=this.boxes,i=0,u=r.length;u>i;i++)t=r[i],this.applyStyle(t,!0);return this.disabled()||(this.util().addEvent(this.config.scrollContainer||window,"scroll",this.scrollHandler),this.util().addEvent(window,"resize",this.scrollHandler),this.interval=setInterval(this.scrollCallback,50)),this.config.live?new n(function(n){return function(t){var i,u,f,e,r;for(r=[],i=0,u=t.length;u>i;i++)e=t[i],r.push(function(){var n,r,t,i;for(t=e.addedNodes||[],i=[],n=0,r=t.length;r>n;n++)f=t[n],i.push(this.doSync(f));return i}.call(n));return r}}(this)).observe(document.body,{childList:!0,subtree:!0}):void 0},u.prototype.stop=function(){return this.stopped=!0,this.util().removeEvent(this.config.scrollContainer||window,"scroll",this.scrollHandler),this.util().removeEvent(window,"resize",this.scrollHandler),null!=this.interval?clearInterval(this.interval):void 0},u.prototype.sync=function(){if(n.notSupported)return this.doSync(this.element)},u.prototype.doSync=function(n){var t,i,f,u,r;if(null==n&&(n=this.element),1===n.nodeType){for(n=n.parentNode||n,u=n.querySelectorAll("."+this.config.boxClass),r=[],i=0,f=u.length;f>i;i++)t=u[i],e.call(this.all,t)<0?(this.boxes.push(t),this.all.push(t),this.stopped||this.disabled()?this.resetStyle():this.applyStyle(t,!0),r.push(this.scrolled=!0)):r.push(void 0);return r}},u.prototype.show=function(n){return this.applyStyle(n),n.className=n.className+" "+this.config.animateClass,null!=this.config.callback&&this.config.callback(n),this.util().emitEvent(n,this.wowEvent),this.util().addEvent(n,"animationend",this.resetAnimation),this.util().addEvent(n,"oanimationend",this.resetAnimation),this.util().addEvent(n,"webkitAnimationEnd",this.resetAnimation),this.util().addEvent(n,"MSAnimationEnd",this.resetAnimation),n},u.prototype.applyStyle=function(n,t){var i,r,u;return r=n.getAttribute("data-wow-duration"),i=n.getAttribute("data-wow-delay"),u=n.getAttribute("data-wow-iteration"),this.animate(function(f){return function(){return f.customStyle(n,t,r,i,u)}}(this))},u.prototype.animate=function(){return"requestAnimationFrame"in window?function(n){return window.requestAnimationFrame(n)}:function(n){return n()}}(),u.prototype.resetStyle=function(){var r,n,u,t,i;for(t=this.boxes,i=[],n=0,u=t.length;u>n;n++)r=t[n],i.push(r.style.visibility="visible");return i},u.prototype.resetAnimation=function(n){var t;if(n.type.toLowerCase().indexOf("animationend")>=0)return(t=n.target||n.srcElement,t.className=t.className.replace(this.config.animateClass,"").trim())},u.prototype.customStyle=function(n,t,i,r,u){return t&&this.cacheAnimationName(n),n.style.visibility=t?"hidden":"visible",i&&this.vendorSet(n.style,{animationDuration:i}),r&&this.vendorSet(n.style,{animationDelay:r}),u&&this.vendorSet(n.style,{animationIterationCount:u}),this.vendorSet(n.style,{animationName:t?"none":this.cachedAnimationName(n)}),n},u.prototype.vendors=["moz","webkit"],u.prototype.vendorSet=function(n,t){var i,r,u,f;r=[];for(i in t)u=t[i],n[""+i]=u,r.push(function(){var t,o,r,e;for(r=this.vendors,e=[],t=0,o=r.length;o>t;t++)f=r[t],e.push(n[""+f+i.charAt(0).toUpperCase()+i.substr(1)]=u);return e}.call(this));return r},u.prototype.vendorCSS=function(n,t){var i,o,f,u,e,s;for(e=r(n),u=e.getPropertyCSSValue(t),f=this.vendors,i=0,o=f.length;o>i;i++)s=f[i],u=u||e.getPropertyCSSValue("-"+s+"-"+t);return u},u.prototype.animationName=function(n){var t;try{t=this.vendorCSS(n,"animation-name").cssText}catch(i){t=r(n).getPropertyValue("animation-name")}return"none"===t?"":t},u.prototype.cacheAnimationName=function(n){return this.animationNameCache.set(n,this.animationName(n))},u.prototype.cachedAnimationName=function(n){return this.animationNameCache.get(n)},u.prototype.scrollHandler=function(){return this.scrolled=!0},u.prototype.scrollCallback=function(){var n;if(this.scrolled&&!(this.scrolled=!1,this.boxes=function(){var t,u,i,r;for(i=this.boxes,r=[],t=0,u=i.length;u>t;t++)n=i[t],n&&(this.isVisible(n)?this.show(n):r.push(n));return r}.call(this),this.boxes.length||this.config.live))return this.stop()},u.prototype.offsetTop=function(n){for(var t;void 0===n.offsetTop;)n=n.parentNode;for(t=n.offsetTop;n=n.offsetParent;)t+=n.offsetTop;return t},u.prototype.isVisible=function(n){var r,u,t,f,i;return u=n.getAttribute("data-wow-offset")||this.config.offset,i=this.config.scrollContainer&&this.config.scrollContainer.scrollTop||window.pageYOffset,f=i+Math.min(this.element.clientHeight,this.util().innerHeight())-u,t=this.offsetTop(n),r=t+n.clientHeight,f>=t&&r>=i},u.prototype.util=function(){return null!=this._util?this._util:this._util=new f},u.prototype.disabled=function(){return!this.config.mobile&&this.util().isMobile(navigator.userAgent)},u}()}).call(this)