// Copyright © 2014-2016 Dynamic Web Services Inc. dba Financial Media Corp, All Rights Reserved var finData = { data:null, setData: function (key, value, win) { win = win || null; this.data[key] = value; this.saveData(win); }, getData:function(key, def){ return (this.data && this.data[key] !=null) ?this.data[key] : def || null; }, loadData: function () { try { var nameData = JSON.parse(window.name); if (this.data != null) { for (var k in this.data) { if (this.data.hasOwnProperty(k)) { nameData[k] = this.data[k]; } } } this.data = nameData; } catch (e) { this.data = {}; } }, saveData: function (win) { if (this.data) { this.loadData(); window.name = JSON.stringify(this.data); if (win && win != window) { win.name = window.name; } } }, attachEventHandler:function(element, event, handler) { if (element.addEventListener) { element.addEventListener(event, handler, true); return true; } else { var onEvent = 'on'+event; if (element.attachEvent) { element.attachEvent(onEvent, handler); return true; }else{ if(!document.all){ document.captureEvents(Event[event.toUpperCase()]); } element[onEvent] = this.funcTrain(element[onEvent], handler); } } return false; }, funcTrain:function(engine, caboose){ return function(){ if(engine){ engine(); } if(caboose){ caboose(); } } } }; finData.loadData(); finData.attachEventHandler(window, "unload", function(){finData.saveData();}); finData.attachEventHandler(window, "beforeunload", function(){finData.saveData();}); // Copyright © 2014-2016 Dynamic Web Services Inc. dba Financial Media Corp, All Rights Reserved var finLib; if (!finLib) { finLib = new (function () { this.getX = function () { return -1 }; this.getY = function () { return -1 }; this.getW = function () { return -1 }; this.getH = function () { return -1 }; this.body = null; this.handlers = { ors: { handlers: [], interval: null, curW: -1, curH: -1 } }; this.queryParams = null; this.ready = function (func) { if (/in/.test(document.readyState)) { setTimeout(finLib.ready, 9, func) } else { func(); } } this.getBody = function () { return finLib.body ? finLib.body : finLib.body = document.body || document.getElementsByTagName('body'); } this.train = function (engine, caboose) { return function () { if (engine) { engine(); } if (caboose) { caboose(); } } } this.attachEventHandler = function (element, event, handler) { if (element.addEventListener) { element.addEventListener(event, handler, true); return true; } else { var onEvent = 'on' + event; if (element.attachEvent) { element.attachEvent(onEvent, handler); return true; } else { if (!document.all) { document.captureEvents(Event[event.toUpperCase()]); } finLib.handlers[onEvent] = element[onEvent]; element[onEvent] = finLib.train(finLib.handlers[onEvent], handler); } } return false; } this.detachEventHandler = function (element, event, handler) { if (element.removeEventListener) { element.removeEventListener(event, handler, true); return true; } else { var onEvent = 'on' + event; if (element.detachEvent) { element.detachEvent(onEvent, handler); return true; } else { element[onEvent] = handlers[onEvent]; finLib.splice(finLib.handlers, finLib.handlers[onEvent]); return true; } } return false; } this.splice = function (array, element) { var i = array.indexOf(element); if (i > -1) { array.splice(i, 1); } } this.concat = function (o, t) { var c = o.length; for (var i = 0; i < t.length; i++) { o[c] = t[i]; c++; } return o; } this.attachResizeHandler = function (func) { if (func != null) { finLib.handlers.ors.handlers.push(func); if (finLib.handlers.ors.handlers.length > 0 && finLib.handlers.ors.interval == null) { finLib.handlers.ors.interval = setInterval(function (ors) { var curW = finLib.getW(); var curH = finLib.getH(); if (ors.curW != curW || ors.curH != curH) { for (i = 0; i < ors.handlers.length; i++) { try { ors.handlers[i](curW, curH, ors.curW, ors.curH); } catch (e) { }; } ors.curW = curW; ors.curH = curH; } }, 10, finLib.handlers.ors); } } } this.detachResizeHandler = function (func) { if (func != null && finLib.handlers.ors.handlers.length > 0) { finLib.splice(finLib.handlers.ors.handlers, func); } if (finLib.handlers.ors.interval != null && finLib.handlers.ors.handlers.length == 0) { clearInterval(finLib.handlers.ors.interval); finLib.handlers.ors.interval = null; } } this.getQueryParam = function (param) { try { if (finLib.queryParams == null) { finLib.queryParams = []; var qs = window.location.search.substring(1).split("&"); for (var i = 0; i < qs.length; i++) { pair = qs[i].split("="); if (pair.length <= 0) { continue; } else if (pair.length == 1) { finLib.queryParams[pair[0]] = ""; } else if (pair.length >= 2) { finLib.queryParams[pair[0]] = pair[1]; } } } if (finLib.queryParams != null && finLib.queryParams[param]) { return finLib.queryParams[param]; } } catch (E) { } return null; } this.setCookie = function (name, value, days, path) { var d = new Date(); d.setTime(d.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = d.toUTCString(); document.cookie = name + "=" + value + "; expires=" + expires + "; path=" + path; } this.getCookie = function (cname, def) { var name = cname + "="; var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; if (cookie) { cookie = cookie.trim(); if (cookie.indexOf(name) == 0) { return cookie.substring(name.length, cookie.length); } } } return (typeof def === "undefined" ? null : def); } this.init = function () { finLib.getBody(); if (typeof (window.pageXOffset) == 'number') { finLib.getX = function () { return window.pageXOffset; }; finLib.getY = function () { return window.pageYOffset; }; finLib.getW = function () { return window.innerWidth; }; finLib.getH = function () { return window.innerHeight; }; } else if (typeof (document.documentElement.scrollLeft) == 'number') { finLib.getX = function () { return document.documentElement.scrollLeft; }; finLib.getY = function () { return document.documentElement.scrollTop; }; finLib.getW = function () { return document.documentElement.clientWidth; }; finLib.getH = function () { return document.documentElement.clientHeight; }; } else { finLib.getX = function () { return finLib.body.scrollLeft || 0; }; finLib.getY = function () { return finLib.body.scrollTop || 0; }; finLib.getW = function () { return finLib.body.clientWidth || 0; }; finLib.getH = function () { return finLib.body.clientHeight || 0; }; } finLib.handlers.ors.curW = finLib.getW(); finLib.handlers.ors.curH = finLib.getH(); } setTimeout(function(){finLib.ready(function () { finLib.init(); })}, 10); }); }// Copyright © 2014-2016 Dynamic Web Services Inc. dba Financial Media Corp, All Rights Reserved var exitTrigger = new (function () { this.init = function(){ finLib.attachEventHandler(document, 'mouseleave', exitTrigger.onOut) || finLib.attachEventHandler(document||window.document, 'mouseleave', exitTrigger.onOut); } this.uninit = function () { finLib.detachEventHandler(document, 'mouseleave', exitTrigger.onOut) || finLib.detachEventHandler(document || window.document, 'mouseleave', exitTrigger.onOut); } this.onOut = function (e) { var e = e ? e : window.event ? window.event : null; if (e && e.target.tagName == "HTML") { if (exitTrigger.check(e)) { exitPlus.open(); } return true; } return false; } this.check = function(e) { pos = exitTrigger.eventPos(e); if (pos.y <= exitPlus.eY) { return true; } } this.eventPos = function (e) { x = e.clientX; y = e.clientY; return { x: x, y: y }; } });// Copyright © 2014-2016 Dynamic Web Services Inc. dba Financial Media Corp, All Rights Reserved var exorn_showing = false; var exitPlus = new (function () { this.eY = 25; this.width = null; this.height = null; this.url = null; this.key = "exp_shows"; this.mobile = false; this.maxSessionShows = 1; this.sessionShows = 0; this.dim = true; this.timeout = 90000; this.button = true; this.relative = true; this.margin = true; this.padding = true; this.divDim = null; this.div = null; this.exitFrame = null; this.pixelImg = null; this.y = 0; this.top = 0; this.scale = 0; this.rCB = false; this.ximg = null; this.aid = null; this.globalCreative = null; this.s1 = null; this.initExit = function () { var nsep = finLib.getQueryParam('nsep'); exitPlus.sessionShows = finData.getData(exitPlus.key, 0); if (exitPlus.maxSessionShows < 0 || (nsep != '1' && exitPlus.sessionShows < exitPlus.maxSessionShows)) { if (finLib.getBody()) { var top = 1; var left = 0; if (exitPlus.rCB) { top = Math.floor((Math.random() * 2) + 1); left = Math.floor((Math.random() * 2) + 1); } exitPlus.url += (exitPlus.url.includes("?")? "&" : "?")+"ebp="+ (top == 1 ? "upper" : "lower") + "_" + (left == "1" ? "left" : "right"); exitPlus.handleScroll(); exitPlus.handleResize(); if(exitPlus.relative){ finLib.getBody().style.position = "relative"; } if(exitPlus.margin){ finLib.getBody().style.margin = 0; } if(exitPlus.padding){ finLib.getBody().style.padding = 0; } exitPlus.divDim = document.createElement('div'); exitPlus.divDim.style.position = "absolute"; exitPlus.divDim.style.top = "0"; exitPlus.divDim.style.left = "0"; exitPlus.divDim.style.width = "100%"; exitPlus.divDim.style.height = "100%"; exitPlus.divDim.style.zIndex = "999998"; exitPlus.divDim.style.display = "none"; exitPlus.divDim.onclick = exitPlus.close; if(exitPlus.dim){ exitPlus.divDim.style.backgroundColor = "#000000"; exitPlus.divDim.style.opacity = ".8"; }else{ exitPlus.divDim.style.opacity = "0"; } exitPlus.div = document.createElement('div'); exitPlus.div.style.top = exitPlus.top + "px"; exitPlus.div.style.marginTop = "-" + (exitPlus.height / 2) + "px"; exitPlus.div.style.left = "50%"; exitPlus.div.style.marginLeft = "-" + (exitPlus.width / 2) + "px"; exitPlus.div.style.position = "absolute"; exitPlus.div.style.zIndex = "999999"; exitPlus.div.style.display = "none"; exitPlus.exitFrame = document.createElement("IFRAME"); exitPlus.exitFrame.setAttribute("src", exitPlus.url); exitPlus.exitFrame.style.width = exitPlus.width + "px"; exitPlus.exitFrame.style.height = exitPlus.height + "px"; exitPlus.exitFrame.style.margin = "0"; exitPlus.exitFrame.scrolling = "no"; exitPlus.exitFrame.frameBorder = "0"; exitPlus.div.appendChild(exitPlus.exitFrame); exitPlus.ximg = document.createElement('img'); exitPlus.ximg.onclick = exitPlus.close; exitPlus.ximg.setAttribute('src', 'https://tpn134.com/res/global/img/x.png'); exitPlus.ximg.style.position = "absolute"; exitPlus.ximg.style.top = top == "1" ? "0" : "100%"; exitPlus.ximg.style.marginTop = "-10px"; exitPlus.ximg.style.left = left == "1" ? "0" : "100%"; exitPlus.ximg.style.marginLeft = "-10px"; exitPlus.ximg.style.zIndex = "999999"; exitPlus.div.appendChild(exitPlus.ximg); finLib.getBody().appendChild(exitPlus.divDim); finLib.getBody().appendChild(exitPlus.div); exitPlus.pixelImg = document.createElement('img'); exitPlus.pixelImg.setAttribute('src', 'https://clicksecure.co/i.ashx?a='+exitPlus.aid+'&c='+exitPlus.globalCreative+'&s1='+exitPlus.s1); exitPlus.pixelImg.style.width = 1; exitPlus.pixelImg.style.height = 1; exitPlus.pixelImg.style.border = 0; } exitTrigger.init(); } } this.initWindow = function () { exorn_showing = true; finLib.attachResizeHandler(exitPlus.onResize); finLib.attachEventHandler(document, 'scroll', exitPlus.onScroll) || finLib.attachEventHandler(window.document, 'scroll', exitPlus.onScroll); } this.uninitWindow = function () { setTimeout(function () { exorn_showing = false; }, exitPlus.timeout) finLib.detachResizeHandler(exitPlus.onReize); finLib.detachEventHandler(document, 'scroll', exitPlus.onScroll) || finLib.detachEventHandler(window.document, 'scroll', exitPlus.onScroll); } this.onScroll = function () { exitPlus.handleScroll(); exitPlus.handleWindow(); } this.onResize = function (curW, curH, lastW, lastH) { exitPlus.handleResize(curH); exitPlus.handleWindow(); exitPlus.handleScale(curW, curH); } this.handleScroll = function () { exitPlus.y = finLib.getY(); } this.handleResize = function (h) { var curH = h || finLib.getH(); exitPlus.top = (curH / 2); } this.handleWindow = function () { exitPlus.div.style.top = exitPlus.top + exitPlus.y + "px"; if (!exitPlus.relative) { exitPlus.divDim.style.top = exitPlus.y + "px"; } } this.handleScale = function (w, h) { var curW = w || finLib.getW(); var curH = h || finLib.getH(); if (exitPlus.mobile || curW < exitPlus.width || curH < exitPlus.height || exitPlus.scale < 1) { var scale = 1; if(curW > 0 && curH > 0){ var scaleW = ((curW / exitPlus.width) ); var scaleH = ((curH / exitPlus.height) ); scale = scaleW 1 && !exitPlus.mobile && exitPlus.scale < 1) { scale = 1; } } if (scale > 0 && (exitPlus.mobile || scale <= 1)) { exitPlus.scale = scale; scale = "scale(" + scale + "," + scale + ")"; exitPlus.div.style.transform = scale; exitPlus.div.style["-webkit-transform"] = scale; exitPlus.div.style["-moz-transform"] = scale; exitPlus.div.style["-o-transform"] = scale; exitPlus.div.style["-ms-transform"] = scale; } } } this.open = function () { if (!exorn_showing) { exitTrigger.uninit(); if (exitPlus.maxSessionShows > 0) { finData.setData(exitPlus.key, exitPlus.sessionShows + 1); } exitPlus.handleScroll(); exitPlus.handleResize(); exitPlus.handleWindow(); exitPlus.handleScale(); exitPlus.divDim.style.display = "block"; exitPlus.div.style.display = "block"; finLib.getBody().appendChild(exitPlus.pixelImg); //finLib.getBody().appendChild(exitPlus.divDim); //finLib.getBody().appendChild(exitPlus.div); exitPlus.initWindow(); } } this.close = function () { exitPlus.uninitWindow(); exitPlus.divDim.style.display = "none"; exitPlus.div.style.display = "none"; } this.init = function () { if (exitPlusSettings && exitPlusSettings.width && exitPlusSettings.height && exitPlusSettings.url) { exitPlus.width = exitPlusSettings.width; exitPlus.height = exitPlusSettings.height; exitPlus.url = exitPlusSettings.url; if(typeof exitPlusSettings.key !== 'undefined'){ exitPlus.key = exitPlusSettings.key; } if(typeof exitPlusSettings.mobile !== 'undefined'){ exitPlus.mobile = exitPlusSettings.mobile; } if(typeof exitPlusSettings.maxSessionShows !== 'undefined'){ exitPlus.maxSessionShows = exitPlusSettings.maxSessionShows; } if(typeof exitPlusSettings.dim !== 'undefined'){ exitPlus.dim = exitPlusSettings.dim; } if(typeof exitPlusSettings.timeout !== 'undefined'){ exitPlus.timeout = exitPlusSettings.timeout; } if(typeof exitPlusSettings.relative !== 'undefined'){ exitPlus.relative = exitPlusSettings.relative; } if(typeof exitPlusSettings.margin !== 'undefined'){ exitPlus.margin = exitPlusSettings.margin; } if (typeof exitPlusSettings.padding !== 'undefined') { exitPlus.padding = exitPlusSettings.padding; } if (typeof exitPlusSettings.rCB !== 'undefined') { exitPlus.rCB = exitPlusSettings.rCB; } if (typeof exitPlusSettings.aid !== 'undefined') { exitPlus.aid = exitPlusSettings.aid; } if (typeof exitPlusSettings.globalCreative !== 'undefined') { exitPlus.globalCreative = exitPlusSettings.globalCreative; } if (typeof exitPlusSettings.s1 !== 'undefined') { exitPlus.s1 = exitPlusSettings.s1; } finLib.ready(function () { exitPlus.initExit(); }); } else { setTimeout(function () { exitPlus.init(); }, 100); } } setTimeout(function () { exitPlus.init(); }, 100); }); if (!String.prototype.includes) { String.prototype.includes = function () { 'use strict'; return String.prototype.indexOf.apply(this, arguments) !== -1; }; } var exitPlusSettings; exitPlusSettings = { width:550, height:480, url:"http://tpn134.com/res/explusRC/banners/skin_5_01/banner_550_480.php?aid=497&sid=emap1bshivn27pmolsvd3vtlu5&coname=BNE%20Intellinews", key:"exitShown_497", mobile:false, maxSessionShows:1, dim:true, timeout:90000, relative:true, margin:true, padding:false, aid:497, globalCreative:3250, s1:"" };