var qsProxy = {"customer_id":"0","methodKey":"BIRTH_CONTROL_TELECONSULTATION","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=BIRTH_CONTROL_TELECONSULTATION&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_eba8fa1e79de4544988d49fbde6a7d70 = new FrameBuilder("eba8fa1e79de4544988d49fbde6a7d70", "e-wc-block-medical-questionnaire", "", "Medical Form", Array);