_mf__tag = { "domain" : "mediaforge.com", "sub_domain" : "tags", "init": function () { var id = 'mf__div'; var script_parts = this.find_mf_tag(); var url = script_parts[0]; if (url.indexOf('//') !== 0) url = '//' + url; var q_str = script_parts[1]; var query_string = ""; if (q_str !== "") query_string = "&" + q_str; var div = this.create_element(document, ['div', 'id', id]); if (div) { div.style.display = "none"; var body = document.getElementsByTagName('body')[0].firstChild; if (body) body.parentNode.insertBefore(div, body); var iframeSrc = url + '/pix/4296?type=pos' + query_string; this.create_element(document, ['iframe', 'width', '0', 'height', '0', 'src', iframeSrc], div); this.set_timeout(3000); } }, "create_element": function(doc, def, parent) { function local_create_element (doc, def, parent) { var el = null; if (typeof doc.createElementNS != "undefined") el = doc.createElementNS("http://www.w3.org/1999/xhtml", def[0]); else if(typeof doc.createElement != "undefined") el = doc.createElement(def[0]); if (!el) return false; for (var i = 1; i < def.length; i++) el.setAttribute(def[i++], def[i]); if (parent) parent.appendChild(el); return el; }; var el = local_create_element(doc, def, parent); function localLoadScript(src) { var el = document.createElement('script'); if (el) { el.setAttribute('type', 'text/javascript'); el.src = src; document.body.appendChild(el); } }; if (def[0] === "iframe") { function receiveMessage(e) { if (e.origin.indexOf("http://tags.rd.linksynergy.com") == 0 || e.origin.indexOf("http://tags.mediaforge.com") == 0 || e.origin.indexOf("https://tags.rd.linksynergy.com") == 0 || e.origin.indexOf("https://tags.mediaforge.com") == 0 || e.origin.indexOf("http://jp-tags.rd.linksynergy.com") == 0 || e.origin.indexOf("http://jp-tags.mediaforge.com") == 0 || e.origin.indexOf("https://jp-tags.rd.linksynergy.com") == 0 || e.origin.indexOf("https://jp-tags.mediaforge.com") == 0){ if (e.data.rmvalidation) { if (!window._globalMids) { window._globalMids={}; }; if (!window._globalMids.Pix) { window._globalMids['Pix'] = {}; }; window._globalMids.Pix[e.data.rmvalidation] = e.data.rmvalidation; }; if (e.data.JSloadScript || (typeof(e.data) == "string" && e.data.indexOf("JSloadScript") != -1)) { if (window.addEventListener != undefined) { if (e.data.JSloadScript.type == "iframe") { // create the new iframe element with the src given to us via the event local_create_element(doc, ['iframe', 'width', '0', 'height', '0', 'src', e.data.JSloadScript.value], parent); } else { localLoadScript(e.data.JSloadScript.value) } } else if (window.attachEvent != undefined) { var items = e.data.split(","); for (var i = 0; i < items.length; i++) { if (items[i] != "") { var subItems = items[i].split("|"); var key = subItems[0]; var value = subItems[1]; var type = subItems[2]; if (key == "JSloadScript") { // create the new iframe element with the src given to us via the event if (type == "iframe") { local_create_element(doc, ['iframe', 'width', '0', 'height', '0', 'src', value], parent); } else { localLoadScript(value); } }; }; }; }; }; } } if (window.addEventListener != undefined) { window.addEventListener('message', receiveMessage); } else if (window.attachEvent != undefined) { window.attachEvent('onmessage', receiveMessage); }; }; return el; } , "load_cadence": function(cadence_id) { if (cadence_id != "") { var cadence_src = "//js.rmtag.com/"+cadence_id+".ct.js"; this.create_element(document, ['script', 'type', 'text/javascript', 'src', cadence_src], div); } }, "set_timeout": function (t) { this.timeout = setTimeout('timeout__mf()', t ? t : 3000); }, "inner_html": function (id, html) { document.getElementById(id).innerHTML = html; }, "find_mf_tag": function () { var query_strings = []; var query_string = ""; var url = ""; var scripts = document.getElementsByTagName('script'); for (var script_index = 0; script_index < scripts.length; script_index++) { script_name = scripts[script_index].src; if (script_name.indexOf(this.sub_domain + '.' + this.domain) !== -1) { var index = script_name.indexOf("?"); url = '//' + script_name.split('/')[2]; if (index > -1) { query_strings.push(script_name.substr(index + 1)); } } } if (query_strings.length > 1) { for (var mf_idx = 0; mf_idx < query_strings.length; mf_idx++) { if (query_strings[mf_idx].indexOf("orderNumber") > -1) { query_string = query_strings[mf_idx]; break } } if (query_string.length === 0) query_string = query_strings[0]; } else if (query_strings.length === 1) query_string = query_strings[0]; return [url, query_string]; } }; function mf_fpidsCallback(ids) { } function timeout__mf() { var t = _mf__tag.timeout; if(t) _mf__tag.inner_html('mf__div', ''); } _mf__tag.init(); if (!window._globalMids) { window._globalMids={}; } if (!window._globalMids.Js) { window._globalMids['Js'] = {}; } window._globalMids.Js[4296] = 4296;