document.write(
'' +
'
' +
''
);
var patientCal_scriptSource_aec8a87e25c14424903144efa92f637c = ' \
var patientCal_body_overflow_aec8a87e25c14424903144efa92f637c = (window.getComputedStyle) ? window.getComputedStyle(document.getElementsByTagName("body")[0]).overflow : document.getElementsByTagName("body")[0].currentStyle.overflow; \
if (window.postMessage) { \
var patientCal_message_function_aec8a87e25c14424903144efa92f637c = function(event) { \
var patientCal_host_aec8a87e25c14424903144efa92f637c = "https://"; \
if (event.origin.replace("https://","http://") != (patientCal_host_aec8a87e25c14424903144efa92f637c + "theserenespot.clinicsense.com").replace("https://","http://")) return; \
\
if (event.data == "patientCalBook:showFrame") { \
\
var patientCal_parameters_aec8a87e25c14424903144efa92f637c = patientCal_getParameters_aec8a87e25c14424903144efa92f637c(); \
var patientCal_frame_aec8a87e25c14424903144efa92f637c = document.getElementsByClassName("patient-cal-book-frame_aec8a87e25c14424903144efa92f637c")[0]; \
var patientCal_body_aec8a87e25c14424903144efa92f637c = document.getElementsByTagName("body")[0]; \
patientCal_body_aec8a87e25c14424903144efa92f637c.style.overflow = "hidden"; \
patientCal_frame_aec8a87e25c14424903144efa92f637c.style.display="block"; \
patientCal_resizeFrame_aec8a87e25c14424903144efa92f637c(patientCal_parameters_aec8a87e25c14424903144efa92f637c); \
event.source.postMessage(\'animateIn:\' + patientCal_toJSON_aec8a87e25c14424903144efa92f637c(patientCal_parameters_aec8a87e25c14424903144efa92f637c), event.origin); \
} \
if (event.data == "patientCalBook:hideFrame") { \
var patientCal_frame_aec8a87e25c14424903144efa92f637c = document.getElementsByClassName("patient-cal-book-frame_aec8a87e25c14424903144efa92f637c")[0]; \
var patientCal_parameters_aec8a87e25c14424903144efa92f637c = patientCal_getParameters_aec8a87e25c14424903144efa92f637c(); \
\
document.getElementsByTagName("body")[0].style.overflow = patientCal_body_overflow_aec8a87e25c14424903144efa92f637c; \
event.source.postMessage(\'animateOut:\' + patientCal_toJSON_aec8a87e25c14424903144efa92f637c(patientCal_parameters_aec8a87e25c14424903144efa92f637c), event.origin); \
} \
if (event.data == "patientCalBook:hideAnimationFinished") { \
var patientCal_frame_aec8a87e25c14424903144efa92f637c = document.getElementsByClassName("patient-cal-book-frame_aec8a87e25c14424903144efa92f637c")[0]; \
patientCal_frame_aec8a87e25c14424903144efa92f637c.style.display="none"; \
} \
if (event.data == "patientCalBook:appointmentSaved") { \
document.dispatchEvent(new patientCal_CustomEvent_aec8a87e25c14424903144efa92f637c("clinicsense.booker.appointmentSaved")); \
} \
}; \
if (window.addEventListener) { \
window.addEventListener("message", patientCal_message_function_aec8a87e25c14424903144efa92f637c, false); \
window.addEventListener("resize", function(event) { patientCal_resizeFrame_aec8a87e25c14424903144efa92f637c(patientCal_getParameters_aec8a87e25c14424903144efa92f637c()); document.getElementsByClassName("patient-cal-book-frame_aec8a87e25c14424903144efa92f637c")[0].contentWindow.postMessage(\'resize:\' + patientCal_toJSON_aec8a87e25c14424903144efa92f637c(patientCal_getParameters_aec8a87e25c14424903144efa92f637c()), \'\' + \'https://\' + \'theserenespot.clinicsense.com\'); }, false); \
} else if (window.attachEvent) { \
window.attachEvent("onmessage", patientCal_message_function); \
} \
} \
';
function patientCal_getParameters_aec8a87e25c14424903144efa92f637c() {
document.getElementsByTagName("body")[0].style.overflow = "hidden";
var frame = document.getElementsByClassName("patient-cal-book-frame_aec8a87e25c14424903144efa92f637c")[0];
var button = document.getElementsByClassName("patient-cal-book-now-button_aec8a87e25c14424903144efa92f637c")[0];
var browserWidth = 0, browserHeight = 0;
if( typeof( window.innerWidth ) == "number" ) {
browserWidth = window.innerWidth;
browserHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
browserWidth = document.documentElement.clientWidth;
browserHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
browserWidth = document.body.clientWidth;
browserHeight = document.body.clientHeight;
}
var pageWidth = Math.max(
Math.max(document.body.scrollWidth, document.documentElement.scrollWidth),
Math.max(document.body.offsetWidth, document.documentElement.offsetWidth),
Math.max(document.body.clientWidth, document.documentElement.clientWidth)
);
var pageHeight = Math.max(
Math.max(document.body.scrollHeight, document.documentElement.scrollHeight),
Math.max(document.body.offsetHeight, document.documentElement.offsetHeight),
Math.max(document.body.clientHeight, document.documentElement.clientHeight)
);
var xScroll, yScroll;
if (self.pageYOffset) {
yScroll = self.pageYOffset;
xScroll = self.pageXOffset;
} else if (document.documentElement && document.documentElement.scrollTop) {
yScroll = document.documentElement.scrollTop;
xScroll = document.documentElement.scrollLeft;
} else if (document.body) {
yScroll = document.body.scrollTop;
xScroll = document.body.scrollLeft;
}
var patientCal_findPos = function(obj) {
var curleft = curtop = 0;
if (obj.offsetParent) {
do {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
}
return [curleft,curtop];
};
var button_pos = patientCal_findPos(button);
var xButton = button_pos[0]+button.clientWidth/2;
var yButton = button_pos[1]+button.clientHeight/2;
document.getElementsByTagName("body")[0].style.overflow = patientCal_body_overflow_aec8a87e25c14424903144efa92f637c;
return {
"browserWidth":browserWidth,
"browserHeight":browserHeight,
"xScroll":xScroll,
"yScroll":yScroll,
"xButton":xButton,
"yButton":yButton,
"pageWidth":pageWidth,
"pageHeight":pageHeight
};
};
function patientCal_resizeFrame_aec8a87e25c14424903144efa92f637c(parameters) {
var frame = document.getElementsByClassName("patient-cal-book-frame_aec8a87e25c14424903144efa92f637c")[0];
var body = document.getElementsByTagName("body")[0];
frame.style.left = 0;
frame.style.right = 0;
frame.style.width = String((parameters.browserWidth < parameters.pageWidth) ? parameters.browserWidth : parameters.pageWidth) + 'px';
frame.style.height = String((parameters.browserHeight < parameters.pageHeight) ? parameters.browserHeight : parameters.pageHeight) + 'px';
frame.style.border = "0";
}
var patientCal_button_click_aec8a87e25c14424903144efa92f637c = function(host) {
var host = 'https://';
if (screen.width <=480 || window.innerWidth <= 480) {
window.open('' + host + 'theserenespot.clinicsense.com/book/');
} else {
try {
document.getElementsByClassName("patient-cal-book-frame_aec8a87e25c14424903144efa92f637c")[0].contentWindow.postMessage('clicked:{"size":10}', '' + host + 'theserenespot.clinicsense.com');
} catch(err) {
window.open('' + host + 'theserenespot.clinicsense.com/book/');
}
}
}
function patientCal_initScript_aec8a87e25c14424903144efa92f637c() {
if ( document.readyState !== 'complete' ) {
setTimeout(patientCal_initScript_aec8a87e25c14424903144efa92f637c, 500);
return;
}
var patientCal_script_element = document.getElementById('patient-cal-script_aec8a87e25c14424903144efa92f637c');
if (typeof(patientCal_script_element) != 'undefined' && patientCal_script_element != null) {
} else {
var patientCal_scriptTag = document.createElement('script');
patientCal_scriptTag.type = "text/javascript";
document.getElementsByTagName('body')[0].appendChild(patientCal_scriptTag);
patientCal_scriptTag.text = patientCal_scriptSource_aec8a87e25c14424903144efa92f637c
}
}
patientCal_initScript_aec8a87e25c14424903144efa92f637c();
function patientCal_toJSON_aec8a87e25c14424903144efa92f637c(parameters) {
var json = [];
for (var key in parameters) {
json.push('"' + key + '":' + parameters[key]);
}
return '{' + json.join() + '}';
};
function patientCal_initFrame_aec8a87e25c14424903144efa92f637c() {
if ( document.readyState !== 'complete' ) {
setTimeout(patientCal_initFrame_aec8a87e25c14424903144efa92f637c, 500);
return;
}
// Create the iframe only if one doesn't already exist. We can use the same frame with each button
var patientCal_frame_element = document.getElementsByClassName("patient-cal-book-frame_aec8a87e25c14424903144efa92f637c")[0];
if (typeof(patientCal_frame_element) != 'undefined' && patientCal_frame_element != null) {
} else {
var patientCal_host_aec8a87e25c14424903144efa92f637c = 'https://';
var patientCal_frameDiv = document.createElement('div');
patientCal_frameDiv.innerHTML = '';
document.getElementsByTagName('body')[0].appendChild(patientCal_frameDiv);
}
}
patientCal_initFrame_aec8a87e25c14424903144efa92f637c();
function patientCal_CustomEvent_aec8a87e25c14424903144efa92f637c( event, params ) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent( 'CustomEvent' );
evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
return evt;
}