/*global escape */ var allText = '

SMS Newsletter

', fileref, obj; var tsw_oldOnLoad = window.onload; window.onload = function () { if (tsw_oldOnLoad) { tsw_oldOnLoad(); } setTimeout(function () { function toTwoPlaces (num) { return (num < 10 ? '0' : '') + num.toString(); } var curDate = new Date(), dateQuery = '?d=' + curDate.getFullYear() + toTwoPlaces(curDate.getMonth() + 1) + toTwoPlaces(curDate.getDate()) + toTwoPlaces(curDate.getHours()); obj = document.getElementsByTagName("head")[0]; fileref = document.createElement("link"); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", "/WebSubscription/ScriptCss?Length=5" + dateQuery); obj.appendChild(fileref); if (navigator.appName === 'Microsoft Internet Explorer') { if (navigator.appVersion.indexOf('MSIE 8.') !== -1) { fileref = document.createElement("link"); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", "/WebSubscription/ScriptCssIE8?Length=5" + dateQuery); obj.appendChild(fileref); } else if (navigator.appVersion.indexOf('MSIE 9.') !== -1) { fileref = document.createElement("link"); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", "/WebSubscription/ScriptCssIE9?Length=5" + dateQuery); obj.appendChild(fileref); } } document.body.insertAdjacentHTML('beforeEnd', allText); fileref = document.createElement('script'); fileref.setAttribute("type", "text/javascript"); fileref.setAttribute("src", "/WebSubscription/ScriptClassUtils?Length=5" + dateQuery); obj.appendChild(fileref); fileref = document.createElement('script'); fileref.setAttribute("type", "text/javascript"); fileref.setAttribute("src", "/WebSubscription/ScriptWidget?Length=5" + dateQuery); obj.appendChild(fileref); }, 1); var widgets = document.getElementsByClassName('_tws_widgetBox'), message = escape(document.title) + '#' + escape(window.location.href); function sendDataToWidget(widget) { if (widget.contentWindow.postMessage) { widget.contentWindow.postMessage(message, "https://panel.twojasugestia.pl"); } } function receiveMessage(event) { var i; if (event.data === 'data_request' && widgets) { for(i = 0; i < widgets.length; i += 1) { sendDataToWidget(widgets[i]); } } } if (window.addEventListener) { window.addEventListener("message", receiveMessage, false); } else if(window.attachEvent) { window.attachEvent("onmessage", receiveMessage, false); } };