try{ var BTF = new function(){ this.setCookie = function(c, v, exp, enc) { var expires = ''; if (exp > 0) { var now = new Date(); now.setDate(now.getDate() + exp); expires = '; expires=' + now.toGMTString(); } document.cookie = c + '=' + (enc ? encodeURIComponent(v) : v) + expires + '; path=/;' }; var BT_Debug = { verbose: 0, debug: function(s) { if (this.verbose) try { /*alert(s);*/ console.debug(s); } catch(e) {}}, setVerbose: function(v) { this.verbose = v; } }; BT_Debug.debug('debug is ON'); var BT_Conf = new function() { this.TIME = new Date().getTime(); this.BTF_API = 'https://api.spoldzielnia.nsaudience.pl/frontend/api/'; this.FINAL_SCRIPT_URI = this.BTF_API + 'sendData.js'; this.PART_SIZE = 2500; this.GATHERING_DELAY = 2000; this.SENDING_INTERVAL = 250; this.TIME_SPENT_PERIOD = 10000; this.TIME_SPENT_COUNT = 10; this.guid = function () { function _p8(s) { var p = (Math.random().toString(16)+"000000000").substr(2,8); return s ? "-" + p.substr(0,4) + "-" + p.substr(4,4) : p ; } return _p8() + _p8(1) + _p8(1) + _p8(); }; this.EID = this.guid(); this.BOOT = {sourceId: 'pp_zaint', uid: 'mi1688bdaed46791f6710b0529649'}; }; parserBox = { syso: null, trace: function() {}, conf: {}, EarlyLogger: null, Utils: null, utils: null, Parser: null, parser: null, gummibear: null, GummiBear: null, swfo2: {}, init: null }; with(parserBox) { GummiBear = function(syso){ this.exception = null; this.DebugModule = { "showDebugInfo": function(elem){ elem.innerHTML = "no gummi bear"; } }; this.UtilsModule = { "getNow": function() { return (new Date()).getTime(); }, "byId": function(id){ return document.getElementById(id); }, "shallowCopy": function(obj) { var ret = {}; for (var i in obj) { if (!obj.hasOwnProperty(i)) continue; ret[i] = obj[i]; } return ret; }, "hyp": new RegExp(unescape('%AD'), 'g'), "unhyphen": function(word){ return word.replace(this.hyp, ''); } } //TODO: dodać raport jeśli to te funkcje zostaną użyte? this.init = function(rootName, root){ try { syso('gummibear init to ' + rootName); root.gummibear = this; var gmiter_target=rootName + '.gummibear'; var gummiTarget = root.gummibear; // no gummibear syso('gumibear init done') } catch(e) { this.exception = e; syso("gummibear: " + e); } } syso("loaded gummibear") }; conf.setAb = false; conf.isPanel = false; conf.isCs = false; conf.debugMode = false; conf.enableRaports = true; conf.raportLimit = 20; conf.reportShortImpressions = false; conf.coile = 100; conf.mod100 = 55; conf.abMaxValues = 60; conf.defaultTimeout = 400; conf.longTimeout = 10000; conf.localDbg = false; conf.noAB = false; conf.enableCookieCheck = false; conf.maxParserDelay = 3000; conf.parserTimeout = 3255; conf.maxContent = 600; conf.innerABoost = 2; conf.tag_boost = {h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, strong: 2, em: 2, i: 2, u: 2, b: 2}; conf.whiteChars_str = '!@#$$%^&*()_+-=[]{};\':",/?\\|<>\n\t\r ' + unescape('%u201E%u201C%u201D%E2%80%9E'); conf.blockChars_str = unescape('%A0'); conf.trim_chars = '.'; conf.minWordLength = 4; conf.minSpanLength = 6; conf.minTitleLength = 1; conf.enders = [/owa$/,/sc$/,/ie$/,/owe$/,/ach$/,/owych$/,/ami$/,/ej$/,/em$/,/ym$/,/ego$/,/owemu$/,/ow$/,/owy$/]; conf.enders_no = []; conf.enders_ne = [/a$/,/e$/,/i$/,/o$/,/u$/,/y$/]; conf.shortWords = 'agd,api,bar,bol,but,dab,dom,dub,dvb,dvd,gsm,gui,hub,ios,kac,koc,kot,led,lek,los,lot,lte,nba,nfz,nhl,nik,nnw,nos,ofe,oko,osa,php,pit,pub,pzu,ram,rtv,usb,upc,vat,zus'; conf.specialWords = []; conf.parseMetaTags = true; conf.skipIfInvisibleTags = {h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1, strong: 1, p: 1, div: 1}; conf.ix_boost = 0; conf.ignoredWords = ['_CC_', 'DoZeNieSieNaToJakCoZaPoOdAleDlaJuzMaSaCzyTakTymTezBoTenIchJaBycByTeBezJejBylTejPodLubNas', 'MamGoNizMiTaAbyKtoNicCosTamNoZlGdyOnTuNadImCiNamWpMuDwaJeSamNimOnaAzDniNpWeAniGryIleOk', 'UstWasTyMojMyMp3IzMlnPktGraArtOneTheWamSpOniUeCieIiKimUsaNiaTysWyWieTzwPanBymItpNrDaZlePsKm', 'PolZnaPkbTopDotOtoSmsOfJanUlPisMeMinObaTvpMldTvReDacInTuzAllOdpWwZasYouDalGreTvnPlGenPtMnaCoz', 'CenUdaTelRedCmItdKgObuMocAndSexDrFotBrZycMazBogVsIiiSilIngDolNiHiWojSadEmBolOwDeHaOjElSet', 'IscOkoLaWgBacItFcMixMbForGolKuIoExAutDjVwPlnLsIncTznPbgObyTleTjXdPapTonSwCelMsLksIsKupSldGru', 'LosZalNocWsiIvRolPasLisSynHeGazRakCiuTpDamNewGgLeoLtdTypAtEgoCarObrDajProMmRsKsZlyUpWbcVflSe', 'BalTsiOtTdiF1FaxHsGmtZlaLpgGpPrlHejBpWodBysBmwAreDnoCoxPazCzIdaDsBeBigOkaWwwMaxFmDvdHatGbTyl', 'BoiFinMakAlDnaSoLzy3dRtvWrzPwOnoStyMarFmsXxSrMgVanNwoHd24hVonZusCdPcUdIdeStFiLutMajXpA4LipEwa', 'KodKwiAzsIdTzBicZylHitManHoComCanWksTozWboIbfPopCzeWalIdzPslDonNotIePicZloCudBodNogZdjWba75d', 'PpSztMoiWhoKrsAsSanPozGksGtUsbGsmOsZzaHmmIlEtcDiPsaLekRadStoAbsAktPsyWowLmPhoNmRpSweRozOr', '1zlApXxiHasEndGtaWinTwoWezLoLasSolKwMlOdeAchPowGrNosLwyOldSgJestJakieTegoBedzieNatomiast', 'JestKtoreKtoryJednakKtoraPrzezBedzieByloTakzePrzedTylkoBylaJegoMozeBardzoJeszczeChocby', 'ZostalSobieWszystkoWszystkimKilkaBylyPonadWszyscyPodczasMialBedaJednymKiedyMnieNiemal', 'ObecnieNawetKiedysJestemWieleTegoWlasnieBardziejPozostalychSwoimWszystkieOrazSwojegoMozemy', 'KtorymRowniezNastepnieNiektoreJedynieZostalyMoznaJesliNiestetyKtoregoWieluMialaRoznychJestesmy', 'SwojaZostalaTerazSwojejRownieJakoGdzieCorazChcePrzyWedlugMimoZebyOdbylaNaprawdeMogaPowinniWiec', 'KtorychTakieSiebieTemuGdybySobaMamyZaledwieCalaMoglSwojeNiejPowinienOstatnioWtedyNiegoTakich', 'TakaWciazPrzedeBowiemPrzeciezByliKtorzyAlboNichNadalSwoichInnymSamaZupelnieWrazSwojKtorejChoc', 'NalezyChociazTychPotemBylesTrocheWszystkichInnychInneZarazZadnychCzegoInnaBylegoCzyliDopiero' ].join(''); conf.iframeInitText = '...'; conf.labelTitle = ''; conf.defaultFont = 'Arial'; conf.noIframe = false; conf.flashvars = function(rurl) {//XXX C&P FlashFrameImager rurl = encodeURIComponent(rurl); return {click: rurl, clickTag: rurl, clickTAG: rurl, clickthru: rurl}; } conf.avImgSize = {x: 72, y: 60}; conf.enableAZ = false; conf.azUrl = null; conf.azInNewPage = false; conf.azConfirmText = '';//XXX mv -> confPl conf.azgaurl = '_AZU_'; conf.azHelpUrl = ''; conf.noColors = false; conf.noctriid = false; conf.maxDomCheckDepth = 100; conf.prefix = 'gb'; conf.ssPrefix = 'gb'; conf.host = 'show.smartcontext.pl'; conf.noCache = '-321699152_-6570625498626663683'; conf.version = '300'; conf.rqSpliterVersion = '297'; conf.rqAds1Version = '295'; conf.ssshortWords = decodeURI(''); conf.eplc_dict = {}; conf.eplc_dict[unescape('%u0142')]='l'; /* ł */ conf.eplc_dict[unescape('%u0104')]='A'; /* Ą */ conf.eplc_dict[unescape('%u0119')]='e'; /* ę */ conf.eplc_dict[unescape('%u0143')]='N'; /* Ń */ conf.eplc_dict[unescape('%u0179')]='Z'; /* Ź */ conf.eplc_dict[unescape('%u017a')]='z'; /* ź */ conf.eplc_dict[unescape('%u0106')]='C'; /* Ć */ conf.eplc_dict[unescape('%u017b')]='Z'; /* Ż */ conf.eplc_dict[unescape('%u0144')]='n'; /* ń */ conf.eplc_dict[unescape('%u0105')]='a'; /* ą */ conf.eplc_dict[unescape('%u017c')]='z'; /* ż */ conf.eplc_dict[unescape('%u015a')]='S'; /* Ś */ conf.eplc_dict[unescape('%u0118')]='E'; /* Ę */ conf.eplc_dict[unescape('%u0107')]='c'; /* ć */ conf.eplc_dict[unescape('%u00f3')]='o'; /* ó */ conf.eplc_dict[unescape('%u00d3')]='O'; /* Ó */ conf.eplc_dict[unescape('%u0141')]='L'; /* Ł */ conf.eplc_dict[unescape('%u015b')]='s'; /* ś */ conf.userCookieId = '_7'; conf.adTypes = { 'T': {name: 'box', imagers: {favico: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=box&element=FAVICO&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'F': {name: 'flash', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flash&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_', flash: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flash&element=FLASH&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_', iframe: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flash&element=iframe&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'L': {name: 'largeFlash', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=largeFlash&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_', flash: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=largeFlash&element=FLASH&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_', iframe: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=largeFlash&element=iframe&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'A': {name: 'awatar', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=awatar&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'E': {name: 'exclusive_normal', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=exclusive_normal&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'S': {name: 'exclusive_sky', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=exclusive_sky&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'R': {name: 'exclusive_narrow', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=exclusive_narrow&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'B': {name: 'exclusive_big', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=exclusive_big&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'Z': {name: 'imgK', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=imgK&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'Y': {name: 'imgSP', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=imgSP&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'X': {name: 'imgDP', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=imgDP&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'W': {name: 'imgDB', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=imgDB&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'V': {name: 'imgSW', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=imgSW&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'U': {name: 'imgMP', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=imgMP&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'O': {name: 'csAd', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=csAd&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'N': {name: 'nkbox', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=nkbox&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'G': {name: 'gadgetAd', imagers: {}}, 'K': {name: 'flashK', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flashK&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_', flash: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flashK&element=FLASH&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_', iframe: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flashK&element=iframe&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'J': {name: 'flashDP', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flashDP&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_', flash: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flashDP&element=FLASH&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_', iframe: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flashDP&element=iframe&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'Q': {name: 'flashSW', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flashSW&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_', flash: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flashSW&element=FLASH&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_', iframe: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flashSW&element=iframe&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}}, 'P': {name: 'flashDB', imagers: {image: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flashDB&element=IMAGE&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_', flash: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flashDB&element=FLASH&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_', iframe: 'http://_HOST_/_/getImageII/?vid=_ID_&typ=flashDB&element=iframe&scale=_SCALE_&prefix=_PREFIX_&nc=_TS_'}} }; EarlyLogger = function() { var that = this; var reportBuffer = []; var excBuffer = []; this.report = function(a, b, c) { reportBuffer.push([a, b, c]); } this.exc = function(a, b, c) { excBuffer.push([a, b, c]); } this.getReports = function() { return []; } this.getExceptions = function() { return []; } this.isAlreadySent = function() { return false; } this.init = function(logger) { for (var i=0; i= 0; this.ie6 = navigator.appVersion.indexOf('MSIE 6') >= 0; this.ie8 = navigator.appVersion.indexOf('MSIE 8') >= 0; this.oid = ''; this.ddStatus = undefined; this.rndId = Math.floor(Math.random() * that.duzo * 1000000); this.timeShift = 0; this.ssab = 'None'; this.ssabChanged = false; this.mockAB = []; this.adTypes = {}; this.typesByLetter = {}; var ats = conf.get('adTypes'); for (var at in ats) { if (!ats.hasOwnProperty(at)) continue; this.adTypes[ats[at].name] = at; this.typesByLetter[at] = ats[at].name; } this.show_rect = function() {}; this.show_point = function() {}; this.printRect = function() {}; this.show_tmp_state = function() {}; this.insert_ix_dbg = function() {}; this.dbgAlterForms = function() {}; this.adc_dbg = function() {}; this.adc_dbg_all = function() {}; this.adc_dbg_plugins = function() {}; this.addBoxDbg = function() {}; this.addBoxDbg1 = function() {}; this.showND = function() {}; this.updateMsgDiv = function() {}; this.highlightForm = function() {}; this.namespace = null; this.errorCodes = {}; this.errorCodes.noSuchElement = 'NO_SUCH_ELEMENT'; this.errorCodes.exception = 'OTHER'; this.errorCodes.form2small = 'TOO_SMALL'; this.errorCodes.invalidAdType = 'INVALID_AD_TYPE'; this.getPlacementStatusName = function(placement) { if (placement.dd) return 'dd'; if (placement.status.crashed) return 'crashed'; if (placement.status.noAds) return 'noAds'; if (placement.status.invalid) return 'invalid'; if (placement.status.incomplete) return 'incomplete'; if (placement.status.done) return placement.status.warnings ? 'warning' : 'complete'; if (placement.status.hidden) return 'hidden'; if (placement.data.ads) return 'assigned'; if (placement.status.waiting) return 'waiting'; if (placement.params) return 'decoded'; if (placement.data.hash || placement.data.id) return 'encoded'; return 'uninitialized'; } this.placementStatusByName = (function() { var ret = {}; ret.waiting = {color: 'brown', letter: 'B'}; ret.hidden = {color: 'navy', letter: 'H'}; ret.crashed = {color: 'violet', letter: 'R'}; ret.uninitialized = {color: 'maroon', letter: 'U'}; ret.encoded = {color: 'darkorange', letter: 'E'}; ret.decoded = {color: 'darkgoldenrod', letter: 'D'}; ret.assigned = {color: 'olive', letter: 'A'}; ret.warning = {color: '#cc0', letter: 'W'}; ret.complete = {color: 'green', letter: 'C'}; ret.incomplete = {color: 'gray', letter: 'I'}; ret.dd = {color: '#586', letter: 'F'}; ret.invalid = {color: 'red', letter: 'X'}; ret.valid = {color: 'pink', letter: 'V'}; ret.noAds = {color: 'black', letter: 'N'}; return ret; })(); this.fixAb = function(ssab) { if (conf.get('setAb')) return; if (logger.isAlreadySent()) return; if (that.ssab != 'None') { that.ssabChanged |= that.ssab != ssab; } that.ssab = ssab; } this.getAB = function(slot) { if (that.mockAB[slot] != undefined) return that.mockAB[slot]; var ret = Math.abs((that.rndId - conf.get('mod100')) / conf.get('coile')); ret = Math.floor(ret); var max = conf.get('abMaxValues'); for (var i=0; i/g, '>').replace(/ 0) && (exc === 'retry')) { return setTimeout(function() { ret(rt - 1, a, b, c, d, e, false); }, firsttry ? 0 : that.ifnull(to, conf.get('defaultTimeout'))); } else if (rt > 0) { that.ftry(str + '_failed', that.bind(oncomplete, false, a, b, c, d, e))(); that.errors.push(exc); logger.exc(str, exc); } else { that.ftry(str + '_timeout', that.bind(oncomplete, null, a, b, c, d, e))(); logger.report('J1-', 'all tries failed: ' + str); } } } return function(a, b, c, d, e) { return ret(retries, a, b, c, d, e, true); }; } this.anyMethodMayFail = function(obj) { for (var m in obj) { if (!obj.hasOwnProperty(m)) continue; if (typeof(obj[m]) != 'function') continue; (function(m) { var unchecked = obj[m]; obj[m] = function(a, b, c, d, e, f, g, h, i, j) { if (arguments.length > 10) throw 'too many args'; try { return unchecked(a, b, c, d, e, f, g, h, i, j); } catch(e) { e.methodName = m; throw e; } } })(m); } } this.onlyOnce = function(f, name, uniqParams) { if (name === undefined) name = f+''; return function(p1, p2, p3, p4, p5) { if (uniqParams) name += ' - ' + p1 + ',' + p2 + ',' + p3 + ',' + p4 + ',' + p5; if (that.busy_f[name]) return trace('not invoking: ' + name); that.busy_f[name] = true; setTimeout(function() { that.busy_f[name] = false; }, 0); f(p1, p2, p3, p4, p5); } } this.loadsc = function(href, nohead, enc, nosyso) { if (!href) return logger.report('J2', 'no href'); if (loadsc) return loadsc(href); syso('*** old load ***'); if (that.options('no_cache')) href += '&noc=' + that.now(); (nosyso ? trace : syso)('loading: ' + href.split('?')[0]); trace('params: ' + href); var sc = document.createElement('SCRIPT'); sc.src = href; sc.type = 'text/javascript'; sc.defer = false; sc.charset = that.ifnull(enc, 'UTF-8'); var adc_head = document.getElementsByTagName('head'); if (adc_head[0] && !nohead) { adc_head[0].appendChild(sc); } else { logger.report('J1-', 'No head for document'); var where = document.body; if (typeof(nohead) === 'object') { if (nohead.parentNode) { where = nohead; } } where.appendChild(sc); } } this.later = function(name, f) { if (typeof(f) != 'function') throw logger.report('J3!-', 'later invalid args'); if (that.todo.length === 0) { setTimeout(that.ftry('later - ' + name, function() { trace('invoking ' + that.todo.length + ' delayed functions'); var todo = []; for (var i=0; i= 800) { w = Math.min(w, b.offsetWidth); } return {w: w, h: h}; } this.getScroll = function() { var sx = 0; var sy = 0; var de = document.documentElement; var b = document.body; if(typeof(window.pageYOffset) === 'number') { sy = window.pageYOffset; sx = window.pageXOffset; } else if(b && (b.scrollLeft || b.scrollTop)) { sy = b.scrollTop; sx = b.scrollLeft; } else if(de && (de.scrollLeft || de.scrollTop)) { sy = de.scrollTop; sx = de.scrollLeft; } return {x: sx, y: sy}; } var mouseCoords1 = function(ev) { if (ev.pageX || ev.pageY) return {x: ev.pageX, y: ev.pageY}; var sc = that.getScroll(); return { x: ev.clientX + sc.x, y: ev.clientY + sc.y }; } this.mouseCoords = function(ev) { if (ev === undefined) { ev = event; } var ret = mouseCoords1(ev); var bo = document.body.getBoundingClientRect(); var sc = that.getScroll(); ret.x += bo.left + sc.x; ret.y -= bo.top + sc.y; return ret; } var ieOffsetHacks = function(node, from) { if (that.ie) { try { node.offsetParent; } catch(e) { logger.report('J2-', 'ie offset ' + from); try { console.log(node);//XXX do not touch this node.offsetParent; } catch(e1) { logger.report('J3-', 'ie offset failed'); return true; } } } } this.offset = function(cont, from) { if (!cont) return logger.report('J3-', 'invalid argument'); if (ieOffsetHacks(cont, from || 'somewhere')) return null; var ret = {x: 0, y: 0, w: cont.offsetWidth, h: cont.offsetHeight}; while (cont.offsetParent != null) { ret.x += cont.offsetLeft - that.ifnull(cont.scrollLeft, 0); ret.y += cont.offsetTop - that.ifnull(cont.scrollTop, 0); cont = cont.offsetParent; } ret.x = Math.floor(ret.x); ret.y = Math.floor(ret.y); ret.w = Math.floor(ret.w); ret.h = Math.floor(ret.h); return ret; } this.preloadLater = function(url, type, param, oncomplete) { if (!url) return; if (url.indexOf('data:image') === 0) return; if (that.preloaded[url]) return; that.preloaded[url] = true; that.later('preload', function() { that.preloadImage(url, type, param, oncomplete); }); } this.preloadImage = function(url, type, param, oncomplete) { syso('preloading: ' + url); oncomplete = that.ifnull(oncomplete, function() {}); var newimg = new Image(); newimg.src = url; newimg.onload = newimg.onerror = function() { trace(url + ' - img size: ' + this.width + ', ' + this.height); newimg.ok = true; if (this.width + this.height > 2) return oncomplete(false); logger.report('J1-o', type + ' preloading failed', param); oncomplete(true); } setTimeout(function() { if (newimg.complete && newimg.ok) return; logger.report('J1-o', type + ' preloading timed out', param); oncomplete(null); setTimeout(function() { if (newimg.complete && newimg.ok) return; logger.report('J1-', type + ' preloading too slow', param); }, 5000); }, 5000); } this.getDomain = that.ftry('getDomain', function(url) { if (url === undefined) url = window.location + ''; if (url.substring(0, 4) != 'http') url = 'http://' + url; return escape((url + '&').split('//')[1].split(/[\?\&\#\:\/]/g)[0]); }); this.wloc = function() { try { return '' + window.location; } catch(e) { logger.report('J1-', 'cannot read window.location'); return '-'; } } this.addFifRef = function(src) { if (!that.fif) return src; try { return src += '&ref=' + encodeURIComponent(document.referrer || (window.top.location + '')); } catch(e) { logger.exc('fif', e); return src; } } var abc = this.abc = '0123456789abcdef'; this.fromHex = function(hex) { hex = hex.toLowerCase(); if (hex === '') return 1; if (hex === 'ff') return 1; var hi = abc.indexOf(hex.charAt(0)); var lo = abc.indexOf(hex.charAt(1)); if (hi < 0 || lo < 0) { logger.report('J2', 'invalid hex value', '_' + hex + '_'); return 1; } return (16 * hi + lo) / 255; } this.toHex = function(proc) { proc = 255 * Math.max(0, Math.min(1, proc)); var lo = proc & 15; var hi = (proc - lo) >> 4; return abc.charAt(hi) + abc.charAt(lo); } this.opa = function(css, op, force) { if (op >= 1 && !force) return; if (css.resetAlpha) return; op = css.ns_opa = that.ifnull(css.ns_opa, 1) * op; try {css.filter='alpha(opacity='+(op*100)+')'} catch(e) {}; try {css.MozOpacity = op} catch(e) {}; try {css.opacity = op} catch(e) {}; } this.getSimpleColor = function(col) { return '#' + col.replace(/^#/g, '').substring(0, 6); } this.fixColor = function(color) { if (!color) return color; if (color.charAt(0) === '#') { color = color.substring(1); } if (color.length === 6) return color; if (color.length != 3) { logger.report('P2-', 'invalid intertext color', color); return 'FF0000'; } var ret = ''; for (var i=0; i<3; ++i) { var c = color.charAt(i); ret += c + c; } return ret; } this.contrast = function(c1, c2, colorPri) { colorPri = colorPri || [1, 1, 1]; var ret = 0; for (var i=0; i<3; ++i) { var ch1 = that.fromHex(c1.substring(2 * i, 2 * i + 2)); var ch2 = that.fromHex(c2.substring(2 * i, 2 * i + 2)); ret += Math.abs(ch1 - ch2) * colorPri[i]; } return ret; } this.mixRgba = function(c1, c2, how) { var ret = ''; for (var i=0; i<8; i += 2) { var ch = 'rgba'.charAt(i / 2); var old1 = that.fromHex(c1.substring(i, i + 2)); var old2 = that.fromHex(c2.substring(i, i + 2)); var new1 = how(ch, old1, old2); ret += that.toHex(new1); } return ret; } this.fixCtrUrls = function(ads, pserver_id) { var test = getTestUrlPart(); var mob = that.isMobile ? 't' : 'f'; if (that.isMobile === undefined) { mob = 'x'; } for (var i=0; i'); ret = ret.replace(/\[\/b\]/g, ''); ret = ret.replace(/<[^>]*$/g, ''); ret = ret.replace(/\[[^\]]*$/g, ''); return ret; } this.splitBoxUrl = function(durl) { var chars = ['.', '/', '?', '=']; var wbr = function(str) { for (var i=0; i'); } return str; } durl = durl.replace(/^http:\/\//, '').replace(/^www\./, ''); var ret = []; var parts = durl.split('['); for (var i=0; i.') + url.substring(url.length - 5); } this.checkVersions = function(spliterVersion, adsVersion) { var checkVersion = function(co, v, rq) { if (1 * v < 0) return; if (that.version+'' === v+'') return; if (1 * v >= 1 * rq) return; if (that.version === '_' || v === '_' || options('betaIx') || options('static_src') || options('replaceCode')) { return trace(co + ': skipping version chcek'); } logger.report('S1-', co + ' version mismatch', v); } checkVersion('spliter', spliterVersion, conf.get('rqSpliterVersion')); adsVersion && checkVersion('ads1', adsVersion, conf.get('rqAds1Version')); } this.reportOnSight = that.retry('reportOnSight', function(id, node, callback) { var off = null; try { off = that.offset(node, 'onSight'); } catch(e) { throw 'retry'; } if (!off) throw 'retry'; if (off.w * off.h <= 0) throw 'retry'; var size = that.getSize(); var scroll = that.getScroll(); if (off.x < scroll.x) throw 'retry'; if (off.y < scroll.y) throw 'retry'; if (off.x > scroll.x + size.w) throw 'retry'; if (off.y > scroll.y + size.h) throw 'retry'; if (!node.vis0) { node.vis0 = true; callback(false); } if (off.x + off.w > scroll.x + size.w) throw 'retry'; if (off.y + off.h > scroll.y + size.h) throw 'retry'; callback(true); that.highlightForm(node); }); this.swfo = function(node, w, h, src, params, attributes, flashvars) { params = that.ifnull(params, {}); attributes = that.ifnull(attributes, {}); flashvars = that.ifnull(flashvars, {}); that.flashCnt = that.ifnull(that.flashCnt, 0); node = that.cel(node, 'div'); var name = node.id = 'flashBox_' + that.flashCnt++; return swfo2.swfobject.embedSWF(src, name, w, h, "10.0.0", null, flashvars, params, attributes); } this.createFlash = function(node, w, h, box, extra) { var src = that.getImager(box, 'flash'); var params = {wmode: 'transparent'}; var aa = box.aa; if (extra.orig) { var amp = aa.indexOf('?') >= 0 ? '&' : '?'; aa += amp + 'word=' + encodeURI(extra.orig); } var fv = conf.get('flashvars')(aa); return that.swfo(node, w + 'px', h + 'px', src, params, {}, fv); } this.getFlashPlayerVersion = function() { var ret = getFlashPlayerVersion0(); that.getFlashPlayerVersion = function() { return ret; } return ret; } var getFlashPlayerVersion0 = function() { try { return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1] } catch(e) { try { if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){ return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]; } } catch(e) {} } return null; } } Parser = function(conf, utils, logger, options) { var that = this; var document = window.document; this.word_sort_val = function(a) { return a.so = a.bust*a.count*a.count*(1+a.count)*(8+a.word.length); } this.makeArray = function(str) { var ret = {}; for (var i=0; i= 0) return null; } ret.word=w; for(var key=0; key 0) { if (that.trimArr[word.charAt(0)]) { word = word.substring(1); o.begin++; } else if (that.trimArr[word.charAt(word.length - 1)]) { word = word.substring(0, word.length - 1); } else { break; } } var ok = true; for (var ch in that.trimArr) { if (!that.trimArr.hasOwnProperty(ch)) continue; if (word.indexOf(ch) >= 0) ok = false; } if (!ok) { trace('skipping word: ' + word); word = ''; continue; } if(ch === '<' && noTags !== true) tag = true; if (parseInt(word) < that.minNumberValue) { word = ''; continue; } o.orgin=word; o.content=that.ecapeNationalLowerCase(word); o.set=0; if (word.length > 1) array.push(o); word = ''; } } else { if(ch === '>' && !quotes && !apostrof) { tag=false; } else if(ch === '"' && !apostrof) { quotes=!quotes; } else if(ch === "'" && !quotes) { apostrof=!apostrof; } } } if (that.specialWords.length == 0) return array; var textLow = text.toLowerCase(); for (var i=0; i 0 && !that.reject_chars[textLow.charAt(off - 1)]) continue; if (!sw.last && off < textLow.length - 1 && !that.reject_chars[textLow.charAt(off + sw.from.length)]) continue; var o = { orgin: text.substring(off, off + sw.from.length), content: sw.to, begin: off, set: 0 } array.push(o); } } return array; } this.walk = function(node, state, onTextNode, onEnter, onExit, onLeaf) { if ((node.nodeType === 3) && (node.nodeValue) && (node.nodeValue.length > 2) && (node.nodeValue[0] != '<')) { return onTextNode(node, state); } var ch = node.childNodes; var tag = 'unknown tag'; if (node.tagName != undefined) tag = (node.tagName + '').toLowerCase(); if ((ch.length === 0) && onLeaf) return onLeaf(tag, node, state); if (onEnter) { try { state = onEnter(tag, node, state); } catch(e) { if (typeof(e) === 'object') logger.exc('walk', e); return; } } for (var i=0; i that.timeEnd) return logger.report('J2-', 'nodeBuff access timed out'); if (that.nodeBuff.length > 1000) return logger.report('J2-', 'nodeBuff size limit exceeded'); var newCopy = {}; newCopy[attr] = val; that.nodeBuff.push({orig: node, copy: newCopy}); } } this.getNodeAttr = function(node, attr) { if (!utils.ie) return node['nsp_' + attr]; try { return node['nsp_' + attr]; } catch(e) { that.fallbackMode(); return that.getNodeAttr(node, attr); } } this.setNodeAttr = function(node, attr, val) { if (!utils.ie) return node['nsp_' + attr] = val; try { node['nsp_' + attr] = val; } catch(e) { that.fallbackMode(); that.setNodeAttr(node, attr, val); } } var add1list = function(out, list, val) { for (var i=0; i 1) && logger.report('P1-', 'space in surface def', list[i]); for (var s=0; s 1) color = ['#00a', '#22f']; if (invisibleIgnored) { that.mark(node, '#430', '#860', 'invisible ignored text node'); } else { that.mark(node, color[0], color[1], 'text node: ' + wc); } that.spans.push(s); state.valid = true; }, function(tag, node, state) { if (utils.now() > that.timeEnd) { throw that.mark(node, '#000', '#222', 'timeout'); } if (node._ceq) { var ixBust = conf.get('ix_boost'); if (ixBust) { logger.report('P1-', 'found ix word', node._ceq); that.addWord(hashArr, node._ceq, state.tb * ixBust, 1, 'ix'); throw that.mark(node, '#070', '#0f0', 'ix word'); } } for (var t=0; t 100 && node.parentNode.offsetHeight > 100) { if (node.firstChild && node.firstChild.nodeValue === node.innerHTML) { logger.report('P1-', 'found inner A'); that.addWords(hashArr, node.innerHTML, conf.get('innerABoost'), 1, 'a'); throw that.mark(node, '#170', '#3f0', 'inner A'); } } throw that.mark(node, '#222', '#667', 'A cutoff'); } else { throw that.mark(node, '#333', '#999', 'def cutoff: ' + tag.toLowerCase()); } } } var disp = '?'; try { if (node.style) { disp = node.style.display; } } catch(e) { logger.report('J1-', 'no display style'); }; if (disp === 'none') { throw that.mark(node, '#d60', '#f90', 'display: none'); } var props = [tag]; if (node.id) props.push('#'+node.id); if (node.className) { var cn = (node.className + '').split(' '); for (var c=0; c that.maxWordLength) continue; that.addWord(hashArr, content, that.spans[t].contextBust, 1, arr.length, 'content'); } } } this.addWord = function(hashArr, word, bust, only, msl, where) { word = word.toLowerCase(); var wl2 = word.length === 2 && word.length < that.minWordLength; if (wl2 && that.shortWords[word] === undefined) return; if (bust === undefined) bust = 1; var o = that.getBaseForm(word); if (o === null) return; o.whereArr = o.whereArr = {}; o.where = o.where || []; o.whereArr[where] || o.where.push(where); o.whereArr[where] = true; if (hashArr[o.bform]) { hashArr[o.bform].only |= only; hashArr[o.bform].msl = Math.max(hashArr[o.bform].msl, msl); hashArr[o.bform].count++; hashArr[o.bform].words += ',' + word; hashArr[o.bform].totalbust += bust; hashArr[o.bform].bust = hashArr[o.bform].totalbust * hashArr[o.bform].origBust / hashArr[o.bform].count; hashArr[o.bform].busts.push(bust); return; } o.only = only;//przynajmniej jedno wystapienie w kontencie dla Ix o.msl = msl;//max. span length o.count = 1; o.words = word; if (that.impWords[word] > 0) { o.important = that.impWords[word];//dbg o.bust *= that.impWords[word]; } o.origBust = o.bust; o.busts = [o.bust];//dbg o.bust = o.bust * bust; o.totalbust = bust; hashArr[o.bform] = o; } var addAll = function(a1, a2) { a2.sort(); while (a2.length > 0) { a1.push(a2.pop()); } } this.getReturnStr = function(hashArr, weightLimit) { var array_tmp = []; for(var key in hashArr) { if (!hashArr.hasOwnProperty(key)) continue; var val = hashArr[key]; if (typeof(val) != 'object') continue; if ((!val.only) || (val.so <= 0)) continue; array_tmp.push(val); } if (array_tmp.length === 0) { logger.report('P1-o', 'no content'); return ''; } else if (array_tmp.length < 30) { logger.report('P0-o', 'low content', array_tmp.length); } for (var i=0; i that.max_url) break; length += word.length + 1; buff.push(word); array_tmp[p].normal_val = c_val; } addAll(contentArr, buff); return contentArr.join('+'); } this.addWords = function(hashArr, words, bust, only, where) { var arr = that.nsSplit(words); for (var i=0; i= that.minWordLength && content.length <= that.maxWordLength) { that.addWord(hashArr, arr[i].content, bust, only, arr.length, where); } } } this.getInputContent = function(hashArr) { if (!conf.get('parseMetaTags')) return; var m = document.getElementsByTagName('input'); for (var i=0;i= 0) { that.addWords(hashArr, m[i].content, that.desc_boost, that.allowOnlyMeta, 'meta - desc'); } else if (d.indexOf('keywords') >= 0) { that.addWords(hashArr, m[i].content, that.kw_boost, that.allowOnlyMeta, 'meta - keywords'); } } var t = document.getElementsByTagName('title'); for (var i=0; i conf.get('maxContent')) { content = content.substring(0, conf.get('maxContent')).replace(/\+[^+]*$/g, ''); content = that.decodable(content, 7); } return content; }; this.content = null; this.parseAll = function(weightLimit, co, params, start) { co = co || 'C,M,I'; start = start || function() {}; start('parserPre'); init1(); that.timeEnd = utils.now() + that.timeout; if (options('noTimeout')) { that.timeEnd += 10000000; } if (params === undefined) params = {}; that.content = {}; start('parserMain'); if (co.indexOf('C') >= 0) that.getSpansAndTexts(that.content, params); start('parserPost'); if (co.indexOf('M') >= 0) that.getMetaContent(that.content); if (co.indexOf('I') >= 0) that.getInputContent(that.content); var ret = that.getReturnStr(that.content, weightLimit); var exceeded = that.exceeded = utils.now() - that.timeEnd; trace('parsing time='+(exceeded+that.timeout)); if (exceeded >= 0) logger.report('P1-o', 'timeout exceeded', exceeded); trace('parsing completed'); return ret; }; } syso = function(str) {} init = function() { conf.adc_skip_tags = ['SCRIPT', 'STYLE', 'SELECT', 'A', 'NOSCRIPT', 'NOEMBED', 'IFRAME']; conf.version = 0; conf.allowOnlyMeta = 1; conf.ix_boost = 1.5; var options = function() {}; var earlyLogger = new EarlyLogger(); gummibear = new GummiBear(syso); gummibear.init('parserBox', parserBox); utils = new Utils(conf, earlyLogger, options, gummibear.UtilsModule); earlyLogger.addstats = earlyLogger.exc = earlyLogger.report = function() {}; parser = new Parser(conf, utils, earlyLogger, options); }; init(); } var BT_Utils=new function() { this.parametersToString=function(parametersMap) { function singleParamToString(paramName, paramValue) { return paramValue ? '&' + encodeURIComponent(paramName) + '=' + encodeURIComponent(paramValue) : ''; } var result = ''; for (var param in parametersMap) { if (parametersMap.hasOwnProperty(param)) { var value = parametersMap[param]; if ((value === null) || (value === undefined)) { continue; } if (value instanceof Array) { for (var i = 0; i < value.length; i++) { result += singleParamToString(param, value[i]); } } else { result += singleParamToString(param, value); } } } return result; }; this.loadScript_=function(s) { var e = document.createElement('script'); e.type = 'text/javascript'; e.referrerPolicy = "no-referrer-when-downgrade"; e.src = s; e.async = true; document.body.appendChild(e); }; this.loadScript=function(p) { p = ((p === null) || (p === undefined)) ? '' : p; this.loadScript_(BT_Conf.FINAL_SCRIPT_URI + '?' + this.parametersToString({eid: BT_Conf.EID, time: BT_Conf.TIME}).substr(1) + p); }; this.go=function(extractor) { setTimeout(function(){ extractor.run(); }, BT_Conf.GATHERING_DELAY); }; }; this.site = { getURL : function() { return window.location.href; }, getReferrer: function() { return document.referrer; }, findBrowser : function() { var ua = navigator.userAgent.toString().toLowerCase(); var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/ var IE7 = (document.all && !window.opera && window.XMLHttpRequest && ua.indexOf('Trident/4.0') === -1) ? true : false; var IE8 = (ua.indexOf('trident/4.0') !== -1); var SAFARI = (ua.indexOf("safari") !== -1) && (ua.indexOf("chrome") === -1); var FIREFOX = (ua.indexOf("firefox") !== -1); var CHROME = (ua.indexOf("chrome") !== -1); var MOBILE_SAFARI = ((ua.indexOf("iphone")!==-1) || (ua.indexOf("ipod")!==-1) || (ua.indexOf("ipad")!==-1)) ? true : false; return IE6 || IE7 || IE8 ? 'IE' : SAFARI ? 'Safari' : FIREFOX ? 'Firefox' : CHROME ? 'Chrome' : MOBILE_SAFARI ? 'Mobile Safari' : 'unknown'; }, findOS : function() { var v = navigator.appVersion; return (v.indexOf("Win") !== -1) ? "Windows" : (v.indexOf("Mac") !== -1) ? "MacOS" : (navigator.userAgent.indexOf("Linux") !== -1) ? "Linux" : (v.indexOf("X11") !== -1) ? "UNIX" : "unknown"; }, run : function() { var parameters = BT_Conf.BOOT; parameters.url = decodeURIComponent(this.getURL()); parameters.user_agent = navigator.userAgent; try { parameters.text = parserBox.parser.parseAll(32).replace(/\+/g, ' '); } catch(e) {} var p = BT_Utils.parametersToString(parameters); BT_Utils.loadScript(p); } }; BT_Utils.go(this.site); }; } catch(e) {}