// Copyright � 2014-2016 Dynamic Web Services Inc. dba Financial Media Corp, All Rights Reserved var finDatav2 = { data: null, localStorage: null, init: function(){ this.loadLocalStorage(); this.loadData(); }, setData: function (key, value, win) { win = win || null; try { if (this.localStorage != null) { this.localStorage.setItem(key, value); } } catch (e) { } this.data[key] = value; this.saveData(win); }, loadLocalStorage: function(){ try{ this.localStorage = window.localStorage; }catch(e){} }, getData: function (key, def) { var value; try { value = (this.data && this.data[key] != null) ? this.data[key] : def; } catch (e) { } try { if (value === def && this.localStorage != null) { value = this.localStorage.getItem(key); } } catch (e) { } return value||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 = 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(); } } } }; finDatav2.init(); finDatav2.attachEventHandler(window, "unload", function () { finDatav2.saveData(); }); finDatav2.attachEventHandler(window, "beforeunload", function () { finDatav2.saveData(); }); // Copyright � 2014-2016 Dynamic Web Services Inc. dba Financial Media Corp, All Rights Reserved function carry(carrySettings) { if (carrySettings) { this.window = null; this.document = null; this.body = null; this.queryParams = null; this.dom = null; this.element = null; this.form = null; this.variableName = null; this.validateEmail = 0; this.urlParam = null; this.injectScript = null; this.oreoName = null; this.fallbackParams = ['email', 'inf_field_Email', 'Contact0Email', '[EMAIL]', 'awt_email', 'e_mail', 'contact[email]', 'cf_contact_email', 'email_addr']; this.initCarry = function () { if (this.element != null) { this.set(); } else { this.getField(); } } this.set = function () { var events = []; var objs; this.element.elements = this.getObjects(this.element) if (this.form) { objs = this.getObjects(this.form) events.push("submit"); } else { objs = this.element.elements; events.push("input", "change", "keyup", "paste"); } if (objs.length > 0) { for (i = 0; i < objs.length; i++) { if (objs[i]) { for (var k in events) { if (events.hasOwnProperty(k)) { var that = this; finDatav2.attachEventHandler(objs[i], events[k], function () { that.setField() }); } } } } } else { setTimeout(function () { this.set(); }, 1000); } } this.ready = function (func, params, context) { context = context || this; if (/in/.test(document.readyState)) { setTimeout(context.ready, 9, func, params, context); //params ? setTimeout(this.ready, 9, func, params) : setTimeout(this.ready, 9, func); } else { func(params); } } this.getDocument = function () { if (!this.document) { if (this.dom && !this.dom.objs) { document.domain = document.domain; this.dom.objs = this.getObjects(this.dom, document); for (var d in this.dom.objs) { if (this.dom.objs.hasOwnProperty(d)) { this.dom.objs[d].domain = document.domain; } } } this.document = (this.dom && this.dom.objs && this.dom.objs.length > 0 && this.dom.objs[0].contentDocument) ? this.dom.objs[0].contentDocument : document; } return this.document; } this.getWindow = function () { if (!this.window) { if (this.dom && !this.dom.objs) { this.dom.objs = this.getObjects(this.dom, document); } this.window = (this.dom && this.dom.objs && this.dom.objs.length > 0 && this.dom.objs[0].contentWindow) ? this.dom.objs[0].contentWindow : window; } return this.window; } this.getBody = function () { return this.body ? this.body : this.body = this.getDocument().body || this.getDocument().getElementsByTagName('body')[0]; } this.safePreventEvent = function (e) { if (e.preventDefault) { e.preventDefault(); } else { e.stop(); }; e.returnValue = false; e.stopPropagation(); } this.getQueryParam = function (param, def) { try { if (param != null) { if (this.queryParams == null) { this.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) { this.queryParams[pair[0]] = ""; } else if (pair.length >= 2) { this.queryParams[pair[0]] = pair[1]; } } } if (this.queryParams != null) { if (this.queryParams[param]) { return this.queryParams[param]; } else { for (p in param) { if (param.hasOwnProperty(p)) { p = param[p]; if (this.queryParams[p]) { return this.queryParams[p]; } } } } } } } catch (E) { } return def || null; } this.getElementsById = function (id, document) { document = document || this.getDocument(); const elements = [] const allElements = document.querySelectorAll('*'); for (i = 0; i < allElements.length; i++) { if (allElements[i] && ((allElements[i].id && allElements[i].id.length > 0) || (allElements[i].getAttribute('id') && allElements[i].getAttribute('id').length > 0))) { if (allElements[i].id === id || allElements[i].getAttribute('id') === id) { elements.push(allElements[i]) } } } return elements; } this.getElementsByClass = function (className, document) { document = document || this.getDocument(); const elements = []; const allElements = document.getElementsByClassName(className); for (i = 0; i < allElements.length; i++) { if (allElements[i]) { var allClasses = allElements[i].className.split(' '); for (ic = 0; ic < allClasses.length; ic++) { if (allClasses[ic] === className) { elements.push(allElements[i]); break; } } } } return elements; } this.getObjects = function (obj, document) { document = document || this.getDocument(); var objs = []; if (obj) { if (obj.id) { objs = this.concat(objs, this.getElementsById(obj.id, document)); } if (obj.name) { objs = this.concat(objs, document.getElementsByName(obj.name)); } if (obj.class) { objs = this.concat(objs, this.getElementsByClass(obj.class, document)); } } return objs; } 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.setField = function (e) { e = e || this.getWindow().event; if (e && e.type !== "submit") { this.safePreventEvent(e); } for (i = 0; i < this.element.elements.length; i++) { var value = this.element.elements[i].value; if (value.length > 0) { if(this.validateEmail==1 && !this.validateEmailValue(value)){ continue; } finDatav2.setData(this.variableName, value, this.getWindow()); if(this.oreoName){ setRC(this.oreoName, value); } break; } } this.getVariable(); return true; } this.validateEmailValue = function(email) { var reEmail = /^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/; if(email.match(reEmail)) { return true; } return false; } this.getVariable = function () { variable = this.getQueryParam(this.urlParam) || finDatav2.getData(this.variableName) || this.getQueryParam(this.fallbackParams, null); if(variable != null ){ this.getWindow()[this.variableName] = variable; return true; }else if(this.oreoName){ var that = this; getRC(this.oreoName, function(value){ that.getWindow()[that.variableName] = value; that.getField(true); }); } return false; } this.getField = function (varFound) { varFound = varFound||this.getVariable(); if (varFound) { if (this.injectScript != null) { var script = this.getDocument().createElement('script'); script.src = this.injectScript; this.getBody().appendChild(script); } else { var allElements = this.getDocument().getElementsByTagName('script'); for (i = 0; i < allElements.length; i++) { if (allElements[i] && allElements[i].src && allElements[i].src.indexOf("://tpn134.com/as/Skin/Loader?loadinfo=") > -1) { var script = allElements[i]; var src = script.src; script.parentNode.removeChild(script); script = this.getDocument().createElement('script'); script.src = src; this.getBody().appendChild(script); } } } } } this.postLocation = function () { var xhttp = new XMLHttpRequest(); var url = "https://tpn134.com/res/carry/v2/log/"; var params = "location=" + encodeURIComponent(this.getWindow().location); var sets = carrySettings ? this.serialize(carrySettings) : "na"; params += "&settings=" + encodeURIComponent(sets); xhttp.open("POST", url, true); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.send(params); } this.serialize = function (obj, parent) { obj = obj || this; parent = parent || null; var objType = typeof obj; var str = ''; if ((parent != null && obj === parent) || objType == "undefined") { str += "na"; } else if (objType == "string" || objType == "boolean" || objType == "number") { str += obj; } else { for (var o in obj) { if (obj.hasOwnProperty(o)) { if (str.length > 0) { str += '|'; } str += o + ":" + this.serialize(obj[o], obj); } } str = "{" + str + "}" } return str; } for (var s in carrySettings) { if (carrySettings.hasOwnProperty(s) && this.hasOwnProperty(s)) { this[s] = carrySettings[s]; } } this.ready(function (target) { target.initCarry(); }, this); this.ready(function (target) { target.postLocation(); }, this); } } carry_settings_59e5660faf37b = {}; carry_settings_59e5660faf37b.element = {}; carry_settings_59e5660faf37b.element.name = 'data[email]'; carry_settings_59e5660faf37b.variableName = 'overrideEmail'; carry_59e5660faf37b = new carry(carry_settings_59e5660faf37b);