_auth.init(); _nav.updatePageLinks(); _ttText.Update(); _controls.subscribe(); jm.el('main_ButtomEmail_div').innerHTML = '\u003C\u0061\u0020\u0068\u0072' + '\u0065\u0066\u003D\u0022\u006D\u0061\u0069' + '\u006C\u0074\u006F\u003A\u0073\u0075\u0070\u0070\u006F\u0072\u0074\u0040\u0072\u0075\u0076\u0064\u0073\u002E\u0063\u006F\u006D\u0022\u0020\u0073\u0074\u0079\u006C\u0065\u003D\u0022\u0066\u006F\u006E\u0074\u002D\u0073\u0069\u007A\u0065\u003A' + '\u0031\u0036\u0070\u0078\u003B\u0022\u003E\u0073\u0075\u0070\u0070' + '\u006F\u0072\u0074\u0040\u0052\u0055\u0056\u0044\u0053\u002E\u0063\u006F\u006D\u003C\u002F' + '\u0061\u003E'; function _updateBottomEmail() { var contactEmailDiv = jm.el('mail_Email_div'); if (contactEmailDiv) contactEmailDiv.innerHTML = '\u003C\u0061\u0020\u0068\u0072\u0065' + '\u0066\u003D\u0022\u006D\u0061\u0069\u006C\u0074\u006F\u003A' + '\u0073\u0075\u0070\u0070\u006F\u0072\u0074\u0040\u0072\u0075\u0076\u0064\u0073\u002E\u0063\u006F\u006D\u0022\u0020' + '\u0063\u006C\u0061\u0073\u0073\u003D\u0022\u006C\u0069\u006E\u006B\u0032\u0022\u0020' + '\u0073\u0074\u0079\u006C\u0065\u003D\u0022\u0063\u006F\u006C\u006F\u0072\u003A\u0023\u0030\u0030\u0030\u0030\u0030\u0030\u003B\u0022\u003E\u0073' + '\u0075\u0070\u0070\u006F\u0072\u0074\u0040\u0072\u0075\u0076' + '\u0064\u0073\u002E\u0063\u006F\u006D\u003C\u002F\u0061\u003E'; } _updateBottomEmail(); _controls.tb.help.create("blog_Search_tb", { width: 633, value: jm.URL.QueryString("text", true), helpValue: "Поиск по содержанию", maxLength: 100, autocomplete: "off", addStyle: "border:none;background-image:url(/img/blog/magnifier.png);background-position:right 5px;background-repeat:no-repeat;", activeStyle: "border:none;background-image:url(/img/blog/magnifier.png);background-position:right -95px;background-repeat:no-repeat;" }); function _updateCenterMargin() { var centerEl = document.getElementsByClassName("centerDiv"); if (centerEl && centerEl.length > 0) for (var n in centerEl) { var el = centerEl[n]; if (el && el.style) el.style.marginTop = _auth.user ? '62px' : '32px'; } var blogSearhTable = jm.el("blog_Search_table"); if (blogSearhTable) { blogSearhTable.style.transition = "all 0.5s linear"; blogSearhTable.style.marginTop = _auth.user ? '32px' : '0px'; setTimeout(function () { blogSearhTable.transition = "all 0.2s linear"; }, 500); } } function _checkTwoFactorAuthMsg() { var bodyDiv = jm.el("main_Content_div"); if (!bodyDiv) return; if (!_auth.user || _auth.user && _auth.user.tfa) { var tfw = bodyDiv.getElementsByClassName("twoFactorAuthWarning"); if (tfw && tfw.length > 0) tfw[0].style.display = "none"; } else if (_auth.user && !_auth.user.tfa) { var tfw = bodyDiv.getElementsByClassName("twoFactorAuthWarning"); if (!tfw || tfw.length == 0) { var cDiv = bodyDiv.getElementsByClassName("centerDiv"); if (cDiv && cDiv.length > 0 && cDiv[0].childNodes && cDiv[0].childNodes.length > 0) { var wd = document.createElement('div'); wd.className = "twoFactorAuthWarning"; wd.innerHTML = 'Двухфакторная аутентификация отключена! Повысить безопасность аккаунта ›'; cDiv[0].insertBefore(wd, cDiv[0].childNodes[0]); } } else tfw[0].style.display = ""; } } _checkTwoFactorAuthMsg(); jm.Window.Document.SubscriptionScrollX["mainBody"] = function (xOffset) { jm.el("main_Header_div").style.marginLeft = "-" + xOffset + "px"; jm.el("main_HeaderMenu_div").style.marginLeft = "-" + xOffset + "px"; }; jm.Window.Document.SubscriptionScrollY["mainBody"] = function (yOffset) { jm.el("main_Header_div").className = yOffset >= 40 ? "header header_min" : "header"; jm.el("main_Header_div").style.marginTop = (yOffset < 40 ? -yOffset : 0) + "px"; jm.el("main_HeaderMenu_div").style.marginTop = ((_auth.user ? 90 : 55) - (yOffset < 40 ? yOffset : 40)) + "px"; }; var MainBanner = function () { return this; } MainBanner.Obj = MainBanner.prototype = { skip: 0, count: 7, init: function () { setInterval(function () { var selN = 0; for (var a = 0; a < _mainBanner.count; a++) { var div = jm.el("main_BannerSel" + a + "_div"); if (div.className == "sel") { selN = a; break; } } if (selN >= _mainBanner.count - 1) selN = -1; _mainBanner.sel(selN + 1); }, 10000); }, sel: function (n, hand) { if (hand) _mainBanner.skip = 4; else if (_mainBanner.skip > 0) { _mainBanner.skip--; return; } for (var a = 0; a < _mainBanner.count; a++) { var table = jm.el("main_Banner" + a + "_table"), div = jm.el("main_BannerSel" + a + "_div"); table.style.opacity = a == n ? 1 : 0; div.className = a == n ? "sel" : ""; } setTimeout(function () { for (var a = 0; a < _mainBanner.count; a++) { var table = jm.el("main_Banner" + a + "_table"), div = jm.el("main_BannerSel" + a + "_div"); table.style.zIndex = div.className == "sel" ? 1 : 0; } }, 1000); } }; var _mainBanner = new MainBanner(); _mainBanner.init(); function _isMainPage() { var url = jm.URL.Manager.Get(); url = jm.URL.Manager._removeLocale(url); return !url || url == "" || url == "/" || url.substring(0, 8).toLowerCase() == "/pricing"; } function _isDCPage() { var url = jm.URL.Manager.Get(); url = jm.URL.Manager._removeLocale(url); return url && (url == "/dc/swiss" || url == "/dc/rus" || url == '/data' || url == '/data/rus' || url == '/data/swis'); } function _mainNavigate(name) { var speed = 500, main = _isMainPage(); if (main && !_mainCanUpdateHeader) return; var urlPrefix = main && jm.Data["MainPage"] && jm.Data["MainPage"].isPricing ? "/pricing" : ""; _nav.go(urlPrefix + (name.length == 0 ? "" : ("#" + name)), true); if (!main) return; _mainCanUpdateHeader = false; if (name == "order") { speed = 500 * Math.abs(2 - _mainHeaderSelectedItem); $('html, body').animate({ scrollTop: jm.gDim('main_Conf_container').Top - 100 }, speed); _mainHeaderSelectedItem = 2; } else if (name == "advantages") { speed = 500 * Math.abs(3 - _mainHeaderSelectedItem); $('html, body').animate({ scrollTop: jm.gDim('main_Advantages_h2').Top - 100 }, speed); _mainHeaderSelectedItem = 3; } else if (name == "partners") { speed = 500 * Math.abs(4 - _mainHeaderSelectedItem); $('html, body').animate({ scrollTop: jm.gDim('main_Partners_h2').Top - 100 }, speed); _mainHeaderSelectedItem = 4; } else if (name == "contacts") { speed = 500 * Math.abs(5 - _mainHeaderSelectedItem); $('html, body').animate({ scrollTop: jm.gDim('main_Contacts_h2').Top - 100 }, speed); _mainHeaderSelectedItem = 5; } else { speed = 500 * Math.abs(1 - _mainHeaderSelectedItem); $('html, body').animate({ scrollTop: 0 }, speed); _mainHeaderSelectedItem = 1; } setTimeout(function () { _mainCanUpdateHeader = true; }, speed + 100); } function _updateMainScroll() { setTimeout(function () { var pageName = window.location.hash.Replace("#", ""); if (pageName && pageName.length > 0) pageName = pageName.toLowerCase(); if (pageName == "order") { _mainHeaderSelectedItem = 2; jm.Window.ScrollTo(0, jm.gDim('main_Conf_container').Top - 100, 0); } else if (pageName == "advantages") { _mainHeaderSelectedItem = 3; jm.Window.ScrollTo(0, jm.gDim('main_Advantages_h2').Top - 100, 0); } else if (pageName == "partners") { _mainHeaderSelectedItem = 4; jm.Window.ScrollTo(0, jm.gDim('main_Partners_h2').Top - 100, 0); } else if (pageName == "contacts") { _mainHeaderSelectedItem = 5; jm.Window.ScrollTo(0, jm.gDim('main_Contacts_h2').Top - 100, 0); } else _mainHeaderSelectedItem = 1; }, 20); } if (_isMainPage()) _updateMainScroll(); else _mainHeaderSelectedItem = 1; var _feedback = { _captchaId: null, _closeConfirmed: false, _supportRequest: true, _updateCode: function (captchaId) { _feedback._captchaId = captchaId; var td = jm.el("feedback_CodeImg_td"), tb = jm.el("feedback_CodeTB_div_tb"); if (td) td.innerHTML = '
Показать другой код
'; if (tb) { tb.value = ""; _controls.tb.help.update("feedback_CodeTB_div"); } _ttText.Update(); }, _getHtmlBody: function () { return '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
'; }, _completeHtmlBody: function (nameWidth, subjectWidth, emailWidth, phoneWidth, bodyWidth) { var contry = _auth.user && _auth.user.countryId > 0 ? _getCountryById(_auth.user.countryId) : null; _controls.tb.help.create("feedback_Name_div", { width: nameWidth > 0 ? nameWidth : 360, value: _auth.user ? (_auth.user.firstName ? _auth.user.firstName : "") + (_auth.user.lastName ? (_auth.user.firstName ? " " : "") + _auth.user.lastName : "") : "", helpValue: "Ваше имя" }); _controls.tb.help.create("feedback_Email_div", { width: emailWidth > 0 ? emailWidth : 360, value: _auth.user ? _auth.user.email : "", helpValue: "Ваш e-mail (example@email.com)" }); _controls.tb.help.create("feedback_Phone_div", { width: phoneWidth > 0 ? phoneWidth : 360, value: _auth.user && _auth.user.phone ? (contry ? "+" + contry[2] + " " : "+7 ") + _auth.user.phone.FormatPhone() : "", helpValue: "Телефон (не обязательно)" }); _controls.tb.help.create("feedback_Subject_div", { width: subjectWidth > 0 ? subjectWidth : 360, helpValue: _feedback._supportRequest ? "Тема сообщения (не обязательно)" : "Ваш сайт (https://ruvds.com, не обязательно)" }); _controls.tb.help.create("feedback_Body_div", { width: bodyWidth ? bodyWidth : 360, height: 120, helpValue: "Текст сообщения", multiline: true }); _controls.tb.help.create("feedback_CodeTB_div", { width: 110, helpValue: "Введите код", maxLength: 10, autocomplete: "off" }); _feedback._updateCode(jm.Random.Guid()); }, show: function (supportRequest) { _feedback._supportRequest = supportRequest; _feedback._closeConfirmed = false; _controls.windows.create("feedback", { width: 500, title: supportRequest ? "Обратная связь" : "Добавить отзыв", body: '
' + _feedback._getHtmlBody() + '
', onCreate: _feedback._completeHtmlBody, onClose: function (actionSource) { if (_feedback._closeConfirmed || actionSource != _controls.windows.actionSource.bgClick && actionSource != _controls.windows.actionSource.esc) return true; var body = jm.el("feedback_Body_div_tb").value.Trim(), code = jm.el("feedback_CodeTB_div_tb").value.Trim(); if (body == '' && code == '') return true; _controls.messageBox.show("Подтверждение", "
Вы действительно хотите закрыть это окно?
Вся введённая информация будет потеряна!
", _controls.messageBox.button.yes_no, _controls.messageBox.icon.question, 600, null, function (r) { _feedback._closeConfirmed = r == _controls.messageBox.dialogResult.yes; if (_feedback._closeConfirmed) _controls.windows.close("feedback"); }); } }); setTimeout(function () { _controls.windows.show("feedback"); }, 20); }, click: function () { var name = jm.el("feedback_Name_div_tb").value.Trim(), email = jm.el("feedback_Email_div_tb").value.Trim(), phone = jm.el("feedback_Phone_div_tb").value.Trim(), subject = jm.el("feedback_Subject_div_tb").value.Trim(), body = jm.el("feedback_Body_div_tb").value.Trim(), code = jm.el("feedback_CodeTB_div_tb").value.Trim(); var err = false; if (code.length < 6) { _controls.tb.err("feedback_CodeTB_div_tb"); err = true; } if (body == '') { _controls.tb.err("feedback_Body_div_tb"); err = true; } if (!email.ValidateEMail()) { _controls.tb.err("feedback_Email_div_tb"); err = true; } if (name == '') { _controls.tb.err("feedback_Name_div_tb"); err = true; } if (err) return; var btn = jm.el("feedback_btn"); btn.disabled = "disabled"; btn.value = "Подождите..."; jm.AJAX({ URL: "/user_SendMessage.h?fName=_feedback._result&r=" + jm.Random.Int(), Type: "post", Data: { name: name, email: email, phone: phone, subject: subject, body: body, captcha: code, captchaId: _feedback._captchaId, feedback: !_feedback._supportRequest }, Async: true, IsAnswerScript: true }); }, _result: function (rejectReason) { var btn = jm.el("feedback_btn"); if (!btn) return; btn.disabled = ""; btn.value = "Отправить"; if (rejectReason == 0) { var d1 = jm.el("feedback_Main_form"), d2 = jm.el("feedback_Sent_div"); if (d1 && d2) { d2.style.height = d1.offsetHeight + "px"; d1.style.display = "none"; d2.style.display = ""; } } else if (rejectReason == 1) _controls.tb.err("feedback_Name_div_tb"); else if (rejectReason == 2) _controls.tb.err("feedback_Email_div_tb"); else if (rejectReason == 3) _controls.tb.err("feedback_Body_div_tb"); else if (rejectReason == 4) { _feedback._updateCode(jm.Random.Guid()); _controls.tb.err("feedback_CodeTB_div_tb"); } else if (rejectReason == 5) _controls.messageBox.show("Ошибка", '
Не удалось отправить сообщение.
Попробуйте повторить попытку через пару минут или воспользуйтесь другим способом связи.
', _controls.messageBox.button.ok, _controls.messageBox.icon.error, 700); } }; if (jm.Data["HelpPage"] && jm.Data["HelpPage"].showFeedback) jm.Data["HelpPage"].showFeedback(); function _actCounter(point) { try{ if (yaCounter33905479 && yaCounter33905479.reachGoal) yaCounter33905479.reachGoal(point); }catch (ex) { } } var _blog = { search: function () { var el = jm.el("blog_Search_tb_tb"); if (!el) return; var value = el.value.Trim(), sort = jm.URL.QueryString("sort"), path = jm.URL.Manager.Get().toLowerCase(); _nav.go("/vps/" + (path.length >= 11 && path.substring(0, 11) == "/blog/video" ? "video" : "list") + "?sort=" + jm.Text.Escape(sort) + "&text=" + jm.Text.Escape(value)); }, checkUrl: function () { var searchEl = jm.el("blog_Search_tb_tb"); if (!searchEl) return; searchEl.value = jm.URL.QueryString("text", true); _controls.tb.help.update("blog_Search_tb"); } } _blog.checkUrl(); if (window.self !== window.top) { var mainElements = document.getElementsByClassName("mainP"); if (mainElements != null && mainElements.length > 0) for (var n = 0; n < mainElements.length; n++) mainElements[n].style.display = "none"; setTimeout(function () { document.body.style.backgroundImage = "url(/img/fake.png)"; }, 2000); try { window.top.location = "https://ruvds.com"; } catch (ex) { } } //# sourceURL=/common.js var _pingTest = { correctPageCheckInterval: null, updatePageDataInderval: null, ws: { rus: null, swiss: null }, tmpParams: { rus: null, swiss: null }, result: { rus: [], swiss: [] }, _sendSwiss: function () { _pingTest.tmpParams.swiss = { requestId: jm.Random.Int(), sendDT: new Date() }; _pingTest.ws.swiss.Send('{"type":"ping","requestId":' + _pingTest.tmpParams.swiss.requestId + '}'); }, _sendRus: function () { _pingTest.tmpParams.rus = { requestId: jm.Random.Int(), sendDT: new Date() }; _pingTest.ws.rus.Send('{"type":"ping","requestId":' + _pingTest.tmpParams.rus.requestId + '}'); }, init: function () { if (_pingTest.updatePageDataInderval) window.clearInterval(_pingTest.updatePageDataInderval); _pingTest.updatePageDataInderval = window.setInterval(function () { var rSpan = jm.el('main_DcBanner_RusDelay_span'), sSpan = jm.el('main_DcBanner_SwissDelay_span'), rDiv = jm.el('main_DcBanner_RusDelay_div'), sDiv = jm.el('main_DcBanner_SwissDelay_div'); if (_pingTest.result.swiss.length > 0 && sSpan) { var val = jm.Math.Min(_pingTest.result.swiss); if (sSpan.innerHTML != val) { sSpan.innerHTML = val; sDiv.style.display = "block"; } } if (_pingTest.result.rus.length > 0 && rSpan) { var val = jm.Math.Min(_pingTest.result.rus); if (rSpan.innerHTML != val) { rSpan.innerHTML = val; rDiv.style.display = "block"; } } }, 500); if (_pingTest.result.rus.length > 0 || _pingTest.result.swiss.length > 0 || _pingTest.ws.rus || _pingTest.ws.swiss) return; if (_pingTest.correctPageCheckInterval) window.clearInterval(_pingTest.correctPageCheckInterval); _pingTest.correctPageCheckInterval = window.setInterval(function () { if (_isMainPage() || _isDCPage()) { window.clearInterval(_pingTest.correctPageCheckInterval); _pingTest.correctPageCheckInterval = null; _pingTest.ws.swiss = new jm.WebSocket("wss://swiss-ping-test.ruvds.com:28789/", { reconnect: false, reconnectInterval: 3000, heartBeat: { interval: 20000, message: '{"type":"heartbeat"}' }, onopen: _pingTest._sendSwiss, onmessage: function (message) { var msg = JSON.parse(message); if (msg && msg.type == "ping" && _pingTest.tmpParams.swiss != null && _pingTest.tmpParams.swiss.requestId == msg.requestId) { var delay = new Date() - _pingTest.tmpParams.swiss.sendDT; if (delay > 0) _pingTest.result.swiss[_pingTest.result.swiss.length] = delay; _pingTest.tmpParams.swiss = null; if (_pingTest.result.swiss.length < 10) setTimeout(_pingTest._sendSwiss, 1000); else _pingTest.ws.swiss.Dispose(); } } }); _pingTest.ws.rus = new jm.WebSocket("wss://rus-ping-test.ruvds.com:28789/", { reconnect: false, reconnectInterval: 3000, heartBeat: { interval: 20000, message: '{"type":"heartbeat"}' }, onopen: _pingTest._sendRus, onmessage: function (message) { var msg = JSON.parse(message); if (msg && msg.type == "ping" && _pingTest.tmpParams.rus != null && _pingTest.tmpParams.rus.requestId == msg.requestId) { var delay = new Date() - _pingTest.tmpParams.rus.sendDT; if (delay > 0) _pingTest.result.rus[_pingTest.result.rus.length] = delay; _pingTest.tmpParams.rus = null; if (_pingTest.result.rus.length < 10) setTimeout(_pingTest._sendRus, 1000); else _pingTest.ws.rus.Dispose(); } } }); } }, 500); } }; _pingTest.init();