var qsProxy = {"customer_id":"0","methodKey":"PCOS_TEST","token":"","email":"","full_name":"","preferred_name":"","nric":"","drug_allergies":"","sex":"","date_of_birth":"","isWebview":"","mdqHashId":"","values":""};
function FrameBuilder(formId, appendTo, initialHeight, title) {
this.formId = formId;
this.initialHeight = initialHeight;
this.frame = null;
this.timeInterval = 200;
this.appendTo = appendTo || false;
this.formSubmitted = 0;
this.frameMinWidth = '100%';
this.defaultHeight = '';
this.init = function() {
this.createFrame();
}
this.createFrame = function() {
this.iframeDomId = this.formId;
var iframe = document.createElement('iframe');
iframe.src = 'https://medical.ease-healthcare.com?methodKey=PCOS_TEST&token=&isWebview=';
iframe.id = this.iframeDomId;
iframe.title = title.replace(/[\\"']/g, '\\$&').replace(/&/g, '&');
iframe.frameborder = 0;
iframe.onload = "resizeIframe(this)";
iframe.style = "width: 100%; display: block;border: none;";
if (this.appendTo === false) {
document.body.appendChild(iframe);
} else {
var tmp = document.createElement('div');
tmp.appendChild(iframe);
var a = this.appendTo;
document.getElementById(a).appendChild(tmp.firstChild);
window.addEventListener('load',function(){
resizeIframe(iframe);
function resizeIframe(obj) {
obj.height = window.innerHeight + 'px';
obj.width = window.innerWidth + 'px';
}
window.parent.addEventListener('resize',function() {
resizeIframe(iframe);
});
});
}
window.addEventListener("message", function () {
if (event.origin !== "https://medical.ease-healthcare.com") return;
var data = event.data;
if (data.func == "triggerChat") {
window.jQuery('body').trigger('triggerChat', [data]);
}
}, false);
}
this.init();
}
FrameBuilder.get = qsProxy || [];
var medical_ffb6d7d2834f4f40ba9ee4b2e4a97f10 = new FrameBuilder("ffb6d7d2834f4f40ba9ee4b2e4a97f10", "e-wc-block-medical-questionnaire", "", "Medical Form", Array);