var loadAsyncDeferredFacebook = function() { (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/bg_BG/sdk.js#xfbml=1&version=v3.0"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); } if (window.addEventListener) window.addEventListener("load", loadAsyncDeferredFacebook, false); else if (window.attachEvent) window.attachEvent("onload", loadAsyncDeferredFacebook); else window.onload = loadAsyncDeferredFacebook;