function reloadHorizon() { function loadHorizon() { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = location.protocol + '//ak.sail-horizon.com/horizon/v1.js'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); s.onload = function() { Sailthru.setup({ domain: 'horizon.complex.com' }); }; } loadHorizon(); }; reloadHorizon();