var wd_key="ef1197038b8944623c3b65057ede735b",wd_query_string="key=ef1197038b8944623c3b65057ede735b&lang=en",wd_baseurl="https://webdiary.fyidoctors.com/WD60",login_type="1",wd_browser_url=window.top.location.href,login_url="",cookiename_patientId="",wd_thisScript=document.scripts[document.scripts.length-1],wd_clear_div=document.createElement("div"),c="[{clear_div}]";wd_thisScript.parentElement.insertBefore(wd_clear_div,wd_thisScript.nextSibling);var wd_response_iframe=document.createElement("iframe");function wd_resizeIframe(e){e>0&&(document.getElementById("wd_ediary_iframe").height=e+"px",wd_response_iframe.setAttribute("style","overflow-y:hidden;clear:both;width:100% !important;height:"+e+"px !important;"))}function reloadIframe(){wd_response_iframe.src=wd_response_iframe.src}wd_response_iframe.setAttribute("id","wd_ediary_iframe"),wd_response_iframe.setAttribute("height",""),wd_response_iframe.setAttribute("width","100%"),wd_response_iframe.setAttribute("allowfullscreen",""),wd_response_iframe.setAttribute("scrolling","no"),wd_response_iframe.setAttribute("seamless","seamless"),wd_response_iframe.setAttribute("frameborder",0),wd_response_iframe.setAttribute("style","overflow-y:hidden;clear:both;width:100% !important;height:0px !important;"),wd_response_iframe.setAttribute("src",wd_baseurl+"/loadIFrame?"+wd_query_string),wd_clear_div.appendChild(wd_response_iframe),"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});var eventMethod=window.addEventListener?"addEventListener":"attachEvent",eventer=window[eventMethod],messageEvent="attachEvent"==eventMethod?"onmessage":"message";function wd_getCookie(e){for(var t=e+"=",r=document.cookie.split(";"),i=0;i<r.length;i++){var o=r[i].trim();if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}eventer(messageEvent,function(e){var data=e.data,obj=eval("("+data+")");if(obj.wd_height&&wd_resizeIframe(obj.wd_height),obj.wd_iframe_reload&&reloadIframe(),obj.scroll_at){var iframe_top_position=document.getElementById("wd_ediary_iframe").offsetTop;scroll_at=obj.scroll_at,window.scrollTo(0,scroll_at)}if(obj.wd_scrollToTop){var iframe_top_position=document.getElementById("wd_ediary_iframe").offsetTop;jQuery('html, body').animate({scrollTop:iframe_top_position},500,"swing",function(){})}},!1),window.onload=function(){var e=document.getElementById("wd_ediary_iframe").contentWindow;e.postMessage(JSON.stringify({third_party_cookie:wd_getCookie(cookiename_patientId)}),"*");var t=setInterval(function(){if(ck=wd_getCookie(cookiename_patientId),2==login_type&&(""==ck||"undefined"==ck))return window.location.href=login_url,clearInterval(t),!1;"undefined"!=typeof ck&&""!=ck&&e.postMessage(JSON.stringify({third_party_cookie:ck}),"*"),e.postMessage(JSON.stringify({wd_browser_url:wd_browser_url}),"*")},500)};