Advertisement
Guest User

Untitled

a guest
Dec 5th, 2010
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var fourtyone = {
  2.     smrTime: new Date(2005, 0, 15).getTimezoneOffset(),
  3.     wntrTime: new Date(2005, 6, 15).getTimezoneOffset(),
  4.     comps: [],
  5.     comp: null,
  6.     setDoc: function (element) {
  7.         var rslt = null;
  8.         try {
  9.             rslt = document.getElementById(element);
  10.         } catch (e) {}
  11.         if (rslt == null || typeof(rslt) == 'undefined') {
  12.             try {
  13.                 rslt = document.getElementsByName(element)[0];
  14.             } catch (e) {}
  15.         }
  16.         if (rslt == null || typeof(rslt) == 'undefined') {
  17.             for (x = 0; x < document.forms.length; x++) {
  18.                 var currForm = document.forms[x];
  19.                 for (y = 0; y < currForm.elements.length; y++) {
  20.                     var currElement = currForm[y];
  21.                     if (currElement.name == element || currElement.id == element) {
  22.                         return currElement;
  23.                     }
  24.                 }
  25.             }
  26.         }
  27.         return rslt;
  28.     },
  29.     evl: function (id) {
  30.         var rslt = "";
  31.         try {
  32.             if (this.comp == null) {
  33.                 this.comp = this.setDoc("clientCapsRef");
  34.             }
  35.             if (typeof(this.comp.getComponentVersion) != 'undefined') rslt = this.comp.getComponentVersion(id, "ComponentID");
  36.         } catch (e) {
  37.             var len = e.message.length;
  38.             len = (len > 40 ? 40 : len);
  39.             rslt = escape(e.message.substr(0, len));
  40.         }
  41.         return rslt;
  42.     },
  43.     exec: function (possibles) {
  44.         for (var i = 0; i < possibles.length; i++) {
  45.             try {
  46.                 var val = eval(possibles[i]);
  47.                 if (val) return val;
  48.             } catch (e) {}
  49.         }
  50.         return "";
  51.     },
  52.     loadComps: function () {
  53.         var comps = ["Acrobat", "Flash", "QuickTime", "Java Plug-in", "Director", "Office"];
  54.         var activeX = {
  55.             "Flash": ["ShockwaveFlash.ShockwaveFlash", function (ax) {
  56.                 return ax.getVariable("$version");
  57.             }],
  58.             "Director": ["SWCtl.SWCtl", function (ax) {
  59.                 return ax.ShockwaveVersion("");
  60.             }]
  61.         }
  62.         for (var i = 0; i < comps.length; i++) {
  63.             var name = comps[i];
  64.             var version = "";
  65.             try {
  66.                 if (navigator.plugins && navigator.plugins.length) {
  67.                     var regex = new RegExp(name + ".* ([0-9._]+)");
  68.                     for (var j = 0; j < navigator.plugins.length; j++) {
  69.                         var match;
  70.                         if (match = regex.exec(navigator.plugins[j].name)) {
  71.                             version = match[1];
  72.                         } else if (match = regex.exec(navigator.plugins[j].description)) {
  73.                             version = match[1];
  74.                         }
  75.                     }
  76.                 } else if (window.ActiveXObject && activeX[name]) {
  77.                     try {
  78.                         var ax = new ActiveXObject(activeX[name][0]);
  79.                         version = activeX[name][1](ax);
  80.                     } catch (e) {
  81.                         version = "";
  82.                     }
  83.                 }
  84.             } catch (e) {
  85.                 version = e.message;
  86.             }
  87.             fourtyone.comps[name] = version;
  88.         }
  89.     },
  90.     getTimeZn: function () {
  91.         return Math.abs(this.smrTime - this.wntrTime);
  92.     },
  93.     isSummer: function () {
  94.         return (this.getTimeZn() != 0);
  95.     },
  96.     isWinter: function (date) {
  97.         var minOffset = Math.min(this.smrTime, this.wntrTime);
  98.         return (this.isSummer() && date.getTimezoneOffset() == minOffset);
  99.     },
  100.     getDayOfYr: function (str) {
  101.         var result = 0;
  102.         var latencyFactor = 0;
  103.         if (this.isWinter(str)) {
  104.             latencyFactor = this.getTimeZn();
  105.         }
  106.         result = -(str.getTimezoneOffset() + latencyFactor) / 60.0;
  107.         return result;
  108.     },
  109.     currDate: function () {
  110.         return new Date(2005, 5, 7, 21, 33, 44, 888).toLocaleString();
  111.     },
  112.     userPrefs: function (debug) {
  113.         this.debug = debug;
  114.         var str = new Date();
  115.         var arr = new Array("\"TF1\"", "\"014\"", "ScriptEngineMajorVersion()", "ScriptEngineMinorVersion()", "ScriptEngineBuildVersion()", "fourtyone.evl('{7790769C-0471-11D2-AF11-00C04FA35D02}')", "fourtyone.evl('{89820200-ECBD-11CF-8B85-00AA005B4340}')", "fourtyone.evl('{283807B5-2C60-11D0-A31D-00AA00B92C03}')", "fourtyone.evl('{4F216970-C90C-11D1-B5C7-0000F8051515}')", "fourtyone.evl('{44BBA848-CC51-11CF-AAFA-00AA00B6015C}')", "fourtyone.evl('{9381D8F2-0288-11D0-9501-00AA00B911A5}')", "fourtyone.evl('{4F216970-C90C-11D1-B5C7-0000F8051515}')", "fourtyone.evl('{5A8D6EE0-3E18-11D0-821E-444553540000}')", "fourtyone.evl('{89820200-ECBD-11CF-8B85-00AA005B4383}')", "fourtyone.evl('{08B0E5C0-4FCB-11CF-AAA5-00401C608555}')", "fourtyone.evl('{45EA75A0-A269-11D1-B5BF-0000F8051515}')", "fourtyone.evl('{DE5AED00-A4BF-11D1-9948-00C04F98BBC9}')", "fourtyone.evl('{22D6F312-B0F6-11D0-94AB-0080C74C7E95}')", "fourtyone.evl('{44BBA842-CC51-11CF-AAFA-00AA00B6015B}')", "fourtyone.evl('{3AF36230-A269-11D1-B5BF-0000F8051515}')", "fourtyone.evl('{44BBA840-CC51-11CF-AAFA-00AA00B6015C}')", "fourtyone.evl('{CC2A9BA0-3BDD-11D0-821E-444553540000}')", "fourtyone.evl('{08B0E5C0-4FCB-11CF-AAA5-00401C608500}')", "navigator.appCodeName", "navigator.appName", "navigator.appVersion", "fourtyone.exec(['navigator.productSub','navigator.appMinorVersion'])", "navigator.browserLanguage", "navigator.cookieEnabled", "fourtyone.exec(['navigator.oscpu','navigator.cpuClass'])", "navigator.onLine", "navigator.platform", "navigator.systemLanguage", "navigator.userAgent", "fourtyone.exec(['navigator.language','navigator.userLanguage'])", "document.defaultCharset", "document.domain", "screen.deviceXDPI", "screen.deviceYDPI", "screen.fontSmoothingEnabled", "screen.updateInterval", "fourtyone.isSummer()", "fourtyone.isWinter(str)", "'@UTC@'", "fourtyone.getDayOfYr(str)", "fourtyone.currDate()", "screen.width", "screen.height", "fourtyone.comps['Acrobat']", "fourtyone.comps['Flash']", "fourtyone.comps['QuickTime']", "fourtyone.comps['Java Plug-in']", "fourtyone.comps['Director']", "fourtyone.comps['Office']", "(new Date().getTime()) - str.getTime()", "fourtyone.smrTime", "fourtyone.wntrTime", "str.toLocaleString()", "screen.colorDepth");
  116.         fourtyone.loadComps();
  117.         this.rslt = ""
  118.         for (i = 0; i < arr.length; i++) {
  119.             if (this.debug) {
  120.                 this.rslt += arr[i].replace(/[\'\"]/g, "'");
  121.                 this.rslt += "="
  122.             }
  123.             try {
  124.                 tmp = eval(arr[i]);
  125.             } catch (e) {
  126.                 tmp = "";
  127.             }
  128.             this.rslt += (this.debug ? tmp : escape(tmp));
  129.             this.rslt += ";";
  130.             if (this.debug) {
  131.                 this.rslt += "\\n";
  132.             }
  133.         }
  134.         this.rslt = this.rslt.replace(escape('@UTC@'), new Date().getTime());
  135.         this.encodeData = new Function("return '" + this.rslt + "'");
  136.     },
  137.     collect: function (name) {
  138.         try {
  139.             var element = null;
  140.             element = this.setDoc(name);
  141.             if (element == null) return;
  142.             try {
  143.                 var prefs = new this.userPrefs();
  144.                 element.value = prefs.encodeData();
  145.             } catch (e) {
  146.                 element.value = escape(e.message);
  147.             }
  148.         } catch (e) {}
  149.     }
  150. }
  151. var fortyone = fourtyone;
  152.  
  153. function fortyone_collect(name) {
  154.     return fortyone.collect(name);
  155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement