function sendDataLayerEvent(n,t,i){var r={event:n,paramName:i};dataLayer.push(r)}function updateShowTouchBannerCookie(n,t){var i=checkBannerCookie();i===!0&&updateCookieBanner(!1),closeBanner(n,t)}function closeBanner(n,t){n!==null&&typeof n!="undefined"&&(t===1?$("."+n).fadeOut(300):$("."+n).slideToggle())}function updateCookieBanner(n){var t=1/24;Cookies.set("ShowTouchAppBanner",n.toString(),{domain:".kasamba.com",expires:t})}function checkBannerCookie(){var n=Cookies.get("ShowTouchAppBanner");return n!==""||typeof n!="undefined"?n==="true"||n==="True":!1}function categoryNoBorder(){$(".row-item").css("border",""),$(".row-item").find(".row-title").find("a").css("color","#303030")}function checkIfSearch(){var n=getUrlVars().q;n!==undefined&&$("#myExpertsFotter").css("position","absolute")}function checkIfheaderInSale(){var i=$("#MobileDiscount").length!==0,n=$("#DynamicLandingPageHolder"),t=$(".expert-category-bar");i&&n.length!==0?(t.css("margin-top","5%"),n.css("padding-top","2em")):n.length!==0&&t.css("margin-top","5%")}function WrongCluster(){var n=9;$("#CatIDHolder").val()!="off"&&$("#CatIDHolder").val()!=n&&(window.location="/")}function InsertCoupon(n){$("#txtCoupon").keypress(function(n){n.which==13&&$("#ValidateCouponAction").click()}),$("#insert-coupon").click(function(){$("#Coupon-Popup").unbind("popupafterclose");var t=$("#ValidateText"),i=$("#ValidateBotton");$("#txtCoupon").val(""),$("#Coupon-Popup").popup("open"),$("#ValidateText").html(""),$("#errCoupon").hide().html(""),$("#ValidateCouponAction").click(function(){var r,u;if($("#errCoupon").hide().html(""),r=$("#txtCoupon").val(),r==""){$("#errCoupon").show().html("Coupon Code is required"),i.show();return}u=n?"4":"3",t.html("checking coupon.."),$.ajax({type:"GET",url:"/Touch.Services/Marketing.svc/GetCoupon/Id/"+r+"/Type/"+u,dataType:"json",contentType:"application/json; charset=utf-8",success:function(n){n.Valid?($("#Coupon-Popup").popup("close"),$("#Coupon-Popup").bind({popupafterclose:function(){$("#jsSaleNameHolder").show().html(n.Name),$("#jsCoupon-Popup-SaleName").html(n.Name),$("#Valid-Coupon-Popup").popup("open"),setTimeout(function(){$("#Valid-Coupon-Popup").popup("close")},1e3)}})):($("#errCoupon").show().html(n.Name),$("#txtCoupon").val(""),t.html(""),i.show())}})})})}function LoadReviews(n,t){var i=4,r="/Touch.Services/Experts.svc/GetReviews/ExpertID/"+n+"/PageNum/"+t+"/PageSize/"+i;$.mobile.showPageLoadingMsg(),$.ajax({type:"GET",url:r,cache:!0,dataType:"text",complete:function(){$.mobile.hidePageLoadingMsg()},success:function(data){var ReviewDesc="",reviewList="",ReviewsData=eval(data),ReviewsContainer=$("#ReviewsContainer"),countReview=0;ReviewsData.length>0?($.each(ReviewsData,function(n){countReview++,ReviewsData[n].RatingDesc.length>0&&(ReviewDesc="''"+ReviewsData[n].RatingDesc+"''"),reviewList+=typeof isReviewsTestGroup!="undefined"&&isReviewsTestGroup()?"<div class='review-item-B'><div class='review-item-first-B'><div style='display: inline-block; padding-bottom: 8px;'><div class='name'>"+ReviewsData[n].MemberName+"<\/div><br><div class='rate'><span class='rating_reviews rating_stars_"+ReviewsData[n].Rating+"' style='margin-left: 0px'><\/span><\/div><\/div><div class='date' style='line-height: 15px; color: #303030'>"+ReviewsData[n].Date.replace(/(\s\d+$)/,",$1")+" <\/div><\/div><div class='review-item-second'><div class='review' style='font-size: 15px; color: #303030'>"+ReviewDesc+"<\/div><\/div><\/div><br><hr />":"<div class='review-item'><div class=review-item-first><div class='name'>"+ReviewsData[n].MemberName+"<\/div><div class='rate'><span class='rating_reviews rating_stars_"+ReviewsData[n].Rating+"'><\/span><\/div><div class='date'>"+ReviewsData[n].Date+" <\/div><\/div><br><div class='review-item-second'><div class='review'>"+ReviewDesc+"<\/div><\/div><\/div><br><hr />"}),ReviewsContainer.append(reviewList),i<=countReview&&$("#ShowMoreReviews").show(),countReview>0&&$("#reviewsIcon").show()):$(".reviews").hide()}})}function detectOrientationQuickPayment(){var n,t=screen.width+"px";clearTimeout(n),n=setTimeout(function(){$("#DemoPage").css("width",""),device_width=$(window).width()},500),$("#QuickPaymentPage").css("width",device_width)}function HandleResults(n,t,i){n<t&&$("#aMoreExperts").hide(),n==0&&i==1&&$("#notFoundData").show()}function getUserCurrencyFromCookie(){var n=getCookie("UserCurrency");return n===""?0:parseInt(n)}function getCookie(n){for(var r=n+"=",f=decodeURIComponent(document.cookie),u=f.split(";"),t,i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return""}function SetSelectCardMessage(n,t){var r=$("select[id*=ddlCreditCard]").find("option:selected").attr("is-prepaid")=="true",i=t.split(" "),u=("<span class='lastDigitsWrap'><label>xx<\/label><label>"+i[1]+"<\/label><\/span>").replace("#",""),f="<span class='creditTypeIcon' cardType='"+i[0]+"' "+(r?"isPrepaid='1'":"")+">"+i[0]+"<br/>"+u+"<\/span>",s="<span>"+i[2]+"<\/span>",h="<span>"+i[3]+"<\/span>",e="<a id='aChangePaymentMethod'>Change<\/a>",o="<div class='sessionPaymentDetails'><div class='textSubTitleB'>This session will use:<\/div><div class='paymentDetails'><div class='creditUsed'>"+f+"<\/div><div class='changeCredit'>"+e+"<\/div><\/div><\/div>";n.html(o)}function SetRefillCardMessage(n,t){var i=t.split(" "),r=("<span class='lastDigitsWrap'><label>xx<\/label><label>"+i[1]+"<\/label><\/span>").replace("#",""),u="<span class='creditTypeIcon' cardType='"+i[0]+"'><span class='creditCardText'>"+i[0]+"<br/>"+r+"<\/span>",f="<div class='sessionPaymentDetails'><div class='paymentDetails'><div class='creditUsed'>"+u+"<\/div><\/div><\/div>";n.html(f)}function BuildCategoryURL(n,t,i,r,u,f,e){var s=getUrlVarNotCaseSevsetive("SortBy"),h=getUrlVarNotCaseSevsetive("HideBusy"),o;return typeof e=="undefined"&&(e=!1),o=jQuery.trim(s)!=""&&e!==!0?s:typeof u!="undefined"?u:0,jQuery.trim(h)!=""&&e!==!0?f=h:typeof f=="undefined"&&(f="true"),"/Touch.Services/Experts.svc/GetExpertsCategoryBySiteID/CategoryID/"+n+"/SortByID/"+o+"/PageNum/"+t+"/PageSize/"+i+"/HideBusyExperts/"+f+"/UserCurrencyCode/"+r}function BuildFavoritesURL(n,t,i){return"/Touch.Services/Experts.svc/MyExpertsByClusterId/Cluster/1119/SortByID/7/PageNum/"+n+"/PageSize/"+t+"/UserCurrencyCode/"+i}function BuildSearchURL(n,t,i){return"/Touch.Services/Search.svc/SearchExperts?searchText="+n+"&pageNumber="+t+"&userCurrencyCode="+i}function LoadCountries(){$.ajax({type:"GET",url:"/Touch.Services/Data/CountriesAndstates.svc/Countries",cache:!0,dataType:"text",success:function(data){var optionList="",CountriesData=eval(data),CountriesSelect=$("select[id*=ddlCountry]");optionList='<option value="">Select Country<\/option>',$.each(CountriesData,function(n){optionList+='<option value="'+CountriesData[n].ID+'">'+CountriesData[n].Name+"<\/option>"}),CountriesSelect.html(optionList),CountriesSelect.selectmenu("refresh",!0)}})}function LoadStates(){$.ajax({type:"GET",url:"/Touch.Services/Data/CountriesAndstates.svc/States",cache:!0,dataType:"text",success:function(data){var StatesData=eval(data);arrStates=JSON.parse(data)}})}function BuildStateSelect(n){var r=!1,u=$("select[id*=ddlState]"),e=$(n).find("option:selected").text(),f=$(n).find("option:selected").val(),t="";for(t='<option value="">Select State<\/option>',i=0;i<arrStates.length;i++)arrStates[i].CountryID==f&&(r=!0,t+='<option value="'+arrStates[i].ID+'">'+arrStates[i].Name+"<\/option>");r?(u.html(t),u.selectmenu("refresh",!0),$("#divStateHolder").show()):($("select[id*=ddlState] option:gt(0)").remove(),$("#divStateHolder").hide())}function LoadCountriesandStateCall(){LoadCountries(),LoadStates()}function CountriesStateBehavior(){var t=$("select[id*=ddlCountry]"),n;t.live("change",function(){var t=$(this).find("option:selected").text(),i=$(this).find("option:selected").val();$("input:text[id*=txtHiddenCountry]").val(i+"~"+t),$("div[id*=divErrState]").hide(),BuildStateSelect(this)}),n=$("select[id*=ddlState]"),n.live("change",function(){var t=$("select[id*=ddlState] option:selected").text(),i=$("select[id*=ddlState] option:selected").val();$("input:text[id*=txtHiddenState]").val(i+"~"+t)})}function SmartBlock(n){$("#call-in-process").hide(),$("#session-graphics").hide(),$("#expert-unavailable").show(),$("#URLHolder").show(),clearInterval(n)}function LoadExperts(n,t,i){var e=!1,u=getUrlVarNotCaseSevsetive("NumMyExperts"),r=getUrlVarNotCaseSevsetive("q"),s;u!=""&&(e=!0),s=$('[data-role="page"]').width(),$.mobile.showPageLoadingMsg();var h=getUrlVarNotCaseSevsetive("CatID"),f=0,o={totalAdvisors:function(){var n=parseInt(u);return isNaN(n)?0:n}(),availableAdvisors:0};$.ajax({contentType:"application/json; charset=utf-8",type:"GET",url:t,cache:!1,dataType:"json",error:function(n){$.mobile.hidePageLoadingMsg(),console.error(n.responseText)},beforeSend:function(){},complete:function(){$.mobile.hidePageLoadingMsg()},success:function(data){var Experts,noSearchHtml,htmlData,testDlpID;if(n==ServiceTypeEnum.Search)if(data!==null&&typeof data!==undefined)Experts=eval(data.ItemsList),TrackSearchResultEvent(Experts,r);else{TrackSearchResultEvent(null,r),r.length<=0&&(r="Your Search"),noSearchHtml="<div id='dvNoResults'  class='no-search-results'>",noSearchHtml+="<div class='no-results-img-holder'>",noSearchHtml+="<span class='no-search-results-icon'><\/span>",noSearchHtml+="<\/div>",noSearchHtml+="<div class='no-results-text center'>",noSearchHtml+="<h4>No results found<\/h4>",noSearchHtml+="We couldn't find anything for<br />",noSearchHtml+="<div class='search-param'>"+decodeURIComponent(r)+".<\/div>",noSearchHtml+="<br />",noSearchHtml+="Try browsing our categories.",noSearchHtml+="<\/div>",noSearchHtml+="<a title='Browse other experts' href='/' class='link-button browse-cat' data-role='none'>Browse Categories",noSearchHtml+="<\/a>",noSearchHtml+="<\/div>",$("#expertsList").append(noSearchHtml);return}else Experts=eval(data.ItemsList);htmlData="",$.each(Experts,function(n,t){if(typeof t!="undefined"){var i=GetSessionSelectorUrl(t.MemberID,t.FullName,SessionTypeEnum.voice),r=GetSessionSelectorUrl(t.MemberID,t.FullName,SessionTypeEnum.chat);ExpertData.profileIDs+=t.MemberID+",",ExpertData.experts[t.MemberID]={id:t.MemberID,urls:{voiceUrl:i,chatUrl:r},Status:t.Status},f++,n<u&&(t.Status==1||t.Status==4||t.Status==5)&&++o.availableAdvisors,ShowHeaderIsOn==!1&&e&&n==u&&(ShowHeaderIsOn=!0,htmlData+='<div class="SuggestedPsychicHeader">Suggested Psychics<\/div>'),htmlData+='<div data-role="collapsible"  id="row-'+f+'" class="expertlist-noicon expertItem advisor-profile-container" data-collapsed="true">',htmlData+="<h1>",htmlData+=createExpertBlock(t),htmlData+='<div class="statusButtons" id="expert-statuses-'+t.MemberID.toString()+'">',htmlData+=createButtons(ExpertData.experts[t.MemberID]),htmlData+="<\/div>",htmlData+='<table style="width:100%">',typeof t.ConsultWithClient!="undefined"&&t.ConsultWithClient==!0&&(htmlData+='<tr><td colspan="2">',htmlData+=t.Status==0||t.Status==2?'<div class="sendMessageButton" fullname="'+t.FullName+'" memberid ="'+t.MemberID+'">':'<div class="sendMessageButton hide" fullname="'+t.FullName+'" memberid ="'+t.MemberID+'">',htmlData+='<a style="font-weight:normal; color:#5f5771; text-shadow:none;" >Or Send the Advisor a Message<\/a><\/div><\/td><\/tr>'),htmlData+="<\/table>",htmlData+="<\/h1>",htmlData+='<div><table class="table-description"><tr><td><div class="profile-name">Profile info<\/div><div class="description">'+t.Description+"<\/div><\/td><\/tr><\/table><\/div>",htmlData+='<div id="optins">',htmlData+='<table width="100%" style="text-align:center"><tr>',htmlData+='<td align="left"><a id="seeProfile" class="link-profile" onclick="ViewProfile('+t.MemberID+')"  href="#">View full profile<\/a><\/td>',htmlData+="<\/td><\/tr><\/table><\/div>",htmlData+="<\/div>"}}),$("#expertsList").append(htmlData).trigger("create"),$(".statusButtons .ui-btn").click(function(n){n.stopPropagation()}),$("#expertsList").children(".ui-collapsible").each(function(){var n=$(this).attr("id"),t=!1;$("#"+n+" table tr>td:nth-child(3) a").click(function(n){n.stopPropagation(),window.location=$(this).attr("href")})}),$("#expertsList .ui-collapsible-heading").click(function(){if($(this).hasClass("ui-collapsible-heading-collapsed"))$(this).find(".ui-collapsible-heading-toggle").css("border-bottom","");else{$(this).find(".ui-collapsible-heading-toggle").css("border-bottom","none");var n={event:"CategoryPageExpertClick"};dataLayer.push(n)}}),$("a[id*=seeProfile]").click(function(){var n={event:"CategoryPageExpertProfileClick"};dataLayer.push(n)}),$("a[id*=btnChatExpert]").click(function(n){var r=document.URL.indexOf("CatID="),t,i;r>=0&&(t={event:"CategoryPageChatClick"},dataLayer.push(t)),undefined!==funneltracking&&(i=new LP.services.FunnelTrackingService.FunnelTrackingEvent(LP.services.FunnelTrackingService.EventType.RegistrationStart,{categoryId:getUrlVarNotCaseSevsetive("CatID"),sessionType:LP.services.FunnelTrackingService.SessionType.Chat,expertId:getVarNotCaseSensetiveFrom("ExpID",n.originalEvent.currentTarget.search),context:"startSession"}),funneltracking.setTrackInfo(i))}),$("a[id*=btnCallExpert]").click(function(n){var t,i;document.URL.indexOf("CatID=")>=0&&(t={event:"CategoryPageCallClick"},dataLayer.push(t)),undefined!==funneltracking&&(i=new LP.services.FunnelTrackingService.FunnelTrackingEvent(LP.services.FunnelTrackingService.EventType.RegistrationStart,{categoryId:getUrlVarNotCaseSevsetive("CatID"),sessionType:LP.services.FunnelTrackingService.SessionType.Voice,expertId:getVarNotCaseSensetiveFrom("ExpID",n.currentTarget.search),context:"startSession"}),funneltracking.setTrackInfo(i))}),$("#expertsList .sendMessageButton").click(function(n){n.stopPropagation(),n.preventDefault();var t=$(this).attr("fullname"),i=$(this).attr("memberid");ComposeMessageModule.show({destinationUserName:t,destinationUserId:i})}),$("a.advisor-3fm").click(show3fmHelp),testDlpID=getUrlVarNotCaseSevsetive("DLPID"),testDlpID!=null&&testDlpID==15899&&$(".expertlist-perMinute").css({display:"none"}),$("#aMoreExperts").show(),getUrlVarNotCaseSevsetive("CatID")===""&&getUrlVarNotCaseSevsetive("q")===""?$("#category-description-content").hide():$("#category-description-content").show(),$("#myExpertsFotter").show(),i(f,o),$.mobile.hidePageLoadingMsg()}}),setInterval(function(){updateStatuses(setMyExpertsButtons)},15e3)}function TrackSearchResultEvent(n,t){var i={},r="";n!=null&&jQuery.each(n,function(n,t){n>0&&(r+=","),r+="{"+t.MemberID+","+t.StatusText+","+ ++n+"}"}),i.SearchString=t,i.ListOfAdvisors=r,i.ResultMethod="list",i.siteId=typeof WebSettings!="undefined"&&WebSettings.getApplication?WebSettings.getApplication().siteId:"5",Cookies&&(i.GuestId=Cookies.get("TrackingGuestId")),(new LP.services.TrackingEventsService).trackEventByName(50,"SearchResults",i)}function show3fmHelp(n){n.stopPropagation(),n.preventDefault();var t=$(".free-minutes-popup");t.removeClass("hide")}function hide3fmHelp(n){n.stopPropagation(),n.preventDefault();var t=$(".free-minutes-popup");t.addClass("hide")}function updateStatuses(n){var t="/touch.services/ajax/ExpertsStatusesService.svc/ExpertsStatuses";$.ajax({type:"POST",url:t,data:JSON.stringify(ExpertData.profileIDs),dataType:"json",contentType:"application/json; charset=utf-8",success:function(t){t.length>=1&&n(t)}})}function setMyExpertsButtons(n){$.each(n,function(n,t){ExpertData.experts[t.ID].Status=t.ST,$("#expert-statuses-"+t.ID).empty().append(createButtons(ExpertData.experts[t.ID])).trigger("create"),$(".statusButtons .ui-btn").click(function(n){n.stopPropagation()}),updateSendMessageButtonStatus(n,t)})}function updateSendMessageButtonStatus(n,t){var r=t.ST===0||t.ST===2,i=$("#expert-statuses-"+t.ID).closest(".expertItem").find(".sendMessageButton");r?i.removeClass("hide"):i.addClass("hide")}function createExpertBlock(n){var t=n.RatersNumber==0&&n.Rating==0,i='<div class="expert-profile-image"><img class="has-loader" src="//expertsimages.kassrv.com/experts-pictures/small/pic'+n.MemberID+'.jpg" onerror = "this.onload=null;this.src=\'//expertsimages.kassrv.com/experts-pictures/small/pic0.jpg\'" /><\/div>',r='<div class="advisor-name">'+truncateText(n.FullName,parseInt($.mobile.ExpertNameMaxLength))+"<\/div>",u=typeof n.RatersNumber=="number"?n.RatersNumber.toLocaleString("en"):n.RatersNumber,f='<div class="advisor-stat">'+(t?'<span class="new-advisor-img"><\/span>':'<span class="image-star mar-star"><\/span> '+n.Rating.toFixed(2)+' <span class="image-review mar-review"><\/span> '+u)+"<\/div>",e=n.HasExpertPromotion||n.HasPercentSale&&isOnlineSale(n.SaleChannel),o='<div class="advisor-rate">'+(e?'<span class="large-font">'+n.UserCurrencySymbol.trim()+n.OnlineFeeAfterSale.toFixed(2)+'<\/span> <span class="advisor-discount">'+n.UserCurrencySymbol.trim()+n.OnlineFeePerMinute.toFixed(2)+'<\/span> <span class="minutes-sign">/&nbsp;minute<\/span>':'<span class="large-font">'+n.UserCurrencySymbol.trim()+n.OnlineFeePerMinute.toFixed(2)+'<\/span> <span class="minutes-sign" style="text-align: center">/&nbsp;minute<\/span>')+"<\/div>",s=n.HasFreeMinutes,h=s?'<a class="advisor-3fm" href="javascript:;"><img src="//siteimages.kassrv.com/images/touch/icons/icon-has-3fm.svg" /><span>3 Free Minutes<\/span><\/a>':"";return'<div id="short-details-container" class="short-details-container">'+i+'<div class="expert-profile-details">'+r+f+'<div class="advisor-rate-3fm">'+o+h+"<\/div><\/div><\/div>"}function createButtons(n){var t="",r,e;if(typeof n!="undefined"){var u=n.Status==5||n.Status==4,f=n.Status==1||n.Status==4,i=n.Status==2;u&&f?(t+='<div id="voiceAndChatButtons"><div class="expert-buttons-container">',t+='<a id="btnCallExpert" onclick="callNowButtonClicked()" rel="nofollow" data-inline="true" href="'+n.urls.voiceUrl+'"  data-role="button" data-corners="true" data-theme="costume-c" class="light-btn btn-shadow left-status-btn" id="callButton">Call now<\/a>',t+='<a id="btnChatExpert" onclick="chatNowButtonClicked()" rel="nofollow" data-inline="true" href="'+n.urls.chatUrl+'"   data-role="button"  data-corners="false" data-theme="costume-a" class="chat-btn btn-shadow right-status-btn" id="chatButton">Chat now<\/a>',t+="<\/div><\/div>"):f?t+='<div class="expert-buttons-container"><a id="btnChatExpert" onclick="chatNowButtonClicked()" rel="nofollow" class="large-button chat-btn btn-shadow single-status-btn"  href="'+n.urls.chatUrl+'"   data-role="button"  data-corners="false" data-theme="costume-a" >Chat now<\/a><\/div>':u?t+='<div class="expert-buttons-container"><a id="btnCallExpert" onclick="callNowButtonClicked()" rel="nofollow" class="large-button light-btn btn-shadow single-status-btn"  href="'+n.urls.voiceUrl+'"  data-role="button" data-corners="false"  data-theme="costume-c" >Call now<\/a><\/div>':(t+='<div class="offlineMessage">',NotifyVariables.notifyFeatureIsTurnedOn==="True"?NotifyVariables.ifClientLoggedIn==="True"?(r=IfExpertAlreadyExistInNotifyList(n.id.toString()),r>-1?(e=GetClientPhoneNumberByIndex(r),i&&(t+='<div class="in-a-reading-text"><span class="in-a-reading"><\/span>In a reading<\/div>'),t+='<div class="expert-buttons-container"><a href="#;" rel="nofollow" class="btnNotifyMeWhenAvailableCategoryDisabled single-status-btn" id="btnRemoveNotification'+n.id.toString()+'" data-role="button" onclick="btnRemoveNotificationOnClick('+n.id+'); return false;" data-theme="costume-b" data-corners="false" data-inline="true"><span class="ui-btn-notify"><\/span>You will be notified<\/a><\/div><div class="ExpertNotificationNumberLineDiv"><span class="ExpertNotificationNumberLine" id="ExpertNotificationNumberLineText'+n.id.toString()+'">You will receive an SMS at '+e+"<\/span><\/div><\/div>"):(i&&(t+='<div class="in-a-reading-text"><span class="in-a-reading"><\/span>In a reading<\/div>'),t+='<div class="expert-buttons-container"><a href="#;" rel="nofollow" class="btnNotifyMeWhenAvailableCategory single-status-btn" id="expert'+n.id.toString()+'NotifyButton" onclick="btnNotifyMeWhenAvailableCategoryOnClick('+n.id+', this.id); return false;" data-role="button" data-theme="costume-b" data-corners="false" data-inline="true">Notify me when available<\/a><\/div><div id="ExpertNotificationNumberLineDivHidden'+n.id.toString()+'" class="ExpertNotificationNumberLineDivHiddenClass"><span class="ExpertNotificationNumberLine"><\/span><\/div><\/div>')):(i&&(t+='<div class="in-a-reading-text"><span class="in-a-reading"><\/span>In a reading<\/div>'),t+='<div class="expert-buttons-container"><a href="#;" rel="nofollow" class="btnNotifyMeWhenAvailableCategory single-status-btn" onclick="btnNotifyMeWhenAvailableCategoryOnClickGuest('+n.id.toString()+');" data-role="button" data-theme="costume-b" data-corners="false" data-inline="true">Notify me when available<\/a><\/div><\/div>'):t+="Advisor is offline.<\/br><b>Try contacting other advisors.<\/b><\/div>")}return t}function isOnlineSale(n){var t=!1,i;return n&&(i=new RegExp("Voice|Chat"),t=i.test(n)),t}function GetSessionSelectorUrl(n,t,i){var r=getUrlVarNotCaseSevsetive("CatID"),u="",f;return r!=""&&(u="&CatID="+r),f=SessionTypeEnum.voice==i?"&isPhone=True":"","/pages/session-selector.aspx?ExpID="+n+"&ExpName="+t+f+u}function ViewProfile(n){var t=getUrlVarNotCaseSevsetive("CatID"),i="";t!=""&&(i="&CatID="+t),window.location="/pages/AdvisorProfile.aspx?ExpID="+n+i}function ExpertStatus(n,t,i){var r="/touch.services/ajax/ExpertsStatusesService.svc/ExpertsStatuses";$.ajax({type:"POST",url:r,data:JSON.stringify(t),dataType:"json",contentType:"application/json; charset=utf-8",cache:!1,error:function(n){alert("server error please try again in few minutes"),console.error(n.responseText)},success:function(t){var u=t[0].ID,r=t[0].ST;!i&&r==1||i&&r==5||r==4?n(!0):n(!1)}})}function StartVoiceSession(n,t,i,r){$.mobile.showPageLoadingMsg();var u="/Touch.Services/PhoneValidationService.svc/CanStartOnlineSession";$.ajax({type:"GET",url:u,cache:!1,dataType:"text",error:function(n){$.mobile.hidePageLoadingMsg(),console.error(n.responseText)},success:function(data){var json,verificationRequired,iframe_width,url,helpPageItem,QS;$.mobile.hidePageLoadingMsg(),json=jQuery.parseJSON(data),json.d==!0?(verificationRequired=VoicePinCodeVerificationRequired&&!IsPhoneVerifiedOnPhoneList(t,i,verifiedNumbers),verificationRequired?(iframe_width=$('[data-role="page"]').width()*.85,url="VoiceVerification.aspx"+window.location.search+"&countryCode="+t+"&phone="+i+"&Ccid="+n+"&originalPhone="+r,$("#VerificationIframe")[0].setAttribute("width",iframe_width+"px"),$("#VerificationIframe").get(0).contentWindow.location.href=url,$("#VoiceVerificationPopUp").popup("open")):eval($("a[id*=lbCallExpert]").attr("href"))):(helpPageItem=$("#ErrorPageInsidePopUp").val(),QS=getUrlVars().QS,QS!=undefined&&(helpPageItem+="?QS="+QS),$("#ankorReConnect").attr("href",helpPageItem),location.href=helpPageItem)}})}function StartChatSession(){setTimeout(function(){eval($("a[id*=lbCallExpert]").attr("href"))},50)}function PhoneValidationHolder(){VerificationSessionEnd=="True"?($("#verifyingMessage").hide(),$("#failedMessage").hide(),parent.window.location=LoginPage):VerificationSessionEnd=="False"&&setTimeout(function(){timerPhoneValidation=window.setInterval(PhoneValidation,3e3)},3e3)}function PhoneValidation(){var n=VerificationCountryCode.toString()+""+VerificationPhoneNumber.toString(),t="/Touch.Services/PhoneValidationService.svc/GetVerificationStatus?phoneNumber="+n;$.ajax({type:"GET",url:t,cache:!1,dataType:"text",error:function(n){console.error(n.responseText)},success:function(n){var t=jQuery.parseJSON(n);switch(t.d){case 1:break;case 2:window.clearInterval(timerPhoneValidation),parent.window.location=VerificationExpertVerification=="expert"?parent.window.location:VerificationVoiceSessionUrl;break;default:$("#verifyingMessage").hide(),$("#failedMessage").show(),window.clearInterval(timerPhoneValidation)}}})}function OpenExpertsPage(n,t){document.location="/pages/MyExperts.aspx?CatID="+n+"&CatName="+t}function isValidUSphoneNumber(n){var t=/^\(?([2-9][0-8][0-9])\)?[-. ]?([2-9][0-9]{2})[-. ]?([0-9]{4})$/;return t.test(n)}function IsPhoneVerifiedOnPhoneList(n,t,i){for(verifiedNumberIndex in i){var r=i[verifiedNumberIndex];if(t==r.Number&&n==r.CountryCode&&r.IsVerified)return!0}return!1}function supports_html5_storage(){try{return"localStorage"in window&&window.localStorage!==null}catch(n){return!1}}function getUrlVars(){for(var i=[],n,r=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),t=0;t<r.length;t++)n=r[t].split("="),i.push(n[0]),i[n[0]]=n[1];return i}function getVarNotCaseSensetiveFrom(n,t){var i=new RegExp("[\\?&]"+n+"=([^&#]*)","i").exec(t);return i?i[1]||"":""}function getUrlVarNotCaseSevsetive(n){return getVarNotCaseSensetiveFrom(n,window.location.href)}function hasWhiteSpace(n){return n.indexOf(" ")>=0}function doFunnelTrack(n,t){n&&t&&funneltracking&&funneltracking.track(new LP.services.FunnelTrackingService.FunnelTrackingEvent(n,t))}function FireTrackingPixel(){var n=2;sessionStatus==2&&RenderPixelTrackingPurchase(sessionData.memberID,sessionData.expertID,sessionData.sessionID,sessionData.categoryID,n)}function isDateExpired(n,t){var i=!1,f="20"+n,e=t,r=new Date,u;return r.setFullYear(f,e,1),u=new Date,r<u&&(i=!0),i}function isPositiveInteger(n){return n>>>0===parseFloat(n)}function isEmptyElement(n,t,i){var u=!0,f=!0,e=$("input[id*="+n+"]"),o=$.trim($(e).val()),r=$("div[id*="+t+"]");return i&&(f=new RegExp(/^\d+$/).test(o)),o.length!==0&&f?r.hide():(r.show(),u=!1),updateImputValidation(e,r),u}function isValidPhoneNumber(n,t,i){var r=!0,u=$.trim($("input[id*="+n+"]").val()),f=$("div[id*="+i+"]"),e=$("input:text[id*="+t+"]");return new RegExp(/^\d{6,15}$/).test(u)?e.val(u):r=!1,i!=null&&(r?f.hide():(f.show(),r=!1)),r}function openHelpPopUp(n){var t="/pages/help.aspx?ContentId="+n;window.location=t}function truncateText(n,t){var i=jQuery.trim(n).substring(0,t);return n.length>t&&(i+="..."),i}function zipValidForCountry(){var i,t,n,r;if(typeof _enbaleZipCountryValidtion=="undefined"||_enbaleZipCountryValidtion==null||_enbaleZipCountryValidtion==!1)return!0;i=$("select[id*=ddlCountry] option:selected").text(),t=$("input[id*=txtboxZipCode]").val();switch(i){case"United States of America":n=/^\d{9}$|^\d{5}$|(^\d{5}-\d{4}$)|(^\d{5}[ ]\d{4}$)/g;break;case"Canada":n=/^[A-z]{1}\d{1}[A-z]{1}([ ]|-)?\d{1}[A-z]{1}\d{1}$/g;break;case"United Kingdom":n=/^.{0,5}([ ]|-)?\d{1}[A-z]{2}$/g;break;case"Australia":n=/^\d{4}$/g;break;default:n=/^.{0,11}$/g}return r=t.match(n)==null||!1?!1:!0,r?$("div[id*=divErrZip]").hide():$("div[id*=divErrZip]").show(),t.match(n)==null||!1?!1:!0}function CheckMigration(){}function btnNotifyMeWhenAvailableCategoryOnClick(n,t){var i=getUrlVarNotCaseSevsetive("CatID");i||(i=defaultSpiritualityCategoryId),FireAnalyticsEventOnNotifyClick(),OnClickNotifyMeWhenAvailable(n,i,!0,!0,t)}function btnRemoveNotificationOnClick(n){RemoveNotification_clicked(n)}function IfExpertAlreadyExistInNotifyList(n){return indexOfHelper.call(NotifyVariables.expertIdsClientAskedToBeNotified,parseInt(n))}function GetClientPhoneNumberByIndex(n){return NotifyVariables.clientPhonesAskedToBeNotified[n]}function btnNotifyMeWhenAvailableCategoryOnClickGuest(n){var t="/pages/AdvisorProfile.aspx?ExpID="+n,i=t+"&expertForNotify="+n;RedirectWithReturnUrl(i)}function RedirectWithReturnUrl(n){var t=encodeURIComponent(n),i="https://touch.kasamba.com/pages/sign-in.aspx?&f=1&returnUrl="+t;window.location.href=i}function updateImputValidation(n,t){$(t).is(":visible")?$(n).addClass("invalid-input"):$(n).removeClass("invalid-input")}function preLoadLoadingImage(){preDownloadLoadingImg=new Image,preDownloadLoadingImg.src=window.location.origin+"/img/icons/load.svg"}function SalesPresenter(){var o=$(".sale-percentage-clarity"),s=$(".sale-minutes-clarity"),h=$(".sale-percentage-value"),c=$(".sale-minutes-value"),l=$(".sale-applied-simple"),n=$(".sale-simple-value"),t=$("#expertPromotion"),i=$("#expertPromotionPercent"),r=$("#expertPromotionFixedFee"),u=$("#expertPromotionAndSale"),f=$(".payment-method-clarity"),e=$(".payment-method-sale-clarity"),a=$(".payment-method-available-minutes"),v=$(".payment-method-paid-minutes"),y=$(".payment-method-value"),p=$("#pBalance"),w=$(".pCreditCards"),b=function(){return LP&&LP.services&&LP.services.SalesContextService&&window.saleRequestData},k=function(n){n.value>0&&(h.text(n.value),o.removeClass("hidden")),n.paidMinutes>0&&(c.text(n.paidMinutes),s.removeClass("hidden"))},d=function(t){t.value>0&&(n.text(t.value),l.removeClass("hidden"),n.removeClass("hidden"))},g=function(n){var f,e;n.expertPromotion&&typeof expertFee!="undefined"&&(f=parseFloat(expertFee.substring(1)),n.expertPromotion.discount_type===0?(n.value&&n.value>0&&u.show(),$("#jsSaleNameHolder").removeClass("hidden"),t.show(),i.text(n.expertPromotion.percentage_discount_amount+"% Off"),i.show()):n.expertPromotion.fixed_fee_amount<f&&(n.value&&n.value>0&&u.show(),$("#jsSaleNameHolder").removeClass("hidden"),e=(Math.round(n.expertPromotion.fixed_fee_amount*100)/100).toFixed(2),t.show(),r.text("$"+e+" / minute"),r.show()))},nt=function(n){(f.length||e.length)&&n.balance>0&&n.availableMinutes>0&&(y.text(n.balance.toFixed(2)),n.type?(v.text(n.availableMinutes),e.removeClass("hidden")):(a.text(n.availableMinutes),f.removeClass("hidden")),p.removeClass("hidden"),w.removeClass("credit-cards-block-only"))},tt=function(n){if(n){switch(n.type){case"PercentReduction":k(n);break;case"AddToBalance":case"SimpleReduction":d(n)}g(n),nt(n)}};this.ensureSalesClarity=function(){if(b()){var n=new LP.services.SalesContextService,t=n.createGetSalesClarityRequest(window.saleRequestData.categoryId,window.saleRequestData.expertId,window.saleRequestData.saleId,!_isVoice);n.getSalesClarity({success:tt},t)}}}function SubmitPreSession(){if(Page_ClientValidate("quick_payment")){$("#SubmitSection").hide(),$("#processing_your_request").show();var n=UpdateCreditCard();n?(dataLayer.push({event:"billing-information-addition-submit"}),$("#PersonalDetailsSuccessMessage").popup("open"),setTimeout(function(){$("#PersonalDetailsSuccessMessage").popup("close");var n=$("select[id*=ddlCreditCard] option:selected").val(),t=$.trim($("#PreVoicePage span[id*=lblAreaCode]").html()),i=$.trim($("#PreVoicePage input[id*=txtPrePhoneNumber]").val()),r=$.trim($("#PreVoicePage input:text[id*=txtPreNumberHidden]").val());_isVoice?StartVoiceSession(n,t,r,i):StartChatSession()},2e3)):($("#SubmitSection").show(),$("#processing_your_request").hide(),$("#PersonalDetailsRequiredErrorMessage").popup("open"))}}function UpdateCreditCard(){$.mobile.showPageLoadingMsg();var n={},t=GetInputVal("txtboxCardHolder"),i=t.lastIndexOf(" ");n.LastName=t.substring(i+1),n.FirstName=t.substring(0,i),n.CCid=$("select[id*=ddlCreditCard] option:selected").val(),n.Address=GetInputVal("txtboxStreetAddress")+" "+GetInputVal("txtboxStreetAddress2"),n.City=GetInputVal("txtboxCity"),n.Zip=$(".jsZipTelType").val(),n.Country=$("select[id*=ddlCountry] option:selected").text(),n.State=$("select[id*=ddlState] option:selected").text(),n.Phone=GetInputVal("txtboxPhoneHidden"),n.DayTimePhone="";var u={ccDetailsUpdated:n},f="/Touch.Services/SessionDetailsProvider.svc/UpdateCreditCardDetails",r=!1;return $.ajax({type:"POST",url:f,async:!1,cache:!1,data:JSON.stringify(u),dataType:"json",contentType:"application/json; charset=utf-8",beforeSend:function(){},success:function(n){n.d==!0&&(r=!0)},error:function(n){$.mobile.hidePageLoadingMsg(),console.error(n.responseText)},complete:function(){$.mobile.hidePageLoadingMsg()}}),r}function PersonalDetailsRequired(n){if(!n)return!1;$.mobile.showPageLoadingMsg();var i="/Touch.Services/SessionDetailsProvider.svc/CCOwnerDetailsRequired?ccid="+n,t=!1;return $.ajax({type:"GET",url:i,async:!1,cache:!1,dataType:"json",contentType:"application/json; charset=utf-8",beforeSend:function(){},success:function(n){$.mobile.hidePageLoadingMsg(),n.d==!0&&(t=!0)},error:function(){$.mobile.hidePageLoadingMsg()}}),t}function GetInputVal(n){if($("input:text[id*="+n+"]").length!=!1)return $("input:text[id*="+n+"]").val()}function OnClickNotifyMeWhenAvailable(n,t,i,r,u){$(window).data(GetNotifyMeFlowRunningString(n))||($(window).data(GetNotifyMeFlowRunningString(n),!0),IsExpertAvailableCheck(n,t,i,r,u))}function ValidateForm(){var n=!0,t=/^\d{6,15}$/;return $("#_lblAlert").text(""),$("#_txtPhone").val()!=""&&$("#_txtPhone").val().match(t)?$("#_txtPhone").css("border","1px solid black"):($("#_lblAlert").text("Please enter a valid number that has 6 to 15 digits."),$("#_txtPhone").css("border","1px solid red"),n=!1),$("#_chkApproveSms").prop("checked")||($("#_lblAlert").text($("#_lblAlert").text()+" Please approve receiving SMS messages"),n=!1),n?($("#_btnApproveNotifyMeWhenAvailable").prop("disabled",!1),$("#_btnApproveNotifyMeWhenAvailable").addClass("ui-btn-up-costume-b"),$("#_btnApproveNotifyMeWhenAvailable").css("color","#5f5771"),$("#_lblAlert").hide()):($("#_btnApproveNotifyMeWhenAvailable").prop("disabled",!0),$("#_btnApproveNotifyMeWhenAvailable").removeClass("ui-btn-up-costume-b"),$("#_btnApproveNotifyMeWhenAvailable").css("color","grey"),$("#pCountryAreaCode").hide(),$("#_lblAlert").show()),n}function SubmitNotifyMeWhenAvailableData(n,t,i,r,u,f,e){var o=4,s;(i&&!r&&(o=1),!i&&r&&(o=5),i||r)&&(s="/Touch.Services/NotifyMeWhenAvailable.svc/Send/ExpertId/"+n+"/CategoryId/"+t+"/CountryCode/"+f+"/Phone/"+e+"/AvailableStatus/"+o,NotifyMeObject.RestartIntervalLoadPhoneSubscription(),$.ajax({type:"GET",url:s,cache:!1,dataType:"text",error:function(){RemoveMultipleFlowsFlag(n)},success:function(){var i=parseInt(n),r=indexOfHelper.call(NotifyVariables.expertIdsClientAskedToBeNotified,i);r<0&&NotifyVariables.expertIdsClientAskedToBeNotified.push(i),NotifyVariables.clientPhonesAskedToBeNotified.push(f.toString()+"-"+e),$("#"+u).replaceWith('<a href="#;" class="btnNotifyMeWhenAvailableCategoryDisabled ui-btn ui-shadow ui-btn-inline ui-btn-up-costume-b" id="btnRemoveNotification'+n.toString()+'" data-role="button" onclick="btnRemoveNotificationOnClick('+n.toString()+'); return false;" data-theme="costume-b" data-corners="false" data-inline="true"><span class="ui-btn-inner"><span class="ui-btn-text"><span class="ui-btn-notify"><\/span>You will be notified<\/span><\/span><\/a>'),$("#ExpertNotificationNumberLineDivHidden"+n.toString()).text("You will receive an SMS at "+f.toString()+"-"+e),$("#ExpertNotificationNumberLineDivHidden"+n.toString()).css("display","block"),$("#ExpertNotificationNumberLineDivHidden"+n.toString()).css("font-size","15px"),RemoveMultipleFlowsFlag(n)}}))}function RemoveNotification_clicked(n){FireAnalyticsEventOnRemoveMotification(),$.get("/AlertTemplates/RemoveNotification.html",function(t){$.colorbox({html:t,scrolling:!1,left:"2%",top:"25%",opacity:0,onLoad:function(){$("#cboxClose").remove()}}),$(".ui-btn-text").css("z-index","0"),$(".ui-btn.ui-focus").css("z-index","0"),$("#_btnApproveRemoveNotification").click(function(){FireAnalyticsEventOnRemoveMotificationApproved(),SubmitRemoveNotificationForCurrentExpert(n),$.colorbox.close()}),$("._btnCloseRemoveNotificationWindow").click(function(){FireAnalyticsEventOnRemoveMotificationCancelled(),$.colorbox.close()})})}function SubmitRemoveNotificationForCurrentExpert(n){var t="/Touch.Services/NotifyMeWhenAvailable.svc/RemoveNotification/ExpertId/"+n;$.ajax({type:"GET",url:t,cache:!1,dataType:"text",error:function(){},success:function(){var r=parseInt(n),i=indexOfHelper.call(NotifyVariables.expertIdsClientAskedToBeNotified,r);i>-1&&NotifyVariables.expertIdsClientAskedToBeNotified.splice(i,1),$("#btnRemoveNotification"+n.toString()).replaceWith('<a href="#;" class="btnNotifyMeWhenAvailableCategory ui-btn ui-shadow ui-btn-inline ui-btn-up-costume-b" id="expert'+n+'NotifyButton" onclick="btnNotifyMeWhenAvailableCategoryOnClick('+n.toString()+', this.id); return false;" data-role="button" data-theme="costume-b" data-corners="false" data-inline="true"><span class="ui-btn-inner"><span class="ui-btn-text" style="z-index: 0;">Notify me when available<\/span><\/span><\/a>'),$("#ExpertNotificationNumberLineText"+n.toString()).text(""),$("#ExpertNotificationNumberLineDivHidden"+n.toString()).text("")}})}function IsExpertAvailableCheck(n,t,i,r,u){var f="/Touch.Services/NotifyMeWhenAvailable.svc/IsExpertAvailable/ExpertId/"+n;$.ajax({type:"GET",url:f,cache:!1,dataType:"json",contentType:"application/json; charset=utf-8",error:function(){RemoveMultipleFlowsFlag(n)},success:function(f){f.IsExpertAvailable===!0?(PresentExpertIsAvailableMessage(f.ExpertName,n),RemoveMultipleFlowsFlag(n)):ContinueWithNotifyFlow(n,t,i,r,u)}})}function PresentExpertIsAvailableMessage(n,t){$.get("/AlertTemplates/ExpertBecameAvailable.html",function(i){$.colorbox({html:i.replace("###ExpertName###",n),scrolling:!1,opacity:0,onLoad:function(){$("#cboxClose").remove()}}),$(".ui-btn-text").css("z-index","0"),$(".ui-btn.ui-focus").css("z-index","0"),$("#_contactNow").click(function(){var n="/pages/AdvisorProfile.aspx?ExpID="+t;window.location.href=n,$.colorbox.close()}),$("#_contactLater").click(function(){location.reload(),$.colorbox.close()}),$("#_btnCloseExpertBecameAvailableWindow").click(function(){$.colorbox.close()})})}function ContinueWithNotifyFlow(n,t,i,r,u){$.ajax({type:"GET",url:"/Touch.Services/NotifyMeWhenAvailable.svc/GetUserNotifyMeWhenExpertAvailableData",dataType:"json",contentType:"application/json; charset=utf-8",error:function(){RemoveMultipleFlowsFlag(n)},success:function(f){if(f.Approved){FireAnalyticsEventOnEligibleClientForNotify(),SubmitNotifyMeWhenAvailableData(n,t,i,r,u,f.DefaultPhonePrefix,f.DefaultPhoneNumber);return}$.get("/AlertTemplates/NotifyWhenAvailablePhone.html",function(e){var s;$.colorbox({html:e.replace("_txtPhonePrefixValue",f.DefaultPhonePrefix==0?"":f.DefaultPhonePrefix).replace("_txtPhoneValue",f.DefaultPhoneNumber==0?"":f.DefaultPhoneNumber),scrolling:!1,opacity:0,onLoad:function(){$("#cboxClose").remove()}}),$(".ui-btn-text").css("z-index","0"),$(".ui-btn.ui-focus").css("z-index","0"),$("#_btnApproveNotifyMeWhenAvailable").click(function(){ValidateForm()&&(FireAnalyticsEventOnNewClientForNotify(),SubmitNotifyMeWhenAvailableData(n,t,i,r,u,$("#_txtPhonePrefix").val(),$("#_txtPhone").val()),$.colorbox.close())}),$("#_btnApproveNotifyMeWhenAvailable").prop("disabled",!0),$("#_btnApproveNotifyMeWhenAvailable").removeClass("ui-btn-up-costume-b"),ValidateForm(),$("#_lblAlert").hide(),$("#_chkApproveSms").change(function(){ValidateForm()}),s=function(){RemoveMultipleFlowsFlag(n),$.colorbox.close()},$("#_btnCloseNotifyMeWhenAvailableWindow").click(s),$(".notify-when-available-dlg-container").click(function(n){n&&n.target&&n.target.id==="NotifyWhenAvailablePopup"&&s()}),$("#_txtPhone").change(function(){ValidateForm()}),$("#_txtPhone").keypress(function(){ValidateForm()});var l=$("#_txtPhonePrefix"),o=$("#ddlAreaCode"),h=$("#pCountryAreaCode"),c=$("input:text[id*=_txtPhonePrefix]");l.click(function(){h.show(),o.selectmenu&&(o.selectmenu("open"),h.hide())}),o.val(c.val()),o.live("change",function(){var t=$(this).find("option:selected").val();c.val(t)})})}})}function RemoveMultipleFlowsFlag(n){$(window).removeData(GetNotifyMeFlowRunningString(n))}function GetNotifyMeFlowRunningString(n){return"NotifyMeFlowInProgress_"+n}function FireAnalyticsEventOnNotifyClick(){dataLayer.push({event:"NotifyWhenAvailableC2A"})}function FireAnalyticsEventOnEligibleClientForNotify(){dataLayer.push({event:"NotifyWhenAvailableEligibleClient"})}function FireAnalyticsEventOnNewClientForNotify(){dataLayer.push({event:"NotifyWhenAvailableNewClient"})}function FireAnalyticsEventOnRemoveMotification(){dataLayer.push({event:"NotifyWhenAvailableCancelEvent"})}function FireAnalyticsEventOnRemoveMotificationApproved(){dataLayer.push({event:"NotifyWhenAvailableRemoved"})}function FireAnalyticsEventOnRemoveMotificationCancelled(){dataLayer.push({event:"NotifyWhenAvailableRemovalCanceled"})}function showEmailValidationColorBox(){if(window.emailValidationEnabled==="True"){var n="";typeof window.WebSettings!="undefined"&&window.WebSettings.getUser!==null&&(n=window.WebSettings.getUser().primaryEmail),n!==null&&n.includes("@facebook.com")&&calculateAndRenderEmailValidationColorBox()}}function calculateAndRenderEmailValidationColorBox(){var t=WebSettings.getUser().memberId,n=parseInt(localStorage.getItem("emailValidationTemplateIdShown"+t)),i=parseInt(localStorage.getItem("emailValidationTemplateTimeShown"+t)),u=new window.URLSearchParams(window.location.search),f=u.get("isRegister"),r;if(f==="true"&&isNaN(n)){renderEmailValidationColorBox(0);return}if(isNaN(n)||n==="0"||isNaN(i)){renderEmailValidationColorBox(1);return}var e=window.emailValidationPeriodInMinutes,o=Date.now()-i,s=new Date(o),h=s.getMinutes();h>=e&&n<4&&(r=n+1,renderEmailValidationColorBox(r))}function renderEmailValidationColorBox(n){var t=n===0||document.referrer.includes("sign-in.aspx")||document.referrer.includes("sign-up.aspx")?2e3:0;setTimeout(function(){$.get(EmailValidationTemplates[n],function(t){var i,r;$.colorbox({html:t,scrolling:!0,left:"2%",top:"14%",fixed:"true",opacity:"0.4",onLoad:function(){$("#cboxClose").remove()}}),$("div[id*=_emailError]").hide(),i=WebSettings.getUser().memberId,localStorage.setItem("emailValidationTemplateIdShown"+i,n),localStorage.setItem("emailValidationTemplateTimeShown"+i,Date.now()),window.addEventListener("scroll",noscroll),$(document).bind("cbox_closed",function(){showThankYou===!0&&(showThankYou=!1,setTimeout(renderEmailValidationThankYou(),1e3)),window.removeEventListener("scroll",noscroll)}),$("#_btnEmailValidationClose").click(function(){$.colorbox.close();var n=trackingService.createTrackingRequestObj(24,"PopUpDismiss",{PopUpType:GetPopupType()});trackingService.trackEvent(n)}),r=trackingService.createTrackingRequestObj(24,"PopUpDisplay",{PopUpType:GetPopupType()}),trackingService.trackEvent(r)})},t)}function sendEmailValidationRequest(n){if(n.preventDefault(),ValidateEmailForm()){var i=$.trim($("input[id*=_inputEmail]").val()),r=profileService.createUpdateMemberProfile(i),t={};t.success=onSuccess,t.error=onServerError,profileService.UpdateMemberProfileRequest(t,r)}}function onServerError(n){var i=$("div[id*=_emailError]");i[0].innerText=JSON.parse(n.responseText).status_message,$("input[id*=_inputEmail]").css("border-color","red"),$("input[id*=_btnSubmitEmail]").css("margin-top","0px"),i.show(),TrackingErrorSubmitEvent(n)}function onSuccess(n){TrackingSuccessSubmitEvent(n),showThankYou=!0;var t=WebSettings.getUser().memberId;localStorage.setItem("emailValidationTemplateIdShown"+t,"4"),lastTemplateId=4,$.colorbox.close()}function renderEmailValidationThankYou(){$.get(EmailValidationThankYouTemplate,function(n){$.colorbox({html:n,scrolling:!0,left:"2%",top:"14%",fixed:"true",opacity:"0.4",onLoad:function(){$("#cboxClose").remove()}}),$("#_btnEmailValidationClose").click(function(){$.colorbox.close()})})}function ValidateEmailForm(){var t=!0,r=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,i=$.trim($("input[id*=_inputEmail]").val()),n=$("div[id*=_emailError]");return n.length>0&&(n[0].innerText="Please enter a valid email address"),i.length!==0&&r.test(i)?(n.hide(),$("input[id*=_btnSubmitEmail]").css("margin-top","25px"),$("input[id*=_inputEmail]").css("border-color","#a8a8a8")):(n.show(),$("input[id*=_inputEmail]").css("border-color","red"),$("input[id*=_btnSubmitEmail]").css("margin-top","0px"),t=!1),t}function noscroll(){window.scrollTo(0,0)}function TrackingErrorSubmitEvent(n){var t=JSON.parse(n.responseText),i=trackingService.createTrackingRequestObj(24,"PopUpSubmit",{PopUpType:GetPopupType(),ResponseCode:n.status,BriteVerifyMode:t.email_validation_response_details.mode,BriteVerifyStatus:t.email_validation_response_details.status,BriteVerifyStatusMessage:t.status_message,BriteVerifyAccount:t.email_validation_response_details.provider_response!==null?t.email_validation_response_details.provider_response.address:"",BriteVerifyProviderStatus:t.email_validation_response_details.provider_response!==null?t.email_validation_response_details.provider_response.status:"",BriteVerifyError:t.email_validation_response_details.provider_response!==null?t.email_validation_response_details.provider_response.error:"",BriteVerifyErrorCode:t.email_validation_response_details.provider_response!==null?t.email_validation_response_details.provider_response.error_code:"",BriteVerifyDuraion:t.email_validation_response_details.provider_response!==null?t.email_validation_response_details.provider_response.duration:"",BriteVerifyIsRoleEmail:t.email_validation_response_details.is_role_email,BriteVerifyIsTempEmail:t.email_validation_response_details.is_temporary_email});trackingService.trackEvent(i)}function TrackingSuccessSubmitEvent(n){var t=n,i=trackingService.createTrackingRequestObj(24,"PopUpSubmit",{PopUpType:GetPopupType(),ResponseCode:200,BriteVerifyMode:t.email_validation_response_details.mode,BriteVerifyStatus:t.email_validation_response_details.status,BriteVerifyAccount:t.email_validation_response_details.provider_response!==null?t.email_validation_response_details.provider_response.address:"",BriteVerifyProviderStatus:t.email_validation_response_details.provider_response!==null?t.email_validation_response_details.provider_response.status:"",BriteVerifyDuraion:t.email_validation_response_details.provider_response!==null?t.email_validation_response_details.provider_response.duration:"",BriteVerifyIsRoleEmail:t.email_validation_response_details.is_role_email,BriteVerifyIsTempEmail:t.email_validation_response_details.is_temporary_email});trackingService.trackEvent(i)}function GetPopupType(){var t=WebSettings.getUser().memberId,n;switch(parseInt(localStorage.getItem("emailValidationTemplateIdShown"+t))){case 0:n="Registration";break;case 1:n="SignIn1";break;case 2:n="SignIn2";break;case 3:n="SignIn3";break;case 4:n="SignIn4"}return n}function LoadFaceBook(){window.fbAsyncInit=function(){FB.init({appId:$.mobile.FacebookAppID,channelUrl:"//"+$.mobile.Domain+"/SocialNetworks/Facebook/channel.aspx",status:!0,cookie:!0,xfbml:!0,version:$.mobile.FbLoginApiVersion}),FB.getLoginStatus(function(n){var t=getUrlVars().LogOut;t!==undefined&&(t==="true"||t===!0)&&n.status==="connected"&&FB.logout()})},function(n){var t,i="facebook-jssdk",r=n.getElementsByTagName("script")[0];n.getElementById(i)||(t=n.createElement("script"),t.id=i,t.async=!0,t.src="https://connect.facebook.net/en_US/sdk.js",r.parentNode.insertBefore(t,r))}(document)}var UserAgentHelper={_browserName:"",isAndroid:function(n){var t=n?n:navigator.userAgent;return t.indexOf("Android")>-1},isAndroidBrowser:function(n){var t=n?n:navigator.userAgent,u=t.indexOf("Android")>-1&&t.indexOf("Mozilla/5.0")>-1&&t.indexOf("AppleWebKit")>-1,i=new RegExp(/AppleWebKit\/([\d.]+)/),f=i.exec(t),r=f===null?null:parseFloat(i.exec(t)[1]);return u&&r!==null&&r<537},isAndroidTablet:function(n){var t=n?n:navigator.userAgent,i=t.match(/Android/i)!=null,r=t.match(/mobile/i)!=null,u=this.isAndroidBrowser();return i&&!r&&!u},isIPad:function(n){var t=n?n:navigator.userAgent;return t.match(/iPad/i)!=null},isIPod:function(n){var t=n?n:navigator.userAgent;return t.match(/iPod/i)!=null},isTouchDevice:function(){return!0==("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},isCriOS:function(n){var t=n?n:navigator.userAgent;return t.match(/CriOS/i)!=null},isSafari:function(n){var t=n?n:navigator.userAgent;return t.search("Safari")>=0&&t.search("CriOS")<0?(this._browserName="Safari",!0):!1},isIphone:function(n){var t=n?n:navigator.userAgent;return t.search("iPhone")>=0},isTablet:function(){return this.isIPad()||this.isAndroidTablet()},isIE:function(n){var t=n?n:window.navigator.userAgent,r=t.indexOf("MSIE "),f,u,i;return r>0&&parseInt(t.substring(r+5,t.indexOf(".",r)),10)?(this._browserName="MSIE",!0):(f=t.indexOf("Trident/"),f>0&&(u=t.indexOf("rv:"),parseInt(t.substring(u+3,t.indexOf(".",u)),10)))?(this._browserName="Trident",!0):(i=t.indexOf("Edge/"),i>0&&parseInt(t.substring(i+5,t.indexOf(".",i)),10))?(this._browserName="Edge",!0):!1},isFirefox:function(n){var t=n?n:navigator.userAgent;return t.match(/Firefox/i)!=null?(this._browserName="Firefox",!0):!1},isFirefoxMacintosh:function(){return this.isFirefox()&&this.isMacintoshPC()},isIOS:function(n){var t=n?n:window.navigator.userAgent,i=/iPad|iPhone|iPod/.test(t)&&!window.MSStream,r=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);return i||r},isMacintoshPC:function(n){var t=n?n:window.navigator.userAgent,i=t.match(/Macintosh/i)!=null,r=t.match(/Intel Mac/i)!=null,u=t.match(/PPC Mac/i)!=null,f=t.match(/68K Mac/i)!=null,e=r||u||f,o=t.match(/Mac OS X/i)!=null,s=navigator.platform&&navigator.platform.indexOf("Mac")>-1;return i||e||o||s},isFirefoxForIOS:function(n){var t=n?n:window.navigator.userAgent;return t.match(/FxiOS/i)!=null},isChrome:function(n){var t=n?n:navigator.userAgent;return t.search("Chrome")>=0?(this._browserName="Chrome",!0):!1},osName:function(){var n={};if(typeof UAParser!="undefined")try{n=(new UAParser).getResult()}catch(t){}return n.os!==undefined&&n.os!==null?n.os.name+" "+n.os.version:navigator.appVersion.indexOf("Win")!==-1?"Windows":navigator.appVersion.indexOf("Mac")!=-1?"MacOS":navigator.appVersion.indexOf("X11")!=-1?"UNIX":navigator.appVersion.indexOf("Linux")!=-1?"Android":this.isMacintoshPC(navigator.userAgent)?"MacOS":this.isIOS(navigator.userAgent)?"IOS":""},browserName:function(){return this._browserName.length<=0&&(this.isSafari(),this.isIE(),this.isFirefox(),this.isChrome()),this._browserName},isIERestrictedVersion:function(n){var i=!1,t;if(n||(n=10),typeof UAParser!="undefined")try{t=(new UAParser).getBrowser(),t&&t.name&&t.major&&(i=t.name==="IE"&&parseInt(t.major)<=n)}catch(r){}return i},isSafariIosMajorVersion:function(n){var i=!1,t;return n&&(t=this.userAgentDetails(),i=t&&t.os.name==="iOS"&&parseInt(t.browser.major)===n),i},isAnyIosMajorVersion:function(n){var i=!1,t;return n&&(t=this.userAgentDetails(),i=t&&t.os.name==="iOS"&&t.os.version&&t.os.version.indexOf(n+".")===0),i},isMobile:function(){return typeof this.userAgentDetails().device!="undefined"&&this.userAgentDetails().device.type=="mobile"?!0:!1},isTablet:function(){return typeof this.userAgentDetails().device!="undefined"&&this.userAgentDetails().device.type=="tablet"?!0:!1},isPrivateMode:function(n){var i=function(){n(!0)},t=function(){n(!1)},u=function(){try{localStorage.length?t():(localStorage.x=1,localStorage.removeItem("x"),t())}catch(n){navigator.cookieEnabled?i():t()}},r;if(window.webkitRequestFileSystem)return void window.webkitRequestFileSystem(0,0,t,i);if("MozAppearance"in document.documentElement.style)return r=indexedDB.open("test"),r.onerror=i,r.onsuccess=t,void 0;if(/constructor/i.test(window.HTMLElement))return u();!window.indexedDB&&(window.PointerEvent||window.MSPointerEvent)&&i(),t()},userAgentDetails:function(){var n={};if(typeof UAParser!="undefined")try{n=(new UAParser).getResult()}catch(t){}return n}},indexOfHelper=function(n){return indexOfHelper=typeof Array.prototype.indexOf=="function"?Array.prototype.indexOf:function(n){for(var t=-1,i=-1,t=0;t<this.length;t++)if(this[t]===n){i=t;break}return i},indexOfHelper.call(this,n)},emailRegex=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,defaultSpiritualityCategoryId=1119,profileIDs="",expertSortId="0",expertIsHideBusy=!0,sessionStatus,arrStates,ShowHeaderIsOn,ExpertData,SessionTypeEnum,timerPhoneValidation,Validators,PaymentValidators,Notifier,SessionDetailsServiceModule,NotifyMeObject;$(document).delegate("#HomePage,#ExpertsPage,#AdvisorProfile,#PreVoicePage,#SignInPage,#SignUpPage","pageshow",function(){showEmailValidationColorBox();var n=$.mobile.WellcomToKasamba;n=="True"&&$("#Kasamba-Migration-Popup").popup("open")}),$('div[data-role="page"]').live("pageinit",function(){$("[id*='txtSearch']").keypress(function(n){n.which==13&&$("#search-button").click()}),$("#search-button").click(function(){var t=$.trim($("[id*='txtSearch']").val()),n;jQuery.trim(t).length>=3?($.mobile.showPageLoadingMsg(),typeof WordWheel!="undefined"&&WordWheel!==null&&(n=WordWheel.GetSearchEventTrackingInfo(),n.SearchString=t,n.SearchType="direct",WordWheel.addSearchPerformedEventToSessionStorage(n)),document.location.href="/pages/MyExperts.aspx?q="+t):$("#searchErrorMessage").popup("open")}),$("[id*='txtSearch']").keypress(function(n){if(n.which==13)return $("#search-button").click(),!1}),$("#Logo").click(function(){var n=$.mobile.HomePage,t=$.mobile.Domain;window.location="https://"+t+n+"?Home=true"}),$(".more-categories").hide();var t=4;$("#MoreAction").click(function(){$(".more-categories").is(":visible")||($(".more-categories").show(),$(".more-categories .row").hide());var n=$(".more-categories .row:visible").length;$(".more-categories .row").slice(n,t).fadeIn(),$("#lastChild").is(":visible")&&$("#MoreAction").hide(),t=t+4}),$("a[id*=aScreenNameLoggedIn]").click(function(){var n={event:"MobileClientMenuOpen"};dataLayer.push(n),$j(".drawer").drawer()}),$("a[id*=aLogOut]").click(function(){var n={event:"MobileClientMenuSignout"};dataLayer.push(n)}),$("a[id*=aMailBoxLnk]").click(function(){var n={event:"MobileClientMenuMailboxClicked"};dataLayer.push(n)}),$("a[id*=aHome]").click(function(){var n={event:"MobileClientMenuHomeClick"};dataLayer.push(n)}),$("a[id*=aMyAdvisors]").click(function(){var n={event:"MobileClientMenuMyPsychicsClicked"};dataLayer.push(n)}),$(".free-minutes-popup, a.free-minutes-popup-close-btn, a.free-minutes-popup-start-btn").click(hide3fmHelp),$(".free-minutes-popup-content").click(function(n){n.stopPropagation(),n.preventDefault()})}),$("#HomePage").live("pageinit",function(){var t="#882687 solid 1px",i="border",r="#882687";categoryNoBorder(),$(".row-item").click(function(){categoryNoBorder(),$(this).find(".row-title").find("a").css("color",r),$(this).css(i,t),setTimeout(categoryNoBorder,1e3),window.location.href=$(this).find(".row-title").find("a").attr("href")}),$(".row-title a").click(function(n){n.preventDefault(),categoryNoBorder(),$(this).css("color",r),$(this).parent().parent().css(i,t),setTimeout(categoryNoBorder,1e3),window.location.href=$(this).attr("href")})}),$("#ContactInformationPage").live("pageinit",function(){$.mobile.showPageLoadingMsg(),LoadCountriesandStateCall(),$.mobile.hidePageLoadingMsg(),CountriesStateBehavior()}),$("#PaypalDepositPage").live("pageinit",function(){var t=getUrlVars().QS,i="/Touch.Services/billing/AddPayPalDepositService.svc/GetAndDoExpressCheckout?QS="+t;$.ajax({type:"GET",url:i,cache:!1,dataType:"json",contentType:"application/json; charset=utf-8",beforeSend:function(){},success:function(n){var t=new URL(n.redirectURL),u=t.search,i=new window.URLSearchParams(u),n,r;switch(n.status){case 0:t.toString().includes("NativeEvent")?t.href+="PayPalSuccess":(i.set("result","success"),t.search=i.toString()),doFunnelTrack(LP.services.FunnelTrackingService.EventType.BillingCompleted,{paymentForm:"paypal"}),n={event:"billingpaypalcompleteed"},dataLayer.push(n),window.location=t.toString();break;case 1:t.toString().includes("NativeEvent.aspx")&&(t.href+="PayPalFailed",window.location=t.toString()),$("#processingPayment").hide(),$("#paypalError").show(),r="/",$("#aPayPalTryAgain").prop("href",r);break;case 2:t.toString().includes("NativeEvent.aspx")&&(t.href+="PayPalTrsFailed",window.location=t.toString()),$("#processingPayment").hide(),$("#trsError").show()}},error:function(n){console.error(n.responseText)},complete:function(){}})}),$("#VoiceVerificationPage").live("pageinit",function(){$(this).css("background","#0F0F0F");var t=!1;$("a[id*=lbVerificationCallExpert]").click(function(){t===!1&&($(this).addClass("ui-disabled"),t=!0)})}),$("#SignInPage").live("pageinit",function(){preLoadLoadingImage();var t=$("#ankor-dont-have-account").attr("href"),i=getUrlVars().QS;i!=undefined&&(t+="?QS="+i),$("#ankor-dont-have-account").attr("href",t),$("#FBConnect").click(function(){var n={event:"facebookSignin"};dataLayer.push(n)}),$("#btnSignin").click(function(){var n={event:"Signin"};dataLayer.push(n)})}),$("#ForgotPasswordPage").live("pageinit",function(){$("#btnContinue").click(function(){if(typeof Page_ClientValidate=="function"&&Page_ClientValidate(),Page_IsValid){var n={event:"ForgotPasswordEmailSubmitted"};dataLayer.push(n)}})}),$("#ResetPasswordPage").live("pageinit",function(){$("#btnContinue").click(function(){if(typeof Page_ClientValidate=="function"&&Page_ClientValidate(),Page_IsValid){var n={event:"ResetPasswordSuccessful"};dataLayer.push(n)}})}),$("#SignUpPage").live("pageinit",function(){preLoadLoadingImage();var t=$("#ankor-sign-up").attr("href"),i=getUrlVars().QS;i!=undefined&&(t+="?QS="+i),$("#ankor-sign-up").attr("href",t),$("#btnSignUP").click(function(){var n={event:"signupclick"};dataLayer.push(n)}),$("#FBConnect").click(function(){var n={event:"facebookconnect "};dataLayer.push(n)})}),$("#transactionErrorPage").live("pageinit",function(){var e=$.mobile.HomePage,u=$.mobile.Domain,r=getUrlVars().QS,t="https://"+u+"/pages/Billing/quick-payment.aspx",f,i;r!=undefined&&(t+="?QS="+r+"&fullDetails=on"),f="",i=new URLSearchParams(window.location.search),i.has("returnURL")&&(t+="?returnURL="+encodeURIComponent(i.get("returnURL"))),self!=top&&$("#ankorReConnect").attr("target","_parent"),$("#ankorReConnect").attr("href",t)}),$("#AccountVerificationPage").live("pageinit",function(){var t="/pages/notification/account-verification.aspx";self!=top&&($("#AccountVerificationPage").hide(),window.top.location=t)}),$("#ExpertsPage").live("pageinit",function(){WrongCluster(),checkIfheaderInSale(),checkIfSearch()}),$(document).delegate("#ExpertsPage","pageshow",function(){var n=1,f,o,s;ServiceTypeEnum={Search:0,Favorites:1,Category:2};var u="",t=1,h=0,i=15,c=300,r=getUserCurrencyFromCookie(),e=getUrlVars().q;jQuery.trim(e)!=""&&(n=ServiceTypeEnum.Search,u=BuildSearchURL(e,t,r)),f=getUrlVarNotCaseSevsetive("CatID"),jQuery.trim(f)!=""&&(SortInit(),n=ServiceTypeEnum.Category,u=BuildCategoryURL(f,t,i,r,expertSortId,expertIsHideBusy)),o=getUrlVars().Favorites,jQuery.trim(o)!=""&&(n=ServiceTypeEnum.Favorites,u=BuildFavoritesURL(t,i,r)),n==ServiceTypeEnum.Search&&(document.title="kasamba results for "+e),n==ServiceTypeEnum.Favorites&&(document.title="kasamba my experts"),LoadExperts(n,u,function(n,r){if(HandleResults(n,i,t),r){var u=0;r.totalAdvisors>0&&(u=100*r.availableAdvisors/r.totalAdvisors),doFunnelTrack(LP.services.FunnelTrackingService.EventType.MyAdvisorsAvailability,{TotalAdvisors:r.totalAdvisors,AvailableAdvisors:r.availableAdvisors,AvailabilityPercent:u})}}),typeof checkBannerCookie!="undefined"&&checkBannerCookie()&&(n===ServiceTypeEnum.Favorites?sendDataLayerEvent("MigrationButtonImpression","MigrationbuttonType","MyAdvisors"):sendDataLayerEvent("MigrationButtonImpression","MigrationbuttonType","FloatingCategory")),s=$(".banner-close");s.one("click",function(){n===ServiceTypeEnum.Favorites?(updateShowTouchBannerCookie("migration-container-advisor",2),sendDataLayerEvent("MigrationCloseClick","MigrationbuttonType","MyAdvisors")):(updateShowTouchBannerCookie("migration-container-category",1),sendDataLayerEvent("MigrationCloseClick","MigrationbuttonType","FloatingCategory"))});$("[id$='topBannerOpenInAppLink']").click(function(){sendDataLayerEvent("MigrationButtonclick","MigrationbuttonType","MyAdvisors")}),$("[id$='floatingBannerAppLink']").click(function(){sendDataLayerEvent("MigrationButtonclick","MigrationbuttonType","FloatingCategory")}),$("#aMoreExperts").click(function(){var o=t,u,e;t++,u="",n==ServiceTypeEnum.Category&&(u=BuildCategoryURL(f,t,i,r,expertSortId,expertIsHideBusy)),n==ServiceTypeEnum.Favorites&&(u=BuildFavoritesURL(t,i,r)),n==ServiceTypeEnum.Search&&(e=getUrlVars().q,u=BuildSearchURL(e,t,r)),LoadExperts(n,u,function(n){HandleResults(n,i,t)});return}),$(".btnNotifyMeWhenAvailableCategory").click(function(){LP.services.UserTrackingService.TrackEvent(LP.services.UserTrackingService.Events.CategoryNotifyMeClicked)})}),$("#AdvisorProfile").live("pageinit",function(){var t=getUrlVarNotCaseSevsetive("ExpID"),i=1,u,f,r,e,o,s,h,c,l,a,v,y,p;jQuery.trim(t)!=""&&LoadReviews(t,i),u=GetSessionSelectorUrl(t,$(".advisor-name").text().trim(),SessionTypeEnum.voice),f=GetSessionSelectorUrl(t,$(".advisor-name").text().trim(),SessionTypeEnum.chat),ExpertData.profileIDs=t,ExpertData.experts[t]={id:t,urls:{voiceUrl:u,chatUrl:f},Status:"0"},setInterval(function(){updateStatuses(setMyExpertsButtons)},15e3),r=function(n){var i=getUrlVarNotCaseSevsetive("CatID"),r="";i!=""&&(r="&CatID="+i),window.location="/pages/session-selector.aspx?ExpID="+t+"&isPhone="+(n?"True":"False")+r},e=$("#btnCallExpert"),e.click(function(){var n={event:"ExpertProfilePhoneClick"};dataLayer.push(n),r(!0)}),o=$("#btnChatExpert"),o.click(function(){var n={event:"ExpertProfileChatClick"};dataLayer.push(n),r(!1)}),s=$("#ShowMoreReviews"),s.click(function(){i++,LoadReviews(t,i)}),typeof checkBannerCookie!="undefined"&&checkBannerCookie()&&sendDataLayerEvent("MigrationButtonImpression","MigrationbuttonType","FloatingProfile"),h=$("[id$='migrationBannerAppLink']");h.one("click",function(){sendDataLayerEvent("MigrationButtonclick","MigrationbuttonType","FloatingProfile")});c=$(".banner-close");c.one("click",function(){updateShowTouchBannerCookie("migration-container",1),sendDataLayerEvent("MigrationCloseClick","MigrationbuttonType","FloatingProfile")});l=$("#btnNotifyMeWhenAvailable");l.one("click",function(){var n=getUrlVarNotCaseSevsetive("CatID");n||(n=defaultSpiritualityCategoryId),FireAnalyticsEventOnNotifyClick(),OnClickNotifyMeWhenAvailable(t,n,!0,!0,"btnNotifyMeWhenAvailable")});a=$("#btnNotifyMeWhenAvailableGuest");a.one("click",function(){var n=window.location.pathname+window.location.search,i=n+"&expertForNotify="+t;RedirectWithReturnUrl(i)});v=$("#btnRemoveNotification"+t.toString()),v.click(function(){RemoveNotification_clicked(t)}),y=$("#MobileDiscount").length!==0,y&&(p=$(".ui-header"),p.css("height","5.2em"))}),$(document).ready(function(){$("#ankorReCall").click(function(){LP.services.UserTrackingService.TrackEvent(LP.services.UserTrackingService.Events.VoiceReconnectClicked),LP.helpers.nativeApi.tryPushEvent("voice_session_reconnect_clicked")}),$("#goHomePageLink").click(function(n){LP.helpers.nativeApi.isNative()&&n.preventDefault(),LP.services.UserTrackingService.TrackEvent(LP.services.UserTrackingService.Events.VoiceGoHomeClicked),LP.helpers.nativeApi.tryPushEvent("GoHomePage")})}),$(document).delegate("#VoiceSessionPage","pageshow",function(){function f(){var f="/Touch.Services/SessionDetailsProvider.svc/CheckSessionStatus?sessionId="+sessionData.sessionID;$.ajax({type:"GET",url:f,cache:!1,dataType:"text",error:function(n){console.error(n.responseText)},success:function(f){var s=jQuery.parseJSON(f),h,c;sessionStatus=s.d.Status,o=s.d.IsPaid;switch(s.d.Status){case 1:$("#session-graphics").hide(),$("#call-in-process").show(),$("#session-action-phone_message").show(),t||LP.helpers.nativeApi.tryPushEvent("new_user_start_voice",""),t=!0;break;case 2:$("#session-graphics").hide(),$("#call-in-process").show(),$("#session-action-phone_message").hide(),r||(h="/Touch.Services/SessionDetailsProvider.svc/UpdateTrackingData?sessionId="+sessionData.sessionID,$.get(h),memberPaidSessionsCount!=="undefined"&&memberPaidSessionsCount!==""&&memberPaidSessionsCount==0&&(doFunnelTrack(LP.services.FunnelTrackingService.EventType.ClientStartsFirstPaidSession,{sessionId:sessionData.sessionID,expertId:sessionData.expertID}),LP.services.UserTrackingService.TrackEvent(LP.services.UserTrackingService.Events.VoiceFirstPaidSession)),r=!0),i||(typeof SessionDetailsServiceModule=="object"&&SessionDetailsServiceModule.updateMemberPaidSessionsCount(!0),i=!0,setTimeout("FireTrackingPixel()",3e4)),t||(LP.services.UserTrackingService.TrackEvent(LP.services.UserTrackingService.Events.VoiceHired),LP.helpers.nativeApi.tryPushEvent("new_user_start_voice","")),t=!0,e&&!u&&(u=!0,c=new LP.services.MembersService,c.getMemberAdditionalDetails().then(function(n){n.absoluteAnyPaidSession||LP.helpers.nativeApi.tryPushEvent("AbsoluteFirstPaidSession_Voice","")}));break;case 3:$.getJSON("/Touch.Services/SessionDetailsProvider.svc/ClearSeesionPaidSessionsNumber"),$("#call-in-process").hide(),$("#session-graphics").hide(),$("#session-end").show(),$("#URLHolder").show(),$("#session-action-phone_message").hide(),clearInterval(n),LP.helpers.nativeApi.tryPushEvent("voice_session_ended");break;case 4:$("#call-in-process").hide(),$("#session-graphics").hide(),$("#expert-unavailable").show(),$("#URLHolder").show(),$("#session-action-phone_message").hide(),clearInterval(n);break;default:$("#backURLs").show()}}})}var e=typeof WebSettings!="undefined"&&WebSettings.IsNative;if(window.history.forward(),LP.services.UserTrackingService.TrackEvent(LP.services.UserTrackingService.Events.VoicePageLoaded),sessionData.sessionID==0)$("#call-in-process").hide(),$("#session-graphics").hide(),$("#expert-unavailable").show(),$("#URLHolder").show(),clearInterval(n);else{$.ajaxSetup({cache:!1});var n=null,o,i=!1,r=!1,t=!1,u=!1;f(),n=window.setInterval(f,5e3)}}),arrStates=[],String.prototype.trunc=function(n){return this.substring(0,n-1).trim(this)+(this.length>n?"&hellip;":"")},ShowHeaderIsOn=!1,ExpertData={profileIDs:"",experts:[]},SessionTypeEnum={voice:0,chat:1},Validators={SendEmailPage:function(n,t){var r=!1,v=$.trim($("input:text[id*=txtSubject]").val()),u=$("div[id*=divErrSubject]"),y=v.length,i;y==0?u.show():(r=!0,u.hide());var f=!1,p=$.trim($("textarea[id*=txtMessage]").val()),e=$("div[id*=divErrMessage]"),o=p.length;o==0||o>=200?e.show():(f=!0,e.hide());var s=!1,h=$.trim($("input[id*=txtEmail]").val()),c=$("div[id*=divErrEmail]"),w=h.length;w!=0&&emailRegex.test(h)?(s=!0,c.hide()):c.show();var l=!1,b=$("input:checkbox[id*=cbApproved]"),a=$("div[id*=divErrApproved]");b.is(":checked")?(l=!0,a.hide()):a.show(),i=!1,r&&s&&f&&l&&(i=!0),t.IsValid=i},SignUpPage:function(n,t){var u;$("#divInvalidEmail").hide();var f=!1,e=$("input[id*=txtEmail]"),o=$.trim($(e).val()),i=$("div[id*=divErrEmail]"),a=o.length;a!=0&&emailRegex.test(o)?(f=!0,i.hide()):i.show(),updateImputValidation(e,i);var s=!1,h=$("input:password[id*=txtPassword]"),c=$.trim($(h).val()),r=$("div[id*=divErrPassword]"),l=c.length;l<6||l>32||hasWhiteSpace(c)?r.show():(s=!0,r.hide()),updateImputValidation(h,r),u=!1,f&&s&&(u=!0,$("#btnSignUP").prop("disabled",!0),$("#SignInUpHolder span.ui-btn-text").addClass("loading")),t.IsValid=u},SignInPage:function(n,t){var u;$("#divInvalidEmail").hide();var f=!1,e=$("input[id*=txtEmail]"),o=$.trim($(e).val()),i=$("div[id*=divErrEmail]"),l=o.length;l!=0&&emailRegex.test(o)?(f=!0,i.hide()):i.show(),updateImputValidation(e,i);var s=!1,h=$("input:password[id*=txtPassword]"),c=$.trim($(h).val()),r=$("div[id*=divErrPassword]"),a=c.length;a<1||hasWhiteSpace(c)?r.show():(s=!0,r.hide()),updateImputValidation(h,r),u=!1,f&&s&&($("#btnSignin").prop("disabled",!0),$("#SignInUpHolder span.ui-btn-text").addClass("loading"),u=!0),t.IsValid=u},ResetPasswordPage:function(n,t){var r=!1,i=$.trim($("input:password[id*=txtNewPassword]").val()),f=$("div[id*=divErrPassword]"),e=i.length,o,u;e<6||e>32||hasWhiteSpace(i)?f.show():(r=!0,f.hide()),o=/^[^\<\>\&]*$/,u=$("div[id*=divErrPasswordFormat]"),o.test(i)?u.hide():(u.show(),r=!1);var s=!1,c=$.trim($("input:password[id*=txtConfirmPassword]").val()),h=$("div[id*=divErrConfirmPassword]");i!=c?h.show():(s=!0,h.hide()),t.IsValid=r&&s},ForgotPasswordPage:function(n,t){$("#divInvalidEmail").hide();var i=!1,r=$.trim($("input[id*=txtEmail]").val()),u=$("div[id*=divErrEmail]"),f=r.length;f!=0&&emailRegex.test(r)?(i=!0,u.hide()):u.show(),t.IsValid=i},PaymentPersonalDetails:function(n,t){var i=!0,r=$.trim($("input:text[id*=txtboxCardHolder]").val()),u=$("div[id*=divErrName]"),c=/^([a-z]+)(\s?[a-z]+)*$/i,l=r.length;l!=0&&c.test(r)?u.hide():(u.show(),i=!1);var f=!0,a=$("select[id*=ddlCountry]").val(),e=$("div[id*=divErrCountry]");a==""?(e.show(),f=!1):e.hide();var o=!0,v=$("select[id*=ddlState]").val(),y=$("select[id*=ddlState] option").length,s=$("div[id*=divErrState]");v==""&&y>1?(s.show(),o=!1):s.hide();var p=isEmptyElement("txtboxCity","divErrCity",!1),w=isEmptyElement("txtboxZipCode","divErrZip",!1)&&zipValidForCountry(),b=isEmptyElement("txtboxStreetAddress","divErrAddress",!1),k=isValidPhoneNumber("txtboxPhone","txtboxPhoneHidden","divErrPhone"),h=!1,d=i&&f&&k&&p&&w&&b&&o;d&&(h=!0,$("#processing_your_request").show(),$("#SubmitSection span.ui-btn-text").addClass("loading")),t.IsValid=h},PayPal:function(n,t){var r=!0,i=t.Value,u=i.length;(i==""||u==0||i=="-1"||i==-1)&&(r=!1),r?$("span[id*="+n.id+"]").hide():$("span[id*="+n.id+"]").show(),t.IsValid=r},ContactInformation:function(n,t){var e=isEmptyElement("TextboxFirstName","divErrFirstName",!1),o=isEmptyElement("TextboxLastName","divErrLastName",!1),i=!0,s=$("select[id*=ddlCountry]").val(),r=$("div[id*=divErrCountry]");s==""?(r.show(),i=!1):r.hide();var h=!0,c=$("select[id*=ddlState]").val(),l=$("select[id*=ddlState] option").length,u=$("div[id*=divErrState]");c==""&&l>1?(u.show(),h=!1):u.hide();var a=isEmptyElement("txtboxCity","divErrCity",!1),v=isEmptyElement("txtboxZipCode","divErrZip",!1),y=isEmptyElement("txtboxStreetAddress","divErrAddress",!1),f=!1;e&&i&&o&&a&&v&&y&&(f=!0),t.IsValid=f}},PaymentValidators={CardNotValid:function(){$(document).ready(function(){var n="/pages/error/transaction-error.aspx",t=getUrlVars().QS,i=getUrlVars().returnURL;t!=undefined&&(n+="?QS="+t),i!=undefined&&(n+="?returnURL="+i),$("#creditCardErrorMessage").popup("open"),$("#ccErrorMessageIframe").get(0).contentWindow.location.href=n})}},window.mobilecheck=function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)?!0:!1},$(document).ready(function(){typeof hideBusyExperts!="undefined"&&(expertIsHideBusy=hideBusyExperts);var n=document.querySelector("input[id*=txtboxPhone]");typeof n!="undefined"&&n!=null&&(n.addEventListener("paste",function(n){n.stopPropagation(),n.preventDefault();var i=n.clipboardData||window.clipboardData,t=i.getData("Text");t=t.replace(/[^\d]/g,"").toString(),$(n.target).val(t),isValidPhoneNumber("txtboxPhone","txtboxPhoneHidden","divErrPhone")}),n.addEventListener("keyup",function(n){n.stopPropagation();var t=$(n.target).val(),i=t.replace(/[^\d]/g,"");$(n.target).val(i)}))}),Notifier={alert:function(n,t,i,r){var e=!1,u="cstNotification",o=$("#"+u);o&&o.remove();var f=$("<div/>").attr("id",u),c=$("<div/>").attr("class",u.toLowerCase()+"-title").html(n),l=$("<div/>").attr("class",u.toLowerCase()+"-content").html(t),a=r===undefined||r.closeButtonImageUrl===undefined?"/img/notification/x-btn.png":r.closeButtonImageUrl,s=$("<img/>").attr({"class":u.toLowerCase()+"-close",name:"close-btn",src:a}),h=function(){e||(e=!0,f.fadeOut(),r&&typeof r.onClose=="function"&&r.onClose())};s.click(function(){h()}),f.append(s),f.append(c),f.append(l),f.hide().appendTo("body").fadeIn(),i=i||30,setTimeout(function(){h()},i*1e3)}},$("#PersonalDetailsRequiredPage").live("pageinit",function(){dataLayer.push({event:"billing-information-addition-presentation"}),$.mobile.showPageLoadingMsg(),LoadCountriesandStateCall(),$.mobile.hidePageLoadingMsg(),CountriesStateBehavior()}),$("#PreVoicePage,#PreChatPage").live("pagebeforeshow",function(){var t=$("select[id*=ddlCreditCard]"),i=$("select[id*=ddlCreditCard] option:first-child").val();t.val(i).change()}),$("#PreVoicePage,#PreChatPage").live("pageinit",function(){function nt(n,t){var i='<div class="'+t.attr("data-css")+'">'+t.attr("data-cc-type")+' <span class="credit-card-number">'+t.attr("data-cc-number")+"<\/span><\/div>";n.html(i)}function a(n){var t=n.attr("data-exp-year"),i=n.attr("data-exp-month"),r=isDateExpired(t,i);r?($("#divErrCardExpired").show(),$("#btnCallExpert").css("visibility","hidden")):($("#divErrCardExpired").hide(),$("#btnCallExpert").css("visibility","visible"))}function tt(){var t='<img class="option-icon" src="//siteimages.kassrv.com/images/touch/card-prepaid.png">',n=$("ul[id*=ddlCreditCard-menu]").find("li a");$("select[id*=ddlCreditCard]").find("option[value!=0]").each(function(i,r){$(r).attr("is-prepaid")=="true"&&$(n[i]).html($(n[i]).html()+t)})}var v=$("#btnCallExpert"),f=$("#refillCreditCard"),y=$("div[id*=pCreditCards]"),e=$("div[id*=divErrCreditCard]"),o=$("select[id*=ddlCreditCard] option").length,t=$("select[id*=ddlCreditCard] option:selected"),i=t.val(),p=$("input[id=hidPreVoiceExpertID]").val(),w=$("#PaymentMethodTypeHf").val(),b=new SalesPresenter,r,s,h,u;funneltracking&&(r=LP.services.FunnelTrackingService.SessionType.Chat,_isVoice&&(r=LP.services.FunnelTrackingService.SessionType.Voice),s=new LP.services.FunnelTrackingService.FunnelTrackingEvent(LP.services.FunnelTrackingService.EventType.prePage,{sessionType:r,expertId:p}),funneltracking.track(s)),o>0&&(h=$("select[id*=ddlCreditCard]"),u=parseInt($("#RefillAmountHf").val()),o>1&&(tt(),a(t),u>0&&($("#refillSettings").show(),f.removeAttr("style"),nt(f,t),y.hide())),h.live("change",function(){var f,e,r;if(t=$(this).find("option:selected"),i=t.val(),f=$(this).find("option:selected").attr("is-prepaid")==="true",a(t),e=$("#divErrCardExpired").is(":visible"),r=$("div[id*=divErrCreditCard]"),i==-1)return r.show(),!0;if(i==0){$.mobile.showPageLoadingMsg(),$(this).prop("selectedIndex",0);var o=getUrlVars().QS,s=$.mobile.Domain,h="https://"+s+"/pages/Billing/quick-payment.aspx?QS="+o;return setTimeout(function(){document.location=h},10),!0}!f||u||e?r.hide():(AnalyticsTrackingModule.trackEvent("UserExplictlyChoosePrepaidCard"),__doPostBack("ddlCreditCard",""))}));var k=$("#ChangeAreaCode"),c=$("#ddlAreaCode"),d=$("#lblAreaCode"),l=$("#pCountryAreaCode"),g=$("input:text[id*=txtAraeCode]");k.click(function(){l.show(),c.selectmenu("open"),l.hide()}),c.live("change",function(){var t=$(this).find("option:selected").val();d.html(t),g.val(t)}),v.click(function(){var i,r,f,u,n,o;if(UserAgentHelper.isIE()||UserAgentHelper.isAndroidBrowser())return Notifier.alert("Oops!","This browser does not support chat sessions. We advise you to use Chrome browser.",10),!1;if($.mobile.MemeberId==n)return $("#expertSelfSessionErrorMessage").popup("open"),!0;if(i=$("select[id*=ddlCreditCard] option:selected").val(),i==-1)return e.show(),!0;if(e.hide(),_isVoice){var s=$.trim($("#PreVoicePage span[id*=lblAreaCode]").html()),h=$.trim($("#PreVoicePage input[id*=txtPrePhoneNumber]").val()),c=isValidPhoneNumber("txtPrePhoneNumber","txtPreNumberHidden",null),l=$.trim($("#PreVoicePage input:text[id*=txtPreNumberHidden]").val()),r={event:"startvoicesession"};if(dataLayer.push(r),!c){$("#PreVoicePage #phoneErrorMessage").popup("open");return}}if($("#btnCallExpert").addClass("loading"),r={event:"startonlinesession"},dataLayer.push(r),f=PersonalDetailsRequired(i),f)return $.mobile.changePage("#PersonalDetailsRequiredPage"),$("#QQPCardNumber").html(t.text()),$("#SubmitSection").show(),$("#processing_your_request").hide(),!0;if(_isVoice)StartVoiceSession(i,s,l,h);else{try{n=$("input[id=hidPreVoiceExpertID]").val(),ChatLog.data.expertId=n,ChatLog.data.memberId=$.mobile.MemeberId,ChatLog.log(ChatLogEvents.startSessionButtonClicked,"",!1)}catch(a){}StartChatSession()}try{u=LP.services.FunnelTrackingService.SessionType.Chat,_isVoice&&(u=LP.services.FunnelTrackingService.SessionType.Voice,n=$("input[id=hidPreVoiceExpertID]").val()),o=new LP.services.FunnelTrackingService.FunnelTrackingEvent(LP.services.FunnelTrackingService.EventType.startSessionClick,{paymentMethodType:w,sessionType:u,expertId:n}),funneltracking.track(o)}catch(a){}}),b.ensureSalesClarity()}),$(document).ready(function(){var n=document.querySelector("input[id*=txtPrePhoneNumber]");typeof n!="undefined"&&n!=null&&(n.addEventListener("paste",function(n){n.stopPropagation(),n.preventDefault();var i=n.clipboardData||window.clipboardData,t=i.getData("Text");t=t.replace(/[^\d]/g,"").toString(),$(n.target).val(t),window.isValidPhoneNumber("txtPrePhoneNumber","txtPreNumberHidden",null)}),n.addEventListener("keyup",function(n){n.stopPropagation();var t=$(n.target).val(),i=t.replace(/[^\d]/g,"");$(n.target).val(i)}))}),SessionDetailsServiceModule=function(){function i(t){return n.serviceUrl+"/"+t}function r(n,t,r,u){var e=function(n){console.error(n.responseText)},f;n.type=="GET"?(f=i(n.name)+(t?"?"+t:""),$.ajax({type:n.type,url:f,cache:!1,dataType:"text",success:r,error:u?u:e})):n.type=="POST"}var n={},t={UPDATE_MEMBER_PAID_SESSIONS:{name:"UpdateMemberPaidSessionsCount",type:"GET"}};return n.serviceUrl="/Touch.Services/SessionDetailsProvider.svc",n.method="POST",n.updateMemberPaidSessionsCount=function(n){r(t.UPDATE_MEMBER_PAID_SESSIONS,n?"hireExpert=true":null,function(n){var t=JSON.parse(n)})},n}(),function(n){function e(n){return t.serviceUrl+"/"+n}function o(n,i){s(t.serviceMethodType,t.serviceMethod.GET_USER_TIER_LEVEL,t.serviceTimeout,function(t){if(t!=null&&t.TierLevel!=null){var r=t.TierLevel;n(r)}else i("No tier level found associated with this member id")},function(n){if(i!=undefined){var t=n.errorMessage;i(t)}})}function s(n,t,i,r,u){f=$.ajax({type:n,url:e(t),dataType:"json",contentType:"application/json; charset=utf-8",success:r,error:u,timeout:i})}function i(n,i){var r=!1;o(function(i){r=a(t.cookieNames.TIER_LEVEL,i,t.cookieExpirationTimeInDays),n!=undefined&&n(r)},function(n){i!=undefined&&i(n)})}function h(n,t){n.preventDefault();var r=t.getAttribute("href");return i(function(){document.location=r},function(){document.location=r}),!0}function c(n){var t=document.cookie.indexOf(";",n);return t==-1&&(t=document.cookie.length),unescape(document.cookie.substring(n,t))}function l(n){for(var r=n+"=",u=r.length,f=document.cookie.length,t=0,i;t<f;){if(i=t+u,document.cookie.substring(t,i)==r)return c(i);if(t=document.cookie.indexOf(" ",t)+1,t===0)break}return null}function r(n,t,i){var f="/",e=document.domain,r=e.split("."),u=e,o;r.length==3&&(u=r[1]+"."+r[2]),o=n+"="+escape(t)+(i==null?"":"; expires="+i.toGMTString())+(f==null?"":"; path="+f)+(u==null?"":"; domain="+u),document.cookie=o}function a(n,t,i){var f=new Date;return f.setTime(f.getTime()+u(i)),r(n,t,f),!0}function u(n){return 864e5*n}function v(){return typeof WebSettings=="undefined"||!WebSettings.AjaxServicesPath?null:(t.serviceUrl=WebSettings.AjaxServicesPath+"SupportService.svc",this.enableTierLevelUpdateInSupportLink=function(n){l(t.cookieNames.TIER_LEVEL_REFRESHED)===null&&i(function(){r(t.cookieNames.TIER_LEVEL_REFRESHED,"1",new Date(+new Date+u(t.cookieExpirationTimeInDays)))}),$(n).click(function(n){h(n,this)})},this)}var t={serviceMethod:{GET_USER_TIER_LEVEL:"GetUserTierLevel"},serviceMethodType:"GET",serviceTimeout:15e3,serviceUrl:"",cookieNames:{TIER_LEVEL:"tid",TIER_LEVEL_REFRESHED:"tid_ref"},cookieExpirationTimeInDays:.25},f=null;n.SupportService=v}(LP.services=LP.services||{}),function(n,t,i){function e(i,r,u){var f=t.createElement(i);return r&&(f.id=h+r),u&&(f.style.cssText=u),n(f)}function ai(){return i.innerHeight?i.innerHeight:n(i).height()}function kt(n){var i=c.length,t=(a+n)%i;return t<0?i+t:t}function y(n,t){return Math.round((/%/.test(n)?(t==="x"?d.width():ai())/100:1)*parseInt(n,10))}function pi(n,t){return n.photo||n.photoRegex.test(t)}function wi(n,t){return n.retinaUrl&&i.devicePixelRatio>1?t.replace(n.photoRegex,n.retinaSuffix):t}function bi(n){"contains"in u[0]&&!u[0].contains(n.target)&&(n.stopPropagation(),u.focus())}function ki(){var t,i=n.data(v,b);i==null?(r=n.extend({},gt),console&&console.log&&console.log("Error: cboxElement missing settings object")):r=n.extend({},i);for(t in r)n.isFunction(r[t])&&t.slice(0,2)!=="on"&&(r[t]=r[t].call(v));r.rel=r.rel||v.rel||n(v).data("rel")||"nofollow",r.href=r.href||n(v).attr("href"),r.title=r.title||v.title,typeof r.href=="string"&&(r.href=n.trim(r.href))}function ft(i,r){n(t).trigger(i),w.trigger(i),n.isFunction(r)&&r.call(v)}function dt(i){if(!at){if(v=i,ki(),c=n(v),a=0,r.rel!=="nofollow"&&(c=n("."+et).filter(function(){var t=n.data(this,b),i;return t&&(i=n(this).data("rel")||t.rel||this.rel),i===r.rel}),a=c.index(v),a===-1&&(c=c.add(v),a=c.length-1)),k.css({opacity:parseFloat(r.opacity),cursor:r.overlayClose?"pointer":"auto",visibility:"visible"}).show(),hi&&u.add(k).removeClass(hi),r.className&&u.add(k).addClass(r.className),hi=r.className,r.closeButton?bt.html(r.close).appendTo(p):bt.appendTo("<div/>"),!tt){if(tt=lt=!0,u.css({visibility:"hidden",display:"block"}),l=e(o,"LoadedContent","width:0; height:0; overflow:hidden"),p.css({width:"",height:""}).append(l),g=ii.height()+fi.height()+p.outerHeight(!0)-p.height(),nt=ri.width()+ui.width()+p.outerWidth(!0)-p.width(),it=l.outerHeight(!0),rt=l.outerWidth(!0),r.w=y(r.initialWidth,"x"),r.h=y(r.initialHeight,"y"),l.css({width:"",height:r.h}),s.position(),ft(gi,r.onOpen),si.add(ei).hide(),u.focus(),r.trapFocus&&t.addEventListener){t.addEventListener("focus",bi,!0);w.one(ti,function(){t.removeEventListener("focus",bi,!0)})}if(r.returnFocus)w.one(ti,function(){n(v).focus()})}ir()}}function di(){!u&&t.body&&(li=!1,d=n(i),u=e(o).attr({id:b,"class":n.support.opacity===!1?h+"IE":"",role:"dialog",tabindex:"-1"}).hide(),k=e(o,"Overlay").hide(),wt=n([e(o,"LoadingOverlay")[0],e(o,"LoadingGraphic")[0]]),ut=e(o,"Wrapper"),p=e(o,"Content").append(ei=e(o,"Title"),oi=e(o,"Current"),ct=n('<button type="button"/>').attr({id:h+"Previous"}),ht=n('<button type="button"/>').attr({id:h+"Next"}),ot=e("button","Slideshow"),wt),bt=n('<button type="button"/>').attr({id:h+"Close"}),ut.append(e(o).append(e(o,"TopLeft"),ii=e(o,"TopCenter"),e(o,"TopRight")),e(o,!1,"clear:left").append(ri=e(o,"MiddleLeft"),p,ui=e(o,"MiddleRight")),e(o,!1,"clear:left").append(e(o,"BottomLeft"),fi=e(o,"BottomCenter"),e(o,"BottomRight"))).find("div div").css({float:"left"}),st=e(o,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),si=ht.add(ct).add(oi).add(ot),n(t.body).append(k,u.append(ut,st)))}function tr(){function i(n){n.which>1||n.shiftKey||n.altKey||n.metaKey||n.ctrlKey||(n.preventDefault(),dt(this))}if(u){if(!li)if(li=!0,ht.click(function(){s.next()}),ct.click(function(){s.prev()}),bt.click(function(){s.close()}),k.click(function(){r.overlayClose&&s.close()}),n(t).bind("keydown."+h,function(n){var t=n.keyCode;tt&&r.escKey&&t===27&&(n.preventDefault(),s.close()),tt&&r.arrowKey&&c[1]&&!n.altKey&&(t===37?(n.preventDefault(),ct.click()):t===39&&(n.preventDefault(),ht.click()))}),n.isFunction(n.fn.on))n(t).on("click."+h,"."+et,i);else n("."+et).live("click."+h,i);return!0}return!1}function ir(){var u,b,p=s.prep,k,d=++ci;if(lt=!0,f=!1,v=c[a],ki(),ft(pt),ft(vt,r.onLoad),r.h=r.height?y(r.height,"y")-it-g:r.innerHeight&&y(r.innerHeight,"y"),r.w=r.width?y(r.width,"x")-rt-nt:r.innerWidth&&y(r.innerWidth,"x"),r.mw=r.w,r.mh=r.h,r.maxWidth&&(r.mw=y(r.maxWidth,"x")-rt-nt,r.mw=r.w&&r.w<r.mw?r.w:r.mw),r.maxHeight&&(r.mh=y(r.maxHeight,"y")-it-g,r.mh=r.h&&r.h<r.mh?r.h:r.mh),u=r.href,vi=setTimeout(function(){wt.show()},100),r.inline){k=e(o).hide().insertBefore(n(u)[0]);w.one(pt,function(){k.replaceWith(l.children())});p(n(u))}else if(r.iframe)p(" ");else if(r.html)p(r.html);else if(pi(r,u)){u=wi(r,u),f=t.createElement("img");n(f).addClass(h+"Photo").bind("error",function(){r.title=!1,p(e(o,"Error").html(r.imgError))}).one("load",function(){var t;d===ci&&(n.each(["alt","longdesc","aria-describedby"],function(t,i){var r=n(v).attr(i)||n(v).attr("data-"+i);r&&f.setAttribute(i,r)}),r.retinaImage&&i.devicePixelRatio>1&&(f.height=f.height/i.devicePixelRatio,f.width=f.width/i.devicePixelRatio),r.scalePhotos&&(b=function(){f.height-=f.height*t,f.width-=f.width*t},r.mw&&f.width>r.mw&&(t=(f.width-r.mw)/f.width,b()),r.mh&&f.height>r.mh&&(t=(f.height-r.mh)/f.height,b())),r.h&&(f.style.marginTop=Math.max(r.mh-f.height,0)/2+"px"),c[1]&&(r.loop||c[a+1])&&(f.style.cursor="pointer",f.onclick=function(){s.next()}),f.style.width=f.width+"px",f.style.height=f.height+"px",setTimeout(function(){p(f)},1))});setTimeout(function(){f.src=u},1)}else u&&st.load(u,r.data,function(t,i){d===ci&&p(i==="error"?e(o,"Error").html(r.xhrError):n(this).contents())})}var gt={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:undefined,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1},b="colorbox",h="cbox",et=h+"Element",gi=h+"_open",vt=h+"_load",yt=h+"_complete",ni=h+"_cleanup",ti=h+"_closed",pt=h+"_purge",k,u,ut,p,ii,ri,ui,fi,c,d,l,st,wt,ei,oi,ot,ht,ct,bt,si,w=n("<a/>"),r,g,nt,it,rt,v,a,f,tt,lt,at,vi,s,o="div",hi,ci=0,yi={},li,nr=function(){function t(){clearTimeout(l)}function e(){(r.loop||c[a+1])&&(t(),l=setTimeout(s.next,r.slideshowSpeed))}function v(){ot.html(r.slideshowStop).unbind(i).one(i,y);w.bind(yt,e).bind(vt,t),u.removeClass(n+"off").addClass(n+"on")}function y(){t(),w.unbind(yt,e).unbind(vt,t);ot.html(r.slideshowStart).unbind(i).one(i,function(){s.next(),v()});u.removeClass(n+"on").addClass(n+"off")}function o(){f=!1,ot.hide(),t(),w.unbind(yt,e).unbind(vt,t),u.removeClass(n+"off "+n+"on")}var f,n=h+"Slideshow_",i="click."+h,l;return function(){if(f)r.slideshow||(w.unbind(ni,o),o());else if(r.slideshow&&c[1]){f=!0;w.one(ni,o);r.slideshowAuto?v():y(),ot.show()}}}();n.colorbox||(n(di),s=n.fn[b]=n[b]=function(t,i){var r=this;if(t=t||{},di(),tr()){if(n.isFunction(r))r=n("<a/>"),t.open=!0;else if(!r[0])return r;i&&(t.onComplete=i),r.each(function(){n.data(this,b,n.extend({},n.data(this,b)||gt,t))}).addClass(et),(n.isFunction(t.open)&&t.open.call(r)||t.open)&&dt(r[0])}return r},s.position=function(t,i){function w(){ii[0].style.width=fi[0].style.width=p[0].style.width=parseInt(u[0].style.width,10)-nt+"px",p[0].style.height=ri[0].style.height=ui[0].style.height=parseInt(u[0].style.height,10)-g+"px"}var f,e=0,o=0,c=u.offset(),l,a,v;d.unbind("resize."+h),u.css({top:-9e4,left:-9e4}),l=d.scrollTop(),a=d.scrollLeft(),r.fixed?(c.top-=l,c.left-=a,u.css({position:"fixed"})):(e=l,o=a,u.css({position:"absolute"})),o+=r.right!==!1?Math.max(d.width()-r.w-rt-nt-y(r.right,"x"),0):r.left!==!1?y(r.left,"x"):Math.round(Math.max(d.width()-r.w-rt-nt,0)/2),e+=r.bottom!==!1?Math.max(ai()-r.h-it-g-y(r.bottom,"y"),0):r.top!==!1?y(r.top,"y"):Math.round(Math.max(ai()-r.h-it-g,0)/2),u.css({top:c.top,left:c.left,visibility:"visible"}),ut[0].style.width=ut[0].style.height="9999px",f={width:r.w+rt+nt,height:r.h+it+g,top:e,left:o},t&&(v=0,n.each(f,function(n){if(f[n]!==yi[n]){v=t;return}}),t=v),yi=f,t||u.css(f),u.dequeue().animate(f,{duration:t||0,complete:function(){w(),lt=!1,ut[0].style.width=r.w+rt+nt+"px",ut[0].style.height=r.h+it+g+"px",r.reposition&&setTimeout(function(){d.bind("resize."+h,s.position)},1),i&&i()},step:w})},s.resize=function(n){var t;tt&&(n=n||{},n.width&&(r.w=y(n.width,"x")-rt-nt),n.innerWidth&&(r.w=y(n.innerWidth,"x")),l.css({width:r.w}),n.height&&(r.h=y(n.height,"y")-it-g),n.innerHeight&&(r.h=y(n.innerHeight,"y")),n.innerHeight||n.height||(t=l.scrollTop(),l.css({height:"auto"}),r.h=l.height()),l.css({height:r.h}),t&&l.scrollTop(t),s.position(r.transition==="none"?0:r.speed))},s.prep=function(i){function k(){return r.w=r.w||l.width(),r.w=r.mw&&r.mw<r.w?r.mw:r.w}function d(){return r.h=r.h||l.height(),r.h=r.mh&&r.mh<r.h?r.mh:r.h}if(tt){var v,y=r.transition==="none"?0:r.speed;l.empty().remove(),l=e(o,"LoadedContent").append(i),l.hide().appendTo(st.show()).css({width:k(),overflow:r.scrolling?"auto":"hidden"}).css({height:d()}).prependTo(p),st.hide(),n(f).css({float:"none"}),v=function(){function p(){n.support.opacity===!1&&u[0].style.removeAttribute("filter")}var f=c.length,i,s="frameBorder",v="allowTransparency",o;if(tt){if(o=function(){clearTimeout(vi),wt.hide(),ft(yt,r.onComplete)},ei.html(r.title).add(l).show(),f>1?(typeof r.current=="string"&&oi.html(r.current.replace("{current}",a+1).replace("{total}",f)).show(),ht[r.loop||a<f-1?"show":"hide"]().html(r.next),ct[r.loop||a?"show":"hide"]().html(r.previous),nr(),r.preloading&&n.each([kt(-1),kt(1)],function(){var i,f,u=c[this],r=n.data(u,b);r&&r.href?(i=r.href,n.isFunction(i)&&(i=i.call(u))):i=n(u).attr("href"),i&&pi(r,i)&&(i=wi(r,i),f=t.createElement("img"),f.src=i)})):si.hide(),r.iframe){i=e("iframe")[0],s in i&&(i[s]=0),v in i&&(i[v]="true"),r.scrolling||(i.scrolling="no"),n(i).attr({src:r.href,name:+new Date,"class":h+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",o).appendTo(l);w.one(pt,function(){i.src="//about:blank"});r.fastIframe&&n(i).trigger("load")}else o();r.transition==="fade"?u.fadeTo(y,1,p):p()}},r.transition==="fade"?u.fadeTo(y,0,function(){s.position(0,v)}):s.position(y,v)}},s.next=function(){!lt&&c[1]&&(r.loop||c[a+1])&&(a=kt(1),dt(c[a]))},s.prev=function(){!lt&&c[1]&&(r.loop||a)&&(a=kt(-1),dt(c[a]))},s.close=function(){tt&&!at&&(at=!0,tt=!1,ft(ni,r.onCleanup),d.unbind("."+h),k.fadeTo(r.fadeOut||0,0),u.stop().fadeTo(r.fadeOut||0,0,function(){u.add(k).css({opacity:1,cursor:"auto"}).hide(),ft(pt),l.empty().remove(),setTimeout(function(){at=!1,ft(ti,r.onClosed)},1)}))},s.remove=function(){u&&(u.stop(),n.colorbox.close(),u.stop().remove(),k.remove(),at=!1,u=null,n("."+et).removeData(b).removeClass(et),n(t).unbind("click."+h))},s.element=function(){return n(v)},s.settings=gt)}(jQuery,document,window),function(n,t){"object"==typeof module&&module.exports?module.exports=t(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"==typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):n.URI=t(n.punycode,n.IPv6,n.SecondLevelDomains,n)}(this,function(n,t,i,r){function u(n,t){var i=1<=arguments.length,r=2<=arguments.length;if(!(this instanceof u))return i?r?new u(n,t):new u(n):new u;if(void 0===n){if(i)throw new TypeError("undefined is not a valid argument for URI");n="undefined"!=typeof location?location.href+"":""}if(null===n&&i)throw new TypeError("null is not a valid argument for URI");return this.href(n),void 0!==t?this.absoluteTo(t):this}function h(n){return n.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(n){return void 0===n?"Undefined":String(Object.prototype.toString.call(n)).slice(8,-1)}function e(n){return"Array"===c(n)}function b(n,t){var r={},u,i;if("RegExp"===c(t))r=null;else if(e(t))for(i=0,u=t.length;i<u;i++)r[t[i]]=!0;else r[t]=!0;for(i=0,u=n.length;i<u;i++)(r&&void 0!==r[n[i]]||!r&&t.test(n[i]))&&(n.splice(i,1),u--,i--);return n}function l(n,t){var r,i,u;if(e(t)){for(i=0,r=t.length;i<r;i++)if(!l(n,t[i]))return!1;return!0}for(u=c(t),i=0,r=n.length;i<r;i++)if("RegExp"===u){if("string"==typeof n[i]&&n[i].match(t))return!0}else if(n[i]===t)return!0;return!1}function k(n,t){if(!e(n)||!e(t)||n.length!==t.length)return!1;n.sort(),t.sort();for(var i=0,r=n.length;i<r;i++)if(n[i]!==t[i])return!1;return!0}function p(n){return n.replace(/^\/+|\/+$/g,"")}function nt(n){return escape(n)}function w(n){return encodeURIComponent(n).replace(/[!'()*]/g,nt).replace(/\*/g,"%2A")}function a(n){return function(t,i){return void 0===t?this._parts[n]||"":(this._parts[n]=t||null,this.build(!i),this)}}function d(n,t){return function(i,r){return void 0===i?this._parts[n]||"":(null!==i&&(i+="",i.charAt(0)===t&&(i=i.substring(1))),this._parts[n]=i,this.build(!r),this)}}var tt=r&&r.URI,f,o,s,v,y,g;u.version="1.19.2",f=u.prototype,o=Object.prototype.hasOwnProperty,u._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:u.preventInvalidHostname,duplicateQueryParameters:u.duplicateQueryParameters,escapeQuerySpace:u.escapeQuerySpace}},u.preventInvalidHostname=!1,u.duplicateQueryParameters=!1,u.escapeQuerySpace=!0,u.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,u.idn_expression=/[^a-z0-9\._-]/i,u.punycode_expression=/(xn--)/i,u.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,u.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,u.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019]))/ig,u.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u201e\u2018\u2019]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},u.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},u.hostProtocols=["http","https"],u.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,u.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},u.getDomAttribute=function(n){if(n&&n.nodeName){var t=n.nodeName.toLowerCase();if("input"!==t||"image"===n.type)return u.domAttributes[t]}},u.encode=w,u.decode=decodeURIComponent,u.iso8859=function(){u.encode=escape,u.decode=unescape},u.unicode=function(){u.encode=w,u.decode=decodeURIComponent},u.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},u.encodeQuery=function(n,t){var i=u.encode(n+"");return void 0===t&&(t=u.escapeQuerySpace),t?i.replace(/%20/g,"+"):i},u.decodeQuery=function(n,t){n+="",void 0===t&&(t=u.escapeQuerySpace);try{return u.decode(t?n.replace(/\+/g,"%20"):n)}catch(i){return n}},s={encode:"encode",decode:"decode"},y=function(n,t){return function(i){try{return u[t](i+"").replace(u.characters[n][t].expression,function(i){return u.characters[n][t].map[i]})}catch(r){return i}}};for(v in s)u[v+"PathSegment"]=y("pathname",s[v]),u[v+"UrnPathSegment"]=y("urnpath",s[v]);s=function(n,t,i){return function(r){var o=i?function(n){return u[t](u[i](n))}:u[t],f,e;for(r=(r+"").split(n),f=0,e=r.length;f<e;f++)r[f]=o(r[f]);return r.join(n)}},u.decodePath=s("/","decodePathSegment"),u.decodeUrnPath=s(":","decodeUrnPathSegment"),u.recodePath=s("/","encodePathSegment","decode"),u.recodeUrnPath=s(":","encodeUrnPathSegment","decode"),u.encodeReserved=y("reserved","encode"),u.parse=function(n,t){t||(t={preventInvalidHostname:u.preventInvalidHostname});var i=n.indexOf("#");return-1<i&&(t.fragment=n.substring(i+1)||null,n=n.substring(0,i)),i=n.indexOf("?"),-1<i&&(t.query=n.substring(i+1)||null,n=n.substring(0,i)),"//"===n.substring(0,2)?(t.protocol=null,n=n.substring(2),n=u.parseAuthority(n,t)):(i=n.indexOf(":"),-1<i&&(t.protocol=n.substring(0,i)||null,t.protocol&&!t.protocol.match(u.protocol_expression)?t.protocol=void 0:"//"===n.substring(i+1,i+3)?(n=n.substring(i+3),n=u.parseAuthority(n,t)):(n=n.substring(i+1),t.urn=!0))),t.path=n,t},u.parseHost=function(n,t){var i,r,f;return n||(n=""),n=n.replace(/\\/g,"/"),i=n.indexOf("/"),-1===i&&(i=n.length),"["===n.charAt(0)?(r=n.indexOf("]"),t.hostname=n.substring(1,r)||null,t.port=n.substring(r+2,i)||null,"/"===t.port&&(t.port=null)):(f=n.indexOf(":"),r=n.indexOf("/"),f=n.indexOf(":",f+1),-1!==f&&(-1===r||f<r)?(t.hostname=n.substring(0,i)||null,t.port=null):(r=n.substring(0,i).split(":"),t.hostname=r[0]||null,t.port=r[1]||null)),t.hostname&&"/"!==n.substring(i).charAt(0)&&(i++,n="/"+n),t.preventInvalidHostname&&u.ensureValidHostname(t.hostname,t.protocol),t.port&&u.ensureValidPort(t.port),n.substring(i)||"/"},u.parseAuthority=function(n,t){return n=u.parseUserinfo(n,t),u.parseHost(n,t)},u.parseUserinfo=function(n,t){var i=n.indexOf("/"),r=n.lastIndexOf("@",-1<i?i:n.length-1);return-1<r&&(-1===i||r<i)?(i=n.substring(0,r).split(":"),t.username=i[0]?u.decode(i[0]):null,i.shift(),t.password=i[0]?u.decode(i.join(":")):null,n=n.substring(r+1)):(t.username=null,t.password=null),n},u.parseQuery=function(n,t){if(!n)return{};if(n=n.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!n)return{};for(var i={},s=n.split("&"),h=s.length,f,r,e=0;e<h;e++)(f=s[e].split("="),r=u.decodeQuery(f.shift(),t),f=f.length?u.decodeQuery(f.join("="),t):null,o.call(i,r))?(("string"==typeof i[r]||null===i[r])&&(i[r]=[i[r]]),i[r].push(f)):i[r]=f;return i},u.build=function(n){var t="",i=!1;return n.protocol&&(t+=n.protocol+":"),!n.urn&&(t||n.hostname)&&(t+="//",i=!0),t+=u.buildAuthority(n)||"","string"==typeof n.path&&("/"!==n.path.charAt(0)&&i&&(t+="/"),t+=n.path),"string"==typeof n.query&&n.query&&(t+="?"+n.query),"string"==typeof n.fragment&&n.fragment&&(t+="#"+n.fragment),t},u.buildHost=function(n){var t="";if(n.hostname)t=u.ip6_expression.test(n.hostname)?t+("["+n.hostname+"]"):t+n.hostname;else return"";return n.port&&(t+=":"+n.port),t},u.buildAuthority=function(n){return u.buildUserinfo(n)+u.buildHost(n)},u.buildUserinfo=function(n){var t="";return n.username&&(t+=u.encode(n.username)),n.password&&(t+=":"+u.encode(n.password)),t&&(t+="@"),t},u.buildQuery=function(n,t,i){var s="",r,c,h,f;for(r in n)if(o.call(n,r))if(e(n[r]))for(h={},f=0,c=n[r].length;f<c;f++)void 0!==n[r][f]&&void 0===h[n[r][f]+""]&&(s+="&"+u.buildQueryParameter(r,n[r][f],i),!0!==t&&(h[n[r][f]+""]=!0));else void 0!==n[r]&&(s+="&"+u.buildQueryParameter(r,n[r],i));return s.substring(1)},u.buildQueryParameter=function(n,t,i){return u.encodeQuery(n,i)+(null!==t?"="+u.encodeQuery(t,i):"")},u.addQuery=function(n,t,i){if("object"==typeof t)for(var r in t)o.call(t,r)&&u.addQuery(n,r,t[r]);else if("string"==typeof t)void 0===n[t]?n[t]=i:("string"==typeof n[t]&&(n[t]=[n[t]]),e(i)||(i=[i]),n[t]=(n[t]||[]).concat(i));else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");},u.setQuery=function(n,t,i){if("object"==typeof t)for(var r in t)o.call(t,r)&&u.setQuery(n,r,t[r]);else if("string"==typeof t)n[t]=void 0===i?null:i;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");},u.removeQuery=function(n,t,i){var r;if(e(t))for(i=0,r=t.length;i<r;i++)n[t[i]]=void 0;else if("RegExp"===c(t))for(r in n)t.test(r)&&(n[r]=void 0);else if("object"==typeof t)for(r in t)o.call(t,r)&&u.removeQuery(n,r,t[r]);else if("string"==typeof t)void 0!==i?"RegExp"===c(i)?n[t]=!e(n[t])&&i.test(n[t])?void 0:b(n[t],i):n[t]!==String(i)||e(i)&&1!==i.length?e(n[t])&&(n[t]=b(n[t],i)):n[t]=void 0:n[t]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");},u.hasQuery=function(n,t,i,r){var f,s;switch(c(t)){case"String":break;case"RegExp":for(f in n)if(o.call(n,f)&&t.test(f)&&(void 0===i||u.hasQuery(n,f,i)))return!0;return!1;case"Object":for(s in t)if(o.call(t,s)&&!u.hasQuery(n,s,t[s]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter");}switch(c(i)){case"Undefined":return t in n;case"Boolean":return n=!(e(n[t])?!n[t].length:!n[t]),i===n;case"Function":return!!i(n[t],t,n);case"Array":return e(n[t])?(r?l:k)(n[t],i):!1;case"RegExp":return e(n[t])?r?l(n[t],i):!1:!(!n[t]||!n[t].match(i));case"Number":i=String(i);case"String":return e(n[t])?r?l(n[t],i):!1:n[t]===i;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");}},u.joinPaths=function(){for(var n,i,r=[],t=[],e=0,f=0;f<arguments.length;f++)for(n=new u(arguments[f]),r.push(n),n=n.segment(),i=0;i<n.length;i++)"string"==typeof n[i]&&t.push(n[i]),n[i]&&e++;return!t.length||!e?new u(""):(t=new u("").segment(t),""!==r[0].path()&&"/"!==r[0].path().slice(0,1)||t.path("/"+t.path()),t.normalize())},u.commonPath=function(n,t){for(var r=Math.min(n.length,t.length),i=0;i<r;i++)if(n.charAt(i)!==t.charAt(i)){i--;break}return 1>i?n.charAt(0)===t.charAt(0)&&"/"===n.charAt(0)?"/":"":(("/"!==n.charAt(i)||"/"!==t.charAt(i))&&(i=n.substring(0,i).lastIndexOf("/")),n.substring(0,i+1))},u.withinString=function(n,t,i){var e,o,r,f,h;i||(i={});var s=i.start||u.findUri.start,l=i.end||u.findUri.end,c=i.trim||u.findUri.trim,a=i.parens||u.findUri.parens,v=/[a-z0-9-]=["']?$/i;for(s.lastIndex=0;;){if(e=s.exec(n),!e)break;if(o=e.index,!i.ignoreHtml||(r=n.slice(Math.max(o-3,0),o),!r||!v.test(r))){for(f=o+n.slice(o).search(l),r=n.slice(o,f),f=-1;;){if(h=a.exec(r),!h)break;f=Math.max(f,h.index+h[0].length)}r=-1<f?r.slice(0,f)+r.slice(f).replace(c,""):r.replace(c,""),r.length<=e[0].length||i.ignore&&i.ignore.test(r)||(f=o+r.length,e=t(r,o,f,n),void 0===e?s.lastIndex=f:(e=String(e),n=n.slice(0,o)+e+n.slice(f),s.lastIndex=o+e.length))}}return s.lastIndex=0,n},u.ensureValidHostname=function(t,i){var f=!!t,r=!1;if(i&&(r=l(u.hostProtocols,i)),r&&!f)throw new TypeError("Hostname cannot be empty, if protocol is "+i);if(t&&t.match(u.invalid_hostname_characters)){if(!n)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(n.toASCII(t).match(u.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]');}},u.ensureValidPort=function(n){if(n){var t=Number(n);if(!(/^[0-9]+$/.test(t)&&0<t&&65536>t))throw new TypeError('Port "'+n+'" is not a valid port');}},u.noConflict=function(n){return n?(n={URI:this.noConflict()},r.URITemplate&&"function"==typeof r.URITemplate.noConflict&&(n.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"==typeof r.IPv6.noConflict&&(n.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"==typeof r.SecondLevelDomains.noConflict&&(n.SecondLevelDomains=r.SecondLevelDomains.noConflict()),n):(r.URI===this&&(r.URI=tt),this)},f.build=function(n){return!0===n?this._deferred_build=!0:(void 0===n||this._deferred_build)&&(this._string=u.build(this._parts),this._deferred_build=!1),this},f.clone=function(){return new u(this)},f.valueOf=f.toString=function(){return this.build(!1)._string},f.protocol=a("protocol"),f.username=a("username"),f.password=a("password"),f.hostname=a("hostname"),f.port=a("port"),f.query=d("query","?"),f.fragment=d("fragment","#"),f.search=function(n,t){var i=this.query(n,t);return"string"==typeof i&&i.length?"?"+i:i},f.hash=function(n,t){var i=this.fragment(n,t);return"string"==typeof i&&i.length?"#"+i:i},f.pathname=function(n,t){if(void 0===n||!0===n){var i=this._parts.path||(this._parts.hostname?"/":"");return n?(this._parts.urn?u.decodeUrnPath:u.decodePath)(i):i}return this._parts.path=this._parts.urn?n?u.recodeUrnPath(n):"":n?u.recodePath(n):"/",this.build(!t),this},f.path=f.pathname,f.href=function(n,t){var f,i,r;if(void 0===n)return this.toString();if(this._string="",this._parts=u._parts(),i=n instanceof u,r="object"==typeof n&&(n.hostname||n.path||n.pathname),n.nodeName&&(r=u.getDomAttribute(n),n=n[r]||"",r=!1),!i&&r&&void 0!==n.pathname&&(n=n.toString()),"string"==typeof n||n instanceof String)this._parts=u.parse(String(n),this._parts);else if(i||r){i=i?n._parts:n;for(f in i)"query"!==f&&o.call(this._parts,f)&&(this._parts[f]=i[f]);i.query&&this.query(i.query,!1)}else throw new TypeError("invalid input");return this.build(!t),this},f.is=function(n){var r=!1,f=!1,e=!1,t=!1,s=!1,h=!1,c=!1,o=!this._parts.urn;this._parts.hostname&&(o=!1,f=u.ip4_expression.test(this._parts.hostname),e=u.ip6_expression.test(this._parts.hostname),r=f||e,s=(t=!r)&&i&&i.has(this._parts.hostname),h=t&&u.idn_expression.test(this._parts.hostname),c=t&&u.punycode_expression.test(this._parts.hostname));switch(n.toLowerCase()){case"relative":return o;case"absolute":return!o;case"domain":case"name":return t;case"sld":return s;case"ip":return r;case"ip4":case"ipv4":case"inet4":return f;case"ip6":case"ipv6":case"inet6":return e;case"idn":return h;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var it=f.protocol,rt=f.port,ut=f.hostname;return f.protocol=function(n,t){if(n&&(n=n.replace(/:(\/\/)?$/,""),!n.match(u.protocol_expression)))throw new TypeError('Protocol "'+n+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return it.call(this,n,t)},f.scheme=f.protocol,f.port=function(n,t){return this._parts.urn?void 0===n?"":this:(void 0!==n&&(0===n&&(n=null),n&&(n+="",":"===n.charAt(0)&&(n=n.substring(1)),u.ensureValidPort(n))),rt.call(this,n,t))},f.hostname=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0!==n){var i={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==u.parseHost(n,i))throw new TypeError('Hostname "'+n+'" contains characters other than [A-Z0-9.-]');n=i.hostname,this._parts.preventInvalidHostname&&u.ensureValidHostname(n,this._parts.protocol)}return ut.call(this,n,t)},f.origin=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n){var i=this.protocol();return this.authority()?(i?i+"://":"")+this.authority():""}return i=u(n),this.protocol(i.protocol()).authority(i.authority()).build(!t),this},f.host=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n)return this._parts.hostname?u.buildHost(this._parts):"";if("/"!==u.parseHost(n,this._parts))throw new TypeError('Hostname "'+n+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},f.authority=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n)return this._parts.hostname?u.buildAuthority(this._parts):"";if("/"!==u.parseAuthority(n,this._parts))throw new TypeError('Hostname "'+n+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},f.userinfo=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n){var i=u.buildUserinfo(this._parts);return i?i.substring(0,i.length-1):i}return"@"!==n[n.length-1]&&(n+="@"),u.parseUserinfo(n,this._parts),this.build(!t),this},f.resource=function(n,t){if(void 0===n)return this.path()+this.search()+this.hash();var i=u.parse(n);return this._parts.path=i.path,this._parts.query=i.query,this._parts.fragment=i.fragment,this.build(!t),this},f.subdomain=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n){if(!this._parts.hostname||this.is("IP"))return"";var i=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,i)||""}if(i=this._parts.hostname.length-this.domain().length,i=this._parts.hostname.substring(0,i),i=new RegExp("^"+h(i)),n&&"."!==n.charAt(n.length-1)&&(n+="."),-1!==n.indexOf(":"))throw new TypeError("Domains cannot contain colons");return n&&u.ensureValidHostname(n,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(i,n),this.build(!t),this},f.domain=function(n,t){if(this._parts.urn)return void 0===n?"":this;if("boolean"==typeof n&&(t=n,n=void 0),void 0===n){if(!this._parts.hostname||this.is("IP"))return"";var i=this._parts.hostname.match(/\./g);return i&&2>i.length?this._parts.hostname:(i=this._parts.hostname.length-this.tld(t).length-1,i=this._parts.hostname.lastIndexOf(".",i-1)+1,this._parts.hostname.substring(i)||"")}if(!n)throw new TypeError("cannot set domain empty");if(-1!==n.indexOf(":"))throw new TypeError("Domains cannot contain colons");return u.ensureValidHostname(n,this._parts.protocol),!this._parts.hostname||this.is("IP")?this._parts.hostname=n:(i=new RegExp(h(this.domain())+"$"),this._parts.hostname=this._parts.hostname.replace(i,n)),this.build(!t),this},f.tld=function(n,t){if(this._parts.urn)return void 0===n?"":this;if("boolean"==typeof n&&(t=n,n=void 0),void 0===n){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.lastIndexOf(".");return r=this._parts.hostname.substring(r+1),!0!==t&&i&&i.list[r.toLowerCase()]?i.get(this._parts.hostname)||r:r}if(n)if(n.match(/[^a-zA-Z0-9-]/))if(i&&i.is(n))r=new RegExp(h(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(r,n);else throw new TypeError('TLD "'+n+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");r=new RegExp(h(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(r,n)}else throw new TypeError("cannot set TLD empty");return this.build(!t),this},f.directory=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n||!0===n){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var i=this._parts.path.length-this.filename().length-1;return i=this._parts.path.substring(0,i)||(this._parts.hostname?"/":""),n?u.decodePath(i):i}return i=this._parts.path.length-this.filename().length,i=this._parts.path.substring(0,i),i=new RegExp("^"+h(i)),this.is("relative")||(n||(n="/"),"/"!==n.charAt(0)&&(n="/"+n)),n&&"/"!==n.charAt(n.length-1)&&(n+="/"),n=u.recodePath(n),this._parts.path=this._parts.path.replace(i,n),this.build(!t),this},f.filename=function(n,t){var i,r;return this._parts.urn?void 0===n?"":this:"string"!=typeof n?!this._parts.path||"/"===this._parts.path?"":(i=this._parts.path.lastIndexOf("/"),i=this._parts.path.substring(i+1),n?u.decodePathSegment(i):i):(i=!1,"/"===n.charAt(0)&&(n=n.substring(1)),n.match(/\.?\//)&&(i=!0),r=new RegExp(h(this.filename())+"$"),n=u.recodePath(n),this._parts.path=this._parts.path.replace(r,n),i?this.normalizePath(t):this.build(!t),this)},f.suffix=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n||!0===n){if(!this._parts.path||"/"===this._parts.path)return"";var i=this.filename(),r=i.lastIndexOf(".");return-1===r?"":(i=i.substring(r+1),i=/^[a-z0-9%]+$/i.test(i)?i:"",n?u.decodePathSegment(i):i)}if("."===n.charAt(0)&&(n=n.substring(1)),i=this.suffix())r=n?new RegExp(h(i)+"$"):new RegExp(h("."+i)+"$");else{if(!n)return this;this._parts.path+="."+u.recodePath(n)}return r&&(n=u.recodePath(n),this._parts.path=this._parts.path.replace(r,n)),this.build(!t),this},f.segment=function(n,t,i){var u=this._parts.urn?":":"/",r=this.path(),f="/"===r.substring(0,1),o;if(r=r.split(u),void 0!==n&&"number"!=typeof n&&(i=t,t=n,n=void 0),void 0!==n&&"number"!=typeof n)throw Error('Bad segment "'+n+'", must be 0-based integer');if(f&&r.shift(),0>n&&(n=Math.max(r.length+n,0)),void 0===t)return void 0===n?r:r[n];if(null===n||void 0===r[n])if(e(t))for(r=[],n=0,o=t.length;n<o;n++)(t[n].length||r.length&&r[r.length-1].length)&&(r.length&&!r[r.length-1].length&&r.pop(),r.push(p(t[n])));else(t||"string"==typeof t)&&(t=p(t),""===r[r.length-1]?r[r.length-1]=t:r.push(t));else t?r[n]=p(t):r.splice(n,1);return f&&r.unshift(""),this.path(r.join(u),i)},f.segmentCoded=function(n,t,i){var f,r;if("number"!=typeof n&&(i=t,t=n,n=void 0),void 0===t){if(n=this.segment(n,t,i),e(n))for(r=0,f=n.length;r<f;r++)n[r]=u.decode(n[r]);else n=void 0!==n?u.decode(n):void 0;return n}if(e(t))for(r=0,f=t.length;r<f;r++)t[r]=u.encode(t[r]);else t="string"==typeof t||t instanceof String?u.encode(t):t;return this.segment(n,t,i)},g=f.query,f.query=function(n,t){if(!0===n)return u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof n){var i=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r=n.call(this,i);return this._parts.query=u.buildQuery(r||i,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==n&&"string"!=typeof n?(this._parts.query=u.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):g.call(this,n,t)},f.setQuery=function(n,t,i){var f=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r;if("string"==typeof n||n instanceof String)f[n]=void 0!==t?t:null;else if("object"==typeof n)for(r in n)o.call(n,r)&&(f[r]=n[r]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=u.buildQuery(f,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof n&&(i=t),this.build(!i),this},f.addQuery=function(n,t,i){var r=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return u.addQuery(r,n,void 0===t?null:t),this._parts.query=u.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof n&&(i=t),this.build(!i),this},f.removeQuery=function(n,t,i){var r=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return u.removeQuery(r,n,t),this._parts.query=u.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof n&&(i=t),this.build(!i),this},f.hasQuery=function(n,t,i){var r=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return u.hasQuery(r,n,t,i)},f.setSearch=f.setQuery,f.addSearch=f.addQuery,f.removeSearch=f.removeQuery,f.hasSearch=f.hasQuery,f.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},f.normalizeProtocol=function(n){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!n)),this},f.normalizeHostname=function(i){return this._parts.hostname&&(this.is("IDN")&&n?this._parts.hostname=n.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!i)),this},f.normalizePort=function(n){return"string"==typeof this._parts.protocol&&this._parts.port===u.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!n)),this},f.normalizePath=function(n){var t=this._parts.path,r,e,i,f;if(!t)return this;if(this._parts.urn)return this._parts.path=u.recodeUrnPath(this._parts.path),this.build(!n),this;if("/"===this._parts.path)return this;for(t=u.recodePath(t),r="","/"!==t.charAt(0)&&(e=!0,t="/"+t),("/.."===t.slice(-3)||"/."===t.slice(-2))&&(t+="/"),t=t.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),e&&(r=t.substring(1).match(/^(\.\.\/)+/)||"")&&(r=r[0]);;){if(i=t.search(/\/\.\.(\/|$)/),-1===i)break;else if(0===i){t=t.substring(3);continue}f=t.substring(0,i).lastIndexOf("/"),-1===f&&(f=i),t=t.substring(0,f)+t.substring(i+3)}return e&&this.is("relative")&&(t=r+t.substring(1)),this._parts.path=t,this.build(!n),this},f.normalizePathname=f.normalizePath,f.normalizeQuery=function(n){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(u.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!n)),this},f.normalizeFragment=function(n){return this._parts.fragment||(this._parts.fragment=null,this.build(!n)),this},f.normalizeSearch=f.normalizeQuery,f.normalizeHash=f.normalizeFragment,f.iso8859=function(){var n=u.encode,t=u.decode;u.encode=escape,u.decode=decodeURIComponent;try{this.normalize()}finally{u.encode=n,u.decode=t}return this},f.unicode=function(){var n=u.encode,t=u.decode;u.encode=w,u.decode=unescape;try{this.normalize()}finally{u.encode=n,u.decode=t}return this},f.readable=function(){var t=this.clone(),i,r;if(t.username("").password("").normalize(),i="",t._parts.protocol&&(i+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&n?(i+=n.toUnicode(t._parts.hostname),t._parts.port&&(i+=":"+t._parts.port)):i+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(i+="/"),i+=t.path(!0),t._parts.query){for(var f="",e=0,o=t._parts.query.split("&"),s=o.length;e<s;e++)r=(o[e]||"").split("="),f+="&"+u.decodeQuery(r[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==r[1]&&(f+="="+u.decodeQuery(r[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"));i+="?"+f.substring(1)}return i+=u.decodeQuery(t.hash(),!0)},f.absoluteTo=function(n){var t=this.clone(),i=["protocol","username","password","hostname","port"],r,f;if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");if((n instanceof u||(n=new u(n)),t._parts.protocol)||(t._parts.protocol=n._parts.protocol,this._parts.hostname))return t;for(r=0;f=i[r];r++)t._parts[f]=n._parts[f];return t._parts.path?(".."===t._parts.path.substring(-2)&&(t._parts.path+="/"),"/"!==t.path().charAt(0)&&(i=(i=n.directory())?i:0===n.path().indexOf("/")?"/":"",t._parts.path=(i?i+"/":"")+t._parts.path,t.normalizePath())):(t._parts.path=n._parts.path,t._parts.query||(t._parts.query=n._parts.query)),t.build(),t},f.relativeTo=function(n){var r=this.clone().normalize();if(r._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");n=new u(n).normalize();var t=r._parts,i=n._parts,f=r.path();if(n=n.path(),"/"!==f.charAt(0))throw Error("URI is already relative");if("/"!==n.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===i.protocol&&(t.protocol=null),t.username===i.username&&t.password===i.password&&null===t.protocol&&null===t.username&&null===t.password&&t.hostname===i.hostname&&t.port===i.port)t.hostname=null,t.port=null;else return r.build();return f===n?(t.path="",r.build()):(f=u.commonPath(f,n),!f)?r.build():(i=i.path.substring(f.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../"),t.path=i+t.path.substring(f.length)||"./",r.build())},f.equals=function(n){var t=this.clone(),f=new u(n),i,s,r;if(n={},t.normalize(),f.normalize(),t.toString()===f.toString())return!0;if(s=t.query(),r=f.query(),t.query(""),f.query(""),t.toString()!==f.toString()||s.length!==r.length)return!1;t=u.parseQuery(s,this._parts.escapeQuerySpace),r=u.parseQuery(r,this._parts.escapeQuerySpace);for(i in t)if(o.call(t,i)){if(e(t[i])){if(!k(t[i],r[i]))return!1}else if(t[i]!==r[i])return!1;n[i]=!0}for(i in r)if(o.call(r,i)&&!n[i])return!1;return!0},f.preventInvalidHostname=function(n){return this._parts.preventInvalidHostname=!!n,this},f.duplicateQueryParameters=function(n){return this._parts.duplicateQueryParameters=!!n,this},f.escapeQuerySpace=function(n){return this._parts.escapeQuerySpace=!!n,this},u}),NotifyMeObject=function(){function n(){$.ajax({type:"GET",url:"/Touch.Services/NotifyMeWhenAvailable.svc/GetPhoneSubscriptions",cache:!1,dataType:"json",success:function(n){NotifyVariables.expertIdsClientAskedToBeNotified=[],NotifyVariables.clientPhonesAskedToBeNotified=[];for(var t=0;t<n.length;t++)NotifyVariables.expertIdsClientAskedToBeNotified.push(n[t].Key),NotifyVariables.clientPhonesAskedToBeNotified.push(n[t].Value)}})}function i(n,t){var i,r=t;this.stop=function(){i&&(clearInterval(i),i=null)},this.start=function(){i||(i=setInterval(n,r))},this.reset=function(n){r=n||r,this.stop(),this.start()}}var t=new i(n,2e4);return{StartIntervalLoadPhoneSubscription:function(){NotifyVariables.notifyFeatureIsTurnedOn==="True"&&NotifyVariables.ifClientLoggedIn==="True"&&(n(),t.start())},RestartIntervalLoadPhoneSubscription:function(){NotifyVariables.notifyFeatureIsTurnedOn==="True"&&NotifyVariables.ifClientLoggedIn==="True"&&t.reset()}}}();var serviceHost=typeof WebSettings!="undefined"?WebSettings.CasApiEndpoint:"",profileService=new LP.services.ProfileService(serviceHost),trackingService=new LP.services.TrackingEventsService(serviceHost),EmailValidationTemplates=["/AlertTemplates/EmailValidationWelcome.html","/AlertTemplates/EmailValidationFirst.html","/AlertTemplates/EmailValidationSecond.html","/AlertTemplates/EmailValidationThird.html","/AlertTemplates/EmailValidationFourth.html"],EmailValidationThankYouTemplate="/AlertTemplates/EmailValidationThankYou.html",showThankYou=!1;$(document).bind("mobileinit",function(){$.mobile.ignoreContentEnabled=!0,$.extend($.mobile,{ajaxFormsEnabled:!1,ajaxLinksEnabled:!1,ajaxEnabled:!1})}),$('div[data-role="page"]').live("pageinit",function(){(window.location.pathname.indexOf("sign-in.aspx")!==-1||window.location.pathname.indexOf("sign-up.aspx")!==-1||window.location.pathname.indexOf("online-registration.aspx")!==-1)&&LoadFaceBook()}),$(function(){"use strict";$(document).ajaxError(function(n,t,i){var u,f,e;try{if(u=LP.helpers.http,f=LP.enums.HttpStatusCodes,console.error(i.type+" "+t.statusText+" "+t.status+" "+i.url),e=u.formatStatusCodeString(t.status,i.url),n.request=i.data||null,typeof Logger!="undefined")try{switch(t.status){case f.Forbidden:case f.Failure:case f.NotFound:Logger.Error(e,null,n);break;default:u.is4xxCode(t.status)||u.is5xxCode(t.status)||u.isExceptionalCode(t.status)?Logger.Error(e,null,n):u.is3xxCode(t.status)&&Logger.Warning(e,null,n)}}catch(o){}}catch(s){}}),typeof antiForgeryToken!="undefined"&&$(document).ajaxSend(function(n,t,i){(i.url===null||i.url.toLowerCase().indexOf("conchatserver")===-1)&&t.setRequestHeader("AntiForgeryToken",antiForgeryToken)})})