var rts_T = Math.random(); rts_T = rts_T * 100000000000000000; (function () { if (typeof (rts_currentEmbeddingNumber) === "undefined") { rts_currentEmbeddingNumber = 0; } else { rts_currentEmbeddingNumber++; } var rts_SRC = "", rts_domain = FindDomain(), rts_scriptSearch = "://" + rts_domain + "/art/js/param.aspx", p_Prot = null, d_Prot = document.location.protocol, sidx = rts_findscript(); if (sidx > -1) { var s1 = rts_getScript(sidx); rts_setParams(s1.innerHTML); var s2 = rts_getScript(sidx+1) p_Prot = s2.src.substr(0, s2.src.indexOf(":")+1); } var rts_Prot = ""; try { rts_Prot = (("https:" === p_Prot || "https:" === d_Prot) ? "https" : "http"); } catch (err) { rts_Prot = "https"; } if (rts_Prot.indexOf("http") < 0) { rts_Prot = "https"; } rts_addParam("rts_Prot", rts_Prot); rts_SRC = rts_Prot + '://' + rts_domain + '/art/s.aspx' + rts_SRC; document.write(""); function rts_setParams(s) { /// creates the params string var ls = s.split("var "); var eqIdx, n, v; for (var i = 0 ; i < ls.length ; i++) { if ((eqIdx = ls[i].indexOf("=")) != -1) { n = ls[i].substr(0, eqIdx).replace(/^\s+|\s+$/g, ""); v = ls[i].substr(eqIdx + 1, ls[i].length).replace(/^\s+|\s+$/g, ""); if (v.indexOf(";") != -1) { v = v.substring(0, v.lastIndexOf(";")); v = v.replace(/\"/g, ""); v = v.replace(/[\n\r\t\v\f]+/g, ""); } var pvalue = rts_EvalParam(s, n, v); if (pvalue != "error" && pvalue != v && pvalue.length > 0) { v = pvalue; } v = v.replace(/\|*\s*\|+$/, ""); rts_addParam(n, v); } } } function rts_EvalParam(s, n, v) { var pvalue = "error"; try { //eval(s + "\n var ep = " + n + ";"); eval("pvalue = " + n + ";"); } catch (err) { pvalue = "error"; } return pvalue.toString(); } function rts_addParam(p, pVal) { /// adds a single param, if name & value are set if (p != null && p.toString().length > 0) { if (pVal != null && pVal.toString().length > 0) { if (rts_SRC.length == 0) { rts_SRC += "?"; } else { rts_SRC += "&"; } var mesc = escape("\\\""); rts_SRC += p + "=" + escape(pVal.toString().replace(/\'/g, "").replace(/\"/g, mesc)); } } } function rts_getScript(sidx) { /// returns the declaring script's content return document.getElementsByTagName('script')[sidx]; } function rts_findscript() { var scriptBlocks = document.getElementsByTagName('script'); var foundEmbeddingNumber = -1; for (i = 0; i < scriptBlocks.length; i++) { if (rts_IsParamsJsBlock(scriptBlocks[i])) { foundEmbeddingNumber++; if (i > 0 && rts_IsValidScriptBlock(scriptBlocks[i - 1])) { if (foundEmbeddingNumber == rts_currentEmbeddingNumber) { return i - 1; } } } } return -1; } function rts_IsParamsJsBlock(scriptBlock) { var isParamsJsBlock = (scriptBlock.src.toLowerCase().indexOf(rts_scriptSearch.toLowerCase()) > -1); return isParamsJsBlock; } function rts_IsValidScriptBlock(scriptBlock) { var regSite = new RegExp(/var[\s]+site[\s]*=/); var regType = new RegExp(/var[\s]+type[\s]*=/); var isValid = false; if (scriptBlock.innerHTML.toLowerCase().match(regSite) && scriptBlock.innerHTML.toLowerCase().match(regType)) { isValid = true; } return isValid; } function FindDomain(srx) { try { var scriptSource = (function(scripts) { var scripts = document.getElementsByTagName('script'), script = scripts[scripts.length - 1]; if (script.getAttribute.length !== undefined) { return script.src; } return script.getAttribute('src', -1); }()); return scriptSource.toLowerCase().match(/https?\:\/\/(.*)\/art\/JS\/param\./i)[1]; } catch (err) { return "partners.webmasterplan.com"; } } })();