function openURLPopup(n,t){window.open(n,t,"status = 1, height = 436, width = 626, resizable = 0")}function timesTotal(n){n<=6?$("#show-more-appt-times-container").css("display","none"):$("#show-more-appt-times-container").css("display","block")}function getScrollBarWidth(){var t=document.createElement("p"),n,r,i;return t.style.width="100%",t.style.height="200px",n=document.createElement("div"),n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.visibility="hidden",n.style.width="200px",n.style.height="170px",n.style.overflow="hidden",n.appendChild(t),document.body.appendChild(n),r=t.offsetWidth,n.style.overflow="scroll",i=t.offsetWidth,r==i&&(i=n.clientWidth),document.body.removeChild(n),r-i}$(document).ready(function(){function r(n,t){var i=["api/v1/schedule",$("#ProfileGuid").val(),$("#PracticeGuid").val(),$("#PreferredFacilityGuid").val(),n,t,"available"];return ABSOLUTE_PATH_ROOT+i.join("/")}var n="YYYYMMDDHHmm",u=0,i=!1,f=moment(),o=f.format(n),s=f.add(7,"days").startOf("day").format(n),t=function(i){var s=$("#appointment-picker-container").pfcalendar,o=s.getNumberOfVisibleDays(),f=moment(s.getStartDate()),h,c;"forward"==i?f.add(o,"days"):f.subtract(o,"days");f<moment()&&(f=moment());h=f.format(n);c=f.add(o,"days").startOf("day").format(n);$.ajax({cache:!1,url:r(h,c),type:"GET",async:!1,success:function(n){$("#appointment-picker-container").pfcalendar({onSelect:function(){e(this)},onNext:function(){t("forward")},onPrev:function(){t("backward")},data:n,page:"forward"==i?++u:--u})},error:function(){setBookingState(!1)}})},e=function(n){!1===i&&(i=!0,$("#AppointmentRequestDateTime").val($(n).attr("data-value")),$("#AppointmentRequestDuration").val("00:30:00"),$(".picker-selected-date").text(moment($(n).attr("data-value")).format("MMMM D, YYYY [at] h:mm a")),$("#appointment-instructions").text("Personal Information"),$("#appointment-picker-container").fadeOut("fast",function(){$("#appointment-form-container").fadeIn("fast");$("#picker-date-range-container").css("opacity",0);$("#active-appointment-step").html(2);i=!1}));ga("send","event",{eventCategory:"patientFusion",eventAction:"Clicked Appointment Time"});dataLayer.push({event:"record",eventName:"Clicked Appointment Time",properties:{eventCategory:"button",eventAction:"click",url:window.location}})};$.ajax({cache:!1,url:r(o,s),type:"GET",success:function(n){$("#appointment-picker-container").pfcalendar({data:n,bind:!0,onSelect:function(){e(this)},onNext:function(){t("forward")},onPrev:function(){t("backward")}})},error:function(){setBookingState(!1)}})});$(document).ready(function(){function r(){$(".readMore").hide();$("#aboutMeText").css("height","auto")}function u(){var t=$("#providerInfo #aboutMeText"),i=t.height(),r;$(t).css("height","auto");r=t.height();i<n?(t.height(i),$(".readMoreSidebar").hide()):i==n?$(".readMoreSidebar").hide():(t.height(r).animate({height:n},{duration:s,easing:"easeOutExpo"}),$(".readMoreSidebar").text("read more..."))}function f(){$("#emailShareModal").modal("show");$("#shareByEmailThankYou").hide();$("#shareByEmail").show()}function i(){$("#shareByEmail").hide();$("#shareByEmailThankYou").show()}function e(){$("#flagModal").hide();$("#flagModal").modal("hide")}function o(){$("#provider-insurance-modal").modal("show")}var s=65,n=200,t;$(".readMore").click(r);$("#show-more-insurances").click(o);$("#ok").click(e);$("#okEmail").click(i);$("#share_email").click(function(){f()});$("#Comment").on("paste keypress keydown",function(){var n=$(this);setTimeout(function(){var t=$(n).val();t.length>499&&$(n).val(t.substring(0,499))},100)});t=3*parseInt($("#aboutMeText").css("line-height"),10);$("#aboutMeText").css("height","auto");$("#aboutMeText").height()<t?$(".readMore").hide():$("#aboutMeText").css("height",t);u();$("[rel=tooltip]").tooltip();$(function(){$("#formShareEmail").submit(function(){return $(this).valid()&&$.ajax({url:this.action,type:this.method,data:$(this).serialize(),success:function(){$("#ToAddress").val("");$("#FromAddress").val("");$("#Message").val("I found a great doctor on patientfusion.com and wanted to share their profile with you.")},error:function(){},beforeSend:function(){i()}}),!1})});$("#formShareEmail").validate({rules:{FromAddress:{email:!0},ToAddress:{email:!0}}});$("#shareByEmailThankYou :button").click(function(){$("#shareByEmailThankYou").hide();$("#emailShareModal").modal("hide")})});$(document).ready(function(){enquire.register("screen and (max-width: 760px)",{unmatch:function(){"undefined"!=typeof GoogleMaps&&GoogleMaps.resize()}});location.hash&&($("a[href="+location.hash+"]").tab("show"),history.pushState("",document.title,window.location.pathname+window.location.search));"undefined"!=typeof GoogleMaps&&GoogleMaps.load()});$(document).ready(function(){function f(){for(var t=$("#appointment-info :input"),r=$("#formStartRequest").validate(),i=!0,n=0;n<t.length;n++)"radio"===t[n].type||r.element(t[n])||(i=!1);return i}function u(t){n($("#appointment-processing"),$("#appointment-confimation"),function(){$("#left-form-nav").hide();$("#appointment-steps").hide();$("#appointment-time-header").hide();$("#appointment-instructions").text("Appointment request made");$("#reset-form").show()});null!==t&&"success"===t?$("#appointment-success").show():$("#appointment-failed").show()}function n(n,t,i){!1===r&&(r=!0,n.fadeOut("fast",function(){t.fadeIn("fast");i();r=!1}))}function i(n){$("#active-appointment-step").html(n)}function e(){var n=$("#scroll-container"),r=$(".slimScrollDiv"),u=n.height(),i;$(n).css("height","auto");i=n.height();u<i&&(r.height(i),n.height(t).animate({height:i},{duration:t,easing:"easeInExpo"}),$("#show-more-appt-times-link").attr("style","display: none !important"),$("#hide-appt-times-link").attr("style","display: block !important"))}function o(){var n=$("#scroll-container"),r=$(".slimScrollDiv"),i=n.height();i>t&&(r.height(t),n.height(i).animate({height:t},{duration:t,easing:"easeInExpo"}),$("#show-more-appt-times-link").attr("style","display: block !important"),$("#hide-appt-times-link").attr("style","display: none !important"))}function s(n){n?($("#map_canvas").show(),"True"!==$("#AppointmentBookingEnabled").val()?($("#office-hours-container").show(),$("#office-available-appointments").hide()):($("#office-hours-container").hide(),$("#office-available-appointments").show())):($("#map_canvas").html('<img src="'+ABSOLUTE_PATH_ROOT+'Content/images/profile_mapErrorImage.png" alt="Unable to show map" />'),$("#office-available-appointments").hide(),$("#office-hours-container").show())}var t=170,r=!1,h=($("#ProfileGuid").val(),$("#PreferredFacilityGuid").val(),$("#PhrAppointmentEndpointUrl").val());s("True"===$("#IsWebSiteEnabled").val());$("#appointment-picker-container").on("calendarDone",function(){$("#scroll-container").slimScroll({height:"170px;",railVisible:!0,alwaysVisible:!0})});$(".doctors-name").text($("#FullName").val());$("#PhoneNumber").mask("(999) 999-9999");$("#BirthDate").mask("99/99/9999");$("#formStartRequest").submit(function(){$.Watermark.HideAll()});$(".yes").click(function(){$(".yes").addClass("selected");$(".no").removeClass("selected");$("#HasSeenTrue").prop("checked",!0);$("#not-accepting-patients-error").hide()});$(".no").click(function(){$(".yes").removeClass("selected");$(".no").addClass("selected");$("#HasSeenFalse").prop("checked",!0);"False"===$("#IsAcceptingNewPatients").val()&&$("#not-accepting-patients-error").show()});$("#show-more-appt-times-link").click(e);$("#hide-appt-times-link").click(o);enquire.register("screen and (max-width: 760px)",function(){$("#appointment-picker-container").pfcalendar.setNumberOfVisibleDays(2);$("#show-more-appt-times-container").show();$("#scroll-container").height(170)});enquire.register("screen and (min-width: 761px) and (max-width: 979px)",function(){$("#appointment-picker-container").pfcalendar.setNumberOfVisibleDays(5);$("#show-more-appt-times-container").show();$("#scroll-container").height(170)});enquire.register("screen and (min-width: 980px)",function(){$("#appointment-picker-container").pfcalendar.setNumberOfVisibleDays(7);$("#show-more-appt-times-container").show();$("#scroll-container").height(170)});$("#right-form-nav").click(function(){"True"===$("#IsAcceptingNewPatients").val()||$("#HasSeenTrue").prop("checked")?f()&&(n($("#appointment-info"),$("#appointment-contact"),function(){$("#appointment-instructions").text("Contact Information");$("#left-form-nav").show();$("#right-form-nav").hide();i(3)}),ga("send","event",{eventCategory:"patientFusion",eventAction:"Appointment Booking Step One"}),dataLayer.push({event:"record",eventName:"Appointment Booking Step One",properties:{eventCategory:"button",eventAction:"click",url:window.location}})):$("#not-accepting-patients-error").show()});$("#appointment-form-prev").click(function(){n($("#appointment-form-container"),$("#appointment-picker-container"),function(){$("#appointment-info").show();$("#appointment-contact").hide();$("#picker-date-range-container").css("opacity",1);$("#appointment-instructions").text("When do you want to come in?");$("#right-form-nav").show();$("#left-form-nav").hide();i(1)})});$("#left-form-nav").click(function(){n($("#appointment-contact"),$("#appointment-info"),function(){$("#appointment-instructions").text("Personal Information");i(2);$("#right-form-nav").show();$("#left-form-nav").hide()})});$.validator.addMethod("check_date_of_birth",function(n){return moment().diff(moment(n),"years")>=18},"You must be over 18 to book an appointment online with this provider. Call to book your appointment.");$.validator.addMethod("check_min_date_of_birth",function(n){var t=Date.parse("01/01/1753");return Date.parse(n)>=t},"Please enter a valid birth date.");$("#formStartRequest").validate({focusInvalid:!1,rules:{EmailAddress:{email:!0},BirthDate:{date:"Enter a valid date",check_date_of_birth:!0,check_min_date_of_birth:!0}},errorPlacement:function(n,t){n.insertAfter(t)},errorElement:"span"});$(function(){$("#formStartRequest").submit(function(){if($(this).valid()){var t=h+"/api/v2/public/creation_requests",i=moment($("#BirthDate").val()).format("YYYY-MM-DD"),r="1"===$("#Gender").val()?"Female":"Male",f=!!$("#HasSeenTrue").prop("checked"),e=moment($("#AppointmentRequestDateTime").val()).format("YYYY/MM/DD HH:mm"),o={data:{type:"creation_requests",attributes:{practice_guid:$("#PracticeGuid").val(),profile_guid:$("#ProfileGuid").val(),patient_first_name:$("#FirstName").val(),patient_last_name:$("#LastName").val(),reason_for_visit:$("#ChiefComplaint").val(),facility_guid:$("#PreferredFacilityGuid").val(),email:$("#EmailAddress").val(),gender:r,phone_number:$("#PhoneNumber").val(),birth_date:i,is_existing_patient:f,start_date_time_flt:e}}};n($("#appointment-contact"),$("#appointment-processing"),function(){$("#left-form-nav").hide();$("#appointment-steps").hide();$("#appointment-time-header").hide();$("#appointment-instructions").text("Appointment request made");$.ajax({url:t,type:"POST",crossDomain:!0,data:o,success:function(n,t){u(t)},error:function(n,t){u(t)}});ga("send","event",{eventCategory:"patientFusion",eventAction:"Appointment Booking Step Two"});dataLayer.push({event:"record",eventName:"Appointment Booking Step Two",properties:{eventCategory:"button",eventAction:"click",url:window.location}})})}return!1})});$("#reset-form").click(function(){$("#formStartRequest").trigger("reset");n($("#appointment-confimation"),$("#appointment-picker-container"),function(){$("#appointment-form-container").hide();$("#appointment-info").show();$("#appointment-contact").hide();$("#picker-date-range-container").css("opacity",1);$("#appointment-instructions").text("When do you want to come in?");$("#right-form-nav").show();$("#left-form-nav").hide();$("#reset-form").hide();i(1);$("#appointment-steps").show();$("#appointment-time-header").show();$("#appointment-failed").hide();$("#appointment-success").hide()})})}),function(n){var t=null,r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],u=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i=7;n.fn.pfcalendar=function(t){var i=this.pfcalendar,r,u,f;void 0===t&&(t={},t.data=i.getDefaultData());r={};n.extend(r,i.defaults,t);u=i.buildTable(r);f=i.buildHeader(r);n(this).find("#picker-header").html(f);n(this).find("#picker-container").html(u);i.setBindings(r);n("#scroll-container").trigger("calendarDone")};n.fn.pfcalendar.defaults={data:{},page:0,onSelect:void 0,onNext:void 0,onPrev:void 0,bind:!0,tableClass:"table pfcalendar-table",tableHeaderClass:"picker-table-thead",tableBodyClass:"picker-table-tbody",tableTimeClass:"picker-cell-time"};n.fn.pfcalendar.getStartDate=function(){return t};n.fn.pfcalendar.getNumberOfVisibleDays=function(){return i};n.extend(n.fn.pfcalendar,{getDefaultData:function(){var n=(new Date).getFullYear(),t=(new Date).getMonth(),i=(new Date).getDate(),r=["9:00:00 AM","9:30:00 AM","10:00:00 AM","10:30:00 AM","11:00:00 AM","11:30:00 AM","12:00:00 PM","12:30:00 PM","1:00:00 PM","1:30:00 PM","2:00:00 PM","2:30:00 PM","3:00:00 PM","3:30:00 PM","4:00:00 PM","4:30:00 PM"];return{days:[{CalendarDate:new Date(n,t,i),CalendarTimes:r},{CalendarDate:new Date(n,t,i+1),CalendarTimes:r},{CalendarDate:new Date(n,t,i+2),CalendarTimes:r},{CalendarDate:new Date(n,t,i+3),CalendarTimes:r},{CalendarDate:new Date(n,t,i+4),CalendarTimes:r},{CalendarDate:new Date(n,t,i+5),CalendarTimes:r},{CalendarDate:new Date(n,t,i+6),CalendarTimes:r}]}},buildHeader:function(n){var u=n.data,f=u.length,r="<table style='width:100%;'>",i;for(r+="<thead class='"+n.tableHeaderClass+"'>",r+="<tr>",i=0;i<f;i++)0==i&&(t=u[i].CalendarDate),r+=this.formatDayHeader(i,u[i].CalendarDate,n);return r+="<\/tr><\/thead>",r+="<\/table>",this.setNavigationRow(n),r},buildTable:function(t){var u=t.data,l=u.length,o=6,s=this.getMaxRows(u),h="170px",c,r,f,i,e;for(n("#scroll-container").height()>170&&(h="auto"),c=s>o?s:o,r="<div id='scroll-container' style='overflow: hidden; height:"+h+"'><table style='width: 100%;'>",r+="<tbody class='"+t.tableBodyClass+"'>",f=0;f<c;f++){for(r+="<tr>",i=0;i<l;i++)e="picker-cell-null ",i>4?e+="hidden-sm hidden-xs":i>1&&(e+="hidden-xs"),u[i].IsOpen?u[i].CalendarTimes[f]?(r+="<td class='"+e+"'><span class='"+t.tableTimeClass+"' data-value='"+this.formatValueTime(u[i].CalendarDate,u[i].CalendarTimes[f])+"'>",r+=this.formatDisplayTime(u[i].CalendarTimes[f])+"<\/span><\/td>"):r+="<td class='"+e+"'><span class='picker-cell-null'>&nbsp;<\/span><\/td>":r+=1===f?"<td class='"+e+"'><span class='picker-cell-null'>Closed<\/span><\/td>":"<td class='"+e+"'><span class='picker-cell-null'>&nbsp;<\/span><\/td>";r+="<\/tr>"}return r+"<\/tbody><\/table><\/div>"},getMaxRows:function(t){for(var i=0,r=0;r<t.length;r++)i<t[r].CalendarTimes.length&&(i=t[r].CalendarTimes.length);return n(".showTimes").css("display","block"),timesTotal(i),i},setNumberOfVisibleDays:function(n){i=n;this.updateDateRange()},setNavigationRow:function(t){t.page<=0?(n("#show-more-appt-times-container").css("margin-left","0"),n("#picker-nav-prev").hide()):(n("#show-more-appt-times-container").css("margin-left","0"),n("#picker-nav-prev").show());n("#picker-nav-next").show();this.updateDateRange()},setBindings:function(t){void 0!==t.onSelect&&(n("."+t.tableTimeClass).click(t.onSelect),n("#picker-nav-prev").unbind("click").click(t.onPrev),n("#picker-nav-next").unbind("click").click(t.onNext))},updateDateRange:function(){if(null!==t){var r=moment(t).add(i-1,"days").toDate();n("#picker-date-range").html(this.formatDateRange(new Date(t),r))}},formatDateRange:function(t,i){var r=n.datepicker.formatDate("MM d",t);return r+=" - ",r+=t.getMonth()==i.getMonth()?n.datepicker.formatDate("d",i):n.datepicker.formatDate("MM d",i),r+(", "+i.getFullYear())},formatDisplayTime:function(n){return n.replace(":00 ","").toLowerCase()},formatValueTime:function(n,t){return moment(n).format("M/D/YYYY")+" "+t},formatDayHeader:function(n,t){var i=new Date(t);return'<th class="'+(n>4?"hidden-xs hidden-sm":n>1?"hidden-xs":"")+'"><span>'+r[i.getDay()]+", "+u[i.getMonth()]+" "+i.getDate()+"<\/span><\/th>"}})}(jQuery)