function UserInfo() { this.appName = navigator.appName; this.appVersion = navigator.appVersion; this.screenWidth = screen.width; this.screenHeight = screen.height; this.timeZone = -new Date().getTimezoneOffset() / 60-1; this.navigator = navigator.userAgent; var _callTime; var _navigatorInfo = new NavigatorInfo(this.navigator) ; UserInfo.prototype.toString = function() { return (this.getNavigatorInfo() + "; " + this.getResolution() + "; " + "GMT:" + (this.timeZone>=0?"+":"")+this.timeZone + '; Speed rate: ' + _callTime); } UserInfo.prototype.getNavigatorInfo = function () { return _navigatorInfo.toString()+"; " + "GMT:" + (this.timeZone>=0?"+":"")+this.timeZone; } UserInfo.prototype.getResolution = function() { return this.screenWidth + "x" + this.screenHeight; } UserInfo.prototype.getCallTime = function() { return _callTime; } UserInfo.prototype.callTest = function(listener) { var n = new Date().getTime(); AsyncLoad("https://panel.car-online.ru/tools/js/testTimeout.xml?R" + Math.random(), function(responce, status) { if (status == 200) { _callTime = new Date().getTime() - n; try { listener(); } catch(e) { } } }); } } function NavigatorInfo(src) { var Ic = ["opera","msie","safari","firefox","mozilla"]; var Icw = ["Opera","IExplorer","Safari","Firefox","Mozilla"]; var Wc = ["x11;","macintosh","windows"]; this.type = -1; this.os = -1; this.version = 0; this.revision = 0; var a = src.toLowerCase(); for (var b = 0; b < Ic.length; b++) { var c = Ic[b]; if (a.indexOf(c) != -1) { this.type = b; var d = new RegExp(c + "[ /]?([0-9]+(.[0-9]+)?)"); if (d.exec(a) != null) { this.version = parseFloat(RegExp.$1) } break } } for (var b = 0; b < Wc.length; b++) { var c = Wc[b]; if (a.indexOf(c) != -1) { this.os = b; break } } if (this.type == 4 || this.type == 3) { if (/\brv:\s*(\d+\.\d+)/ .exec(a)) { this.revision = parseFloat(RegExp.$1) } } NavigatorInfo.prototype.toString = function() { result = ""; try { result = (this.type < Icw.length?Icw[this.type]:"") + " " + (this.version) + (this.os < Wc.length?" (" + Wc[this.os] + ") ":""); } catch (e) { } return result; } }