// Copyright © 2014-2016 Dynamic Web Services Inc. dba Financial Media Corp, All Rights Reserved var finData = { data:null, setData:function(key, value){ this.data[key] = value; this.saveData(); }, getData:function(key, def){ return (this.data && this.data[key] !=null) ?this.data[key] : def || null; }, loadData:function(){ if(!this.data){ try{ this.data = JSON.parse(window.name); }catch(e){ this.data = {}; } } }, saveData:function(){ if(this.data){ window.name=JSON.stringify(this.data); } }, 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] = 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.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 def || null; } 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 exorn_showing = false; var enterPlus = new (function () { this.width = null; this.height = null; this.url = null; this.key = "enp_shows"; this.mobile = false; this.maxSessionShows = 1; this.sessionShows = 0; this.dim = true; this.time = 4000; this.timeout = 90000; this.button = true; this.relative = true; this.margin = true; this.padding = true; this.divDim = null; this.div = null; this.y = 0; this.top = 0; this.initEnter = function () { var nsep = finLib.getQueryParam('nsep'); enterPlus.sessionShows = finData.getData(enterPlus.key, 0); if ((enterPlus.maxSessionShows < 0) || (nsep != '1' && enterPlus.sessionShows < enterPlus.maxSessionShows)) { if(finLib.getBody()){ enterPlus.handleScroll(); enterPlus.handleResize(); if(enterPlus.relative){ finLib.getBody().style.position = "relative"; } if(enterPlus.margin){ finLib.getBody().style.margin = 0; } if(enterPlus.padding){ finLib.getBody().style.padding = 0; } enterPlus.divDim = document.createElement('div'); enterPlus.divDim.style.position = "absolute"; enterPlus.divDim.style.top = "0"; enterPlus.divDim.style.left = "0"; enterPlus.divDim.style.width = "100%"; enterPlus.divDim.style.height = "100%"; enterPlus.divDim.style.zIndex = "999998"; enterPlus.divDim.onclick = enterPlus.close; if(enterPlus.dim){ enterPlus.divDim.style.backgroundColor = "#000000"; enterPlus.divDim.style.opacity = ".8"; }else{ enterPlus.divDim.style.opacity = "0"; } enterPlus.div = document.createElement('div'); enterPlus.div.style.top = enterPlus.top + "px"; enterPlus.div.style.marginTop = "-" + (enterPlus.height / 2) + "px"; enterPlus.div.style.left = "50%"; enterPlus.div.style.marginLeft = "-" + (enterPlus.width / 2) + "px"; enterPlus.div.style.position = "absolute"; enterPlus.div.style.zIndex = "999999"; var frame = document.createElement("IFRAME"); frame.setAttribute("src", enterPlus.url); frame.style.width = enterPlus.width + "px"; frame.style.height = enterPlus.height + "px"; frame.scrolling = "no"; frame.frameBorder = "0"; enterPlus.div.appendChild(frame); var ximg = document.createElement('img'); ximg.onclick = enterPlus.close; ximg.setAttribute('src', 'https://tpn134.com/res/global/img/x.png'); ximg.style.position = "absolute"; ximg.style.top = '0'; ximg.style.left = "100%"; ximg.style.marginTop = "-10px"; ximg.style.marginLeft = "-10px"; ximg.style.zIndex = "999999"; enterPlus.div.appendChild(ximg); } setTimeout(enterPlus.open, enterPlus.time); } } this.initWindow = function () { exorn_showing = true; finLib.attachResizeHandler(enterPlus.onResize); finLib.attachEventHandler(document, 'scroll', enterPlus.onScroll) || finLib.attachEventHandler(window.document, 'scroll', enterPlus.onScroll); } this.uninitWindow = function () { setTimeout(function () { exorn_showing = false; }, enterPlus.timeout) finLib.detachResizeHandler(enterPlus.onReize); finLib.detachEventHandler(document, 'scroll', enterPlus.onScroll) || finLib.detachEventHandler(window.document, 'scroll', enterPlus.onScroll); } this.onScroll = function () { enterPlus.handleScroll(); enterPlus.handleWindow(); } this.onResize = function (curW, curH, lastW, lastH) { enterPlus.handleResize(curH); enterPlus.handleWindow(); enterPlus.handleScale(curW, curH); } this.handleScroll = function () { enterPlus.y = finLib.getY(); } this.handleResize = function (h) { var curH = h || finLib.getH(); enterPlus.top = (curH / 2); } this.handleWindow = function () { enterPlus.div.style.top = enterPlus.top + enterPlus.y + "px"; if (!enterPlus.relative) { enterPlus.divDim.style.top = enterPlus.y + "px"; } } this.handleScale = function (w, h) { var curW = w || finLib.getW(); var curH = h || finLib.getH(); if (enterPlus.mobile || curW < enterPlus.width || curH < enterPlus.height) { var scale = 1; if(curW > 0 || curH > 0){ var scaleW = ((curW / enterPlus.width) ); var scaleH = ((curH / enterPlus.height) ); scale = scaleW 0 && (enterPlus.mobile || scale < 1)) { scale = "scale(" + scale + "," + scale + ")"; enterPlus.div.style.transform = scale; enterPlus.div.style["-webkit-transform"] = scale; enterPlus.div.style["-moz-transform"] = scale; enterPlus.div.style["-o-transform"] = scale; enterPlus.div.style["-ms-transform"] = scale; } } } this.open = function () { if(!exorn_showing){ if (enterPlus.maxSessionShows > 0) { finData.setData(enterPlus.key, enterPlus.sessionShows + 1); } enterPlus.handleScroll(); enterPlus.handleResize(); enterPlus.handleWindow(); enterPlus.handleScale(); finLib.getBody().appendChild(enterPlus.divDim); finLib.getBody().appendChild(enterPlus.div); enterPlus.initWindow(); } } this.close = function () { enterPlus.uninitWindow(); enterPlus.divDim.style.display = "none"; enterPlus.div.style.display = "none"; } this.init = function () { if (enterPlusProperties && enterPlusProperties.width && enterPlusProperties.height && enterPlusProperties.url){ enterPlus.width = enterPlusProperties.width; enterPlus.height= enterPlusProperties.height; enterPlus.url = enterPlusProperties.url; if(typeof enterPlusProperties.key !== 'undefined'){ enterPlus.key = enterPlusProperties.key; } if(typeof enterPlusProperties.mobile !== 'undefined'){ enterPlus.mobile = enterPlusProperties.mobile; } if(typeof enterPlusProperties.maxSessionShows !== 'undefined'){ enterPlus.maxSessionShows = enterPlusProperties.maxSessionShows; } if(typeof enterPlusProperties.dim !== 'undefined'){ enterPlus.dim = enterPlusProperties.dim; } if(typeof enterPlusProperties.time !== 'undefined'){ enterPlus.time = enterPlusProperties.time; } if(typeof enterPlusProperties.timeout !== 'undefined'){ enterPlus.timeout = enterPlusProperties.timeout; } if(typeof enterPlusProperties.relative !== 'undefined'){ enterPlus.relative = enterPlusProperties.relative; } if(typeof enterPlusProperties.margin !== 'undefined'){ enterPlus.margin = enterPlusProperties.margin; } if(typeof enterPlusProperties.padding !== 'undefined'){ enterPlus.padding = enterPlusProperties.padding; } finLib.ready(function () { enterPlus.initEnter(); }); }else{ setTimeout(function(){enterPlus.init()}, 100); } } setTimeout(function () { enterPlus.init() }, 100); }); var enterPlusProperties; enterPlusProperties = { width:550, height:480, url:"http://tpn134.com/res/enterplus/banners/skin_5_01/banner_550_480.php?aid=330&sid=fsu36jjgiia4crfp2ahld3mk44&coname=Nasdaq", key:"enterShown_330", mobile:false, maxSessionShows:1, dim:true, time:4000, timeout:90000, relative:true, margin:true, padding:true };