function ajaxRequest(n){n.ProfileIds!=null&&n.ProfileIds!=""&&$.ajax({type:"POST",url:n.ServiceUrl,data:JSON.stringify(n.ProfileIds),dataType:"json",contentType:"application/json; charset=utf-8",success:function(t){t.length>=1&&UpdateExpertStatusProfileButtons(t,n.AwayButtonID,n.ChatButtonID,n.VoiceButtonID,n.ChatVoiceButtonID)}})}function UpdateExpertStatusProfileButtons(n,t,i,r,u){for(var s,h=$("[id=buttons]"),o=$("[id=statusText]"),e="",f=0;f<n.length;f++){if(clearButtons(h[f]),s=n[f].ST,typeof userChannelChoice=="undefined")switch(s){case 0:case 3:e=t,$(o[f]).text("Away");break;case 2:e=t,$(o[f]).text("Busy");break;case 1:e=i,$(o[f]).text("Online");break;case 4:e=u,$(o[f]).text("Online");break;case 5:e=r,$(o[f]).text("Online")}else switch(userChannelChoice){case 0:switch(s){case 0:case 3:e=t,$(o[f]).text("Away");break;case 2:e=t,$(o[f]).text("Busy");break;case 1:e=i,$(o[f]).text("Online");break;case 4:e=u,$(o[f]).text("Online");break;case 5:e=r,$(o[f]).text("Online")}break;case 1:switch(s){case 0:case 3:e=t,$(o[f]).text("Away");break;case 2:e=t,$(o[f]).text("Busy");break;case 1:e=i,$(o[f]).text("Online");break;case 4:e=i,$(o[f]).text("Online");break;case 5:e=t,$(o[f]).text("Online")}break;case 5:switch(s){case 0:case 3:e=t,$(o[f]).text("Away");break;case 2:e=t,$(o[f]).text("Busy");break;case 1:e=t,$(o[f]).text("Online");break;case 4:e=r,$(o[f]).text("Online");break;case 5:e=r,$(o[f]).text("Online")}}showButton(h[f],e)}}function clearButtons(n){$(n).children().each(function(){$(this)[0].className!="clientEditButtons"&&$(this).hide()})}function showButton(n,t){$(n).children("#"+t).show()}function SetMyClientsStatusText(n){var t=$("[id$='lblFilterpopulation']");if(n>0){switch($("#selectedFilter").attr("filter")){case"1":n>1?t.text("You communicated with "+n+" clients in the last 60 days:"):t.text("You communicated with one client in the last 60 days:");break;case"2":n>1?t.text("You have "+n+" favorite clients:"):t.text("You have one favorite client:");break;case"3":switch($("#selectedShow").attr("show")){case"4":n==1?t.text("You have one referred client who grants you reduced commission:"):n>1&&t.text("You have "+n+" referred clients who grant you reduced commission:");break;default:n>1?t.text("You have referred "+n+" clients. "):t.text("You have referred one client:")}break;case"4":n>1?t.html("You have "+n+" leads. They are not your clients, yet! <br /> Your leads are clients that marked you as favorite, allowed you to contact them,<br /> and did not yet have a session with you."):t.html("You have one lead. They are not your clients, yet! <br /> Your leads are clients that marked you as favorite, allowed you to contact them,<br /> and did not yet have a session with you.");break;case"5":switch($("#selectedShow").attr("show")){case"1":n>1?t.text("You have "+n+" clients that allowed you to contact them:"):t.text("You have one client that allowed you to contact them:");break;case"2":n>1?t.text("You have "+n+" blocked clients:"):t.text("You have one blocked client:");break;case"3":n>1?t.text("You have "+n+" removed clients: "):t.text("You have one removed client: ");break;default:n>1?t.text("You have "+n+" clients:"):t.text("You have one client:")}break;case"6":$("#selectedShow").attr("show")==="1"?t.text("New clients that had a session with you in the last 7 days and haven't been messaged."):t.text("New clients that had a session with you in the last 7 days.");break;case"7":t.text("Clients that didn't have a session with you in the last 7-21 days.")}t.show()}else t.text="",t.hide()}function ShowHideNote(n){var t=n.children(".note_text"),i;n.css("display")=="none"?($(".clients_container").css("z-index",4),n.show(),t.focus(),i=t.val(),t[0].value="",t[0].value=i):($(".clients_container").css("z-index",0),n.hide())}function closeNote(n){$(".clients_container").css("z-index",0),$(n.parentElement).hide(),resetButtonsStatus()}function resetButtonsStatus(){$("#hook_show_dropdown").attr("class","sort show_dropdown"),$("#hook_page_dropdown_clients").attr("class","page_selection sort"),$("#hook_filter_dropdown").attr("class","sort filter")}function SaveNote(n,t,i){var r=$(n.parentElement),f=r.children("#clientNote"),u=f[0].value,e="/WebServices/Ajax/Experts.svc/SaveNote";$.ajax({type:"POST",dataType:"json",contentType:"application/json",url:e,data:JSON.stringify({MemberID:t,NoteTxt:u}),success:function(n){n==="OK"?(r.hide(),u==""?i.text("Add Note"):i.text("View / Edit Note")):alert("Note saving failed")}}),resetButtonsStatus()}function ChangeBlockStatus(n,t,i){var u=$(n)[0].text,r=!0,f,e;if(u.indexOf("Unblock")>-1&&(r=!1),r&&(f=confirm("Are you sure you want to block "+i+"?"),f!=!0))return!1;e="/WebServices/Ajax/Experts.svc/ChangeBlockStatus?IDToBlock="+t+"&toBlock="+r,$.ajax({type:"GET",dataType:"json",contentType:"application/json; charset=utf-8",url:e,success:function(t){t==="OK"?u.indexOf("Unblock")>-1?$($(n)[0]).text($(n)[0].text.replace("Unblock","Block")):$($(n)[0]).text($(n)[0].text.replace("Block","Unblock")):alert("Block failed")}})}function RemoveMember(n,t,i,r){var u,f,e;if(r&&(u=confirm("Are you sure you want to remove "+i+"?"),u!=!0))return!1;f=$(n).attr("favorite"),e="/WebServices/Ajax/Experts.svc/RemoveMember?IDToRemove="+t+"&removeMember="+r+"&isFavoriteMember="+f,$.ajax({type:"GET",dataType:"json",contentType:"application/json; charset=utf-8",url:e,success:function(u){return u==="OK"?r?($($(n)[0]).text($(n)[0].text.replace("Remove","Removed")),$($(n)[0]).attr("onclick","RemoveMember(this ,"+t+",' "+i+"',false)"),!0):($($(n)[0]).text($(n)[0].text.replace("Removed","Remove")),$($(n)[0]).attr("onclick","RemoveMember(this,"+t+",' "+i+"',true)"),!0):(alert("Remove failed"),!0)}})}function ChangeFavStatus(n,t,i,r){var f=$(n)[0].text,u=!1,e,o;if(f=="Add to favorites"&&(u=!0),!u&&(e=confirm("Are you sure you want to remove "+r+" from favorites?"),e!=!0))return!1;o="/WebServices/Ajax/Experts.svc/ChangeFavStatus?IDToFavorite="+i+"&addToFav="+u,$.ajax({type:"GET",dataType:"json",contentType:"application/json; charset=utf-8",url:o,success:function(i){i==="OK"?f=="Add to favorites"?($($(n)[0]).text("Remove from favorites"),t.show()):($($(n)[0]).text("Add to favorites"),t.hide()):alert("Add To Favorites failed")}})}function showChanged(n,t,i){var r=$($(n)[0]).attr("show"),u=$($("#selectedFilter")[0]).attr("filter");currentPage=1,$("#selectedShow").text(n.text),$("#hook_show_dropdown").attr("class","sort show_dropdown"),$("#hook_filter_dropdown").attr("class","sort filter"),$("#selectedShow").attr("show",r),getMyClients(u,r,t),$("#showBy").hide(),getMyClients(u,r,t,undefined,undefined,i)}function filterChanged(n,t,i,r,u){var f=n,e;currentPage=1,e=$($("#selectedShow")[0]).attr("show"),f=="3"||f=="5"||f=="6"?($("#hook_show_dropdown").show(),$("#selectedShow").text("All"),e="0",$("#hook_page_dropdown_clients").closest("div").find("#hook_filter_dropdown").animate({right:"550px"},500),f=="3"&&($("#referrals_ddl").show(),$("#everyone_ddl").hide(),$("#newClients_ddl").hide(),$("#selectedShow").attr("show","0")),f=="5"&&($("#everyone_ddl").show(),$("#referrals_ddl").hide(),$("#newClients_ddl").hide(),$("#selectedShow").attr("show","0")),f=="6"&&($("#newClients_ddl").show(),$("#referrals_ddl").hide(),$("#everyone_ddl").hide(),$("#selectedShow").attr("show","0"))):($("#hook_filter_dropdown").css({left:"",right:285}),$("#hook_show_dropdown").hide()),$("#selectedFilter").text(t),$("#hook_filter_dropdown").attr("class","sort filter"),$("#hook_show_dropdown").attr("class","sort show_dropdown"),$("#selectedFilter").attr("filter",f),$("#filterBy").hide(),getMyClients(f,e,i,r,undefined,u)}function getMyClients(n,t,i,r,u,f){$("#btnShowMore").hide(),$("#noClients").hide(),typeof u=="undefined"&&(u="1"),typeof f=="undefined"&&(f="9"),typeof r=="undefined"&&(r="null");var e="/WebServices/Ajax/Experts.svc/GetMyClients?filterBy="+n+"&showBy="+t+"&clientName="+r+"&pageNumber="+u+"&pageSize="+f;clientsGrid.init({ServiceUrl:e,clientsTemplate:"clientsTemplate",placeHolderID:"hook_clients_container",loadingHolderID:"profileLoadingHolder"}),clientsGrid.getClients(function(n){n<=9?$("#btnShowMore").hide():$("#btnShowMore").show(),n===0?$("#noClients").show():$("#noClients").hide();$("#hook_clients_container").on("click",".send_mail",function(){AnalyticsTrackingModule.trackEvent("DesktopMessaging_ComposeMessage_ClickedFromMyClients")});$("#hook_clients_container").on("click",".view_sessions",function(){AnalyticsTrackingModule.trackEvent("DesktopMessaging_OfferEmailReading_ClickedFromMyClients")})},i)}function onBlockClientRequest(n,t,i){var u=$(n)[0].text,r=!0;u.indexOf("Unblock")>-1&&(r=!1),r?onBlockClientFun(n,t,i):ChangeBlockStatus(n,t,i)}function expertClickEvent(n,t,i,r,u){var f={};typeof n!="undefined"&&typeof t!="undefined"&&i!==""&&(f.position=n,f.exepertId=t,f.expertName=i,f.categoryUrl=r,f.location=u,window._currentPageView.expertsClick(f))}function expertAddToCartEvent(n,t,i,r,u,f){var e={};e.variant=n,e.exepertId=t,e.expertName=i,e.categoryUrl=r,e.expertFee=u||0,e.onlyOnce=f||!1,window._currentPageView.expertGridAddToCartClick(e)}function expertCheckOutClick(n,t,i,r,u,f){var e={};e.expertName=n,e.exepertId=t,e.categoryUrl=i,e.expertFee=r||0,e.step=u,e.onlyOnce=f||!1,window._currentPageView.checkOutClick(e)}function initGalleryContent(){function r(n){var t,r;n++,$(".galleryContentMenu li.menuItem").removeClass("act").addClass("inact"),t=$(".galleryContentMenu li.menuItem:nth-child("+n+")"),t.addClass("act"),t.removeClass("inact"),r=t.prevAll(".menuItem").length,$(".contentGallery .slides").animate({marginLeft:-i[r]+"px"},450)}function e(){if(n==-1)return!1;n==3&&(n=0),r(n),n++}var t=0,i=[],n,u,f;$(".contentGallery .slides .slide").each(function(n){return i[n]=t,t+=$(this).width(),$(this).width()?void 0:(alert("Please, fill in width & height for all your images!"),!1)}),$(".contentGallery .slides").width(t),$(".galleryContentMenu ul li a").click(function(n,t){n.preventDefault();var i=$(this).parent().index();r(i),t||clearInterval(f)}),$(".galleryContentMenu ul li.menuItem:first").addClass("act").siblings().addClass("inact"),n=0,u=10,f=setInterval(function(){e()},u*1e3)}function initCarousel(){jQuery(".carousel").scrollGallery({mask:".mask",slider:".slideset",slides:".slide",btnPrev:"a.btn-prev",btnNext:"a.btn-next",circularRotation:!1,autoRotation:!1,switchTime:3e3,animSpeed:500})}function showCarousel(){$(".slide").css("display","block")}function SetArrowHighet(){jQuery.browser.mozilla&&$(".about-us-arrow").css("top","-1em")}function initSlideShow(){jQuery(".fade-gallery").fadeGallery({slides:".slide",event:"click",disableWhileAnimating:!0,disableFadeIE:!0,useSwipe:!0,autoRotation:!0,autoHeight:!0,switchTime:4e3,animSpeed:500})}function initParalax(){var u=721,i;if(!jQuery.browser.safari&&!jQuery.browser.msie&&!(screen.height<u)&&(i=/MSIE 10.*Touch/.test(navigator.userAgent)||"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,!i)){var n=jQuery(window),r=jQuery("#header .holder"),f=jQuery(".section"),t="disabled-move";f.each(function(i){function l(){var v,b;if(u.length){var l=h.offset().top,a=h.outerHeight(),d=w.outerHeight(),k=n.height(),o=r.outerHeight(),f=n.scrollTop();l+a+d<=k+f&&u.addClass(t),l<k/2-a/2+f?(u.removeClass(t),u.parent().css({marginBottom:e})):l+a>=u.offset().top&&(u.removeClass(t),e=0),i<1&&(v=y.offset().top,f+o>=v?s.css({marginTop:-v+o}):s.css({marginTop:-f})),b=p.offset().top,u.hasClass(t)||(f+o>=b+e&&!c?u.css({marginTop:-b+o}):u.css({marginTop:-f+e}))}}function a(){f.length&&(c=n.height()-r.outerHeight()<f.outerHeight()),l()}var o=jQuery(this),v=o.find(".wrap-box");v.each(function(){jQuery(this).css({height:jQuery(this).height()})});var f=o.find(".fixed-section"),s=f.filter(".top-stay"),u=f.filter(".bottom-stay"),y=s.parent(),p=u.parent(),w=u.find(".strip"),h=o.find(".info-section"),e=0,c=!1;f.each(function(){var t=jQuery(this);t.data("origOffsetTop",t.offset().top),t.css({position:"absolute"}),n.bind("scroll",function(){t.css({left:-n.scrollLeft()})})}),a(),n.bind("scroll",l).bind("resize",a)})}}function initSmoothScroll(){var n=900,t=jQuery("html,body"),i=jQuery("#header .holder").innerHeight();jQuery("a.btn-scroll").click(function(i){var r=jQuery(this).attr("href"),u=r==="#"?0:jQuery(r).offset().top-38;i.preventDefault(),t.animate({scrollTop:u},n)}),jQuery(".scroll-menu ul a").click(function(r){var u=jQuery(this).attr("href"),f=u==="#"?0:jQuery(u).offset().top-i-38;r.preventDefault(),t.animate({scrollTop:f},n)})}function initSameHeight(){jQuery(".boxes").sameHeight({elements:".box",useMinHeight:!0,flexible:!0,multiLine:!0,biggestHeight:!0}),jQuery("#footer .cols").sameHeight({elements:".col",useMinHeight:!0,flexible:!0,multiLine:!0,biggestHeight:!0})}function OpenAdvisorRatingLightbox(n){$("#ReviewPopup").css("display","block"),$("#cboxOverlay").css("display","block"),$("#iframeShowComment").empty().attr("src",n),$("#iframeShowComment").attr("Color","blue"),$(".top-middle-review").removeAttr("class").addClass("blue-background").addClass("top-middle-review")}function scrollTo(n){$("html,body").animate({scrollTop:$("#"+n).offset().top-50},1500)}function initExpertClickEvents(){$(".box .holder").click(function(){try{var n=$(this).closest("article").find("#color");expertClickEvent(n.attr("itemIndex"),n.attr("expertId"),n.find(".expertName").text(),n.attr("category"),getCategoryLocation(n.attr("category")))}catch(t){Logger.Error("Error logging Analytics Event: expertclick",!0,t)}}),$("#buttons a").click(function(n){try{n.preventDefault();var i=$(this).attr("href"),t=$(this).closest("#buttons").parent().find("#color");expertAddToCartEvent($(this).attr("id"),t.attr("expertId"),t.find(".expertName").text(),t.attr("category"),parseFloat(t.find(".lblOnlineFee").attr("half")).toFixed(2)),window.location.href=i}catch(r){Logger.Error("Error logging Analytics Event: expertGridAddToCartClick",!0,r)}})}function getCategoryLocation(n){var t="Homepage";switch(n){case TagManagerHelper.HomePageCategories.education:return t+"Tutoring";case TagManagerHelper.HomePageCategories.business:return t+"Business";case TagManagerHelper.HomePageCategories.computers:return t+"Technology";case TagManagerHelper.HomePageCategories.counseling:return t+"Counseling";case TagManagerHelper.HomePageCategories.health:return t+"Health";default:return""}}function homePageLoadedEvent(n){try{window._currentPageView.homepageLoaded(n)}catch(t){Logger.Error("Error logging GTM Event: homepageLoaded",!0,t)}}function homepagePaginationOnNavigateBindingEvent(n){try{window._currentPageView.homepagePaginationOnNavigateBinding(n)}catch(t){Logger.Error("Error binding GTM Event: homepagePaginationOnNavigateBinding",!0,t)}}function initExpertView(){$(".searchClients").click(function(){searchClients()}),$("#searchTextClient").keyup(function(n){n.keyCode===13&&searchClients()}),$(".sort:not(.active) .activities-link.opener").click(function(){$("#filterBy").show()}),initParalax(),GetClients()}function searchClients(){searchMode=!0;var n=$("#searchTextClient").val();(n!=="undefined"||n!=="")&&filterChanged(5,"Everyone",initCarousel,n),$("#searchTerm").text(n)}function GetClients(){function i(){$.ajax({type:"GET",url:"/WebServices/Ajax/Experts.svc/GetPBQuestionsCount",dataType:"json",contentType:"application/json; charset=utf-8",success:function(n){$("#totalQuestions").text(n)}})}function r(){if(n===0){n++;return}$(t).each(function(){$(this).is(":visible")&&$(this).hide()}),$(t[n]).fadeIn(700),n===3?n=0:n++}var n=0,t=[$("#onlineExperts"),$("#sessionsNum"),$("#pbAnswers"),$("#pbQuestion")];setInterval(function(){i()},6e4),setInterval(function(){r()},2e3),clientsGrid.init({ServiceUrl:url,clientsTemplate:"clientsTemplate",placeHolderID:"hook_clients_container",loadingHolderID:""}),clientsGrid.getClients(function(n){n===0?$("#noClients").show():$("#noClients").hide()},function(){searchMode=!1,initCarousel(),initParalax()})}function gallerySlideRefresh(){var n=9;$("#expertsList").css("margin-left"," 0"),$(".btn-prev").addClass("disabled"),$("#expertsList article.box:visible").length<n?$(".btn-next").addClass("disabled"):$(".btn-next").removeClass("disabled")}function initMemberView(n){var t=1,i=100,r=8;initExpertClickEvents(),$(".drop a[sortid]").click(function(){$(".activities-link").click(),$(".activities-link").text($(this).text()),$("#SortValue").val($(this).attr("SortId")),$("#expertsList").empty(),t=1,n="",toggleEditMode("close"),GetMyExperts(t,i,n,r)}),$("#clientedeitmode").click(function(){toggleEditMode(),gallerySlideRefresh()}),GetMyExperts(t,i,n,r)}function setTopImageViewForMember(){$(".top-image").length>=1&&$(".top-image").css("margin-top","3%")}function initGuestView(n){var t=$("[id=MemID]");t.each(function(){n+=this.innerHTML+","}),RefreshStatusMembers(n),initCarousel(),showCarousel(),initParalax(),initExpertClickEvents()}function GetMyExperts(n,t,i,r){$("#SortValue").val()&&(r=$("#SortValue").val());var u="/WebServices/Ajax/Experts.svc/MyExperts/"+r+"/"+n+"/"+t;expertGrid.init({ServiceUrl:u,expertTemplate:"expertTemplate",placeHolderID:"expertsList",loadingHolderID:"profile-ajax-loader",cleanGrid:!1,profileIds:i}),expertGrid.getExperts(null,function(){initCarousel(),initParalax(),$(".profileID").each(function(){i+=$(this).text()+","}),i===""&&showCarousel(),RefreshStatusMembers(i),RegisterTagManagerEvents(),initExpertClickEvents()})}function toggleEditMode(n){var t=$("#expertsList");t.hasClass("editMode")?(LoadEditExperts(!1),$("#clientedeitmode").html("Edit my experts"),t.removeClass("editMode")):n!=="close"&&($("#clientedeitmode").html("Close edit mode"),LoadEditExperts(!0),t.addClass("editMode"))}function LoadEditExperts(n){n?$("#expertsList .suggested").hide():$("#expertsList .suggested").show(),$(".clientEditButtons").toggle()}function getProfileIdsFromPage(){var n="";return $(".profileID").each(function(){n+=$(this).text()+","}),n}function RefreshStatusMembers(n){expertsStatuses.init({ProfileIds:n,Interval:"15000",ChatButtonID:"letsChatButtons",VoiceButtonID:"letsCallButtons",ChatVoiceButtonID:"voiceAndChatButtons",AwayButtonID:"sendMailButton"}),expertsStatuses.getAndSetExpertsStatuses()}function deleteExpert(n,t,i){RemoveMember(n,t,i,!0),$(n).closest("article").fadeOut("slow")}function MyExpertsShowHideNote(n){var t=$(n.parentElement).children(".note"),i=t.children(".note_text"),r;t.css("display")==="none"?($(".clients_container").css("z-index",4),t.show(),i.focus(),r=i.val(),i[0].value="",i[0].value=r,$(".sort_dropdown").hide()):($(".clients_container").css("z-index",0),t.hide())}function MyExpertsCloseNote(n){$(".clients_container").css("z-index",0),$(n.parentElement).hide()}function MyExpertsSaveNote(n,t){var i=$(n.parentElement),u=i.children("#clientNote"),r=u[0].value,f="/WebServices/Ajax/Experts.svc/SaveNote";$.ajax({type:"POST",dataType:"json",contentType:"application/json",url:f,data:JSON.stringify({MemberID:t,NoteTxt:r}),success:function(n){n==="OK"?(i.hide(),r===""?$(i.parent().children("#addNote")[0]).text("Add Note"):$(i.parent().children("#addNote")[0]).text("View / Edit Note")):alert("Note saving failed")}})}function initScrollToTop(){var n=!1;$(window).scroll(function(){$(this).scrollTop()>950&&!n?$("#back-to-top").fadeIn():n||$("#back-to-top").fadeOut()}),$("#back-to-top").click(function(){return n=!0,$("#back-to-top").fadeOut(),$("body,html").animate({scrollTop:750},1e3),setTimeout(function(){n=!1},1e3),!0})}var clientsGrid,onBlockClientFun;$.ajaxSetup({cache:!1}),$.fn.digits=function(){return this.each(function(){$(this).text($(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"))})};var expertGrid=function(){var n={ServiceUrl:"",expertTemplate:"",placeHolderID:"",loadingHolderID:"",cleanGrid:"",profileIds:""};return{init:function(t){n=t},profileIds:function(){return n.profileIds},hideShowMoreCallBack:function(){},getExperts:function(t,i){$("#"+n.loadingHolderID).show(),$.ajax({type:"GET",url:n.ServiceUrl,dataType:"json",contentType:"application/json; charset=utf-8",beforeSend:function(){n.loadingHolderID!=""&&$("#"+n.loadingHolderID).show()},complete:function(){n.loadingHolderID!=""&&$("#"+n.loadingHolderID).hide(),expertGrid.hideShowMoreCallBack()},success:function(data){var array,j;if(t&&t(data),n.cleanGrid&&($("#"+n.placeHolderID).empty(),n.profileIds=""),$("#count_psychics").html(data.ItemsAmount),$("#count_psychics_input").val(data.ItemsAmount),array=eval(data.ItemsList),array.length>=1){for(profileIds.length>1&&(profileIds+=","),j=0;j<array.length;j++)profileIds+=array[j].MemberID+",";$("#"+n.expertTemplate).tmpl(data,{dataArrayIndex:function(n){return $.inArray(n,array)}}).appendTo("#"+n.placeHolderID)}i&&i(array.length),$("span#ratesNumber").digits(),$('#Reviews div[id^="numberss"]').digits()}})}}}(),intervalTime="15000",intervalHolder,expertsStatuses=function(){var n={ProfileIds:"",Interval:"",ChatButtonID:"",VoiceButtonID:"",ChatVoiceButtonID:"",AwayButtonID:""};return{init:function(t){n=t,n.ServiceUrl="/Webservices/Ajax/ExpertsStatusesService.svc/ExpertsStatuses",intervalTime=n.Interval},getAndSetExpertsStatusesWithoutInterval:function(){ajaxRequest(n)},getAndSetExpertsStatuses:function(){clearInterval(intervalHolder),intervalHolder=setInterval(function(){ajaxRequest(n)},intervalTime)}}}();clientsGrid=function(){var n={ServiceUrl:"",clientsTemplate:"",placeHolderID:"",loadingHolderID:"",cleanGrid:!1};return{init:function(t){n=t},getClients:function(t,i){$.ajax({type:"GET",url:n.ServiceUrl,dataType:"json",contentType:"application/json; charset=utf-8",beforeSend:function(){n.loadingHolderID!=""&&$("#"+n.loadingHolderID).show()},complete:function(){n.loadingHolderID!=""&&$("#"+n.loadingHolderID).hide()},success:function(data){var result=eval(data);typeof t!="undefined"?t(result.ItemsAmount):t(0),$("#"+n.placeHolderID).empty(),SetMyClientsStatusText(result.ItemsAmount),result.ItemsAmount>0&&$("#"+n.clientsTemplate).tmpl(result).appendTo("#"+n.placeHolderID),i&&i(result.length)}})}}}(),function(){"use strict";var n={};n.exertsGridClickEvent=function(n){n=n||{};var t={event:"expertclick",ecommerce:{click:{actionField:{list:n.location},products:[{name:(n.expertName||"").toString(),id:(n.exepertId||"").toString(),category:n.categoryUrl||"",position:(n.position||"").toString()}]}}};if(n.userType&&(n.userType!=="Guest"||n.userType!=="Member"))switch(n.userType){case"Guest":case"newMemeber":n.GuestsAndNewMembersOrMember="GuestAndNewMembers";break;case"Member":n.GuestsAndNewMembersOrMember="Member"}window.TagManagerHelper.submitEvent(t,[n],{submitOnlyOncePerExpert:!0,expertId:n.exepertId})},n.expertsGridEvent=function(n){var u,i,r,f,t;if(n=n||{},u=window.TagManagerHelper.importProperties([window.TagManagerHelper.PropertyGroups.category]),i={event:n.event||"",ecommerce:{impressions:[]}},n.userType&&(n.userType!=="Guest"||n.userType!=="Member"))switch(n.userType){case"Guest":case"newMemeber":n.GuestsAndNewMembersOrMember="GuestAndNewMembers";break;case"Member":n.GuestsAndNewMembersOrMember="Member"}if(n.experts){r=0;for(f in n.experts)t=n.experts[f],r++,i.ecommerce.impressions.push({name:t.ExpertName||"",id:(t.ExpertID||"").toString(),category:t.CategoryName||"",list:t.ListName||"",position:t.ItemPosition?parseInt(t.ItemPosition):r,dimension4:(t.NumberOfReviews||"").toString(),variant:t.ExpertStatus||""});delete n.experts}window.TagManagerHelper.submitEvent(i,[n,u])},window._currentPageView={_expertsGrid:n}}(),function(){"use strict";var t={};t.expertGridAddToCartClick=function(n){if(n=n||{},typeof n.variant!="undefined")switch(n.variant){case"sendMailButton":n.variant=TagManagerHelper.VariantType.email,n.step=TagManagerHelper.CheckoutSteps.clickSend,t.checkOutClick(n);break;case"letsChatButton":n.variant=TagManagerHelper.VariantType.chat;break;case"ChatMailButton":n.variant=TagManagerHelper.VariantType.email,n.step=TagManagerHelper.CheckoutSteps.clickSend,t.checkOutClick(n);break;case"chatButton":n.variant=TagManagerHelper.VariantType.chat;break;case"callButton":n.variant=TagManagerHelper.VariantType.voice;break;case"VoiceMailButton":n.variant=TagManagerHelper.VariantType.email,n.step=TagManagerHelper.CheckoutSteps.clickSend,t.checkOutClick(n);break;case"letsCallButton":n.variant=TagManagerHelper.VariantType.voice;break;case"callNow":n.variant=TagManagerHelper.VariantType.voice;break;case"chatNow":n.variant=TagManagerHelper.VariantType.chat;break;case"emailNow":n.variant=TagManagerHelper.VariantType.email,n.step=TagManagerHelper.CheckoutSteps.clickSend,t.checkOutClick(n)}var i={event:"addToCart",ecommerce:{add:{products:[{name:(n.expertName||"").toString(),id:(n.exepertId||"").toString(),category:n.categoryUrl||"",variant:(n.variant||"").toString()}]}}};if(n.userType&&(n.userType!=="Guest"||n.userType!=="Member"))switch(n.userType){case"Guest":case"newMemeber":n.GuestsAndNewMembersOrMember="GuestAndNewMembers";break;case"Member":n.GuestsAndNewMembersOrMember="Member"}window.TagManagerHelper.submitEvent(i,[n],{submitOnlyOncePerExpert:!0,expertId:n.exepertId})},t.checkOutClick=function(n){n=n||{};var t={event:"checkout",ecommerce:{checkout:{actionField:{step:n.step},products:[{name:(n.expertName||"").toString(),id:(n.exepertId||"").toString(),category:n.categoryUrl||"",price:(n.expertFee||"").toString()}]}}};if(n.userType&&(n.userType!=="Guest"||n.userType!=="Member"))switch(n.userType){case"Guest":case"newMemeber":n.GuestsAndNewMembersOrMember="GuestAndNewMembers";break;case"Member":n.GuestsAndNewMembersOrMember="Member"}window.TagManagerHelper.submitEvent(t,[n],{submitOnlyOncePerExpert:n.onlyOnce,expertId:n.exepertId})},t.expertPurchase=function(n){n=n||{};var t={event:"purchase",ecommerce:{purchase:{actionField:{id:n.sessionId,revenue:n.expertFee},products:[{name:(n.expertName||"").toString(),id:(n.exepertId||"").toString(),category:n.categoryUrl||"",price:(n.expertFee||"").toString(),variant:(n.variant||"").toString()}]}},sessionId:n.sessionId};if(n.userType&&(n.userType!=="Guest"||n.userType!=="Member"))switch(n.userType){case"Guest":case"newMemeber":n.GuestsAndNewMembersOrMember="GuestAndNewMembers";break;case"Member":n.GuestsAndNewMembersOrMember="Member"}window.TagManagerHelper.submitEvent(t,[n])},window._currentPageView=window._currentPageView?$.extend(window._currentPageView,t):t}(window._currentPageView),function(n){"use strict";var t={},i={};t.homepageLoaded=function(t){n._expertsGrid.expertsGridEvent({event:"HomePageLoad",userType:window.data.usertype,experts:t})},t.homepagePagination=function(t,r,u){var e,f,o;if((!i[u]||!(i[u].indexOf(r)>=0))&&(i[u]||(i[u]=[]),i[u].push(r),t&&t.length>=1)){for(e=[],f=0;f<t.length;f++)o={CategoryName:t[f].CategoryName||"",ListName:t[f].ListName||"",ExpertID:t[f].ExpertID||0,ItemPosition:t[f].ItemPosition?parseInt(t[f].ItemPosition):-1,ExpertName:t[f].ExpertName||"",NumberOfReviews:t[f].NumberOfReviews||0,ExpertStatus:t[f].ExpertStatus||""},e.push(o);n._expertsGrid.expertsGridEvent({event:"HomepagePagination",userType:window.data.usertype,experts:e})}},t.homepagePaginationOnNavigateBinding=function(n){$(".categoryExpertsGrid .btn-next, .categoryExpertsGrid .btn-prev").click(function(){var i=$(this).attr("refCategoryExpertsContainer");i&&setTimeout(function(){try{var o=$("div[categoryExpertsContainer='"+i+"']"),s=n[i],h=o.find(".slide.active").find("article").find("div[id*=color]"),c=parseInt($($(h)[0]).attr("itemIndex"));if(h&&s.length>0){var r=3,u=o.attr("hidePostRequest")==="0"?2:r,f=c<=u?1:parseInt(c/r)+1,e=0,l=u;f>1&&(e=u+(f-2)*r,l=e+r),t.homepagePagination(s.slice(e,l),f,i)}}catch(a){Logger.Error("Error logging GTM Event: homepagePagination",!0,a)}},1500)})},t.expertsClick=function(t){n._expertsGrid.exertsGridClickEvent(t)},window._currentPageView=window._currentPageView?$.extend(window._currentPageView,t):t}(window._currentPageView),jQuery(function(){initSlideShow(),initSmoothScroll(),initGalleryContent(),$(window).trigger("resize")})