// ==================================== // http://cs.hit.gemius.pl/gplayer.js // ==================================== // (c) by Gemius SA - gemius player tools // ver. 2.1 function gemius_pending(i) { window[i] = window[i] || function() {var x = window[i+'_pdata'] = window[i+'_pdata'] || []; x[x.length]=arguments;};}; gemius_pending('gemius_hit'); gemius_pending('gemius_event'); gemius_pending('pp_gemius_hit'); gemius_pending('pp_gemius_event'); if (typeof GemiusPlayerVisibility == "undefined") { var GemiusPlayerVisibility = { isframe : null, framevis : null, childs : [], timerID : null, init : function() { try { GemiusPlayerVisibility.isframe = (top !== self); if (window.addEventListener) { window.addEventListener("message", GemiusPlayerVisibility._msgreceive, false); } else if (window.attachEvent) { window.attachEvent("onmessage", GemiusPlayerVisibility._msgreceive); } if (GemiusPlayerVisibility.isframe) { parent.postMessage("__xx_gplayer_vischeck_xx__","*"); } } catch (e) { } }, check : function(object) { try { if (GemiusPlayerVisibility.isframe && GemiusPlayerVisibility.framevis===null) { parent.postMessage("__xx_gplayer_vischeck_xx__","*"); return null; } else if (GemiusPlayerVisibility.isframe && GemiusPlayerVisibility.framevis===false) { return false; } else if (GemiusPlayerVisibility.isframe !== null) { var vis = GemiusPlayerVisibility._inScreen(object); return vis; } else { return null; } } catch (e) { return null; } }, _msgreceive : function(e) { if (typeof e.data=="string" && e.data=="__xx_gplayer_vischeck_xx__") { try { if (GemiusPlayerVisibility.isframe && GemiusPlayerVisibility.framevis===null) { parent.postMessage("__xx_gplayer_vischeck_xx__","*"); } var frames = document.getElementsByTagName('iframe'); var frame = null; try { for (var i = 0; i0 && visy>0 && (visx*visy > rect.height*rect.width*0.5 || visx*visy > window.innerHeight*window.innerWidth*0.5); return vis; } } }, _isChild : function(p, c) { var node = c.parentNode; while (node != null) { if (node == p) { return true; } node = node.parentNode; } return false; } } GemiusPlayerVisibility.init(); } function GemiusPlayer(playerID, gemiusID, playerData) { this.interval = 5 * 60; this.updateInterval = 1; this.instanceID = (((new Date()).getTime()) + Math.floor(Math.random()*1000)).toString(); this.playerID = playerID; this.gemiusID = gemiusID; this.playerData = (playerData || {}); this.initialized = false; this.programs = {}; this.ads = {}; this.hitsCounter = 0; this.currentProgramID = null; this.videoObject = null; this.resolution = null; this.visible = null; //public methods this.setVideoObject = function(video) { this.videoObject = video; } this.newProgram = function(programID, programData) { this._init(); this.programs[programID] = {"state": "new", "started": false, "program_started": false, "last_action_time": null, "data": this._clone(programData), "extradata": {}}; this._sendHit(programID, null, "data", "streamcontent", []); } this.newAd = function(adID, adData) { this._init(); this.ads[adID] = {"state": "new", "started": false, "last_action_time": null, "currentProgramID": null, "currentAdPosition": null, "data": this._clone(adData), "extradata": {}}; this._sendHit(null, adID, "data", "streamspot", []); } this.programEvent = function(programID, offset, eventType, eventData) { eventData = eventData || {}; if (this.programs[programID]) { this.hitsCounter = (programID==this.currentProgramID)?(this.hitsCounter+1):1; this.currentProgramID = programID; if (this.hitsCounter<=2000) { if (eventType == "play") { this._playProgram(programID, offset, eventData); } else if (eventType == "chngQual" || eventType == "chngRes" || eventType == "chngVol") { this._changeParam(programID, null, offset, eventType, eventData); } else { this._event(programID, null, offset, eventType, eventData); } } else { this._stopAll(); } } } this.adEvent = function(programID, adID, offset, eventType, eventData) { eventData = eventData || {}; if (this.programs[programID] && this.ads[adID]) { this.hitsCounter = (programID==this.currentProgramID)?(this.hitsCounter+1):1; this.currentProgramID = programID; if (this.hitsCounter<=2000) { if (eventType == "play") { this._playAd(programID, adID, offset, eventData); } else if (eventType == "chngQual" || eventType == "chngRes" || eventType == "chngVol") { this._changeParam(programID, adID, offset, eventType, eventData); } else { this._event(programID, adID, offset, eventType, eventData); } } else { this._stopAll(); } } } //private methods this._playProgram = function(programID, offset, eventData) { this._stopAll(); var eventCategory = (this.programs[programID]['program_started']==false)?"programstart":(this.programs[programID]["started"]?"play":"start"); var params = ["_SCO="+offset, "_SED="+this._updateActionTime(this.programs[programID])]; if (typeof eventData['autoPlay'] != "undefined") params = params.concat(["_ECA=" + (eventData['autoPlay']?1:0)]); if (typeof eventData['partID'] != "undefined") this.programs[programID]["extradata"]["partID"] = eventData['partID']; else delete this.programs[programID]["extradata"]["partID"]; if (typeof eventData['volume'] != "undefined") params = params.concat(["_SPVN=" + eventData['volume']]); if (typeof eventData['resolution'] != "undefined") params = params.concat(["_SPRN=" + eventData['resolution']]); this.programs[programID]["state"] = "play"; this.programs[programID]["started"] = true; this.programs[programID]["program_started"] = true; this._sendHit(programID, null, "stream", eventCategory, params); if (typeof eventData['volume'] != "undefined") this.playerData['volume'] = eventData['volume']; if (typeof eventData['resolution'] != "undefined") this.playerData['resolution'] = eventData['resolution']; for (var adID in this.ads) { this.ads[adID]["started"] = false; } for (var pID in this.programs) { if (pID != programID) { this.programs[pID]["started"] = false; this.programs[pID]["program_started"] = false; } } } this._playAd = function(programID, adID, offset, eventData) { this._stopAll(); var start = (!this.ads[adID]["started"] || this.ads[adID]["currentProgramID"]!=programID || this.ads[adID]["currentAdPosition"]!=eventData['adPosition']); var breakType = this._getBreakType(programID, offset); var eventCategory = (start && breakType!="post" && this.programs[programID]['program_started']==false)?"programstart":(start?"start":"play"); var params = ["_SCO="+offset,"_SED="+this._updateActionTime(this.ads[adID])]; if (typeof eventData['autoPlay'] != "undefined") params = params.concat(["_ECA=" + (eventData['autoPlay']?1:0)]); if (typeof eventData['adPosition'] != "undefined") this.ads[adID]["extradata"]["adPosition"] = eventData['adPosition']; else delete this.ads[adID]["extradata"]["adPosition"]; if (typeof eventData['breakSize'] != "undefined") this.ads[adID]["extradata"]["breakSize"] = eventData['breakSize']; else delete this.ads[adID]["extradata"]["breakSize"]; if (breakType) this.ads[adID]["extradata"]["breakType"] = breakType; else delete this.ads[adID]["extradata"]["breakType"]; if (typeof eventData['volume'] != "undefined") params = params.concat(["_SPVN=" + eventData['volume']]); if (typeof eventData['resolution'] != "undefined") params = params.concat(["_SPRN=" + eventData['resolution']]); this.ads[adID]["state"] = "play"; this.ads[adID]["started"] = true; this.ads[adID]["currentProgramID"] = programID; this.ads[adID]["currentAdPosition"] = eventData['adPosition']; if (breakType!="post") this.programs[programID]["program_started"] = true; this._sendHit(programID, adID, "stream", eventCategory, params); if (typeof eventData['volume'] != "undefined") this.playerData['volume'] = eventData['volume']; if (typeof eventData['resolution'] != "undefined") this.playerData['resolution'] = eventData['resolution']; } this._event = function(programID, adID, offset, eventType, eventData) { var evtypes = {"pause":"pause", "stop":"stop", "close":"close", "buffer":"buffering", "break":"break", "seek":"seek", "complete":"complete", "skip":"skip", "next":"next", "prev":"prev"}; var data = (adID?this.ads[adID]:this.programs[programID]); if (evtypes[eventType]) { var params = ["_SED="+this._updateActionTime(data)].concat(this._convertEventParams(eventData)); if (typeof offset != "undefined") params = params.concat(["_SCO="+offset]); if (eventType == "stop" || eventType == "complete" || eventType == "close") { data["started"] = false; if (!adID) this.programs[programID]["program_started"] = false; } data["state"] = evtypes[eventType]; this._sendHit(programID, adID, "stream", evtypes[eventType], params); } } this._changeParam = function(programID, adID, offset, eventType, eventData) { var data = (adID?this.ads[adID]:this.programs[programID]); var params = ["_SED="+this._updateActionTime(data)]; if (typeof offset != "undefined") params = params.concat(["_SCO="+offset]); if (typeof eventData['volume'] != "undefined") params = params.concat(["_SPVN=" + eventData['volume']]); if (typeof eventData['resolution'] != "undefined") params = params.concat(["_SPRN=" + eventData['resolution']]); if (typeof eventData['quality'] != "undefined") params = params.concat([(adID?"_SAQN=":"_SCQN=") + eventData['quality']]); this._sendHit(programID, adID, "stream", "continue", params); if (eventData['quality']) data['data']['quality'] = eventData['quality']; if (eventData['resolution']) this.playerData['resolution'] = eventData['resolution']; if (eventData['volume']) this.playerData['volume'] = eventData['volume']; } this._getBreakType = function(programID, offset) { try { var duration = (this.programs[programID]['data']['programDuration'] || 0); if (typeof duration != "number") duration = parseInt(duration,10); if (typeof offset != "number") offset = parseInt(offset,10); if ((duration<=100 && offset<=0) || (duration>100 && offset<5)) return "pre"; else if (duration>0 && ((duration<=100 && offset>=duration) || (duration>100 && offset>duration-5))) return "post"; else return "mid"; } catch (e) { return ""; } } this._stopAll = function() { for (var programID in this.programs) { if (this.programs[programID]["state"] == "play") { this._event(programID, null, undefined, "pause", {}); } } for (var adID in this.ads) { if (this.ads[adID]["state"] == "play" && this.programs[this.ads[adID]["currentProgramID"]]) { this._event(this.ads[adID]["currentProgramID"], adID, undefined, "pause", {}); } } } this._update = function() { var vis = GemiusPlayerVisibility.check(this.videoObject); var res = this._getPlayerSize(); if (vis !== this.visible || res !== this.resolution) { this._continue(); this.visible = vis; this.resolution = res; } } this._getPlayerSize = function() { if (!this.videoObject) { return null; } else { try { var rect = this.videoObject.getBoundingClientRect(); return rect.width + "x" + rect.height; } catch (e) { return null; } } } this._continue = function() { for (var programID in this.programs) { if (this.programs[programID]["state"] == "play") { var params = ["_SED="+this._updateActionTime(this.programs[programID])]; this._sendHit(programID, null, "stream", "continue", params); } } for (var adID in this.ads) { if (this.ads[adID]["state"] == "play") { var params = ["_SED="+this._updateActionTime(this.ads[adID])]; this._sendHit(this.ads[adID]["currentProgramID"], adID, "stream", "continue", params); } } } this._unload = function() { try { var delay = false; for (var programID in this.programs) { if (this.programs[programID]["state"] == "play") { var params = ["_SED="+this._updateActionTime(this.programs[programID])]; this._sendHit(programID, null, "stream", "unload", params); delay = true; } } for (var adID in this.ads) { if (this.ads[adID]["state"] == "play") { var params = ["_SED="+this._updateActionTime(this.ads[adID])]; this._sendHit(this.ads[adID]["currentProgramID"], adID, "stream", "unload", params); delay = true; } } if (delay && typeof navigator.sendBeacon != "function") { var start = (new Date()).getTime(); while (start+250>(new Date()).getTime()); } } catch(e) {} } this._updateActionTime = function(streamData) { var duration = 0; try { if (streamData['state'] == 'play' && streamData['last_action_time']) { duration = Math.round(((new Date()).getTime() - streamData['last_action_time']) / 1000); if (duration < 0 || duration > 2*this.interval) { duration = 0; } } streamData['last_action_time'] = (new Date()).getTime(); } catch (e) {} return duration; } this._sendHit = function(programID, adID, eventType, eventCategory, params) { var extra = ["_EC="+eventCategory].concat(this._getPlayerParams()).concat(this._getProgramParams(programID)).concat(this._getAdParams(adID)).concat(params); gemius_event.apply(window, ['_' + eventType + '_', this.gemiusID].concat(extra)); } this._getProgramParams = function(programID) { if (!this.programs[programID]) return []; var pkeys = {'programType':'_SCTE','programDuration':'_SCD','programName':'_SCT','series':'_SCS','typology':'_SCTY', 'premiereDate':'_SCPD','externalPremiereDate':'_SCEPD','quality':'_SCQ', "resolution":"_SCR", "volume":"_SCV"}; var epkeys = {'partID':'_SCP'}; var params = ["_SC="+programID]; params = params.concat(this._convertParams(this.programs[programID]["data"], pkeys, true)); params = params.concat(this._convertParams(this.programs[programID]["extradata"], epkeys)); return params; } this._getAdParams = function(adID) { if (!this.ads[adID]) return []; var akeys = {'adName':'_SAN','adDuration':'_SAD','adType':'_SAT','campaignClassification':'_SAC','quality':'_SAQ', "resolution":"_SAR", "volume":"_SAV"}; var eakeys = {'adPosition':'_SAP', 'breakSize':'_SBS', 'breakType':'_SBT'}; var params = ["_SA="+adID]; params = params.concat(this._convertParams(this.ads[adID]["data"], akeys, true)); params = params.concat(this._convertParams(this.ads[adID]["extradata"], eakeys)); return params; } this._getPlayerParams = function() { var pkeys = {"currentDomain":"_SPD", "resolution":"_SPR", "volume":"_SPV"}; var params = ["_SPI="+this.instanceID,"_SP="+this.playerID]; if (this.resolution !== null) params = params.concat(["_SPS="+this.resolution]); if (this.visible !== null) params = params.concat(["_SPIS="+(this.visible?"1":"0")]); return params.concat(this._convertParams(this.playerData,pkeys)); } this._convertEventParams = function(eventData) { var ekeys = {'listID':'_SL'}; return this._convertParams(eventData, ekeys); } this._convertParams = function(params, keyMap, allowCustomParams) { var res = []; if (typeof params != 'undefined') { for (var key in params) { if (keyMap[key] || allowCustomParams) { res[res.length] = (keyMap[key] || key) + "=" + params[key]; } } } return res; } this._addEvent = function(obj,type,fn) { if (obj.addEventListener) { obj.addEventListener(type, fn, false); } else if (obj.attachEvent) { obj.attachEvent('on'+type, fn); } } this._init = function() { if (!this.initialized) { this.initialized = true; this._update(); setInterval(this._wrapFun(this,"_continue"), this.interval * 1000); setInterval(this._wrapFun(this,"_update"), this.updateInterval * 1000); try { if (typeof navigator.sendBeacon == "function") { this._addEvent(window.top, 'unload', this._wrapFun(this,"_unload")); } else { this._addEvent(window.top, 'beforeunload', this._wrapFun(this,"_unload")); } } catch (e) { if (typeof navigator.sendBeacon == "function") { this._addEvent(window, 'unload', this._wrapFun(this,"_unload")); } else { this._addEvent(window, 'beforeunload', this._wrapFun(this,"_unload")); } } } } this._wrapFun = function(self, method) { return function() { self[method](); } } this._clone = function(obj) { var res = {}; if (!obj) return res; for (var key in obj) { if (obj.hasOwnProperty(key)) res[key] = obj[key]; } return res; } } if (typeof window['gemius_player_data'] != 'undefined') { for (var i=0; i0 || robj.allowaddscript==0 || typeof gemius_open != 'undefined') { url += (d+i)+'/redot.js?l='+robj.vers+robj.req+params; gemius_hcconn.append_script(url,null,1); } else { url += (d+i)+'/rexdot.js?l='+robj.vers+robj.req+params; gemius_hcconn.state = 1; gemius_hcconn.append_script(url,gemius_hcconn.xdot_loaded,1); } } gemius_hcconn.requests = []; } }, latehits : function() { if (gemius_hcconn.waiting_for_fpdata==0 && gemius_hcconn.waiting_for_lsdata==0 && gemius_hcconn.waiting_on_prerender==0) { if (gemius_hcconn.closing==0 && gemius_hcconn.ssl==0 && gemius_hcconn.lsdata!='' && gemius_hcconn.lsdata[0]!='-' && gemius_hcconn.lsgetframe) { if (gemius_hcconn.addto==null) { try { gemius_hcconn.lsgetframe.contentWindow.postMessage("_xx_gemius_get_add_xx_","*"); gemius_hcconn.addto = setTimeout(gemius_hcconn.lsaddto,250); } catch (e) { gemius_hcconn.sendhits(null); } } } else { gemius_hcconn.sendhits(null); } } }, lsaddto : function() { if (gemius_hcconn.addto!=null) { gemius_hcconn.addto = null; gemius_hcconn.sendhits(null); } }, paramsready : function() { if (gemius_hcconn.params_ready_called==0 && gemius_hcconn.waiting_for_fpdata==0 && gemius_hcconn.waiting_for_lsdata==0) { var data = {'lsdata' : gemius_hcconn.lsdata, 'fpdata' : gemius_hcconn.fpdata}; gemius_hcconn.params_ready_called = 1; try { if (typeof gemius_params_ready != 'undefined') { gemius_params_ready(data); } else if (typeof pp_gemius_params_ready != 'undefined') { pp_gemius_params_ready(data); } } catch (e) {} } }, visibilitychanged : function() { if (document[gemius_hcconn.visapi_s]!='prerender' && gemius_hcconn.waiting_on_prerender) { gemius_hcconn.waiting_on_prerender = 0; setTimeout(gemius_hcconn.latehits,100); } gemius_hcconn.sonar_update(); }, unloadhit : function(robj,nr) { var url = (gemius_hcconn.ssl?'https://':'http://')+gemius_hcconn.hc+'/_'; var d = new Date().getTime(); var vis = (gemius_hcconn.visapi_h=='')?3:(document[gemius_hcconn.visapi_h])?2:1; var params = '&vis='+vis; params += '&fpdata='+((gemius_hcconn.waiting_for_fpdata==0 && gemius_hcconn.has_consent)?gemius_hcconn.fpdata:"-UNLOAD"); params += '&lsdata='+((gemius_hcconn.waiting_for_lsdata==0 && gemius_hcconn.has_consent)?(gemius_hcconn.lsdata+'<ime='+gemius_hcconn.ltime):"-UNLOAD"); if (gemius_hcconn.has_consent!==true) { params += '&nc=1'; } if (gemius_hcconn.closing) { url += (d+nr)+'/redot.gif?l='+robj.vers+params+robj.req; if (typeof navigator.sendBeacon == "function") { navigator.sendBeacon(url); } else { var images_l = gemius_hcconn.images.length; gemius_hcconn.images[images_l]=new Image(); gemius_hcconn.images[images_l].src = url; } } else { url += (d+nr)+'/redot.js?l='+robj.vers+robj.req+params; gemius_hcconn.append_script(url,null,1); } }, unload : function(closing) { try { var i; var uhits = gemius_hcconn.requests.length; var last = (!gemius_hcconn.closing && closing); gemius_hcconn.closing = (gemius_hcconn.closing>0 || closing)?1:0; if (gemius_hcconn.waiting_on_prerender==0) { for (i=0 ; i 0) { var start = (new Date()).getTime(); while (start+200>(new Date()).getTime()); } } } catch (e) {} }, getfpcookie : function() { gemius_hcconn.fpdata = '-TURNEDOFF'; try { var cookies = document.cookie.split(';'); var cookie_arr; for (var i=0; istart) { str += '|'; } str += ((new String(arr[i])).replace(/\|/g,'_')); } } return str; }, internal_hit : function(allowaddscript,vers,id,evid,et,hsrc,sonar,extra) { var req = ""; if (gemius_hcconn.event_identifier==null && id) { gemius_hcconn.event_identifier = id; } req += '&id='+id; if (typeof et != 'undefined') { req += '&et='+et; } if (typeof hsrc != 'undefined') { req += '&hsrc='+hsrc; } if (sonar) { req += '&initsonar=1'; if ((typeof gemius_test_sonar != 'undefined') || (typeof pp_gemius_test_sonar != 'undefined')) { var cdata=gemius_hcconn.sonar_load(id,1); if (cdata[0]>=1) { var addparams=["_cnt="+cdata[0],"_dur="+cdata[1],"_vis="+cdata[2],"_freq="+cdata[3],"_evid="+cdata[4]]; for (var i=0; i0) extra += '|'; extra += ((new String(addparams[i])).replace(/\|/g,'_')); } } } } if (typeof extra != 'undefined' && typeof encodeURIComponent != 'undefined') { req += '&extra='+encodeURIComponent(extra.substring(0,1999)); } req += '&eventid='+evid+gemius_hcconn.parameters(); gemius_hcconn.requests[gemius_hcconn.requests.length] = {req:req,allowaddscript:allowaddscript,vers:vers}; gemius_hcconn.latehits(); }, timer : function() { var i; for (i=0 ; i 24*3600*1000) time = 24*3600*1000 - data["dur"]; if (data["lvstate"] == "visible") { data["dur"] += time; if (time < 4000) data["vdur"] += time; } else if (data["lvstate"] == "hidden" || !data["lvstate"]) { data["dur"] += time; } data["lvchange"] = ((new Date()).getTime()); data["lvstate"] = (gemius_hcconn.visapi_s?document[gemius_hcconn.visapi_s]:""); } }, sonar_add : function(identifier,evid,freq,extra) { gemius_hcconn.sonar_update(); var data={}; data["id"]=identifier; data["evid"]=evid; data["freq"]=freq; data["extra"]=extra; data["to"]=null; data["dur"]=((gemius_hcconn.sonar_data.length>0)?gemius_hcconn.sonar_data[0]["dur"]:0); data["vdur"]=((gemius_hcconn.sonar_data.length>0)?gemius_hcconn.sonar_data[0]["vdur"]:0); data["lvchange"] = ((new Date()).getTime()); data["lvstate"] = (gemius_hcconn.visapi_s?document[gemius_hcconn.visapi_s]:""); data["linterval"] = ((new Date()).getTime()); data["sdur"] = 0; if (identifier && evid && freq>0) { var fun=(function(sid){return function(){gemius_hcconn.sonar(sid);};}(gemius_hcconn.sonar_data.length)); data["to"]=setInterval(fun, 1000); } gemius_hcconn.sonar_data[gemius_hcconn.sonar_data.length] = data; }, sonar : function(sid) { var data, prob; gemius_hcconn.sonar_update(); data=gemius_hcconn.sonar_data[sid]; prob=(((new Date()).getTime()) - data["linterval"])/1000; data["linterval"]=((new Date()).getTime()); while (prob>0) { if (data["sdur"]<24*3600 && prob<=4 && data["lvstate"]=="visible" && Math.random() < prob/data["freq"]) { gemius_hcconn.internal_hit(0,99,data["id"],data["evid"],"smpsonar",0,0,"_ASF="+data["freq"]+(data["extra"]?("|"+data["extra"]):"")); } data["sdur"] += Math.min(prob,data["freq"]); prob -= data["freq"]; } }, sonar_save : function() { var exp = ((new Date()).getTime())+7200000; for (var i=0; i0) { gemius_hcconn.internal_hit(allowaddscript,vers,args[0],evid,"view",hsrc,sonar,gemius_hcconn.array_to_string(args,1)); } }, gevent : function(allowaddscript,vers,args,evid,hsrc,sonar) { var pos = 0; var et = "view"; if (args.length>1) { var m = (new String(args[0])).match('^_([a-zA-Z0-9]+)_$'); if (m) { et = m[1]; pos = 1; } } if (args.length>pos) { if (!args[pos] && gemius_hcconn.event_identifier != null) { args[pos] = gemius_hcconn.event_identifier; } if (args[pos]) { gemius_hcconn.internal_hit(allowaddscript,vers,args[pos],evid,et,hsrc,sonar,gemius_hcconn.array_to_string(args,pos+1)); } } }, addscripthit : function() { gemius_hcconn.ghit(1,96,arguments,0,2,0); }, plainhit : function() { gemius_hcconn.ghit(0,97,arguments,0,2,0); }, addscriptevent : function() { gemius_hcconn.gevent(1,96,arguments,0,3,0); }, plainevent : function() { gemius_hcconn.gevent(0,97,arguments,0,3,0); }, pendingdata : function(arr,fn) { var i; if (typeof window[arr] != 'undefined') { for (i=0 ; i0 && gemius_hcconn.fpdata[0]=='-') || gemius_hcconn.fpdata=='')?1:0; } else { gemius_hcconn.waiting_for_fpdata = 0; gemius_hcconn.fpdata = "-DNT"; } } try { if (gemius_hcconn.dnt==0) { gemius_hcconn.waiting_for_lsdata = (typeof window.postMessage != 'undefined' && typeof localStorage != 'undefined' && localStorage != null)?1:0; if (gemius_hcconn.waiting_for_lsdata==0) { gemius_hcconn.lsdata='-NOTSUP'; } } else { gemius_hcconn.waiting_for_lsdata = 0; gemius_hcconn.lsdata = "-DNT"; } } catch (e) { gemius_hcconn.waiting_for_lsdata = 0; gemius_hcconn.lsdata='-TURNEDOFF'; } if (gemius_hcconn.dnt==0) { if (gemius_hcconn.use_cmp && gemius_cmpclient.find_cmp()) { gemius_hcconn.cmpto = setTimeout(gemius_hcconn.consentto,10000); gemius_cmpclient.get_consent(gemius_hcconn.consent_loaded,gemius_hcconn.cmp_purposes); } else if (gemius_hcconn.gdpr_params() != '') { gemius_hcconn.cmpto = setTimeout(gemius_hcconn.consentto,10000); var url = (gemius_hcconn.ssl?'https://':'http://')+gemius_hcconn.hc+'/gdprdata.js' + gemius_hcconn.gdpr_params(true); gemius_hcconn.append_script(url,gemius_hcconn.gdprdata_loaded,0); } else { gemius_hcconn.waiting_for_consent = 0; gemius_hcconn.has_consent = true; if (gemius_hcconn.waiting_for_fpdata) { gemius_hcconn.load_fpdata(); } if (gemius_hcconn.waiting_for_lsdata) { gemius_hcconn.load_lsdata(); } } } else { gemius_hcconn.waiting_for_consent = 0; gemius_hcconn.has_consent = false; gemius_hcconn.waiting_for_fpdata = 0; gemius_hcconn.fpdata = "-DNT"; } gemius_hcconn.waiting_on_prerender = 0; gemius_hcconn.paramsready(); gemius_hcconn.findvisapi(); if (gemius_hcconn.visapi_s != '') { if (document[gemius_hcconn.visapi_s] == 'prerender') { gemius_hcconn.waiting_on_prerender = 1; } gemius_hcconn.add_event(document,gemius_hcconn.visapi_c,gemius_hcconn.visibilitychanged); } gemius_hcconn.sonar_add(); gemius_hcconn.latehits(); gemius_hcconn.add_event(window,"unload",function() {gemius_hcconn.unload(true);} ); gemius_hcconn.add_event(window,"beforeunload",function() {gemius_hcconn.unload(true);} ); gemius_hcconn.add_event(document,"mousedown",function() {gemius_hcconn.unload(false);} ); } }; gemius_hcconn.init(); gemius_hit = gemius_hcconn.plainhit; gemius_event = gemius_hcconn.plainevent; pp_gemius_hit = gemius_hcconn.addscripthit; pp_gemius_event = gemius_hcconn.addscriptevent; try { if (typeof gemius_loaded != "undefined") { gemius_loaded(); } else if (typeof pp_gemius_loaded != "undefined") { pp_gemius_loaded(); } } catch (e) {} if (typeof gemius_identifier != 'undefined') gemius_hcconn.event_identifier = gemius_identifier; else if (typeof pp_gemius_identifier != 'undefined') gemius_hcconn.event_identifier = pp_gemius_identifier; gemius_hcconn.sendpendingdata(); }