(function() { var css = '.ac-widget {position:fixed; top: 50%; right: -50px; display: block;width: 150px;height: 40px;transform: rotate(-90deg); background-image: url("https://assurance.sysnetgs.com/img/thumb.png");background-size: contain; background-repeat: no-repeat; background-position: center; border-top-left-radius: 3px; border-top-right-radius: 3px; box-shadow: 0 1px 0 8px white,0 0 0 9px hsl(0, 0%, 90%),-2px -4px 12px rgba(0, 0, 0, 0.2); cursor: pointer;}', head = document.head, style = document.createElement('style'), preview = document.createElement('div'), lang = navigator.language || navigator.browserLanguage, windowObjectReference = null, assuranceCardUrl = "https://assurance.sysnetgs.com/assurancecard/be8e7fbc4499573f56e43e03e7c6fa75c9907de49d4c64814fd53cba6f4ad88a/assurancecard/", PreviousUrl; style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } head.appendChild(style); preview.id = 'widget-preview'; preview.className = 'ac-widget'; if (lang.indexOf('fr') == 0) preview.className += ' ac-widget-french'; document.body.appendChild(preview); console.log(assuranceCardUrl); preview.onclick = function() { if(windowObjectReference == null || windowObjectReference.closed) { windowObjectReference = window.open(assuranceCardUrl, 'assurance_card', 'width=500,height=535, menubar=no, resizable, scrollbars, location=no, top=100, left=100'); } else if(PreviousUrl != assuranceCardUrl) { windowObjectReference = window.open(assuranceCardUrl, 'assurance_card', 'width=500,height=535, menubar=no, resizable, scrollbars, location=no, top=100, left=100'); windowObjectReference.focus(); } else { windowObjectReference.focus(); }; PreviousUrl = assuranceCardUrl; }; })();