var ___idUser = '143'; var ___idGroup = '0'; var ___opertorIsOnline = '5'; var ___iscosurf = '1'; var ___serverHost = 'https://livesupport.pl/'; var ___pageURL = 'https%3A%2F%2F4f.com.pl%2F'; var ___showLSTimeout = -1; var ___buttonUrl = 'https://livesupport.pl/chat/?m=JSN&e=bottom&idUser=143'; var ___color = '#ffffff'; var ___bg = '#008AC6'; var ___lng = 'pl'; var ___text = 'Porozmawiaj on-line'; var ___offline = 'Zostaw wiadomość'; var ___w = '200'; var ___h = '41'; var ___img = ''; var ___pos = 'right'; var ___nk = ''; var ___isMobile = ''|false; var showoffline = true; if(___idUser=='340'){ ___w = 203; ___h = 43; } if(typeof scparams != 'undefined' ){ if(typeof scparams.color != 'undefined' ){ ___color = scparams.color; } if(typeof scparams.bg != 'undefined' ){ ___bg = scparams.bg; } if(typeof scparams.text != 'undefined' ){ ___text = scparams.text; } if(typeof scparams.offline != 'undefined' ){ ___offline = scparams.offline; } if(typeof scparams.ho != 'undefined' ){ showoffline = false; } if(typeof scparams.lng != 'undefined' ){ ___lng = scparams.lng; } if(typeof scparams.w != 'undefined' ){ ___w = scparams.w; } if(typeof scparams.h != 'undefined' ){ ___h = scparams.h; } if(typeof scparams.img != 'undefined' ){ ___img = scparams.img; } if(typeof scparams.pos != 'undefined' ){ ___pos = scparams.pos; } if(typeof scparams.nick != 'undefined' ){ ___nk = '&nick=' + scparams.nick; } } ___color = ___color.replace("#", ""); ___bg = ___bg.replace("#", ""); var LS_API_FL = function(){ var floatDivContainer, frame; return { createFloat: function() { floatDivContainer = document.createElement("div"); floatDivContainer.style.bottom = "0px"; if(___idUser=='779'){ if(screen.width<600){ floatDivContainer.style.bottom = "53px"; } } if(___idUser=='785'){ if(screen.width<600){ floatDivContainer.style.bottom = "53px"; } } if(___idUser=='805'){ if(screen.width<600){ floatDivContainer.style.bottom = "58px"; } } floatDivContainer.style.position = "fixed"; if(___pos=='right'){ if(___isMobile){ floatDivContainer.style.right = "8px"; }else{ floatDivContainer.style.right = "55px"; } }else{ if(___isMobile){ floatDivContainer.style.left = "8px"; }else{ floatDivContainer.style.left = "55px"; } } if(___idUser=='340'){ if(screen.width>600){ floatDivContainer.style.bottom = "0px"; floatDivContainer.style.right = "40px"; } } if(___idUser=='603'){ if(screen.width < 601){ floatDivContainer.style.right = "4px"; } } floatDivContainer.style.width = parseInt(___w) + "px"; floatDivContainer.style.height = parseInt(___h) + "px"; floatDivContainer.style.zIndex = "999999"; floatDivContainer.id = 'ls-float-element-cnt'; frame = document.createElement("iframe"); frame.setAttribute('src', ___buttonUrl + '&bg=' + ___bg + '&lng=' + ___lng + '&color=' + ___color + '&text=' + ___text+ '&offline=' + ___offline+'&w='+___w + '&h='+___h + '&img=' + ___img); frame.style.width = parseInt(___w) + "px"; frame.style.height = parseInt(___h) + "px"; frame.style.border = "none"; floatDivContainer.appendChild(frame); document.body.appendChild(floatDivContainer); }, enlargeContainer: function() { floatDivContainer.style.width = "344px"; floatDivContainer.style.height = "322px"; frame.style.width = "344px"; frame.style.height = "322px"; }, decreaseContainer: function() { floatDivContainer.style.width = parseInt(___w) + "px"; floatDivContainer.style.height = parseInt(___h) + "px"; frame.style.width = parseInt(___w) + "px"; frame.style.height = parseInt(___h) + "px"; }, attachCosurf: function(idMsg, url) { if(___iscosurf==='1'){ window.LS_idMsg = idMsg; window.LS_url = url; if (!window.jQuery) { var jq = document.createElement('script'); jq.type = 'text/javascript'; jq.src = 'https://code.jquery.com/jquery-1.10.2.min.js'; document.getElementsByTagName('head')[0].appendChild(jq); } var lssc = document.createElement("script");lssc.type="text/javascript";lssc.async=false; lssc.src="https://cdn.socket.io/socket.io-1.2.0.js"; var lss = document.getElementsByTagName("script")[0]; lss.parentNode.insertBefore(lssc, lss); lssc = document.createElement("script");lssc.type="text/javascript";lssc.async=false; lssc.src="https://cs.slsystems.pl/client/main.js"; lss = document.getElementsByTagName("script")[0]; lss.parentNode.insertBefore(lssc, lss); } } }; }(); var LS_Messager = function() { var window = this, cacheBurst = 1, attachedCallback, intervalId, lastHash; return { postMessage: function(message, targetUrl, target) { if(!targetUrl) { return; } target = target || parent; if(window['postMessage']) { target['postMessage'](message, targetUrl.replace( /([^:]+:\/\/[^\/]+).*/, '$1')); } else { target.location = targetUrl.replace(/#.*$/, '') + '#' + (+new Date) + (cacheBurst++) + '&' + message; } }, receiveMessage: function(callback, sourceOrigin) { if (window['postMessage']) { if(callback) { attachedCallback = function(e) { if((typeof sourceOrigin === 'string' && e.origin !== sourceOrigin) || (Object.prototype.toString.call(sourceOrigin)) === "[object Function]" && sourceOrigin[e.origin] === false) { return false; } callback(e); } } if(window['addEventListener']) { window[callback ? 'addEventListener' : 'removeEventListener']('message', attachedCallback, false); } else { window[callback ? 'attachEvent' : 'detachEvent']('onmessage', attachedCallback); } } else { intervalId && clearInterval(intervalId); intervalId = null; if (callback) { intervalId = setInterval(function() { var hash = document.location.hash, re = /^#?\d+&/; if (hash !== lastHash && re.test(hash)) { lastHash = hash; callback({data: hash.replace(re, '')}); } }, 100); } } } }; }(); if(___opertorIsOnline != "0"){ LS_API_FL.createFloat(); }else{ if(showoffline){ LS_API_FL.createFloat(); } } LS_Messager.receiveMessage(function(message){ //console.log(message); if(message.data == 'enlarge') { LS_API_FL.enlargeContainer(); } if(message.data == 'decrease') { LS_API_FL.decreaseContainer(); } var res = message.data.split(";"); if(res.length == 3 && res[0]=='cosurf') { LS_API_FL.attachCosurf(res[1], res[2]); } if(res.length == 2 && res[0]=='gamessage') { sendGAmessage(res[1]); } }, 'https://livesupport.pl'); function sendGAmessage(type){ try { sendevent(type); } catch (e) { return true; } } function inIframe () { try { return window.self !== window.top; } catch (e) { return true; } }