(function() {if (!quad_akon .static.initialized) with (quad_akon) { trace('initializing static'); static.fstarts = []; static.evlog = nslog_akon; static.evlog.s += ' BS'; static.customize = function() { try {x.x.x} catch(e) {static.fstarts.push(['rqComm', e.lineNumber, 0])}; conf.prefix = 'akon'; conf.host = 'adsearch.adkontekst.pl'; conf.noCache = 'h1prn6gp'; conf.version = '121'; conf.rqSpliterVersion = '117'; conf.rqAds1Version = '117'; conf.ctr_url = '_#U#_'; 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.adTypes = { 'T': {name: 'box', imagers: {}}, 'F': {name: 'flash', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=flash&element=image&scale=_SCALE_&nc=_TS_', flash: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=flash&element=flash&scale=_SCALE_&nc=_TS_'}}, 'L': {name: 'largeFlash', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=largeFlash&element=image&scale=_SCALE_&nc=_TS_', flash: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=largeFlash&element=flash&scale=_SCALE_&nc=_TS_'}}, 'A': {name: 'awatar', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=awatar&element=image&scale=_SCALE_&nc=_TS_'}}, 'E': {name: 'exclusive_normal', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=exclusive_normal&element=image&scale=_SCALE_&nc=_TS_'}}, 'S': {name: 'exclusive_sky', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=exclusive_sky&element=image&scale=_SCALE_&nc=_TS_'}}, 'R': {name: 'exclusive_narrow', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=exclusive_narrow&element=image&scale=_SCALE_&nc=_TS_'}}, 'B': {name: 'exclusive_big', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=exclusive_big&element=image&scale=_SCALE_&nc=_TS_'}}, 'Z': {name: 'imgK', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=imgK&element=image&scale=_SCALE_&nc=_TS_'}}, 'Y': {name: 'imgSP', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=imgSP&element=image&scale=_SCALE_&nc=_TS_'}}, 'X': {name: 'imgDP', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=imgDP&element=image&scale=_SCALE_&nc=_TS_'}}, 'W': {name: 'imgDB', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=imgDB&element=image&scale=_SCALE_&nc=_TS_'}}, 'V': {name: 'imgSW', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=imgSW&element=image&scale=_SCALE_&nc=_TS_'}}, 'U': {name: 'imgMP', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=imgMP&element=image&scale=_SCALE_&nc=_TS_'}}, 'O': {name: 'csAd', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=csAd&element=image&scale=_SCALE_&nc=_TS_'}}, 'N': {name: 'nkbox', imagers: {image: 'http://adsearch.adkontekst.pl/_/getImageII/?vid=_ID_&typ=nkbox&element=image&scale=_SCALE_&nc=_TS_'}} }; try {x.x.x} catch(e) {static.fstarts.push(['rqConf', e.lineNumber, 0])}; conf.placementPrefix = 'QAPS_AKPL'; conf.labelsCnt = 12; conf.textLabelWidth = conf.img_text_label_width = 65; conf.labelText = conf.img_text_label = 'Adkontekst'; conf.adc_akon_url = 'http://www.adkontekst.pl/autozamowienie_cpc/'; conf.adc_akon_href = 'http://ad.hit.gemius.pl/hitredir/id=.WqVhm_brTxgwVaRdbrcZZbffQrsJu7_ZbngHvx5yVv.57/stparam=wgrmiuknxi/url=http%3A//www.adkontekst.pl/autozamowienie_cpc/%3Futm_source%3DAdkontekst%26utm_medium%3Dmetka%26utm_term%3D_EREF_%26utm_campaign%3Dkontekst'; try {x.x.x} catch(e) {static.fstarts.push(['cusomCommon', e.lineNumber, 0])}; spliter.events.onbeforeparse.push(function() { conf.enders = [/ami$/,/zie$/,/ego$/,/cie$/,/em$/,/ie$/,/ym$/,/sc$/,/ow$/]; conf.enders_no = [/owy$/,/owa$/,/owe$/,/owym$/]; conf.enders_ne = [/e$/,/y$/,/i$/,/a$/,/u$/,/o$/]; conf.enableAZ = true; conf.azUrl = 'https://panel.adkontekst.pl/autoOrder/index?domain=_DOM_&cid=_CAID_&pid=_PRID_&utm_source=Adkontekst&utm_medium=kupreklame&utm_term=_EREF_&utm_campaign=layer&nc=_NOW_'; conf.azPrefix = 'http://_HOST_/_/static/akon/autozamowienie/'; conf.azgaurl = 'http://ad.hit.gemius.pl/hitredir/id=.WqVhm_brTxgwVaRdbrcZZbffQrsJu7_ZbngHvx5yVv.57/stparam=wgrmiuknxi/%3F&url=_AZU_'; conf.azHelpUrl = 'http://www.adkontekst.pl/help/LayerHelp'; conf.azConfirmText = 'Czy chcesz przerwac tworzenie kampanii?'; conf.tp_url = 'http://mandie2.netsprint.net/secure/tomek/QAE.html'; conf.minWordLength = 2; conf.minNumberValue = 1000; conf.ignoredWords = ['_CC_', 'DoZeNieSieNaToJakCoZaPoOdAleDlaJuzMaSaCzyTakTymTezBoTenIchJaBycByTeBezLatJejBylTejPodLubNas', 'MamGoNizMiTaAbyKtoNicCosTamNoZlGdyOnTuNadImCiNamWpMuDwaJeSamNimOnaRazAzRokDniNpWeAniGryIleOk', 'UstWasTyMojMyMp3IzMlnPktGraArtOneTheWamSpOniUeCieIiKimUsaNiaTysWyWieTzwPanBymItpNrDaZlePsKm', 'PolZnaPkbTopDotOtoSmsOfJanUlPisMeMinObaTvpMldTvReDacInTuzAllOdpWwZasYouDalGreTvnPlGenPtMnaCoz', 'DomCenUdaTelRedCmItdKgObuMocAndSexDrFotBrZycMazBogVsIiiSilIngDolNiHiWojSadEmBolOwDeHaOjElSet', 'IscOkoLaWgBacItFcMixMbForGolKuIoExAutDjVwPlnLsIncTznPbgObyTleTjXdPapTonSwCelMsLksIsKupSldGru', 'LosZalNocWsiIvRolPasLisSynHeGazRakCiuTpDamNewGgLeoLtdTypAtEgoCarObrDajProMmRsKsZlyUpWbcVflSe', 'BalTsiOtTdiF1FaxHsGmtZlaLpgGpPrlHejBpWodBysBmwAreDnoCoxPazCzIdaDsBeBigOkaWwwMaxFmDvdHatGbTyl', 'BoiFinMakAlDnaSoLzy3dRtvWrzPwOnoStyMarFmsXxSrMgVanNwoHd24hVonZusCdPcUdIdeStFiLutMajXpA4LipEwa', 'KodKwiAzsIdTzBicZylHitManHoComCanWksTozWboIbfPopCzeWalIdzPslDonNotIePicZloCudBodNogZdjWba75d', 'PpSztMoiWhoKrsAsSanVatPozGksGtUsbGsmOsZzaHmmIlEtcDiPsaLekRadStoAbsAktPsyWowLmPhoNmRpSweRozOr', '1zlApXxiHasEndGtaWinTwoWezLoLasSolKwMlOdeAchPowGrNosLwyOldSg' ].join(''); var zanoxUrl = '20192653C939700273'; var tmpIds = {'#648411': true, '#648521': true, '#648522': true, '#648523': true}; var zid = {}; for (var id=681484; id<=681498; ++id) { zid['#' + id]='21093591C2093553773'; } zid['#681499']='21093637C1702287672'; zid['#681505']='21093637C1702287672'; zid['#681511']='21093637C1702287672'; zid['#681516']='21093637C1702287672'; zid['#681521']='21093637C1702287672'; zid['#681501']='21093708C1677577758'; zid['#681508']='21093708C1677577758'; zid['#681513']='21093708C1677577758'; zid['#681518']='21093708C1677577758'; zid['#681523']='21093708C1677577758'; zid['#681502']='21093701C1956507546'; zid['#681509']='21093701C1956507546'; zid['#681514']='21093701C1956507546'; zid['#681519']='21093701C1956507546'; zid['#681524']='21093701C1956507546'; zid['#681503']='21093333C799623489'; zid['#681510']='21093333C799623489'; zid['#681515']='21093333C799623489'; zid['#681520']='21093333C799623489'; zid['#681525']='21093333C799623489'; zid['#650809']='20269146C431886349'; zid['#650816']='20269146C431886349'; zid['#650817']='20269146C431886349'; zid['#650818']='20269146C431886349'; zid['#650819']='20269146C431886349'; zid['#650820']='20269146C431886349'; zid['#681500']='21093786C109845764'; zid['#681507']='21093786C109845764'; zid['#681512']='21093786C109845764'; zid['#681517']='21093786C109845764'; zid['#681522']='21093786C109845764'; zid['#699960']='21581263C429909755'; zid['#699961']='21581263C429909755'; zid['#699962']='21581263C429909755'; zid['#699964']='21581263C429909755'; zid['#699965']='21581263C429909755'; zid['#699966']='21581263C429909755'; zid['#699968']='21581263C429909755'; zid['#699969']='21581263C429909755'; zid['#699970']='21581263C429909755'; zid['#699972']='21581263C429909755'; zid['#699973']='21581263C429909755'; zid['#699974']='21581263C429909755'; zid['#699976']='21581263C429909755'; zid['#699977']='21581263C429909755'; zid['#699978']='21581263C429909755'; zid['#699980']='21581263C429909755'; zid['#699981']='21581263C429909755'; zid['#699982']='21581263C429909755'; zid['#699984']='21581263C429909755'; zid['#699985']='21581263C429909755'; zid['#699986']='21581263C429909755'; zid['#699963']='21581265C700578430'; zid['#699967']='21581265C700578430'; zid['#699971']='21581265C700578430'; zid['#699975']='21581265C700578430'; zid['#699979']='21581265C700578430'; zid['#699983']='21581265C700578430'; zid['#699987']='21581265C700578430'; zid['#705501']='21624336C1090244976'; zid['#705502']='21624336C1090244976'; zid['#705503']='21624336C1090244976'; zid['#705504']='21624336C1090244976'; var old = utils.getImager; utils.getImager = function(box, ktory, scale) { if (zid) { var boxId = '#' + 1 * box.id; if (zid[boxId]) { syso('zannox 15800'); var zannoxImg2 = new Image(1, 1); zannoxImg2.src = 'http://ad.zanox.com/ppv/?' + zid[boxId]; document.body.appendChild(zannoxImg2); zid[boxId] = false; setTimeout(function() { utils.raport('P0', 'zannox2', box.id); }, 2000); } } var ret = old(box, ktory, scale); var tmpId = tmpIds['#' + box.id]; if (!tmpId) return ret; if (ktory != 'flash') return ret; if (zanoxUrl) { syso('zannox 1'); var zannoxImg = new Image(1, 1); zannoxImg.src = zanoxUrl; document.body.appendChild(zannoxImg); zanoxUrl = false; utils.raport('P0-', 'zannox1', box.id); } return ret.replace(/\?/g, '?incomingURL=' + encodeURIComponent(box.aa) + '&'); } }); try {x.x.x} catch(e) {static.fstarts.push(['cusom', e.lineNumber, 0])}; spliter.events.onbeforeparse.push(function() { conf.enableAKPlacements = true; conf.img_text_label_width = 100; conf.img_text_label = 'Reklama AdKontekst'; conf.az_text = unescape('Kup%20reklam%u0119%20tutaj'); conf.az_shortText = unescape('Kup%20reklam%u0119'); conf.az_longText = unescape('Kup%26nbsp%3Breklam%u0119%26nbsp%3Bna%26nbsp%3B_WHERE_'); }); } try {x.x.x} catch(e) {static.fstarts.push(['confCommon', e.lineNumber, 0])}; conf.enableRaports = true; conf.raportLimit = 10; conf.raportExtraLimit = 1; conf.coile = 100; conf.mod100 = 55; conf.defaultTimeout = 400; conf.defaultSysoColor = 'gray'; conf.subframeSysoColor = 'brown'; conf.longTimeout = 15000; conf.localDbg = false; conf.encoding = 'UTF-8'; conf.maxContent = 600; conf.tag_boost = {h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, bold: 2, strong: 2, em: 2, i: 2, u: 2}; conf.whiteChars_str = '!@#$$%^&*()_+-=[]{};\':",/?\\|<>\n\t\r ' + unescape('%u201C%u201D'); conf.blockChars_str = unescape('%A0'); conf.trim_chars = '.'; conf.minWordLength = 4; conf.minSpanLength = 6; conf.enders = []; conf.enders_no = []; conf.enders_ne = []; conf.twoLetterWords = ''; conf.ignoredWords = ''; conf.labelTitle = ''; conf.defaultFont = 'Arial'; conf.enableC2a = false; conf.c2aText = ''; conf.enableAZ = false; conf.azUrl = null; conf.azPrefix = ''; conf.azInNewPage = false; conf.azConfirmNeeded = true; conf.azConfirmText = ''; conf.az_ifheight = 720; conf.az_ifwidth = 310; conf.azgaurl = '_AZU_'; conf.azHelpUrl = ''; try {x.x.x} catch(e) {static.fstarts.push(['conf', e.lineNumber, 0])}; conf.adc_skip_tags = ['SCRIPT', 'STYLE', 'SELECT', 'A', 'NOSCRIPT', 'IFRAME']; conf.allowOnlyMeta = 1; conf.pscript_prefix = 'x___x'; conf.pscript_ecdef = 'extra_content'; conf.allowForceEx = false; conf.allowedFonts = '#Arial#'; conf.enableAKPlacements = false; conf.allowSamePlacementIds = true; conf.ignoreSamePlacementIds = false; conf.ads_limit = 14; conf.enableCopyAds = true; conf.emptyBoxes = false; conf.doublePalette = true; conf.retries = 1000; conf.write_form_retries = 20; conf.enableOneLineForms = true; conf.minFS = 9; conf.maxFS = 14; conf.imgBottomColors = '#000000#7777FF#FF7700#444444#'; conf.img_text_label_width = conf.textLabelWidth; conf.img_text_label = conf.labelText; conf.flashLabelWidth = 129; conf.flashLabelHeight = 17; conf.flashLabelSmall = 23; conf.cssOptions = 0; conf.adWarnInnerHTML = false; conf.ad_warn_function = function() {return null}; conf.labelSizes = function() {return {vx: 15, vy: 60, hx: 64, hy: 15}}; conf.enableLandingPageParams = false; conf.noClickurlTrash = false; conf.minClickTime = 0; conf.c2aShortText = ''; conf.c2aFS = 10; conf.c2aWidth = 0; conf.c2aShortWidth = 0; conf.az_text = ''; conf.az_shortText = ''; conf.az_longText = '' + ' '; conf.azFS = 11; conf.azCB = 1; conf.azBB = 0.2; conf.azBold = true; conf.azUnderline = true; conf.moreAZ = false; //***************************************************************************** conf.vimgurl = 'http://_HOST_/_/static/_PREFIX_/script_gen/labels/pion**.png?no_cache=_START_'; conf.himgurl = 'http://_HOST_/_/static/_PREFIX_/script_gen/labels/poziom**.png?no_cache=_START_'; conf.spliter2Url = 'http://_HOST_/quad/spliter/?prid=_PRID_&caid=_CAID_&nc=_NOW_&cc=_CC_&form=_FORM_&iid=_IID_&content=_CONTENT_&extra=_EXTRA_&prefix=_PREFIX_'; conf.spliter3Url = 'http://_HOST_/quad/spliter/?prid=_PRID_&caid=_CAID_&nc=_NOW_&cc=_CC_&form=_FORM_&iid=_IID_&content=_CONTENT_&qnr=_QN_&without=_WO_&extra=_EXTRA_&prefix=_PREFIX_'; conf.adFrameUrl = 'http://_HOST_/quad/spliter/?prid=_PRID_&caid=_CAID_&nc=_NOW_&cc=_CC_&form=_FORM_&iid=_IID_&jsdata=_FDEF_&bts=_IDS_&ref=_REF_&prefix=_PREFIX_'; conf.raportUrl = 'http://_HOST_/_/raport/?nsnow=_NOW_&emt=box'; conf.getParamsUrl = 'http://_HOST_/_/pb/?prid=_PRID_&caid=_CAID_&p=_PLIDS_&prefix=_PREF_&no_cache=_START_&no_cache_chan=_XNC_'; conf.flash_label_url = 'http://_HOST_/_/static/_PREFIX_/script_gen/labels/metka_08.png?no_cache=_START_'; conf.tp_url = ''; conf.form_header_src = ''; conf.form_header_size = {x: 0, y: 0}; conf.txt_nkao = ''; try {x.x.x} catch(e) {static.fstarts.push(['utils', e.lineNumber, 0])}; Utils = function(conf, options) { var that = this; this.options = options; if (!options) this.options = function() {return false}; conf.get = function(str, def) { if (conf[str] != undefined) return conf[str]; if (def != undefined) return def; if (that.busy) return; that.busy = true; that.raport('J3!', 'No required configuration paramerer', str); that.busy = false; throw str; } conf.getUrl = function(confParam, def) { return conf.get(confParam, def) .replace(/_HOST_/g, conf.get('host')) .replace(/_PREFIX_/g, conf.get('prefix')) .replace(/_START_/g, conf.get('noCache')) .replace(/_NOW_/g, that.now()) ; } this.duzo = 1 << 30; this.version = conf.get('version'); this.rqSpliterVersion = conf.get('rqSpliterVersion'); this.rqAds1Version = conf.get('rqAds1Version'); this._dbg_ = {}; this._dbgc_ = {}; this.trash = []; this.tmp_state = {}; this.busy_f = {}; this.s1cache = {}; this.todo = []; this.evlog = {s:'0'}; this.ie = navigator.appVersion.indexOf('MSIE') >= 0; this.ie6 = navigator.appVersion.indexOf('MSIE 6') >= 0; this.adTypes = { text: 'T', box: 'T', skyscraper: 'S', exclusive_sky: 'S', rectangle: 'E', billboard: 'E', exclusive: 'G', exclusive_normal: 'E', exclusive_narrow: 'R', exclusive_big: 'B', flash: 'F', avatar: 'A', awatar: 'A', imgK: 'Z', imgSP: 'Y', imgsp: 'Y', imgDP: 'X', imgDB: 'W', imgSW: 'V', imgMP: 'U', imgMF: 'M', csAd: 'O', nkbox: 'N', largeflash: 'L' }; var ats = conf.get('adTypes'); for (var at in ats) { this.adTypes[ats[at].name] = at; } this.show_rect = function() {}; this.show_point = function() {}; this.printRect = function() {}; this.show_tmp_state = function() {}; this.insert_ix_dbg = function() {}; this.printTimes = 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.replaceAds = function() {}; this.showND = function() {}; this.updateMsgDiv = function() {}; this.stages = function() {};//deprecated this.getImager = function(box, ktory, scale) { ktory = that.ifnull(ktory, 'image'); if (box[ktory]) return box[ktory].replace('_MOD3_', Math.floor(Math.random() * 3)); var typ = that.ifnull(that.adTypes[box.typ], box.typ); typ = conf.get('adTypes')[typ]; if (!typ || !typ.imagers[ktory]) { that.raport('S1!-', 'unknown imager', box.typ + '.' + ktory); return null; } return typ.imagers[ktory] .replace(/_ID_/g, box.id) .replace(/_TYP_/g, box.typ) .replace(/_ELEMENT_/g, ktory) .replace(/_TS_/g, box.timestamp) .replace(/_SCALE_/g, that.ifnull(scale, 1)) + (options('no_cache') ? '&nc2=' + that.now() : ''); } this.emptyAd = function() { return {title: '', desc: '', url: '', opis1: '', opis2: ''}; } this.syso1 = function(str) { if (that.s1cache[str]) return trace(str); that.s1cache[str] = true; syso(str); } this.now = function() { return (new Date()).getTime(); } this.byId = function(id) { return document.getElementById(id); } this.cel = function(par, tag, type) { var el = document.createElement(tag); if (type) { el.type = type; } if (par) { par.appendChild(el); } return el; } this.cel_back = function(par, tag) { if (!par.firstChild) return that.cel(par, tag); var el = document.createElement(tag); par.insertBefore(el, par.firstChild); return el; } this.ctn = function(par, txt) { par.appendChild(document.createTextNode(txt)); } this.rm = function(node) { node.parentNode.removeChild(node); } this.clr = function(node) { while (node.firstChild) node.removeChild(node.firstChild); } this.createIframe = function(node, x, y, src) { if (that.ie && src) { for (var i=0; i 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.apply(oncomplete, false, a, b, c, d, e))(); that.errors.push(exc); that.exc(str, exc); } else { that.ftry(str + '_timeout', that.apply(oncomplete, null, a, b, c, d, e))(); that.raport('J1-', 'all tries failed: ' + str); } } } return function(a, b, c, d, e) { return ret(retries, a, b, c, d, e, true); }; } 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 that.raport('J2', 'no href'); 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, conf.get('encoding')); var adc_head = document.getElementsByTagName('head'); if (adc_head[0] && !nohead) { adc_head[0].appendChild(sc); } else { that.raport('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 (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}; } this.mouseCoords = 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.offset = function(cont) { 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; } return ret; } this.preloadImage = function(url, oncomplete) { 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); that.raport('J1-o', 'preloading failed', escape(url)); new Image().src = url + '&nc2=' + that.now(); oncomplete(true); } setTimeout(function() { if (newimg.complete && newimg.ok) return; that.raport('J1-o', 'preloading timed out', escape(url)); oncomplete(null); setTimeout(function() { if (newimg.complete && newimg.ok) return; that.raport('J1-', 'preloading too slow'); }, 5000); }, 5000); } this.getValue = function(x) { if (typeof(x) === 'string' && x.indexOf(',') > 0) { var arr = x.split(','); var ret = []; for (var i=0; i.') + url.substring(url.length - 5); } 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.getFlashPlayerVersion = 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; } this.sendstatlimit = 100; this.errors = []; this.raportLimit = conf.get('raportLimit', 5); this.rndId = Math.floor(Math.random() * this.duzo * 1000000); this.profiling = []; this.order = []; this.profiling_map = {}; this.lastTime = 0; this.fstarts = []; this.reports = []; this.excList = []; this.excMap = {}; this.reportsByType = {}; this.anything2send = false; this.alreadySent = false; this.raportBuffer = []; this.status = null; this.steps = 0; this.co100 = function(coile) { var sto = that.ifnull(coile, conf.get('coile')); return (that.rndId - conf.get('mod100')) % sto === 0; } this.getLno = function(e) { if (typeof(e) != 'object') return '?'; var lno = e.lineNumber; if (isNaN(lno)) return '-'; try { if (e.fileName.indexOf('dbg_utils') >= 0) return 'dbg_utils ' + lno; } catch(e) {} try { if (that.fstarts_closed === undefined) { that.fstarts_closed = true; that.fstarts.push('end', 100000, 0); syso('no line number table'); return '-'; } for (var i=0; i 1) { if (Math.floor(that.rndId / conf.get('coile', 100)) % conf.get('raportExtraLimit', 1) > 0) { return syso('don\'t reporting: ' + str); } } if (document.readyState === 'loading' || document.readyState === 'interactive') { return setTimeout(that.apply(that.sendstat, str), conf.get('defaultTimeout')); } if (that.raportLimit < 0) return syso('raport limit exceeded: ' + str); var logImage = new Image(1, 1); logImage.style.position = 'absolute'; logImage.style.left = '0px'; logImage.style.top = '0px'; document.body.appendChild(logImage); that.raportLimit--; str = (str + ';;').replace(/\s/g, '_').replace(/\{.*\}/g, '[...]').substring(0, 1800); var resolution = 'unknown'; try { resolution = screen.width + 'x' + screen.height; } catch(e) {} var newsrc = conf.getUrl('raportUrl').replace(/_NOW_/g, that.now) + ',' + conf.get('prefix') + ',' + that.version + ',' + that.rndId + ',' + that.ifnull(that.prid, -1) + ',' + that.ifnull(that.caid, -1) + ',' + that.ifnull(that.plid, -1) + ',' + (that.ie ? (that.ie6 ? '6' : 'T') : 'F') + ',' + (that.evlog.s.length <= 100 ? that.evlog.s.replace(/ /g, '_') : '-') + ',' + resolution + ';' + str.replace(/^,/, ''); logImage.src = newsrc; syso('reporting: ' + str.substring(1), 'white'); } this.printstats = function(stats) { var ret = ''; for (var key in stats) { if (key === 'null') continue; if ({}[key] !== undefined) continue; if (stats[key] === undefined) continue; ret += ',' + key + ',' + (''+stats[key]).replace(/&|\/|,|=/g, '_'); } return ret.replace(/^,/, ''); } this.addstats = function(type, important, stats) { if (that.sendstatlimit-- < 0) return syso('reporting failed!'); that.anything2send |= important; stats.type = type; that.raportBuffer.push(stats); if (that.alreadySent) { that.sendAllNow(); } } this.exc = function(fname, exc, param) { try { if (that.fstarts.length > 0) { syso('reporting exception at: ' + that.getLno(exc) + ' (' + exc.lineNumber + ')', 'red'); } that.excList.push(exc); that.updateMsgDiv(); if (param === undefined) param = '-'; var emsg = that.ifnull(exc.message, '-').toLowerCase().replace(/.backtrace.*/g, ''); if (that.excMap[fname + '#' + emsg] != undefined) return syso('exception - again'); that.excMap[fname + '#' + emsg] = true; that.addstats('exception', true, { fname: fname, e: emsg, lno: that.getLno(exc), param: param }); } catch(e) { syso('raporting failed: ' + e.lineNumber); } } this.raportParams = function(all, msg, param) { all = all.toLowerCase(); var ret = {msg: msg, param: param}; if (all.indexOf('s') >= 0) ret.cause = 'server'; if (all.indexOf('j') >= 0) ret.cause = 'js'; if (all.indexOf('p') >= 0) ret.cause = 'placement'; if (all.indexOf('1') >= 0) ret.sev = 1; if (all.indexOf('2') >= 0) ret.sev = 2; if (all.indexOf('3') >= 0) ret.sev = 3; if (all.indexOf('4') >= 0) ret.sev = 4; if (all.indexOf('-') >= 0) ret.co100 = true; if (all.indexOf('!') >= 0) ret.stop = true; return ret; } this.report_prv = function(all, msg, param, stray) { try { if (stray != undefined) { syso('stray params: ' + msg); that.later('stray', function() { that.raport('J1', 'stray raport params', msg); }); } if (typeof(all) === 'string') all = that.raportParams(all, msg, param); if (all.msg === undefined) all.msg = '-'; if (all.param === undefined) all.param = '-'; if (all.old === undefined) all.old = false; if (all.co100 === undefined) all.co100 = false; if (all.sev === undefined) all.sev = 0; if (all.cause === undefined) all.cause = 'unknown'; if (all.stop) { that.stop(all.msg); } if (that.reportsByType[all.msg]) return trace(all.msg + ' - again'); that.reportsByType[all.msg] = all.param; that.reports.push(all); that.updateMsgDiv(); var sysostr = all.msg + ': ' + all.param; var sysocolor = all.co100 ? 'navy' : ['yellow', 'gold', '#f50', 'red', '#70f'][all.sev]; syso('reporting - ' + sysostr, sysocolor); that.addstats('msg', !all.co100, { type: 'msg', sev: all.sev, cause: all.cause, e: all.msg.replace(/[^\w]+/g, '_'), param: all.param }); } catch(e) { syso('reporting failed! ' + e.lineNumber, 'pink'); try { console.error(e); } catch(e1) {}; } } this.raport = this.report = this.report_prv; this.stop = function(errorName) { that.status = errorName; that.start = function() {}; that.stop = function() {}; that.done = function() {}; that.profiling = this.order = []; } this.start = function(taskName) { trace(taskName); that.steps++; var now = that.now(); var tasktime = now - that.lastTime; if (that.profiling_map[taskName]) { for (var i=0; i= 1 * rq) return; if (that.version === '_' || v === '_' || options('betaIx') || options('static_src') || options('replaceCode')) { return trace(co + ': skipping version chcek'); } that.raport('S1-', co + ' version mismatch', v); } this.initRaports(); } swfo2.swfobject = null; with(swfo2) { /*! SWFObject v2.2 is released under the MIT License */ swfobject = function() { var UNDEF = "undefined", OBJECT = "object", SHOCKWAVE_FLASH = "Shockwave Flash", SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", FLASH_MIME_TYPE = "application/x-shockwave-flash", EXPRESS_INSTALL_ID = "SWFObjectExprInst", ON_READY_STATE_CHANGE = "onreadystatechange", win = window, doc = document, nav = navigator, plugin = false, domLoadFnArr = [main], regObjArr = [], objIdArr = [], listenersArr = [], storedAltContent, storedAltContentId, storedCallbackFn, storedCallbackObj, isDomLoaded = false, isExpressInstallActive = false, dynamicStylesheet, dynamicStylesheetMedia, autoHideShow = true, /* Centralized function for browser feature detection - User agent string detection is only used when no good alternative is possible - Is executed directly for optimal performance */ ua = function() { var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, u = nav.userAgent.toLowerCase(), p = nav.platform.toLowerCase(), windows = p ? /win/.test(p) : /win/.test(u), mac = p ? /mac/.test(p) : /mac/.test(u), webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*\$/, "\$1")) : false, // returns either the webkit version or false if not webkit ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html playerVersion = [0,0,0], d = null; if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) { d = nav.plugins[SHOCKWAVE_FLASH].description; if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+ plugin = true; ie = false; // cascaded feature detection for Internet Explorer d = d.replace(/^.*\s+(\S+\s+\S+\$)/, "\$1"); playerVersion[0] = parseInt(d.replace(/^(.*)\..*\$/, "\$1"), 10); playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*\$/, "\$1"), 10); playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)\$/, "\$1"), 10) : 0; } } else if (typeof win.ActiveXObject != UNDEF) { try { var a = new ActiveXObject(SHOCKWAVE_FLASH_AX); if (a) { // a will return null when ActiveX is disabled d = a.GetVariable("$version"); if (d) { ie = true; // cascaded feature detection for Internet Explorer d = d.split(" ")[1].split(","); playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; } } } catch(e) {} } return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac }; }(), /* Cross-browser onDomLoad - Will fire an event as soon as the DOM of a web page is loaded - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/ - Regular onload serves as fallback */ onDomLoad = function() { if (!ua.w3) { return; } if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically callDomLoadFunctions(); } if (!isDomLoaded) { if (typeof doc.addEventListener != UNDEF) { doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false); } if (ua.ie && ua.win) { doc.attachEvent(ON_READY_STATE_CHANGE, function() { if (doc.readyState == "complete") { doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee); callDomLoadFunctions(); } }); if (win == top) { // if not inside an iframe (function(){ if (isDomLoaded) { return; } try { doc.documentElement.doScroll("left"); } catch(e) { setTimeout(arguments.callee, 0); return; } callDomLoadFunctions(); })(); } } if (ua.wk) { (function(){ if (isDomLoaded) { return; } if (!/loaded|complete/.test(doc.readyState)) { setTimeout(arguments.callee, 0); return; } callDomLoadFunctions(); })(); } addLoadEvent(callDomLoadFunctions); } }(); function callDomLoadFunctions() { if (isDomLoaded) { return; } try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span")); t.parentNode.removeChild(t); } catch (e) { return; } isDomLoaded = true; var dl = domLoadFnArr.length; for (var i = 0; i < dl; i++) { domLoadFnArr[i](); } } function addDomLoadEvent(fn) { if (isDomLoaded) { fn(); } else { domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+ } } /* Cross-browser onload - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/ - Will fire an event as soon as a web page including all of its assets are loaded */ function addLoadEvent(fn) { if (typeof win.addEventListener != UNDEF) { win.addEventListener("load", fn, false); } else if (typeof doc.addEventListener != UNDEF) { doc.addEventListener("load", fn, false); } else if (typeof win.attachEvent != UNDEF) { addListener(win, "onload", fn); } else if (typeof win.onload == "function") { var fnOld = win.onload; win.onload = function() { fnOld(); fn(); }; } else { win.onload = fn; } } /* Main function - Will preferably execute onDomLoad, otherwise onload (as a fallback) */ function main() { if (plugin) { testPlayerVersion(); } else { matchVersions(); } } /* Detect the Flash Player version for non-Internet Explorer browsers - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description: a. Both release and build numbers can be detected b. Avoid wrong descriptions by corrupt installers provided by Adobe c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available */ function testPlayerVersion() { var b = doc.getElementsByTagName("body")[0]; var o = createElement(OBJECT); o.setAttribute("type", FLASH_MIME_TYPE); var t = b.appendChild(o); if (t) { var counter = 0; (function(){ if (typeof t.GetVariable != UNDEF) { var d = t.GetVariable("$version"); if (d) { d = d.split(" ")[1].split(","); ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; } } else if (counter < 10) { counter++; setTimeout(arguments.callee, 10); return; } b.removeChild(o); t = null; matchVersions(); })(); } else { matchVersions(); } } /* Perform Flash Player and SWF version matching; static publishing only */ function matchVersions() { var rl = regObjArr.length; if (rl > 0) { for (var i = 0; i < rl; i++) { // for each registered object element var id = regObjArr[i].id; var cb = regObjArr[i].callbackFn; var cbObj = {success:false, id:id}; if (ua.pv[0] > 0) { var obj = getElementById(id); if (obj) { if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match! setVisibility(id, true); if (cb) { cbObj.success = true; cbObj.ref = getObjectById(id); cb(cbObj); } } else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported var att = {}; att.data = regObjArr[i].expressInstall; att.width = obj.getAttribute("width") || "0"; att.height = obj.getAttribute("height") || "0"; if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); } if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); } // parse HTML object param element's name-value pairs var par = {}; var p = obj.getElementsByTagName("param"); var pl = p.length; for (var j = 0; j < pl; j++) { if (p[j].getAttribute("name").toLowerCase() != "movie") { par[p[j].getAttribute("name")] = p[j].getAttribute("value"); } } showExpressInstall(att, par, id, cb); } else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF displayAltContent(obj); if (cb) { cb(cbObj); } } } } else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content) setVisibility(id, true); if (cb) { var o = getObjectById(id); // test whether there is an HTML object element or not if (o && typeof o.SetVariable != UNDEF) { cbObj.success = true; cbObj.ref = o; } cb(cbObj); } } } } } function getObjectById(objectIdStr) { var r = null; var o = getElementById(objectIdStr); if (o && o.nodeName == "OBJECT") { if (typeof o.SetVariable != UNDEF) { r = o; } else { var n = o.getElementsByTagName(OBJECT)[0]; if (n) { r = n; } } } return r; } /* Requirements for Adobe Express Install - only one instance can be active at a time - fp 6.0.65 or higher - Win/Mac OS only - no Webkit engines older than version 312 */ function canExpressInstall() { return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312); } /* Show the Adobe Express Install dialog - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 */ function showExpressInstall(att, par, replaceElemIdStr, callbackFn) { isExpressInstallActive = true; storedCallbackFn = callbackFn || null; storedCallbackObj = {success:false, id:replaceElemIdStr}; var obj = getElementById(replaceElemIdStr); if (obj) { if (obj.nodeName == "OBJECT") { // static publishing storedAltContent = abstractAltContent(obj); storedAltContentId = null; } else { // dynamic publishing storedAltContent = obj; storedAltContentId = replaceElemIdStr; } att.id = EXPRESS_INSTALL_ID; if (typeof att.width == UNDEF || (!/%\$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; } if (typeof att.height == UNDEF || (!/%\$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; } doc.title = doc.title.slice(0, 47) + " - Flash Player Installation"; var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", fv = "MMredirectURL=" + win.location.toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title; if (typeof par.flashvars != UNDEF) { par.flashvars += "&" + fv; } else { par.flashvars = fv; } // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work if (ua.ie && ua.win && obj.readyState != 4) { var newObj = createElement("div"); replaceElemIdStr += "SWFObjectNew"; newObj.setAttribute("id", replaceElemIdStr); obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf obj.style.display = "none"; (function(){ if (obj.readyState == 4) { obj.parentNode.removeChild(obj); } else { setTimeout(arguments.callee, 10); } })(); } createSWF(att, par, replaceElemIdStr); } } /* Functions to abstract and display alternative content */ function displayAltContent(obj) { if (ua.ie && ua.win && obj.readyState != 4) { // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work var el = createElement("div"); obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content el.parentNode.replaceChild(abstractAltContent(obj), el); obj.style.display = "none"; (function(){ if (obj.readyState == 4) { obj.parentNode.removeChild(obj); } else { setTimeout(arguments.callee, 10); } })(); } else { obj.parentNode.replaceChild(abstractAltContent(obj), obj); } } function abstractAltContent(obj) { var ac = createElement("div"); if (ua.win && ua.ie) { ac.innerHTML = obj.innerHTML; } else { var nestedObj = obj.getElementsByTagName(OBJECT)[0]; if (nestedObj) { var c = nestedObj.childNodes; if (c) { var cl = c.length; for (var i = 0; i < cl; i++) { if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) { ac.appendChild(c[i].cloneNode(true)); } } } } } return ac; } /* Cross-browser dynamic SWF creation */ function createSWF(attObj, parObj, id) { var r, el = getElementById(id); if (ua.wk && ua.wk < 312) { return r; } if (el) { if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content attObj.id = id; } if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML var att = ""; for (var i in attObj) { if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries if (i.toLowerCase() == "data") { parObj.movie = attObj[i]; } else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword att += ' class="' + attObj[i] + '"'; } else if (i.toLowerCase() != "classid") { att += ' ' + i + '="' + attObj[i] + '"'; } } } var par = ""; for (var j in parObj) { if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries par += ''; } } el.outerHTML = '' + par + ''; objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only) r = getElementById(attObj.id); } else { // well-behaving browsers var o = createElement(OBJECT); o.setAttribute("type", FLASH_MIME_TYPE); for (var m in attObj) { if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword o.setAttribute("class", attObj[m]); } else if (m.toLowerCase() != "classid") { // filter out IE specific attribute o.setAttribute(m, attObj[m]); } } } for (var n in parObj) { if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element createObjParam(o, n, parObj[n]); } } el.parentNode.replaceChild(o, el); r = o; } } return r; } function createObjParam(el, pName, pValue) { var p = createElement("param"); p.setAttribute("name", pName); p.setAttribute("value", pValue); el.appendChild(p); } /* Cross-browser SWF removal - Especially needed to safely and completely remove a SWF in Internet Explorer */ function removeSWF(id) { var obj = getElementById(id); if (obj && obj.nodeName == "OBJECT") { if (ua.ie && ua.win) { obj.style.display = "none"; (function(){ if (obj.readyState == 4) { removeObjectInIE(id); } else { setTimeout(arguments.callee, 10); } })(); } else { obj.parentNode.removeChild(obj); } } } function removeObjectInIE(id) { var obj = getElementById(id); if (obj) { for (var i in obj) { if (typeof obj[i] == "function") { obj[i] = null; } } obj.parentNode.removeChild(obj); } } /* Functions to optimize JavaScript compression */ function getElementById(id) { var el = null; try { el = doc.getElementById(id); } catch (e) {} return el; } function createElement(el) { return doc.createElement(el); } /* Updated attachEvent function for Internet Explorer - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks */ function addListener(target, eventType, fn) { target.attachEvent(eventType, fn); listenersArr[listenersArr.length] = [target, eventType, fn]; } /* Flash Player and SWF content version matching */ function hasPlayerVersion(rv) { var pv = ua.pv, v = rv.split("."); v[0] = parseInt(v[0], 10); v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0" v[2] = parseInt(v[2], 10) || 0; return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; } /* Cross-browser dynamic CSS creation - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php */ function createCSS(sel, decl, media, newStyle) { if (ua.ie && ua.mac) { return; } var h = doc.getElementsByTagName("head")[0]; if (!h) { return; } // to also support badly authored HTML pages that lack a head element var m = (media && typeof media == "string") ? media : "screen"; if (newStyle) { dynamicStylesheet = null; dynamicStylesheetMedia = null; } if (!dynamicStylesheet || dynamicStylesheetMedia != m) { // create dynamic stylesheet + get a global reference to it var s = createElement("style"); s.setAttribute("type", "text/css"); s.setAttribute("media", m); dynamicStylesheet = h.appendChild(s); if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) { dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1]; } dynamicStylesheetMedia = m; } // add style rule if (ua.ie && ua.win) { if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) { dynamicStylesheet.addRule(sel, decl); } } else { if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) { dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}")); } } } function setVisibility(id, isVisible) { if (!autoHideShow) { return; } var v = isVisible ? "visible" : "hidden"; if (isDomLoaded && getElementById(id)) { getElementById(id).style.visibility = v; } else { createCSS("#" + id, "visibility:" + v); } } /* Filter to avoid XSS attacks */ function urlEncodeIfNecessary(s) { var regex = /[\\\"<>\.;]/; var hasBadChars = regex.exec(s) != null; return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s; } /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only) */ var cleanup = function() { if (ua.ie && ua.win) { window.attachEvent("onunload", function() { try { // remove listeners to avoid memory leaks var ll = listenersArr.length; for (var i = 0; i < ll; i++) { listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]); } // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect var il = objIdArr.length; for (var j = 0; j < il; j++) { removeSWF(objIdArr[j]); } // cleanup library's main closures to avoid memory leaks for (var k in ua) { ua[k] = null; } ua = null; for (var l in swfobject) { swfobject[l] = null; } swfobject = null; } catch(e) {}; }); } }(); return { /* Public API - Reference: http://code.google.com/p/swfobject/wiki/documentation */ registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) { if (ua.w3 && objectIdStr && swfVersionStr) { var regObj = {}; regObj.id = objectIdStr; regObj.swfVersion = swfVersionStr; regObj.expressInstall = xiSwfUrlStr; regObj.callbackFn = callbackFn; regObjArr[regObjArr.length] = regObj; setVisibility(objectIdStr, false); } else if (callbackFn) { callbackFn({success:false, id:objectIdStr}); } }, getObjectById: function(objectIdStr) { if (ua.w3) { return getObjectById(objectIdStr); } }, embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) { var callbackObj = {success:false, id:replaceElemIdStr}; if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) { setVisibility(replaceElemIdStr, false); addDomLoadEvent(function() { widthStr += ""; // auto-convert to string heightStr += ""; var att = {}; if (attObj && typeof attObj === OBJECT) { for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs att[i] = attObj[i]; } } att.data = swfUrlStr; att.width = widthStr; att.height = heightStr; var par = {}; if (parObj && typeof parObj === OBJECT) { for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs par[j] = parObj[j]; } } if (flashvarsObj && typeof flashvarsObj === OBJECT) { for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs if (typeof par.flashvars != UNDEF) { par.flashvars += "&" + k + "=" + flashvarsObj[k]; } else { par.flashvars = k + "=" + flashvarsObj[k]; } } } if (hasPlayerVersion(swfVersionStr)) { // create SWF var obj = createSWF(att, par, replaceElemIdStr); if (att.id == replaceElemIdStr) { setVisibility(replaceElemIdStr, true); } callbackObj.success = true; callbackObj.ref = obj; } else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install att.data = xiSwfUrlStr; showExpressInstall(att, par, replaceElemIdStr, callbackFn); return; } else { // show alternative content setVisibility(replaceElemIdStr, true); } if (callbackFn) { callbackFn(callbackObj); } }); } else if (callbackFn) { callbackFn(callbackObj); } }, switchOffAutoHideShow: function() { autoHideShow = false; }, ua: ua, getFlashPlayerVersion: function() { return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] }; }, hasFlashPlayerVersion: hasPlayerVersion, createSWF: function(attObj, parObj, replaceElemIdStr) { if (ua.w3) { return createSWF(attObj, parObj, replaceElemIdStr); } else { return undefined; } }, showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) { if (ua.w3 && canExpressInstall()) { showExpressInstall(att, par, replaceElemIdStr, callbackFn); } }, removeSWF: function(objElemIdStr) { if (ua.w3) { removeSWF(objElemIdStr); } }, createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) { if (ua.w3) { createCSS(selStr, declStr, mediaStr, newStyleBoolean); } }, addDomLoadEvent: addDomLoadEvent, addLoadEvent: addLoadEvent, getQueryParamValue: function(param) { var q = doc.location.search || doc.location.hash; if (q) { if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark if (param == null) { return urlEncodeIfNecessary(q); } var pairs = q.split("&"); for (var i = 0; i < pairs.length; i++) { if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1))); } } } return ""; }, // For internal usage only expressInstallCallback: function() { if (isExpressInstallActive) { var obj = getElementById(EXPRESS_INSTALL_ID); if (obj && storedAltContent) { obj.parentNode.replaceChild(storedAltContent, obj); if (storedAltContentId) { setVisibility(storedAltContentId, true); if (ua.ie && ua.win) { storedAltContent.style.display = "block"; } } if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); } } isExpressInstallActive = false; } } }; }(); } try {x.x.x} catch(e) {static.fstarts.push(['placementUtils', e.lineNumber, 0])}; PlacementUtils = function(conf, utils, options) { var that = this; this.abc = '0123456789abcdef'; this.param_map = {}; if (options === undefined) options = function() {return false}; this.getSrc = function(scr, i) { try { return scr.src + ''; } catch(e) { utils.raport('J1-o', 'cannot access script src', i); return ''; } } this.parseScripts = utils.ftry('parseScripts', function(spliter, static, placement_map, oc) { var forms = static.forms; var global = static.global; if (oc === undefined) oc = function() {}; var oncomplete = utils.retry('waitForAkPlacements', function() { for (var i=0; i 0 && forms.length > that.formLimit) forms.pop(); } for (var i=0; i conf.get('ads_limit')) break; var e = extra[ei]; if (typeof(e) === 'function') { var fa = utils.ftry('extra1', e)(); syso('generated ' + fa.length + ' extra forms'); for (var i=0; i= 0) continue; try { var line = params.split('=')[1].split('&')[0]; if (map[line] === undefined) { utils.raport('S2!', 'no such entry in placement map', line); continue; } var node = utils.cel(null, 'div'); sc.parentNode.insertBefore(node, sc); var form = that.readForm(node, map[line].split('-')[4], sc); form.needUpdate = true; form.prid = map[line].split('-')[2]; form.caid = map[line].split('-')[3]; form.version = 'v4'; forms.push(form); syso('found Quad-4 placement: ' + line); } catch(e) { utils.exc('parseQ4Scripts - unable to parse params', e, params); } } } this.parseQ3Scripts = function(forms, global, ssPlacements) { var scarr = document.getElementsByTagName('script'); for (var i=0; i ' + ssPlacements[line]); quad5 = true; var oldline = line; line = ssPlacements[oldline]; if (line === undefined) { utils.raport('P2!-', 'unregistered placement for channel', oldline.substring(1)); continue; } } var node = utils.cel(null, 'div'); sc.parentNode.insertBefore(node, sc); var form = that.readForm(node, line, sc, params.split('--')[1].split('-')[1]); form.version = quad5 ? 'v5' : 'v3'; forms.push(form); if (!quad5) { syso('found Quad-3 placement: ' + line); } } catch(e) { utils.exc('parseQ3Scripts - unable to parse params', e, params); } } } this.parseAkScripts = function(forms, prid, caid) { if (!conf.get('enableAKPlacements')) return; if (typeof(adKontekst_pola) === 'undefined') return; for (var i=0; i= 0) && (src.indexOf(host) < 0) && (src.indexOf('intext') < 0)) { return syso('alien QUAD-1 placement found; skipping old placements'); } } for (var i=0; i maxv)) { errors.push(['invalid int value', str + ' = ' + form[str]]); } form[str] = Math.min(maxv, Math.max(minv, utils.ifnull(i, def))); } this.fixColor = function(c) { if (c.charAt(0) === '#') c = c.substring(1); var cc = '#white|fff#aqua|0ff#magneta|f0f#yellow|ff0#red|f00#green|0f0#blue|00f#black|000#gray|777#silver|ddd#'; var ci = cc.indexOf('#'+c+'|'); if (ci >= 0) c = cc.substring(ci).split('|')[1].split('#')[0]; if (c.length === 3) c = c.charAt(0) + c.charAt(0) + c.charAt(1) + c.charAt(1) + c.charAt(2) + c.charAt(2); return c; } this.checkCol = function(form, errors, str, def) { if (form.colors[str] === undefined) form.colors[str] = def; if (form.colors[str] === "") form.colors[str] = def; form.colors[str] = that.fixColor(form.colors[str]); var strv = form.colors[str].toLowerCase(); if (strv.length != 6) { form.colors[str] = def; errors.push(['invalid color', strv]); return syso('restored default color: ' + form.colors[str]); } for (var i=0; i<6; i++) { if (that.abc.indexOf(strv.charAt(i)) < 0) { form.colors[str] = def; errors.push(['invalid color', strv]); return syso('restored default color: ' + form.colors[str]); } } } this.fixColors = function(form, colors, s1, s2, warn, change) { if (!colors) return; var c1 = colors[s1].toLowerCase(); var c2 = colors[s2].toLowerCase(); var diff = 0; for (var i=0; i<6; i+=2) { var ch1 = that.abc.indexOf(c1.charAt(i)); var ch2 = that.abc.indexOf(c2.charAt(i)); diff += Math.abs(ch1 - ch2); } trace('diff='+diff); if (diff > warn) return; if (form.warnings === undefined) form.warnings = []; form.warnings.push(['ugly colors', diff + ' (' + s1 + ', ' + s2 + ')']); colors['old'+s1] = colors[s1]; if (diff > change) return; var n1 = ''; var n2 = ''; for (var i=0; i<6; i+=2) { var ch1 = that.abc.indexOf(c1.charAt(i)); var ch2 = that.abc.indexOf(c2.charAt(i)); var d = Math.abs(ch1 - ch2); if (d > change / 3) { n1 += c1.charAt(i) + c1.charAt(i+1); n2 += c2.charAt(i) + c2.charAt(i+1); continue; } var ch = Math.floor((ch1 + ch2) / 2); var nh1 = that.abc.charAt(Math.max(0, Math.min(15, ch > 7 ? ch - 3 : ch + 3))); n1 += nh1 + nh1; } syso('fixed colors: ' + c1 + ', ' + c2 + ' --> ' + n1); colors[s1] = n1; } this.validateForm = function(form, errors) { if (form.colors === undefined) form.colors = {}; if (form.labelType === 0) form.labelType = 3; var checkInt = function(prop, minv, maxv, def, noWarn) { return that.checkInt(form, noWarn ? [] : errors, prop, minv, maxv, def); } var checkCol = function(prop, def) { if (form.colors[prop] === 'transparent') return true; return that.checkCol(form, errors, prop, def); } var checkExCol = function(prop, def) { if (!form.exColors) return; if (form.exColors[prop] === 'transparent') return; var colors = form.colors; form.colors = form.exColors; that.checkCol(form, errors, prop, def); form.colors = colors; } if (typeof(form.corners) != 'object') { form.errors.push(['no corners', '']); form.corners = {}; } checkInt('merging', 1, 7, 2); checkInt('spacing', 0, 20, 1); checkInt('labelType', 1, 4, 3); checkInt('labelId', 1, conf.get('labelsCnt'), 1); that.checkInt(form.corners, errors, 'tl', 0, 4, 3); that.checkInt(form.corners, errors, 'tr', 0, 4, 3); that.checkInt(form.corners, errors, 'bl', 0, 4, 3); that.checkInt(form.corners, errors, 'br', 0, 4, 3); checkInt('x', 40, 1600, 300); checkInt('y', 20, 1200, 100, true); if (!options('skipValidation')) { checkInt('fontSize', 9, 12, NaN, true); } checkInt('cornerSizeX', 3, 20, 7, true); checkInt('cornerSizeY', 3, 20, 7, true); checkInt('borderSize', 0, 4, 1, true); checkInt('placementId', 0, 1000000, 0, true); checkCol('title', '0000FF'); checkCol('bg', 'FFFFFF'); checkCol('desc', '000000'); checkCol('url', '0000FF'); checkCol('frame', 'B9B9B9'); checkCol('headerBg', 'FFFFFF'); checkCol('headerFrame', 'B9B9B9'); checkCol('labelTxt', form.colors.title); checkExCol('title', '000000'); checkExCol('desc', '000000'); checkExCol('url', '000000'); checkExCol('frame', '000000'); checkExCol('labelTxt', '777777'); checkExCol('autoOrder', '777777'); checkExCol('bg', 'FFFFFF'); if (form.merging != 7) { that.fixColors(form, form.colors, 'title', 'headerBg', 5, 3); that.fixColors(form, form.colors, 'desc', 'bg', 5, 3); that.fixColors(form, form.colors, 'url', 'bg', 5, 3); that.fixColors(form, form.colors, 'labelTxt', 'bg', 5, 3); that.fixColors(form, form.exColors, 'title', 'bg', 5, 3); that.fixColors(form, form.exColors, 'desc', 'bg', 5, 3); that.fixColors(form, form.exColors, 'url', 'bg', 5, 3); that.fixColors(form, form.exColors, 'labelTxt', 'bg', 5, 3); that.fixColors(form, form.exColors, 'autoOrder', 'bg', 5, 3); } if ((form.labelType < 1) || (form.labelType > 4)) form.labelType = 3; form.font = utils.ifnull(form.font, conf.get('defaultFont')); if (!options('skipValidation')) { if (form.imgBottomColor && conf.get('imgBottomColors').indexOf('#'+form.imgBottomColor+'#') < 0) { //errors.push(['disallowed image bottom color', form.imgBottomColor]); //XXX form.imgBottomColor = null; } if (conf.get('allowedFonts').indexOf('#' + form.font + '#') < 0) { errors.push(['disallowed font', form.font]); form.font = 'Arial'; } } form.x = form.x - 0; form.y = form.y - 0; return errors; } this.exclusiveIsEnabled = function(form) { if (options('noex')) return ''; if ((form.noEx === 'b') && conf.get('allowForceEx')) return 'E'; if ((form.noEx === 'w') && conf.get('allowForceEx')) return 'W'; if (form.forbidden && form.forbidden.search(/:exclusive:/i)) return ''; if (form.noEx) return ''; if (form.x >= 580 && form.y >= 100) return 'e'; if (form.x >= 540 && form.y >= 170) return 'E'; if (form.x >= 380 && form.y >= 190) return 'E'; if (form.x >= 240 && form.y >= 250) return 'E'; if (form.x >= 160 && form.y >= 400) return 'W'; return ''; } this.fixForm = function(form) { if (form.fixed) return form; if ((form.exColors && !form.exColors.title) || !conf.get('doublePalette', false)) { form.exColors = null; } var errors = that.validateForm(form, []); if (errors.length > 0) { form.errors = errors; utils.raport('P1-', 'form contains errors', errors.length + ' ' + errors[0][0] + ': ' + errors[0][1]); } form.fixed = true; form.cc = form.r * form.c; form.ee = that.exclusiveIsEnabled(form); return form; } this.readForm = function(node, str, script, caid) { if (typeof(str) != 'string') syso(str); var arr = str.split(','); var ret = { script: script, node: node, caid: caid, line: str, colors: { title: arr[0], bg: arr[1], desc: arr[2], url: arr[3], frame: arr[4], headerBg: arr[5], headerFrame: arr[6] }, x: arr[7], y: arr[8], r: arr[9], c: arr[10], corners: { tl: arr[11], tr: arr[12], bl: arr[13], br: arr[14] }, withUrl: arr[15] === 't', labelId: arr[16], labelType: arr[17], merging: arr[19], spacing: arr[20], noContent: arr[21] === 't' ? true : arr[21] === 'f' ? false : undefined, placementId: arr[22], noEx: arr[23] === 't', showHeader: arr[24], font: arr[25], fontSize: arr[26], cornerSizeX: arr[27], cornerSizeY: arr[28], borderSize: arr[29], imgBottomColor: arr[30], adart3: arr[31] === 't', showFavico: arr[32] === 't', labelPos: parseInt(utils.ifnull(arr[33], 0)), exColors: { title: arr[34], desc: arr[35], url: arr[36], frame: arr[37], labelTxt: arr[38], autoOrder: arr[39], bg: arr[40] } } return that.fixForm(ret); } this.getScriptParams = function(form) { var ret = ""; var exColors = utils.ifnull(form.exColors, {}); ret += form.colors.title + ','; ret += form.colors.bg + ','; ret += form.colors.desc + ','; ret += form.colors.url + ','; ret += form.colors.frame + ','; ret += form.colors.headerBg + ','; ret += form.colors.headerFrame + ','; ret += form.x + ','; ret += form.y + ','; ret += form.r + ','; ret += form.c + ','; ret += form.corners.tl + ','; ret += form.corners.tr + ','; ret += form.corners.bl + ','; ret += form.corners.br + ','; ret += (form.withUrl ? 't' : 'f') + ','; ret += form.labelId + ','; ret += form.labelType + ','; ret += '1,'; ret += form.merging + ','; ret += form.spacing + ','; ret += form.noContent === false ? 'f' : ''; ret += ',' + form.placementId; ret += ',' + (form.noEx ? 't' : 'f'); ret += ',' + form.showHeader; ret += ',' + utils.ifnull(form.font, ''); ret += ',' + utils.ifnull(form.fontSize, ''); ret += ',' + utils.ifnull(form.cornerSizeX, ''); ret += ',' + utils.ifnull(form.cornerSizeY, ''); ret += ',' + utils.ifnull(form.borderSize, ''); ret += ',' + utils.ifnull(form.imgBottomColor, ''); ret += ',' + (form.adart3 ? 't' : 'f'); ret += ',' + (form.showFavico ? 't' : 'f'); ret += ',' + form.labelPos; ret += ',' + utils.ifnull(exColors.title, ''); ret += ',' + utils.ifnull(exColors.desc, ''); ret += ',' + utils.ifnull(exColors.url, ''); ret += ',' + utils.ifnull(exColors.frame, ''); ret += ',' + utils.ifnull(exColors.labelTxt, ''); ret += ',' + utils.ifnull(exColors.autoOrder, ''); ret += ',' + utils.ifnull(exColors.bg, ''); return ret.replace(/undefined/g, ''); } } try {x.x.x} catch(e) {static.fstarts.push(['parser', e.lineNumber, 0])}; Parser = function(conf, utils, options) { var that = this; 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 (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; } } } return array; } this.copy = function(obj) { var ret = {}; for (var i in obj) ret[i] = obj[i]; return ret; } this.printObj = function(obj) { var ret = ''; for (var i in obj) ret += ', ' + i + '=' + obj[i]; return ret.substring(2); } 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') utils.exc('walk', e); return; } } for (var i=0; i 1) color = ['#00a', '#22f']; that.mark(node, color[0], color[1], 'text node'); that.spans.push(s); state.valid = true; }, function(tag, node, state) { if ((new Date()).getTime() > that.timeEnd) { throw that.mark(node, '#000', '#222', 'timeout'); } for (var t=0; t that.maxWordLength) continue; that.addWord(hashArr, content, that.spans[t].contextBust, 1, arr.length); } } } this.addWord = function(hashArr, word, bust, only, msl) { word = word.toLowerCase(); var wl2 = word.length === 2 && word.length < that.minWordLength; if (wl2 && that.twoLetterWords[word] === undefined) return; if (bust === undefined) bust = 1; var o = that.getBaseForm(word); if (o === null) return; 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; } this.getReturnStr = function(hashArr) { var array_tmp = []; for(var key in hashArr) { if ({}[key] === undefined) { 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) { utils.raport('P1-o', 'no content', undefined); return ''; } else if (array_tmp.length < 30) { utils.raport('P0-o', 'low content', array_tmp.length); } for (var i=0; i that.max_url) break; content += word; content += '+'; array_tmp[p].normal_val = c_val; trace(c_val + ' ---> ' + word + ' (' + array_tmp[p].bform + ', ' + hashArr[array_tmp[p].bform].val + ')'); } return content; } this.addWords = function(hashArr, words, bust, only) { 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); } } } this.getInputContent = function(hashArr) { var m = document.getElementsByTagName('input'); for (var i=0;i= 0) { that.addWords(hashArr, m[i].content, that.desc_boost, that.allowOnlyMeta); } else if (d.indexOf('keywords') >= 0) { that.addWords(hashArr, m[i].content, that.kw_boost, that.allowOnlyMeta); } } var t = document.getElementsByTagName('title'); for (var i=0; i conf.get('maxContent')) { content = content.substring(0, conf.get('maxContent')).replace(/\+[^+]*$/g, ''); for (var a=content.length-7; a 0) { content += '&timeout=' + that.exceeded; } return content; } this.content = null; this.parseAll = function(co, params) { utils.start('parserPre'); that.init(); that.timeEnd = (new Date()).getTime() + that.timeout; if (params === undefined) params = {}; that.content = {}; if (co.indexOf('M') >= 0) that.getMetaContent(that.content); if (co.indexOf('I') >= 0) that.getInputContent(that.content); utils.start('parserMain'); if (co.indexOf('C') >= 0) that.getSpansAndTexts(that.content, params); utils.start('parserPost') var ret = that.getReturnStr(that.content); var exceeded = that.exceeded = utils.now() - that.timeEnd; trace('parsing time='+(exceeded+that.timeout)); if (exceeded >= 0) utils.raport('P1-o', 'timeout exceeded', exceeded); trace('parsing completed'); return ret; } } try {x.x.x} catch(e) {static.fstarts.push(['nstables', e.lineNumber, 0])}; NSTables = function(utils, conf, options, font) { var that_nst = this; this.dbg = options('dbg_div'); this.font = font; var getDiv = function(doc) { return doc.createElement('div'); } if (this.dbg) { getDiv = function(doc, dbg) { var ret = doc.createElement('div'); ret.style.overflow = 'hidden'; ret.id = 'Q' + utils.trash.length; ret.dbg = dbg; utils.trash.push(ret); return ret; } } this.getImgDiv = function(url, minx, miny, fc, bc) { var obj = that_nst.emptyDiv(minx, miny, fc, bc); obj.css.backgroundImage = 'url('+url+')'; if (!utils.ie) { obj.css.backgroundPosition = 'center'; } obj.css.backgroundRepeat = 'no-repeat'; obj.img = true; return obj; } this.busy = false; this.over = []; var adda = function(dom, a) { if (a.click) { dom.onclick = a.click; if (a.mousedown) dom.onmousedown = a.mousedown; } else if (a.href) { dom.onclick = utils.ftry('click', utils.onlyOnce(function() { syso('click: ' + a.href); window.open(a.href, '_blank'); }, 'mainClick')); } var pri = a.pri === 1; var show_ws = function() { var desc = ''; var max = -1; for (var i=0; i max) { max = that_nst.over[i].pri; desc = that_nst.over[i].url; } } try { window.status = desc; } catch(e) { if (!that_nst.wsw_sent) { that_nst.wsw_sent = true; utils.raport('J1-', 'cannot change window status'); } }; } dom.onmouseout = utils.ftry('onmouseover', function() { for (var i=0; i'; } try { ifr = utils.createIframe(div, x, y); if (conf.get('noIframe', false)) throw 'd'; if (ifr.contentDocument) { cd = ifr.contentDocument; } else if (ifr.contentWindow) { cd = ifr.contentWindow.document; } cd.open(); var hidden = ''; if (options('overlap')) { hidden = 'overflow: hidden; '; } cd.write('' + extra + ''); cd.close(); div = cd.body; } catch(e) { utils.raport('P1!-o', 'getIframe', e.message); if (backupUrl) { ifr.src = backupUrl; } else { cd = document; try { div.removeChild(ifr); } catch(e1){} } return null; } return {cd: cd, div: div}; } this.emptyDiv = function(w, h, fc, bc) { var obj = {}; if (!w) w = 0; if (!h) h = 0; obj.minSize = {x: w, y: h}; obj.realSize = {x: w, y: h}; obj.fc = fc; obj.bc = bc; obj.leaf = true; obj.css = {}; obj.go1 = function(doc, checkNodes, textNodes, smallDOM) { obj.checkSize = false; return obj.minSize; } obj.setFullSize = function(dim, size) { obj.realSize[dim] = size; } obj.getRealHeights = function(h_in, h_out) { if (obj.realSize.y < h_in[obj.type]) obj.realSize.y = h_in[obj.type]; if (h_out[obj.type] === undefined) h_out[obj.type] = 0; if (obj.realSize.y > h_out[obj.type]) h_out[obj.type] = obj.realSize.y; return obj.realSize.y; } obj.getFinalDOM = function(doc, par, x, y) { var rs = obj.realSize; if (obj.sizeFrom === undefined) { if ((rs.x <= 0) || (rs.y <= 0)) return; if (!obj.bc && !obj.img) return; } if (!obj.bc && !obj.img) return; obj.dom = doc.createElement('div'); if (that_nst.dbg) obj.dom = getDiv(doc, obj); var ods = obj.dom.style; for (var i in obj.css) { try { ods[i] = obj.css[i]; } catch(e) { utils.raport('J1!-', 'unsupported css value', i + ' ' + obj.css[i]); } } if (obj.bc) ods.backgroundColor = obj.bc; ods.width = rs.x + 'px'; ods.height = rs.y + 'px'; ods.left = x + 'px'; ods.top = y + 'px'; if (obj.a) adda(obj.dom, obj.a); par.appendChild(obj.dom); if (obj.title) { obj.dom.setAttribute('title', obj.title); } if (obj.oncomplete) { obj.oncomplete(obj.dom); } } return obj; } this.textDiv = function(fc, bc, tc, txt, sfs, type) { var obj = that_nst.emptyDiv(0, 0, fc, bc); obj.tc = tc; obj.txt = txt; obj.sfs = sfs; obj.type = type; obj.go1 = function(doc, checkNodes, textNodes, smallDOM) { obj.checkSize = true; if (obj.type) checkNodes.push(obj); if (!obj.fixed) textNodes.push(obj); obj.dom = getDiv(doc, obj); var ds = obj.dom.style; for (var i in obj.css) ds[i] = obj.css[i]; if (obj.tc) ds.color = obj.tc; if (obj.bc) ds.backgroundColor = obj.bc; ds.width = ''; ds.height = ''; obj.span = doc.createElement('span'); obj.span.innerHTML = obj.txt; obj.dom.appendChild(obj.span); smallDOM.appendChild(obj.dom); return obj.minSize; } obj.setFullSize = function(dim, size) { if (size < 0) utils.raport('J2!', 'negative full size: ' + dim, size); if (size === 0 && obj.txt) utils.raport('J2!', 'no full size: ' + dim, size); obj.realSize[dim] = size; obj.dom.style.width = obj.realSize[dim] + 'px'; } obj.setFontSize = function(fs) { var cs = obj.sfs(fs); if (typeof(cs) === 'number') { cs = {fs: cs, lh: 2}; } obj.dom.style.fontSize = cs.fs + 'px'; obj.dom.style.lineHeight = cs.fs + cs.lh + 'px'; } obj.getRealSize = function() { var offh = obj.span.offsetHeight + utils.ifnull(that_nst.extraH, 0); obj.realSize.y = offh; if (obj.txt && (obj.realSize.y < 5)) { obj.realSize.y = (parseInt(obj.dom.style.fontSize) + 4) * Math.floor(obj.txt.length * 10 / obj.realSize.x + 1); if (obj.txt.length > 1 && !conf.get('force_write', false)) { utils.raport('J1!', 'no height info available', obj.realSize.y + ', ' + obj.dom.style.fontSize); } } obj.exceedsWidth = obj.span.offsetWidth > obj.realSize.x + 0; obj.lastSizes = {x: obj.span.offsetWidth, y: obj.span.offsetHeight}; if (obj.exceedsWidth && obj.onWidthExceeded) { obj.onWidthExceeded(obj.span.offsetWidth - (obj.realSize.x + 0)); } } obj.checkSizes = function(str) { if (obj.skipWidthChangeTest) return; if (obj.txt === '') return; var sizes = {x: obj.span.offsetWidth, y: obj.span.offsetHeight}; if (sizes.x > obj.lastSizes.x) { utils.raport('J2', 'width changed ' + str, sizes.x - obj.lastSizes.x); } if (sizes.y > obj.lastSizes.y) { utils.raport('J2', 'height changed ' + str, sizes.y - obj.lastSizes.y); } } obj.getFinalDOM = function(doc, par, x, y) { if (obj.oncomplete) { obj.oncomplete(); obj.span.innerHTML = obj.txt; } if (obj.className) { obj.dom.className = obj.className; } var ds = obj.dom.style; ds.width = obj.realSize.x + 'px'; ds.height = obj.realSize.y + 'px'; ds.fontFamily = utils.ifnull(obj.font, that_nst.font); ds.left = x + 'px'; ds.top = y + 'px'; ds.zIndex = 1; obj.span.style.zIndex = 2; if (obj.a) adda(obj.dom, obj.a); if (obj.title) { obj.dom.setAttribute('title', obj.title); } par.appendChild(obj.dom); if (obj.mouseOverOut) { obj.dom.mouseOverOut = obj.mouseOverOut; obj.dom.onmouseover = function(ev) { obj.mouseOverOut(true, ev); } obj.dom.onmouseout = function(ev) { obj.mouseOverOut(false, ev); } } obj.checkSizes(1); utils.later('ckech span width', utils.apply(obj.checkSizes, 2)); } return obj; } this.table = function(c, r, wx, wy, sx, sy) { var obj = {}; obj.colc = c; obj.rowc = r; obj.cellc = {x: c, y: r}; if (wx === undefined) wx = []; if (wy === undefined) wy = []; if (sx === undefined) sx = []; if (sy === undefined) sy = []; obj.weights = {x: wx, y: wy}; obj.minSizes = {x: sx, y: sy}; obj.sameSize = {x: false, y: false}; obj.extendLimit = {x: null, y: null}; obj.cells = []; for (var x=0; x 0) { totalW += wg[i]; heavy.push(i); } size -= obj.realSizes[dim][i]; } var w0 = size % totalW; var w1 = (size - w0) / totalW; var hn = heavy.length; for (var i=0; i 0) && (w1 * wg[heavy[i]] + e > limit)) { obj.extendLimit[dim][heavy[i]] = 0; obj.realSizes[dim][heavy[i]] += limit; obj.weights[dim][heavy[i]] = 0; return obj.checkLimit(dim, origSize); } w0 -= e; hn--; } obj.extendLimit[dim] = null; return obj.setFullSize(dim, origSize); } obj.setFullSize = function(dim, size) { if (obj.extendLimit[dim]) return obj.checkLimit(dim, size); obj.fullSize[dim] = size; var totalW = 0; var heavy = []; var wg = obj.weights[dim]; if (obj.sameSize[dim]) { var maxsize = 0; for (var i=0; i 0) { totalW += wg[i]; heavy.push(i); } size -= obj.realSizes[dim][i]; } } var w0 = size % totalW; var w1 = (size - w0) / totalW; var hn = heavy.length; for (var i=0; i s1) s1 = h_in[ch.type]; if (s1 > obj.realSizes.y[ch.y]) obj.realSizes.y[ch.y] = s1; if (ch.exceedsWidth || s1 > ch.heightLimit) obj.exceedsWidth = true; } var size = 0; for (var y=0; y maxY) { tn.txtPrefix = tn.txtPrefix.substring(0, tn.txtPrefix.lastIndexOf(' ')); tn.span.innerHTML = tn.txtPrefix + ' ...'; throw 'retry'; } }, undefined, undefined, 0); tn.oncomplete = function() { tn.dom.style.height = ''; utils.later('sety1', f); }; obj.css = {}; obj.go1 = function(doc, checkNodes, textNodes, smallDOM) { tn.css = obj.css; return oldgo1(doc, checkNodes, textNodes, smallDOM); } return obj; } this.hiddenTable = function(top, bottom, cache, id, tfc, tbc, tfsf, canShow) { var obj = that_nst.table(1, 2, [1], [1, 0]); var showAll = cache[id]; if (canShow) { obj.top = obj.cells[0][0] = that_nst.table(2, 1, [0, 1], [1], [10, 0]); var switcher = obj.top.cells[0][0] = that_nst.textDiv(tfc, tbc, 'black', showAll ? '-' : '+', tfsf); switcher.oncomplete = function() { switcher.dom.onclick = utils.onlyOnce(function() { syso('switcher clicked'); cache[id] = !showAll; cache.redraw(); }, 'mainClick'); } obj.top.cells[1][0] = top; bottom.skipWidthChangeTest = true; if (showAll) obj.cells[0][1] = bottom; } else { obj.cells[0][0] = top; } return obj; } this.root = function(tab) { var obj = {}; obj.tab = tab; obj.checkNodes = []; obj.textNodes = []; obj.exceedsWidth = false; obj.close = function(doc, root, width) { obj.root = root; obj.root.style.fontFamily = that_nst.font; obj.smallDOM = getDiv(doc, obj); obj.tab.go1(doc, obj.checkNodes, obj.textNodes, obj.smallDOM); obj.tab.setFullSize('x', width); } obj.getHeight = function(fs) { var heights = {}; for (var i=0; i 0; if (conf.get('force_write', false)) ok = true; if (!ok) { var n = form.node; var why = ''; for (var j=0; j<100; j++) { if (!n) { why = 'detached'; break; } if (n.tagName === 'HEAD') { why = 'head'; break; } if (n.style && n.style.display === 'none') why = 'none'; if (options('reveal')) { if (n.style.display != 'inline') n.style.display = 'block'; n.style.overflow = 'visible'; } if (n === document.body) break; n = n.parentNode; } if (why === 'none') { utils.raport('P2!-o', 'display none'); } else if (why === 'detached') { utils.raport('P2!-', 'form detached'); } else if (why === 'head') { utils.raport('P2!-', 'form in head section'); } else { setTimeout(function() { if (that.formVisible) return; utils.raport('P2!-o', 'no size info available'); }, conf.get('hiddenFormReportTimeout', 3000)); } } return ok; } this.maxFeatures = 5; this.cutoff = function(stage) { return { noUrl: stage <= 0, cutAvatars: stage <= 1, smallAzButton: stage <= 2, noC2a: stage <= 3, extraC2a: stage >= 5 }; } this.write2 = function(forms, redraw, oncomplete) { utils.start('rendering'); var anyerr = false; var started = utils.now(); for (var i=0; i 0) { that.formVisible = true; utils.raport('P0-o', 'form appeared ' + (form.retries < 10 ? 'soon' : 'late'), form.retries); } form.painted = true; form.created = utils.now(); if (!conf.get('silentWriter', false)) { syso('written form #' + i + ' (' + form.placementId + ')'); } }, conf.get('retries'))(form, i); } utils.start('sync'); try { utils._dbg_.totalTime = (utils.now() - started) + ' ms'; utils._dbg_.nodes = form.doc.getElementsByTagName('div').length; } catch(e) {} utils.retry('waitForAll', function(forms) { for (var i=0; i= 0; --fc) { var root = that.writeF(form, fc); height = root.getHeight(root.fs); exceedsWidth = root.exceedsWidth; ok = height <= form.y && !exceedsWidth; form.featuresEnabled = fc; form.minHeight = height; trace('fc: ' + fc + ', fs: ' + form.computedFontSize + ', height: ' + height + ' exceedWidth: ' + exceedsWidth); if (ok) break; } if (!ok) { that.reportTooLarge(form, height, exceedsWidth); } if (options('incfs') || options('moref') || options('lessf')) { if (options('moref')) { fc++; } else if (options('lessf')) { fc--; } root = that.writeF(form, fc); if (options('incfs')) { utils._dbg_.fontSize = ++root.fs; } height = root.getHeight(root.fs); utils._dbg_.height = height + ' px'; utils._dbgc_.height = height > form.y ? 'maroon' : null; } utils._dbg_.features = fc; root.write(form.doc, form.y); that.fixStrips(root); } this.center = function(node) { if (options('incfs')) return; node.oncomplete = function() { utils.later('center', function() { var ile = (node.dom.offsetHeight - node.span.offsetHeight) / 2; node.dom.style.paddingTop = ile + 'px'; }); } } this.writeBoxFormType2 = function(form, box1, exh) { var csx = form.cornerSizeX; var ret = nst.table(form.c, form.r); ret.sameSize.x = true; var b=0; for (var x=0; x= 3) { node.cells[x][y] = nst.textDiv(null, null, col.title, conf.get('labelText'), that.fsf.ex_label); node.cells[x][y].css = {textAlign: 'right', textDecoration: 'underline'}; node.cells[x][y].a = that.a_label; } } //deprecated this.exForm = function(tab) { tab.type = 'A'; tab.bc = 'FFFFFF'; tab.fc = '777777'; } this.getColorsFromEx = function(form) { form.origColors = utils.shallowCopy(form.colors); if (form.exColors) { form.colors = form.exColors; form.colors.headerBg = form.colors.bg; form.colors.headerFrame = form.colors.frame; return true; } return false; } this.avColors = function(form) { if (that.getColorsFromEx(form)) return; that.exColors(form); form.colors.labelTxt = form.colors.title; form.colors.bg = 'FFFFFF'; form.colors.headerBg = 'FFFFFF'; form.colors.frame = '777777'; form.colors.headerFrame = '777777'; } this.exColors = function(form) { if (that.getColorsFromEx(form)) return; var colors = form.colors; colors.bg = colors.headerBg = 'FFFFFF'; colors.frame = colors.headerFrame = '777777'; var check = function(col) { if ('0123456789'.indexOf(col.charAt(0)) >= 0) return true; if ('0123456789'.indexOf(col.charAt(2)) >= 0) return true; return false; } if (check(colors.title) && check(colors.desc) && check(colors.url)) return; colors.title = colors.desc = colors.labelTxt = '737486'; colors.url = '5368B8'; return; } this.addLabel = function(form, dom) { var ls = conf.get('labelSizes')(form.labelId); if (form.labelType === 1) { var ret = nst.table(2, 2, [1, 0], [1, 0]); ret.cells[0][0] = dom; var labT = nst.table(1, 3, [1], [1, 0, 0]); ret.cells[1][0] = labT; labT.cells[0][0] = nst.emptyDiv(0, 0); labT.cells[0][2] = nst.emptyDiv(0, Math.min(10, (form.y - ls.vy) / 2)); labT.cells[0][1] = nst.getImgDiv(conf.getUrl('vimgurl').replace('**', form.labelId), ls.vx, ls.vy);//FIXME labT.cells[0][1].title = conf.get('labelTitle'); labT.cells[0][1].a = that.a_label; if (!form.cutoff.smallAzButton && conf.get('moreAZ')) { features.az(ret, 0, 1, 'left', form, 1); } return ret; } else if (form.labelType === 2) { var ret = nst.table(1, 2, [1], [1, 0]); ret.cells[0][0] = dom; var labT = nst.table(3, 1, [1, 0, 0], [0]); ret.cells[0][1] = labT; labT.cells[0][0] = nst.emptyDiv(0, 0); features.az(labT, 0, 0, 'left', form, 2); labT.cells[2][0] = nst.emptyDiv(ls.hy, 0); labT.cells[1][0] = nst.getImgDiv(conf.getUrl('himgurl').replace('**', form.labelId), ls.hx, ls.hy);//FIXME labT.cells[1][0].title = conf.get('labelTitle'); labT.cells[1][0].css.backgroundPosition = 'right'; labT.cells[1][0].a = that.a_label; return ret; } return dom; } this.reportTooLarge = function(form, ile, exceedsWidth) { if (ile - form.y > 0) { utils.raport('P1-o', 'not enought space in form', 'missing: ' + (ile - form.y) + ', current=' + form.y + ', required=' + ile); } if (exceedsWidth) { utils.raport('P1-o', 'form width exceeded', 'x='+form.x+', y='+form.y+', c='+form.c+', r='+form.r); } } this.getFontSizes = function(dom, form) { var mins = 1 * conf.get('minFS') - 1; var maxs = 1 * conf.get('maxFS'); var fixed = parseInt(form.fontSize); if (!isNaN(fixed)) { var ile = dom.getHeight(fixed); utils._dbg_.fontSize = 'fixed'; utils._dbg_.height = ile + ' px'; return fixed; } var ok = null; var maxiter = 100; var ile; while (mins < maxs) { if (maxiter--<0) break; var check = Math.floor((mins + maxs + 1) / 2); ile = dom.getHeight(check); ok = ile <= form.y && !dom.exceedsWidth; trace(mins+' '+maxs+' '+ile+' '+(dom.exceedsWidth ? '<-->' : '')); if (ok) { mins = check; } else { maxs = check - 1; } } mins = Math.max(mins, 1 * conf.get('minFS')); ile = dom.getHeight(mins); utils._dbgc_.fontSize = mins < 1 * conf.get('minFS') ? 'maroon' : 'green'; utils._dbgc_.height = form.y < ile ? 'maroon' : 'green'; utils._dbg_.fontSize = mins; utils._dbg_.height = ile + ' px'; if (!ok) { dom.getHeight(mins); } trace('font size: ' + mins); return mins; } this.getBorder = function(tab) { var gb = function(tab, top, bottom, left, right, fc, bc) { if (tab.fc) fc = tab.fc; if (tab.bc) bc = tab.bc; if (tab.leaf || tab.fc) { if (top) top.push({fg: fc, bg: bc, node: tab}); if (bottom) bottom.push({fg: fc, bg: bc, node: tab}); if (left) left.push({fg: fc, bg: bc, node: tab}); if (right) right.push({fg: fc, bg: bc, node: tab}); } else { if (top) for (var x=0; x=0; j--) { var sub = Math.min(arr[j].size, t.end); arr[j].size -= sub; t.end -= sub; } } root.tab.dom.style.display = 'none'; for (var i=0; i 1) || (y+1/n > 1) ? 0 : 1; }, function(x, y, n) { var s = 0.4/n; return n*(1-(x+s)*(x+s)-(y+s)*(y+s))/2.0; }, function(x, y, n) { return (x<1/n) || (y<1/n) ? 0 : n*(1-x-y)/1.4; } ]; this.mergeColors = function(c1, c2, w) { var ret = ''; var digits = '0123456789abcdef'; var getc = function(c) { return digits.indexOf(c.toLowerCase()) } for (var i=0; i<3; i++) { var val1 = 16 * getc(c1.charAt(2*i)) + getc(c1.charAt(2*i+1)); var val2 = 16 * getc(c2.charAt(2*i)) + getc(c2.charAt(2*i+1)); var val = Math.max(0, Math.min(255, val1 * (1-w) + val2 * w)); ret += digits.charAt(Math.floor(val / 16)); ret += digits.charAt(val % 16); } return ret; } this.setColor = function(ch, val, colors) { ch.bc = val >= 0.999 ? colors.bg : (val >= -1.001 ? colors.fg : null); if (val < 0) { var op = Math.min(1, val+1); if (op <= 0) { ch.bc = null; } else if (val < -0.01) { utils.opa(ch.css, op); } } else { if ((colors.fg === undefined) || (colors.bg === undefined)) { utils.raport('J2!', 'color definition is missing'); ch.bc = 'FF0000'; } else { if (colors.bg === 'transparent') { ch.bc = colors.fg; utils.opa(ch.css, 1 - val); } else if (colors.fg === 'transparent') { ch.bc = colors.bg; utils.opa(ch.css, val); } else { ch.bc = that.mergeColors(colors.fg, colors.bg, Math.max(0.0, Math.min(1.0, val))); } } } } this.drawCorner = function(form, corner, colors, hswap, vswap) { var cs1y = form.cornerSizeY; var cs1x = form.cornerSizeX; var bs = form.borderSize; var cdef = corner + '-' + cs1x + '-' + cs1y + '-' + bs; if (!that.corners[cdef]) { var c = []; for (var x=0; x 0.999) v = 0.999; if (v != last) { if (posy >= 0) cx.push({v: last, r: y - posy}); posy = y; last = v; } } cx.push({v: last, r: cs1y - posy}); } var cc = that.corners[cdef] = []; var last1 = []; var posx = -1; for (var x=0; x= 0) cc.push({v: last1, r: x - posx}); posx = x; last1 = v; } } cc.push({v: last1, r: c.length - posx}); } var csa = that.corners[cdef]; var tx = nst.table(csa.length, 1); tx.minSizes.y[0] = cs1y; for (var x=0; x maxx) return false; if (form.y < miny || form.y > maxy) return false; return utils.ifnull(cc, 1); } var avdim = function(form, minx, maxx, miny, maxy, cc) { var newcc = Math.min(form.r, form.c) > 1 ? Math.min(cc, form.cc) : cc; return oddo(form, minx, maxx, miny, maxy, newcc); } var avSize4 = function(form) { var xy = form.x + 'x' + form.y; if (xy === '300x100') return {c:1, r:1}; if (xy === '300x165') return {c:1, r:2}; if (xy === '300x255') return {c:1, r:3}; if (xy === '620x165') return {c:2, r:2}; if (xy === '940x75') return {c:3, r:1}; return false; } this.featureConf = function() {return [ [that.adart3, utils.adTypes.csAd, function(form) { return form.adart3 ? form.cc : false; }], [that.billboard, utils.adTypes.billboard, function(form) { return form.ee === 'e' ? 1 : false; }], [that.billboard75, utils.adTypes.exclusive_big, function(form) { if (oddo(form, 580, 750, 100, 219)) return 1; if (oddo(form, 450, 579, 180, 219)) return 1; return false; }], [that.rectangle, utils.adTypes.billboard, function(form) { return form.ee === 'E' ? 1 : false; }], [that.rectangle, utils.adTypes.exclusive_big, function(form) { if (oddo(form, 450, 750, 220, 300)) return 1; if (oddo(form, 300, 479, 230, 300)) return 1; return false; }], [that.skyscraper, utils.adTypes.skyscraper, function(form) { return form.ee === 'W' ? 1 : false; }], [that.skyscraper, utils.adTypes.exclusive_narrow, function(form) { return oddo(form, 160, 299, 300, 600); }], [that.billboard, utils.adTypes.exclusive, function(form) { return form.ee === 'e' ? 1 : false; }], [that.rectangle, utils.adTypes.exclusive, function(form) { return form.ee === 'E' ? 1 : false; }], [that.skyscraper, utils.adTypes.exclusive, function(form) { return form.ee === 'W' ? 1 : false; }], [that.nkform, utils.adTypes.nkbox, function(form) { return form.merging != 7 ? form.cc : false; }], [that.nkformSmall, utils.adTypes.nkbox, function(form) { return form.merging == 7 ? 1 : false; }], [that.imageAd(false, 250, 250), utils.adTypes.imgK, function(form) { return oddo(form, 250, 299, 250, 300); }], [that.imageAd(false, 300, 250), utils.adTypes.imgSP, function(form) { return oddo(form, 300, 335, 250, 300); }], [that.imageAd(false, 336, 280), utils.adTypes.imgDP, function(form) { return oddo(form, 336, 474, 280, 300); }], [that.imageAd(false, 728, 90), utils.adTypes.imgDB, function(form) { return oddo(form, 724, 1025, 90, 130); }], [that.imageAd(true, 160, 600), utils.adTypes.imgSW, function(form) { return oddo(form, 160, 220, 600, 1000); }], [that.imageAd(false, 468, 60), utils.adTypes.imgMP, function(form) { return form.x >= 468 && form.x <= 727 && form.y >= 60 && form.y <= 200 ? 1 : false; }], [that.stdFlashAd, utils.adTypes.flash, function(form) { return form.x === 300 && form.y === 250 ? 1 : false; }], [that.smallFlashAd(468, 60), utils.adTypes.imgMF, function(form) { return form.x >= 468 && form.x <= 727 && form.y >= 60 && form.y <= 200 ? 1 : false; }], [that.avararLeftXY, utils.adTypes.avatar, function(form) { return options('forceAvLeft') ? form.cc : false; }], [that.avatarTop, utils.adTypes.avatar, function(form) { return options('forceAvTop') ? form.cc : false; }], [that.avatarK(1, 1), utils.adTypes.avatar, function(form) { return oddo(form, 200, 579, 100, 149, 1); }], [that.avatarK(2, 1), utils.adTypes.avatar, function(form) { return oddo(form, 580, 799, 100, 149, 2); }], [that.avatarK(3, 1), utils.adTypes.avatar, function(form) { return oddo(form, 800, 969, 100, 149, 3); }], [that.avatarK(4, 1), utils.adTypes.avatar, function(form) { return oddo(form, 970, 1300, 100, 149, 4); }], [that.avatarK(2, 2), utils.adTypes.avatar, function(form) { return oddo(form, 580, 799, 200, 260, 4); }], [that.avatarK(3, 2), utils.adTypes.avatar, function(form) { return oddo(form, 800, 959, 200, 260, 6); }], [that.avatarK(4, 2), utils.adTypes.avatar, function(form) { return oddo(form, 960, 1300, 200, 260, 8); }], [that.avatarK(1, 1), utils.adTypes.avatar, function(form) { return oddo(form, 250, 269, 150, 169, 1); }], [that.avatarK(1, 2), utils.adTypes.avatar, function(form) { return oddo(form, 250, 269, 170, 199, 2); }], [that.avatarK(1, 2), utils.adTypes.avatar, function(form) { return oddo(form, 270, 579, 150, 199, 2); }], [that.avatarK(1, 2), utils.adTypes.avatar, function(form) { return oddo(form, 250, 319, 200, 249, 2); }], [that.avatarK(1, 3), utils.adTypes.avatar, function(form) { return oddo(form, 320, 579, 200, 249, 3); }], [that.avatarK(1, 3), utils.adTypes.avatar, function(form) { return oddo(form, 250, 319, 250, 300, 3); }], [that.avatarK(1, 4), utils.adTypes.avatar, function(form) { return oddo(form, 320, 579, 250, 300, 4); }], [that.avatarTop, utils.adTypes.avatar, function(form) { return oddo(form, 150, 249, 180, 349, 1); }], [that.avatarTop, utils.adTypes.avatar, function(form) { return oddo(form, 150, 249, 350, 479, 2); }], [that.avatarTop, utils.adTypes.avatar, function(form) { return oddo(form, 150, 249, 480, 699, 3); }], [that.avatarTop, utils.adTypes.avatar, function(form) { return oddo(form, 150, 249, 700, 1100, 4); }], [that.oneLineForm, utils.adTypes.text, function(form) { form.oneLine = form.labelType === 'right' ? (Math.round((form.y - form.spacing * form.r) / form.r) < 58) && (Math.round((form.x - 16 - form.spacing * form.c) / form.c) >= 480) : (Math.round((form.y - 16 - form.spacing * form.r) / form.r) < 58) && (Math.round((form.x - form.spacing * form.c) / form.c) >= 480); return conf.get('enableOneLineForms') && form.oneLine ? form.r * form.c : false; }], [that.wideForm, utils.adTypes.text, function(form) { if (form.labelType === 4) return form.cc; if (form.y / form.r > 63) return false; if (form.x * form.r / (form.y * form.c) >= conf.get('labelXY', 6)) { return form.cc; } return false; }], [that.textForm, utils.adTypes.text, function(form) { return form.r * form.c; }] ]}; this.setBottom = function(_writer, _nst, ref) { writer = _writer; nst = _nst; that.ref = ref; } this.fixurl = function(box, form) { var ret = box.aa; if (!ret) { syso('no click-url'); return null; } try { var cs = that.clickStats(box, form); if (box.typ != utils.adTypes.flash) { utils.later('sendClickBox', utils.apply(utils.addstats, 'afterClickBox', true, cs)); } if (conf.get('noClickurlTrash')) return ret; ret += '&iid=' + utils.rndId; if (typeof(quad_events) != 'undefined') {//bc if (quad_events.ctr_param) ret += '&ctr_param=' + escape(quad_events.ctr_param); } syso('click url: ' + ret); } catch(e) { utils.exc('click_stats', e); } return ret; } this.blockClick = function(form, box) { return false; } this.a_box = function(box, form, ifnoflash) { return { click: utils.ftry('mainClick', utils.onlyOnce(function() { if (that.dontclick) return syso('don\'t click'); if (ifnoflash) { if (form.doc.body.innerHTML.indexOf('flashblock') < 0) return syso('flash bg click'); syso('flashblock detected'); } form.clicked = utils.now(); form.clickNo = utils.ifnull(form.clickNo, -1) + 1; box.clickNo = utils.ifnull(box.clickNo, -1) + 1; if (that.blockClick(form, box)) { utils.raport('P4', 'blockedClick'); return; } var url = that.fixurl(box, form); form.prevClick = box.prevClick = form.clicked; if (url) window.open(url, '_blank'); fire('onclick', box, false, form); }, 'mainClick'), null, utils.apply(utils.raport, 'J4', 'click crashed')), mousedown: function() { setTimeout(function() { if (form.clicked) return; form.clicked = utils.now(); utils.raport('J1o', 'no click', utils.now()); }, conf.get('dontClickTimeout', 3000)) }, url: box.durl, pri: 0 } } this.clickStats = function(box, form) { var now = form.clicked; return { formx: form.x, formy: form.y, adt: utils.ifnull(utils.adTypes[box.typ], box.typ), id: box.id, time1: now - form.created, time2: now - form.created2, forme: 'ex_' + form.ee, clickT: now - form.prevClick, clickNo: form.clickNo, clickAdT: now - box.prevClick, clickAdNo: box.clickNo } } this.goC2a = function(form) { if (form.y <= 120) return false; if (form.cutoff.noC2a) return false; return conf.get('enableC2a') != options('noC2a'); } this.goAZ = function(form, lt) { lt = utils.ifnull(lt, 3); if (!conf.get('enableAZ')) return false; if (!(that.enableAZ || options('forceAutoOrder'))) return false; if (form.cutoff.noAZ) return false; if (form.labelType != lt) return false; if (form.x < 160) return false; if (form.y < 60 && lt === 3) return false; if (form.noIframe) return false; if (window.top != window) return false; return true; } this.c2a = function(node, x, y, align, text, color, form) { if (!that.goC2a(form)) return; var cta = node.cells[x][y] = nst.textDiv(null, null, color, text, function() { return {fs: conf.get('c2aFS'), lh: 2}; }); cta.css.textAlign = align; } this.bright = function(color) { return '01234567'.indexOf(color.charAt(0)) < 0 || '01234567'.indexOf(color.charAt(2)) < 0 || '0123456789AB'.indexOf(color.charAt(4)) < 0; } this.az = function(node, x, y, align, form, lt) { if (!that.goAZ(form, lt)) return; var col = form.colors.autoOrder; if (!col) { var col = writer.mergeColors(form.colors.bg, form.colors.title, conf.get('azCB')); col = writer.mergeColors(col, that.bright(col) ? '000000' : 'FFFFFF', conf.get('azBB')); } var txt = conf.get(form.ee === 'W' ? 'az_shortText' : 'az_text').replace(/ /g, ' '); if (!form.aoWontFit) { txt = conf.get('az_longText').replace(/_WHERE_/g, utils.getDomain()); } var az = node.cells[x][y] = nst.textDiv(null, null, col, txt, function() { return {fs: conf.get('azFS'), lh: 2}; }); az.onWidthExceeded = function(oile) { trace('ao width exceeded by ' + oile); form.aoWontFit = true; } az.css.textAlign = align; if (conf.get('azBold')) az.css.fontWeight = 'bold'; if (conf.get('azUnderline')) az.css.textDecoration = 'underline'; az.a = {click: utils.onlyOnce(utils.apply(autoOrder.show, form.prid, form.caid, that.ref), 'mainClick'), url: conf.get('az_text'), pri: 2}; autoOrder.preload(); } this.setCss = function(node, shift) { var opts = conf.get('cssOptions') >> shift; if (opts & 1) node.css.fontWeight = 'bold'; if (opts & 8) node.css.textDecoration = 'underline'; } this.getDurl = function(form, box) { if (!form.withUrl) return ''; if (form.cutoff.noUrl) return ''; var durl = box.durl; var chars = ['.', '/', '?', '=', '&']; for (var i=0; i'); } return durl; } this.alignForm = function(form, node, minX, minY) { if (form.x <= minX && form.y <= minY) return node; var ex = form.x - minX; var ey = (form.y - minY) / 2; syso('transparent align required: ' + minX + ' ' + minY); var ret = nst.table(2, 3, [0, 1], [1, 0, 1], [minX, ex], [ey, minY, ey]); ret.cells[0][1] = node; return ret; } this.setName = function(form, name) { if (form.formType) return; form.formType = (name+'').replace(/-/, '_'); utils._dbg_.formType = name; } this.smallFlashAd = function(minX, minY) { return function(form) { return that.flashAd(form, minX, minY); } } this.stdFlashAd = function(form) { return that.flashAd(form); } this.flashAd = function(form, minX, minY) { that.setName(form, 'flash'); form.r = form.c = 1; minX = utils.ifnull(minX, form.x); minY = utils.ifnull(minY, form.y); form.labelType = 3; var box = form.ads[0]; var fpv = utils.getFlashPlayerVersion(); syso('flash player version: ' + fpv); var ret = nst.table(1, 1, [1], [1]); var main = ret.cells[0][0] = nst.getImgDiv(utils.getImager(box), minX, minY); main.a = that.a_box(box, form, fpv); main.a.mousedown = function() {}; main.oncomplete = function(node) { var aa = that.fixurl(box, form); if (fpv != null) { var obj = node; var emb = form.doc.createElement('embed'); if (!utils.ie) { obj = form.doc.createElement('object'); var param = form.doc.createElement('param'); obj.appendChild(param); param.name = 'wmode'; param.value = 'opaque'; obj.setAttribute('wmode', 'opaque'); emb.setAttribute('wmode', 'opaque'); } emb.width = minX + 'px'; emb.height = minY + 'px'; emb.type = 'application/x-shockwave-flash'; if (aa) emb.setAttribute('flashvars', 'click='+escape(aa)+'&clickTag='+escape(aa)); emb.src = utils.ifnull(box.fimg, utils.getImager(box, 'flash')); emb.wmode = 'opaque'; obj.appendChild(emb); obj.style.zIndex = 100; emb.style.zIndex = 200; if (!utils.ie) node.appendChild(obj); } var a = form.doc.createElement('a'); node.appendChild(a); var d = form.doc.createElement('div'); a.appendChild(d); d.style.width = conf.get('flashLabelWidth') + 'px'; d.style.height = conf.get('flashLabelHeight') + 'px'; d.style.position = 'absolute'; d.style.left = minX - conf.get('flashLabelSmall') + 'px'; d.style.bottom = '0px'; d.style.zIndex = 10000; d.style.opacity = 1; var lurl = conf.getUrl('flash_label_url'); d.style.backgroundImage = 'url('+lurl+')'; d.onmouseover = function() { d.style.left = minX - conf.get('flashLabelWidth') + 'px'; that.dontclick = true; }; d.onmouseout = function() { d.style.left = minX - conf.get('flashLabelSmall') + 'px'; that.dontclick = false; }; a.href = writer.a_label.href; a.target = '_blank'; } return that.alignForm(form, ret, minX, minY); } this.imgBottomLabel = function(form) { var box = form.ads[0]; var belka = nst.table(4, 1, [0, 1, 0, 0], [1], [3, 0, conf.get('img_text_label_width'), 3]); belka.cells[1][0] = nst.textDiv(null, null, 'FFFFFF', box.url, writer.fsf.image); belka.cells[1][0].a = that.a_box(box, form); belka.cells[2][0] = nst.textDiv(null, null, 'FFFFFF', conf.get('img_text_label'), writer.fsf.image); belka.cells[2][0].a = writer.a_label; belka.cells[2][0].css.textAlign = 'right'; return belka; } this.nkform = function(form) { that.setName(form, 'nk'); form.cornerSizeX = form.cornerSizeY = 1; var col = form.colors; return writer.writeBoxForm(form, function (box, lastLine, lastBox, ext) { var ret = nst.table(3, 9, [0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1], [ext.l, 0, ext.r], [ext.t, 0, 10, 0, 10, 0, 6, 0, ext.b]); var titleDiv = ret.cells[1][1] = nst.textDiv(null, null, col.title, box.title, writer.fsf.fixed(11, 0)); if (box.extra === 'img') { var it = ret.cells[1][3] = nst.table(2, 1, [0, 1], [1]); it.cells[0][0] = nst.getImgDiv(utils.getImager(box), 113, 75); } ret.cells[1][5] = nst.textDiv(null, null, col.desc, box.opis1, writer.fsf.fixed(11, 3)); var urlDiv = ret.cells[1][7] = nst.textDiv(null, null, col.url, box.durl, writer.fsf.fixed(11, 0)); titleDiv.css.fontWeight = 'bold'; urlDiv.css.textDecoration = 'underline'; if (!form.withUrl) { urlDiv.css.display = 'none'; } ret.fc = col.frame; ret.bc = 'FFFFFF'; ret.a = that.a_box(box, form); return ret; }); } this.nkformSmall = function(form) { that.setName(form, 'nksmall'); var col = form.colors; var box = form.ads[0]; var ret = nst.table(1, 7, [1], [0, 0, 0, 0, 0, 0, 1], [0], [0, 10, 0, 10, 0, 6, 0]); ret.bc = 'transparent'; var titleDiv = ret.cells[0][0] = nst.textDiv(null, null, col.title, box.title, writer.fsf.fixed(11, 0)); if (box.extra === 'img') { var it = ret.cells[0][2] = nst.table(2, 1, [0, 1], [1]); it.cells[0][0] = nst.getImgDiv(utils.getImager(box), 113, 75); } ret.cells[0][4] = nst.textDiv(null, null, col.desc, box.opis1, writer.fsf.fixed(11, 3)); var urlDiv = ret.cells[0][6] = nst.textDiv(null, null, col.url, box.durl + '»', writer.fsf.fixed(11, 0)); titleDiv.css.fontWeight = 'bold'; urlDiv.css.textDecoration = 'underline'; ret.a = that.a_box(box, form); return ret; } this.imageAd = function(sky, minX, minY) { return function(form) { that.setName(form, 'graphics'); form.r = form.c = 1; minX = utils.ifnull(minX, form.x); minY = utils.ifnull(minY, form.y); form.labelType = 3; var box = form.ads[0]; var lh = sky ? 22 : 11; var ret = nst.table(1, 2, [1], [1, 0], [0], [0, lh]); ret.cells[0][0] = nst.getImgDiv(utils.getImager(form.ads[0]), minX, minY - lh); ret.cells[0][0].a = that.a_box(box, form); if (sky) { var belka = ret.cells[0][1] = nst.table(1, 2, [1], [1, 1]); belka.cells[0][0] = nst.textDiv(null, null, 'FFFFFF', box.url, writer.fsf.image); belka.cells[0][0].a = that.a_box(box, form); belka.cells[0][0].css.textAlign = 'center'; belka.cells[0][1] = nst.textDiv(null, null, 'FFFFFF', conf.get('img_text_label'), writer.fsf.image); belka.cells[0][1].a = writer.a_label; belka.cells[0][1].css.textAlign = 'center'; } else { ret.cells[0][1] = that.imgBottomLabel(form); } ret.cells[0][1].bc = utils.ifnull(form.imgBottomColor, '000000'); return that.alignForm(form, ret, minX, minY); } } this.avImgTab = function(form, box, margin, color, ci) { var ret = nst.table(3, 3, [0, 0, 0], [0, 0, 0], [margin, 0, margin], [margin, 0, margin]); ret.cells[1][1] = nst.getImgDiv(utils.getImager(box), form.avSize.x, form.avSize.y - ci); ret.bc = form.colors.bg; return ret; } this.avatarK = function(c, r) { return function(form) { return that.avatarLeft(form, r, c); } } this.avatar4 = function(form) { that.setName(form, 'avatar4'); form.colors.labelTxt = '6B7B8C'; form.colors.autoOrder = '6B7B8C'; form.avSize = {x: 90, y: 75}; var xy = avSize4(form); if (xy) { form.c = xy.c; form.r = xy.r; } var col = form.colors; col.bottomFrame = col.autoOrder; var titleFS = function(n) {return writer.fixfs(n, Math.max(10, Math.min(n+1, 13)))}; var descFS = function(n) {return writer.fixfs(n, Math.max(10, Math.min(n, 12)))}; var urlFS = function(n) {return writer.fixfs(n, Math.max(10, Math.min(n-1, 10)))}; return writer.writeBoxForm(form, function (box, lastLine, lastBox, ext) { var ret = nst.table(4, 1, [0, 0, 1, 0], [1], [ext.l, form.avSize.x, 0, ext.r], [form.avSize.y]); var itab = ret.cells[1][0] = nst.table(3, 3, [1, 0, 1], [0, 0, 1]); itab.cells[1][1] = that.avImgTab(form, box, 0, '000077', 0); var right = ret.cells[2][0] = nst.table(2, 7, [0, 1], [0, 0, 0, 0, 0, 0, 1], [10, 0]); right.cells[1][2] = nst.textDiv(null, null, col.title, box.title, titleFS); right.cells[1][2].css.fontWeight = 'bold'; right.cells[1][4] = nst.textDiv(null, null, col.desc, box.opis1, descFS); var url = '» ' + box.url; if (box.url.length === 0) { url = ''; } right.cells[1][6] = nst.textDiv(null, null, col.url, url, urlFS); right.cells[1][6].css.fontWeight = 'bold'; ret.a = that.a_box(box, form); ret.bc = col.bg; ret.fc = col.frame; if (lastLine) { right.cells[1][6] = that.addLabelBar(right.cells[1][6], form, box.x === 0, lastBox, ext); } return ret; }); } this.avatarBilb = function(form) { that.setName(form, 'avatar-bilb'); return that.avatarLeft(form, 1, Math.min(form.cc, form.ads.length)); } this.avatarRect = function(form) { that.setName(form, 'avatar-rect'); return that.avatarLeft(form, Math.min(form.cc, form.ads.length), 1); } this.avararLeftXY = function(form) { return that.avatarLeft(form, form.r, form.c); } this.avatarLeft = function(form, r, c) { that.setName(form, 'avatar-left'); form.avSize = conf.get('avImgSize', {x: 72, y: 60}); var spx = form.cutoff.cutAvatars ? 1 : 4; var spy = spx; var ci = form.cutoff.cutAvatars ? 4 : 0; var mw = 6; if (conf.get('customSpacing', false)) { spx = conf.get('customSpacing').mz; mw = conf.get('customSpacing').mw; } form.r = r; form.c = c; writer.avColors(form); return writer.writeBoxForm(form, function (box, lastLine, lastBox, ext) { var ret = nst.table(4, 3, [0, 0, 1], [1, 0, 1], [spx + ext.l, form.avSize.x, 0], [spy, form.avSize.y - ci, spy]); var itab = ret.cells[1][1] = nst.table(3, 3, [1, 0, 1], [1, 0, 1]); itab.cells[1][1] = that.avImgTab(form, box, 0, '000077', ci); ret.cells[2][1] = that.singleBox(form, box, lastLine, lastBox, {l: mw, t: 0, b: 0, r: ext.r}, true); if (!form.cutoff.noUrl) { box.prv._t.sfs = writer.fsf.notmin(box.prv._t.sfs); box.prv._d.sfs = writer.fsf.notmin(box.prv._d.sfs); box.prv._u.sfs = writer.fsf.notmin(box.prv._u.sfs); } ret.a = that.a_box(box, form); ret.bc = form.colors.bg; ret.fc = form.colors.frame; form.prv.type = 'avLeft'; if (lastLine) return that.addLabelBar(ret, form, box.x === 0, lastBox, ext); return ret; }); } this.avatarTop = function(form) { that.setName(form, 'avatar-top'); form.avSize = conf.get('avImgSize', {x: 72, y: 60}); var sp = 6; form.r = form.ads.length; form.c = 1; writer.avColors(form); return writer.writeBoxForm(form, function (box, lastLine, lastBox, ext) { var es = Math.min(form.cc, form.ads.length) === 2 ? 6 : 0; var ret = nst.table(3, 3, [0, 1, 0], [0, 0, 1], [sp, 0, sp], [sp + es, 0, sp]); var itab = ret.cells[1][1] = nst.table(3, 3, [options('centerAvX') ? 0 : 1, 0, 1], [1, 0, 1]); itab.cells[1][1] = that.avImgTab(form, box, 0, '000077', 0); ret.cells[1][2] = that.singleBox(form, box, lastLine, lastBox, {l: 0, t: sp, b: 0, r: 0}, true); if (!form.cutoff.noUrl) { box.prv._t.sfs = writer.fsf.notmin(box.prv._t.sfs); box.prv._d.sfs = writer.fsf.notmin(box.prv._d.sfs); box.prv._u.sfs = writer.fsf.notmin(box.prv._u.sfs); } ret.bc = 'FFFFFF'; ret.fc = '777777'; ret.a = that.a_box(box, form); form.prv.type = 'avTop'; if (lastLine) return that.addLabelBar(ret, form, true, true, ext); return ret; }); } this.billboard = function(form) { that.setName(form, 'billboard'); form.r = form.c = 1; var box1 = form.ads[0]; writer.exColors(form); var col = form.colors; var ret = nst.table(5, 3, [0, 0, 0, 1, 0], [1, 0, 1], [10, 0, 30, 0, 10], [6, 0, 0]); ret.fc = form.colors.frame; ret.bc = form.colors.bg; var tImg = ret.cells[1][1] = nst.table(1, 3, [1], [0, 0, 1], [0], [50, 5, 0]); tImg.cells[0][0] = nst.getImgDiv(utils.getImager(box1), 200, 50); tImg.cells[0][1].css.backgroundPosition = 'center'; tImg.cells[0][2] = nst.textDiv(null, null, col.url, box1.durl, writer.fsf.ex_url); tImg.cells[0][2].css.textAlign = 'center'; var tDesc = ret.cells[3][1] = nst.table(1, 5, [1], [0, 0, 0, 0, 1], [0], [0, 8, 20, 0, 0]); tDesc.cells[0][0] = nst.textDiv(null, null, col.title, box1.title, writer.fsf.ex_title); tDesc.cells[0][0].css = {fontWeight: 'bold', textDecoration: 'underline'}; tDesc.cells[0][2] = nst.textDiv(null, null, col.desc, box1.opis1, writer.fsf.ex_desc); tDesc.cells[0][2].css = {fontWeight: 'bold'}; ret.a = that.a_box(box1, form); ret = that.addLabelBar(ret, form, true, true, {exColors: col, bm: 4}); ret = writer.addCorners(ret, form, {tl: 3, tr: 3, bl: 3, br: 3}); return ret; } this.billboard75 = function(form) { that.setName(form, 'billboard-75'); form.r = form.c = 1; var box1 = form.ads[0]; writer.exColors(form); var col = form.colors; var ret = nst.table(5, 3, [0, 0, 0, 1, 0], [1, 0, 1], [10, 0, 20, 0, 10], [5, 0, 0]); ret.fc = form.colors.frame; ret.bc = form.colors.bg; var tImg = ret.cells[1][1] = nst.table(1, 2, [1], [0, 1]); tImg.cells[0][0] = nst.getImgDiv(utils.getImager(box1, 'image', 0.625), 150, 75); tImg.cells[0][1].css.backgroundPosition = 'center'; var tDesc = ret.cells[3][1] = nst.table(1, 5, [1], [0, 0, 0, 0, 1], [0], [0, 8, 0, 8, 0]); tDesc.cells[0][0] = nst.textDiv(null, null, col.title, box1.title, writer.fsf.ex_title); tDesc.cells[0][0].css = {fontWeight: 'bold', textDecoration: 'underline'}; tDesc.cells[0][2] = nst.textDiv(null, null, col.desc, box1.opis1, writer.fsf.ex_desc); tDesc.cells[0][4] = nst.textDiv(null, null, col.url, box1.durl, writer.fsf.ex_url); ret.a = that.a_box(box1, form); ret = that.addLabelBar(ret, form, true, true, {exColors: col, bm: 4}); ret = writer.addCorners(ret, form, {tl: 3, tr: 3, bl: 3, br: 3}); return ret; } this.rectangle = function(form) { that.setName(form, 'rectangle'); form.r = form.c = 1; var box1 = form.ads[0]; writer.exColors(form) var col = form.colors; var h1 = box1.typ === utils.adTypes.exclusive_normal ? 16 : 10; var ret = nst.table(1, 12, [1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0], [10, 0, 10, 0, h1, 0, 10, 0, 10, 0, 0, 8]); ret.fc = form.colors.frame; ret.bc = form.colors.bg; if (box1.typ === utils.adTypes.exclusive_normal) { ret.cells[0][1] = nst.getImgDiv(utils.getImager(box1), 200, 50); } else if (box1.typ === utils.adTypes.exclusive_big) { ret.cells[0][1] = nst.getImgDiv(utils.getImager(box1, 'image', 0.625), 150, 75); } ret.cells[0][1].css.backgroundPosition = 'center'; ret.cells[0][3] = nst.textDiv(null, null, col.url, box1.url, writer.fsf.ex_url); ret.cells[0][3].css.textAlign = 'center'; ret.cells[0][5] = nst.textDiv(null, null, col.title, box1.title, writer.fsf.ex_title); ret.cells[0][5].css = {textAlign: 'center', fontWeight: 'bold', textDecoration: 'underline'}; ret.cells[0][7] = nst.textDiv(null, null, col.desc, box1.opis1, writer.fsf.ex_desc); ret.cells[0][7].css = {textAlign: 'center', fontWeight: 'bold'}; that.c2a(ret, 0, 9, 'center', conf.get('c2aText'), col.title, form); ret.a = that.a_box(box1, form); ret = that.addLabelBar(ret, form, true, true, {exColors: col, bm: 10}); ret = writer.addCorners(ret, form, {tl: 3, tr: 3, bl: 3, br: 3}); return ret; } this.skyscraper = function(form) { that.setName(form, 'skyscraper'); form.r = form.c = 1; var box1 = form.ads[0]; writer.exColors(form) var col = form.colors; var ret = nst.table(1, 12, [1], [0, 0, 2, 0, 0, 0, 0, 3, 0, 0], [0], [13, 0, 10, 0, 10, 0, 10, 0, 0, 10, 0, 10]); ret.fc = form.colors.frame; ret.bc = form.colors.bg; if (box1.typ === utils.adTypes.exclusive_sky) { ret.cells[0][1] = nst.getImgDiv(utils.getImager(box1), 140, 120); } else if (box1.typ === utils.adTypes.exclusive_narrow) { ret.cells[0][1] = nst.getImgDiv(utils.getImager(box1), 125, 125); } ret.cells[0][3] = nst.textDiv(null, null, col.title, box1.title, writer.fsf.ex_title); ret.cells[0][3].css.textAlign = 'center'; ret.cells[0][3].css.textDecoration = 'underline'; ret.cells[0][5] = nst.textDiv(null, null, col.desc, box1.opis1, writer.fsf.ex_desc); ret.cells[0][5].css.textAlign = 'center'; ret.cells[0][5].css.fontWeight = 'bold'; that.c2a(ret, 0, 7, 'right', conf.get('c2aText'), col.title, form); ret.cells[0][8] = nst.textDiv(null, null, col.url, box1.url, writer.fsf.ex_url); ret.cells[0][8].css.textAlign = 'center'; ret.a = that.a_box(box1, form); ret = that.addLabelBar(ret, form, true, true, {exColors: col, bm: 10}); ret = writer.addCorners(ret, form, {tl: 3, tr: 3, bl: 3, br: 3}); return ret; } this.wideForm = function(form) { that.setName(form, 'wide'); form.labelType = 4; var lw = conf.get('textLabelWidth'); if (that.goC2a(form)) { lw = Math.max(lw, conf.get('c2aWidth')); } return writer.writeBoxForm(form, function(box, lastLine, lastBox, ext) { form.withUrl = false; var col = form.colors; var ret = nst.table(5, 5, [0, 5, 0, 0, 0], [0, 0, 0, 1, 0], [ext.l, 0, 0, lw, ext.r], [0, 0, 0, 0, 0]); var title = ret.cells[1][1] = nst.textDiv(col.headerFrame, col.headerBg, col.title, box.title, writer.fsf.small_title, 'T'); ret.cells[1][1].css.fontWeight = 'bold'; var desc = ret.cells[1][3] = nst.textDiv(col.frame, col.bg, col.desc, box.opis1, writer.fsf.small_desc, 'D'); if (lastBox && lastLine) { var ltab = ret.cells[3][3] = nst.table(1, 3, [1], [1, 1, 0]); ltab.cells[0][2] = nst.textDiv(col.frame, col.bg, col.url, conf.get('labelText'), writer.fsf.small_label); ltab.cells[0][2].css.textAlign = 'right'; ltab.a = writer.a_label; } else { var ltab = ret.cells[3][3] = nst.table(1, 2, [1], [1, 1]); that.c2a(ltab, 0, 1, 'right', conf.get('c2aText'), col.title, form); } for (var x=0; x 2; var col = form.colors; var ret = nst.table(2, 3, [1, 0], [1, 0, 1], [0, lw], [0, 0, 0]); var html = ('_T_ ' + '_D_ ' + '_U_') .replace(/_CT_/g, col.title) .replace(/_T_/g, box.title) .replace(/_CD_/g, col.desc) .replace(/_D_/g, box.opis1) .replace(/_CU_/g, col.url) .replace(/_U_/g, form.withUrl ? box.durl : ''); var all = ret.cells[0][1] = nst.textDiv(null, null, null, html, writer.fsf.small_desc, 'O'); ret.cells[0][1].a = that.a_box(box, form); if (last && !that.goAZ(form)) { var ltab = ret.cells[1][1] = nst.table(1, 2, [1], [0, 1]); if (form.cutoff.extraC2a) { ltab.weights.y[0] = 1; that.c2a(ltab, 0, 0, 'right', conf.get('c2aShortText'), col.title, form); ltab.cells[0][0].a = that.a_box(box, form); } ltab.cells[0][1] = nst.textDiv(null, null, col.labelTxt, conf.get('labelText'), writer.fsf.small_label, 'O'); ltab.cells[0][1].css.textDecoration = 'underline'; ltab.cells[0][1].css.verticalAlign = 'middle'; ltab.cells[0][1].css.textAlign = 'right'; ltab.cells[0][1].a = writer.a_label; writer.center(ltab.cells[0][1]); } else { that.c2a(ret, 1, 1, 'right', conf.get('c2aShortText'), col.title, form); ret.cells[1][1].a = that.a_box(box, form); } var ret1 = nst.table(3, 3, [0, 1, 0], [0, 1, 0], [ext.l, 0, ext.r], [Math.floor(ext.t / 2), 0, Math.floor(ext.b / 2)]); ret1.cells[1][1] = ret; ret1.type = 'O'; ret1.fc = col.frame; ret1.bc = col.bg; box.prv._t = all; box.prv._d = all; box.prv._u = all; form.prv.type = 'text'; if (lastLine && that.goAZ(form) && form.labelType > 2) { return that.addLabelBar(ret1, form, box.x === 0, lastBox, ext); } return ret1; }); } this.textForm = function(form) { that.setName(form, 'text'); return writer.writeBoxForm(form, function (box, lastLine, lastBox, ext) { return that.singleBox(form, box, lastLine, lastBox, ext); }); } this.singleBox = function(form, box, lastLine, lastBox, ext, forAvatars) { nst.font = 'verdana,arial'; var col = form.colors; var canAddAZ = box.x === 0 && lastLine && !forAvatars; var textLabel = form.labelType === 3 && lastLine; var ret = nst.table(1, 4, [1], [1, 0, 0, 1]); var top = ret.cells[0][1] = nst.table(3, 3, [0, 1, 0], [1, 0, 1], [ext.l, 0, ext.r], [ext.t, 0, 3]); var bottom = ret.cells[0][2] = nst.table(3, 5, [0, 1, 0], [0, 0, 1, 0, lastLine && lastBox && form.labelType >= 3 || !that.goC2a(form) ? 0 : 1], [ext.l, 0, ext.r], [0, 0, 0, 0, ext.b]); if (!forAvatars) { top.type = 'T'; bottom.type = 'D'; } top.fc = col.headerFrame; top.bc = col.headerBg; top.tc = col.title; bottom.fc = col.frame; bottom.bc = col.bg; ret.extendLimit.y = [10]; ret.cells[0][0].fc = ret.cells[0][1].fc; ret.cells[0][0].bc = ret.cells[0][1].bc; ret.cells[0][3].fc = ret.cells[0][2].fc; ret.cells[0][3].bc = ret.cells[0][2].bc; var title = top.cells[1][1] = nst.textDiv(null, null, null, box.title, writer.fsf.title); title.css.fontWeight = 'bold'; var desc = bottom.cells[1][0] = nst.textDiv(null, null, col.desc, box.opis1, writer.fsf.desc); var url = bottom.cells[1][1] = nst.textDiv(null, null, col.url, that.getDurl(form, box), writer.fsf.url); url.css.textDecoration = 'underline'; var labelTab = bottom.cells[1][3] = nst.table(2, 1, [1, 0], [1], [0, conf.get('c2aWidth')]); if (!textLabel || !lastBox || form.cutoff.extraC2a) { that.c2a(labelTab, 1, 0, 'right', conf.get('c2aText'), col.title, form); } box.prv._t = title; box.prv._d = desc; box.prv._u = url; form.prv.type = 'text'; ret.a = that.a_box(box, form); if (textLabel && !forAvatars) return that.addLabelBar(ret, form, box.x === 0, lastBox, ext); return ret; } this.addLabelBar = function(node, form, left, right, flags) { flags = utils.ifnull(flags, {}); var col = utils.ifnull(flags.exColors, form.colors); var ret = nst.table(1, 2, [1], [1, 0]); ret.cells[0][0] = node; var bar = ret.cells[0][1] = nst.table(5, 3, [0, 1, 0, 0, 0], [0, 1, 0], [utils.ifnull(flags.l, 0), 0, 0, right ? conf.get('textLabelWidth') : 0, utils.ifnull(flags.r, 0)], [utils.ifnull(flags.tm, 0), 1, utils.ifnull(flags.bm, 0)]); bar.type = 'LB'; bar.fc = col.frame; bar.bc = col.bg; if (left) { var bl = bar.cells[1][0] = nst.table(2, 1, [1, 0], [1]); that.az(bl, 0, 0, 'left', form); bar.oncomplete = utils.later('aoboc', function() { if (!bl.cells[0][0].span) return trace('autoOrder button - no dom'); if (!bl.cells[0][0].dom.parentNode) return trace('autoOrder button - no parent node'); bl.cells[0][0].dom.style.width = bl.cells[0][0].span.offsetWidth + 3 + 'px'; bl.cells[0][0].dom.parentNode.style.backgroundColor = bl.cells[0][0].dom.style.backgroundColor; }); } if (right && form.labelType === 3) { var label = bar.cells[3][0] = nst.textDiv( null, null, col.labelTxt, conf.get('labelText'), writer.fsf.label); label.css.textAlign = 'right'; label.css.textDecoration = 'underline'; label.a = writer.a_label; } return ret; } /**** ADART FORMS ****/ this.ago = function(when) {//XXX localization! if (when <= 0) return ['?', unescape('kiedy%u015B'), '']; var t = (utils.now() - when) / 1000; if (t <= 1) return ['0', 'teraz', '']; var d = [ {n: 60, d:['sek', 'sek', 'sek']}, {n: 60, d:['min', 'min', 'min']}, {n: 24, d:['godz', 'godz', 'godz']}, {n: 30, d:[unescape('dzie%u0144'), 'dni', 'dni']}, {n: 12, d:['m-c', 'm-ce', 'm-cy']}, {n: 100, d:['rok', 'lata', 'lat']} ]; for (var i=0; i 0) t1 = 1; if (d[i].n > 4) t1 = 2; if (t < d[i].n) return [Math.floor(t), d[i].d[t1], ' temu']; t /= d[i].n; } return ['?', '...', '']; } this.maxLength = function(form) { return Math.max(10, (form.x / form.c - 40) * (form.y / form.r - 40) / 82); } this.short = function(str, form) { var max = that.maxLength(form); if (typeof(_maxLength) == 'function') {//TODO rm! max = _maxLength(form); } if (str.length < max) return str; return str.substring(0, max - 3).replace(/\s+[^\s]+$/, '...'); } this.extend = function(node, maxxy, str) { if (options('shortTitle')) return; utils.later('extend', function() { var words = str.split(' '); var prev = ''; var curr = words[0]; for (var i=1; i= maxxy.x || node.offsetHeight > maxxy.y) { node.innerHTML = prev.replace(/\.\.\.$/g, '') + suff; break; } } }); } this.fsaa = function(d) { return function(n) { return {fs: Math.min(12, n + d), lh: 2}; } } this.adart3 = function(form) { that.setName(form, 'adart'); form.labelType = 3; var bs = form.borderSize; var ls = conf.get('labelSizes')(form.labelPos); var fs = that.fsaa; var ret = nst.table(3, 3, [0, 1, 0], [0, 1, 0], [bs, 0, bs], [bs, 0, 0]); ret.bc = form.colors.frame; for (var i=0; i<2; ++i) { var corner = ret.cells[[0, 2][i]][2] = nst.table(1, 4, [1], [0, 0, 1, 0], [0], [0, bs, 0, 0]); corner.cells[0][2].bc = 'transparent'; corner.cells[0][3].bc = 'transparent'; } var main = ret.cells[1][1] = nst.table(2 * form.c - 1, 2 * form.r - 1); main.bc = form.colors.bg; for (var x=0; x 0) { main.weights.x[2 * x - 1] = 0; main.minSizes.x[2 * x - 1] = 1; var line = main.cells[2 * x - 1][2 * y] = nst.table(1, 3, [1], [0, 1, 0], [1], [4, 0, 4]); line.cells[0][1].bc = form.colors.frame; } if (y > 0) { main.weights.y[2 * y - 1] = 0; main.minSizes.y[2 * y - 1] = 1; var line = main.cells[2 * x][2 * y - 1] = nst.table(3, 1, [0, 1, 0], [1], [4, 0, 4], [1]); line.cells[1][0].bc = form.colors.frame; } } } var labelImgDiv = nst.getImgDiv(conf.getUrl('himgurl').replace('**', form.labelPos), ls.hx, ls.hy); labelImgDiv.a = writer.a_label; labelImgDiv.title = conf.get('labelTitle'); if (form.labelPos === 0) { var labelCell = nst.table(3, 3, [0, 1, 0], [0, 1, 0], [1, 0, 1], [1, 0, 1]); labelCell.bc = 'BBBBBB'; labelCell.cells[1][1] = labelImgDiv; var labout = ret.cells[1][2] = nst.table(1, 2, [1], [0, 1], [0], [bs, 0]); var labin = labout.cells[0][1] = nst.table(3, 1, [1, 0, 0], [1], [0, 0, 15], [0]); labin.bc = 'transparent'; labin.cells[1][0] = labelCell; labelCell.minSizes.y[0] = 0; } else { var shdown = 6; ret.cells[0][2].weights.y[0] = ret.cells[2][2].weights.y[0] = 1; ret.cells[0][2].minSizes.y[3] = ret.cells[2][2].minSizes.y[3] = shdown; var labfg = nst.table(3, 1, [1, 0, 0], [1], [0, 0, 15], [0]); labfg.bc = 'transparent'; labfg.cells[1][0] = labelImgDiv; var labbg = nst.table(1, 4, [1], [1, 0, 1], [0], [0, bs, 0, shdown]); labbg.cells[0][0].bc = form.colors.bg; labbg.cells[0][1].bc = form.colors.frame; labbg.cells[0][2].bc = 'transparent'; ret.cells[1][2] = nst.layered([labbg, labfg]); } return ret; } } static.customize(); try {x.x.x} catch(e) {static.fstarts.push(['boxStatic', e.lineNumber, 0])}; utils = new Utils(conf, spliter.cookie_params); try { utils.checkVersion('ads1', ads1_version, utils.rqAds1Version); } catch(e) { utils.raport('S2', 'old ads1 script'); } utils.checkVersion('spliter', spliter.ver, utils.rqSpliterVersion); utils.fstarts = static.fstarts; utils.evlog = static.evlog; utils.prid = spliter.prid; utils.caid = spliter.caid; static.placementUtils = new PlacementUtils(conf, utils, spliter.cookie_params); static.parser = new Parser(conf, utils, spliter.cookie_params); static.autoOrder = new AutoOrder(conf, utils); static.features = new Features(conf, utils, spliter.cookie_params, static.autoOrder, spliter.fire); static.featureConf = static.features.featureConf(); static.features.enableAZ = spliter.enableAZ; static.writer = new Writer(conf, utils, spliter.cookie_params, static.features, (spliter.ref+'').substring(2)); static.lock = true; static.forms = []; static.global = { ignoreContent: false, extraContent: '' }; static.cache = {}; static.without = []; static.withoutMap = {}; static.checkAdsLimit = function() { if (conf.get('emptyBoxes')) return; if (spliter.cookie_params('noLimit')) return syso('skipping ads limit check'); var cc = 0; for (var i=0; i 0 && !form.write) { utils.raport('S2!', 'invalid ad type', form.ads[0].typ); } ret += ';'; } syso('fdef='+ret); return ret; } static.esc1 = function(str) { return str.replace(//g, '>'); } static.validateAds = function(ads) { for (var i=0; i ' + set); if (static.lock === set) return false; static.lock = set; if (typeof(adp_forms) === 'object') adp_forms = null; return true; } static.adc_go1 = utils.ftry('go1', function() { utils.start('go1'); static.evlog.s += ' B1'; if (static.urlparts && static.urlparts[1] === '-') return utils.stop('urlparts'); if (spliter.cookie_params('pprev') && !static.betaPluginReady) { return utils.waitForBetaPlugin(static.adc_go2); } else if (spliter.cookie_params('newDebug') && utils.processBetaPlugins) { return utils.processBetaPlugins(false, static.adc_go2, spliter); } static.adc_go2(); }); static.adc_go2 = utils.retry('go2', function() { if (utils.vlrqSent) throw 'retry'; static.wfa_wait = true; utils.later('wfasyso', function() { if (!static.wfa_wait) return; syso('waiting for publisher ready signal (wfa)'); }); utils.start('wfa'); if (typeof(wfa) != 'undefined') return wfa = static.adc_wfa; if (typeof(wfa_akon) != 'undefined') return wfa_akon = static.adc_wfa; if (typeof(akon_wfa) != 'undefined') return akon_wfa = static.adc_wfa; utils.start('go3'); static.adc_go3(); }); static.adc_wfa = function() { static.wfa_wait = false; utils.start('go3'); static.adc_go4(); } var rcfq = conf.get('readyCheckFq', 50); static.adc_go3 = utils.retry('go3', function() { static.wfa_wait = false; if (!spliter.timein) return static.adc_go4(); if (document.readyState === 'complete') { syso('document ready'); return static.adc_go4(); } var wait = spliter.started + spliter.timein - utils.now(); if (wait < 0) { static.adc_go4(); } else { syso('waiting: ' + wait + ' ms.'); if (wait > rcfq) throw 'retry'; setTimeout(static.adc_go4, wait); } }, undefined, undefined, rcfq); static.adc_go4 = utils.ftry('go3', function() { utils.start('go4'); static.evlog.s += ' B2'; spliter.fire('onbeforeparse'); conf.default_show_header = spliter.ad_warn_show_header === true;//XXX ugly nextPlacement = static.extraForm; adp_forms = null;//bc static.safemode = typeof(nsc_safemode) != 'undefined' || spliter.events.safemode != undefined; static.safemode = static.safemode != spliter.cookie_params('safeMode'); if (static.safemode) { spliter.timein = 0; utils.raport('P1-', 'safemode'); } static.prefix = 'quad_' + conf.get('prefix') + 'XstaticXplacementUtils'; if (spliter.events.formLimit) { nextPlacement(); static.placementUtils.formLimit = spliter.events.formLimit; } static.global.prid0 = spliter.prid; static.global.caid0 = spliter.caid; static.placementUtils.parseScripts(spliter, static, placement_map, utils.ftry('go4', function() { utils.start('placement3'); trace('forms count: ' + static.forms.length); spliter.fire('onafterformsparsed', static.forms, static.global); static.placementUtils.formLimit = undefined; if (!conf.get('ignoreSamePlacementIds')) { var ids = {}; for (var i=0; i= 0) ch = '&'; b.a += escape(ch) + spliter.u_params; } if (conf.get('enableLandingPageParams')) { b.a=b.a.replace(new RegExp('\\$'+conf.get('prefix'),'g'), '%24'+conf.get('prefix')) .replace('%24'+conf.get('prefix')+'visid', escape(b.id)) .replace('%24'+conf.get('prefix')+'adid', escape(b.aid)) .replace('%24'+conf.get('prefix')+'campid', escape(b.cid)) .replace('%24'+conf.get('prefix')+'pubdomain', escape(b._d)); } } utils.fixCtrUrls(ads, spliter.pserver_id); for (var i=0; i cc) break; if (static.withoutMap['#'+ads[i].id]) utils.syso1('got repeated ads'); static.withoutMap['#'+ads[i].id] = true; static.without.push(ads[i].id); } } static.checkLateAKPlacements = utils.retry('checkLateAKPlacements', function() { if (typeof(adKontekst_pola) === 'undefined') return; var ile = 0; for (var i=0; i 0) nextPlacement(); throw 'retry'; }, utils.duzo); static.writeBoxes = utils.ftry('writeBoxes', function(allads) { if (allads.length === 0) { utils.stop('no ads'); return utils.noAds(true); } syso('got ' + allads.length + ' ads.'); static.blockIds(allads, static.cc); static.removeOldAds(); static.chooseAds(static.forms, allads); static.checkLateAKPlacements(); static.fixCtrUrls(allads); if (static.safemode) { utils.stop('dbg'); for (var i=0; i