Понравилась идея о том, чтобы использовать IPython Notebook для настройки XPath запросов. Это можно делать при помощи объектов lxml, requests. Здесь я успешно опробовал работу связки и распечатал справки по объектам. Нашел ссылки на справочники, после беглого прочтения пришел к выводу, что обе библиотеки не только похожи на объекты Scrapy, но могут быть использованы для экспресс- скрапинга.
Вместо ожидаемой загрузилась не та страница. Причем я это не сразу проверил, а только после того, как начал искать причину, почему не работают XPath запросы. Об requests надо сделать отдельный пост. Я эту библиотеку прошлой весной не забраковал, но предпорчел ей Scrapy. Теперь обнаружил, что объектная модель и принципы работы очень поожи на Scrapy...
from lxml import html
import requests
page = requests.get('https://cars.mail.ru/catalog/bmw/3/f30_31/sedan/index.html')
page.headers
{'content-encoding': 'gzip', 'transfer-encoding': 'chunked', 'server': 'nginx', 'connection': 'keep-alive', 'date': 'Wed, 14 Jan 2015 17:33:14 GMT', 'content-type': 'text/html; charset=utf-8'}
page.request.headers
{'Connection': 'keep-alive', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'User-Agent': 'python-requests/2.5.1 CPython/2.7.5 Windows/8'}
Чтобы проверить, загрузилась ли страница, я использовал метод page.text, в результате распечатался html-текст страницы, он в самом конце поста в последнем приложении. Поиск в рачспечатке классов, используемых в XPath запросах ниже не дал результатов... Но, не буду забегать вперед, а сделаю вид, что я еще не знаю, что загрузил не ту страницу (я бы тоже не стал сотрудничать с таким 'User-Agent': 'python-requests/2.5.1 CPython/2.7.5 Windows/8')
Далее пытаюсь повторить последовательноть команд из поста
tree=html.fromstring(page.text)
У объекта html есть метод xpath. Он то нам и нужен
help(tree.xpath)
Help on built-in function xpath: xpath(...) xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables) Evaluate an xpath expression using the element as context node.
Пытаемся повторить код из статьи, мы вот в этом месте "tree now contains the whole HTML file in a nice tree structure which we can go over two different ways: XPath and CSSSelect. In this example, we will focus on the former"
При помощи Firebug я нашел в свое время вот такие запросы
//div[@class="catalog-age__mod__item__box"]
//div[@class="catalog-age__mod__item__note"]
#- Автомат, задний привод, бензин, 9.2 с до 100 км/ч
//div[@class="catalog-age__mod__item__type__text catalog-age__mod__item__type__text_hp"]
#136 л.с.
//a[@class="catalog-age__mod__item__type__link"]/text()
//a[@class="catalog-age__mod__item__type__link"]/@href
//a[@class="catalog-age__mod__item__equip clear"]
Пробуем применит их к загруженнойй странице и видим пустые списки
#This will create a "Автомат, задний привод, бензин, 9.2 с до 100 км/ч"
description = tree.xpath('//div[@class="catalog-age__mod__item__note"] /text()')
#This will create a list 136 л.с.
power = tree.xpath('//div[@class="catalog-age__mod__item__type__text catalog-age__mod__item__type__text_hp"]/text()')
description
[]
power
[]
Потом мне пришлось искать способы просмотра кода страницы (результаты в самом конце поста)
Но все работает, я выбрал в распечаке ссылку с id PH_link_edumail и выреза ссылку:¶
tree.xpath('//a[@id="PH_link_edumail"]/@href')
['https://r.mail.ru/n165232964?sz=36&rnd=193229278']
А теперь попробуем построить дерево DOM из распечаки¶
tree2=html.fromstring(Out[21])
tree2.xpath('//a[@id="PH_link_edumail"]/@href')
['https://r.mail.ru/n165232964?sz=36&rnd=193229278']
НеплохоЮ мы взяли код из (последней) ячейки Notebook (нашего поста), а теперь проверим, можно ли построить дерево из только фрагмента html-кода
string ="""<div class="catalog-age__mod__item__box">
<div class="catalog-age__mod__item__type clear">
<div class="catalog-age__mod__item__type__text catalog-age__mod__item__type__text_title">
<a class="catalog-age__mod__item__type__link" href="https://cars.mail.ru/catalog/bmw/3/f30_31/sedan/specifications/?gear_type=204&fuel=222&modification_id=22938">316i AT</a>
</div>
<div class="catalog-age__mod__item__type__text catalog-age__mod__item__type__text_hp">136 л.с.</div>
</div>
<div class="catalog-age__mod__item__note">
Автомат,
задний привод,
бензин, 9.2 с до 100 км/ч
</div>
<a class="catalog-age__mod__item__equip clear" href="https://cars.mail.ru/catalog/bmw/3/f30_31/sedan/32100/">
<span>Special Edition SKD</span>
<div class="catalog-age__mod__item__equip__price">
<span class="catalog-age__mod__item__equip__price__value">
<span class="rank"><i>1</i><i>398</i><i>000</i></span>
</span>
<span class="catalog-age__mod__item__equip__price__note">руб.</span>
</div>
</a>
</div>
"""
tree3=html.fromstring(string)
tree3.xpath('//div[@class="catalog-age__mod__item__note"] /text()')
[u'\n \xd0\x90\xd0\xb2\xd1\x82\xd0\xbe\xd0\xbc\xd0\xb0\xd1\x82,\n \xd0\xb7\xd0\xb0\xd0\xb4\xd0\xbd\xd0\xb8\xd0\xb9\xa0\xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd0\xbe\xd0\xb4,\n \xd0\xb1\xd0\xb5\xd0\xbd\xd0\xb7\xd0\xb8\xd0\xbd, 9.2\xa0\xd1\x81\xa0\xd0\xb4\xd0\xbe\xa0100\xa0\xd0\xba\xd0\xbc/\xd1\x87\n ']
Итак, все работает и по отдельности и вместе. Для задачек о настройке XPath запросов нам проще копипастить ииследуемые фрагменты, для мониторинга (например, загрузки рекламы, цен...) можно попробовать requests... хотя есть и другие варианты
Приложения¶
dir(html)
['CheckboxGroup', 'CheckboxValues', 'DictMixin', 'Element', 'FieldsDict', 'FormElement', 'HTMLParser', 'HtmlComment', 'HtmlElement', 'HtmlElementClassLookup', 'HtmlEntity', 'HtmlMixin', 'HtmlProcessingInstruction', 'InputElement', 'InputGetter', 'InputMixin', 'LabelElement', 'MultipleSelectOptions', 'RadioGroup', 'SelectElement', 'SetMixin', 'TextareaElement', 'XHTMLParser', 'XHTML_NAMESPACE', '_MethodFunc', '__all__', '__builtins__', '__bytes_replace_meta_content_type', '__doc__', '__file__', '__fix_docstring', '__name__', '__package__', '__path__', '__str_replace_meta_content_type', '_archive_re', '_class_xpath', '_collect_string_content', '_contains_block_level_tag', '_element_name', '_forms_xpath', '_id_xpath', '_iter_css_imports', '_iter_css_urls', '_label_xpath', '_looks_like_full_html_bytes', '_looks_like_full_html_unicode', '_nons', '_options_xpath', '_rel_links_xpath', '_setmixin', '_transform_result', '_unquote_match', 'copy', 'defs', 'document_fromstring', 'etree', 'find_class', 'find_rel_links', 'fragment_fromstring', 'fragments_fromstring', 'fromstring', 'html_parser', 'html_to_xhtml', 'iterlinks', 'make_links_absolute', 'open_http_urllib', 'open_in_browser', 'parse', 're', 'resolve_base_href', 'rewrite_links', 'submit_form', 'sys', 'tostring', 'urljoin', 'xhtml_parser', 'xhtml_to_html']
dir(page) #page = requests.get('https://cars.mail.ru/catalog/bmw/3/f30_31/sedan/index.html')
['__attrs__', '__bool__', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getstate__', '__hash__', '__init__', '__iter__', '__module__', '__new__', '__nonzero__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_content', '_content_consumed', 'apparent_encoding', 'close', 'connection', 'content', 'cookies', 'elapsed', 'encoding', 'headers', 'history', 'is_permanent_redirect', 'is_redirect', 'iter_content', 'iter_lines', 'json', 'links', 'ok', 'raise_for_status', 'raw', 'reason', 'request', 'status_code', 'text', 'url']
dir(requests)
['ConnectionError', 'HTTPError', 'NullHandler', 'PreparedRequest', 'Request', 'RequestException', 'Response', 'Session', 'Timeout', 'TooManyRedirects', 'URLRequired', '__author__', '__build__', '__builtins__', '__copyright__', '__doc__', '__file__', '__license__', '__name__', '__package__', '__path__', '__title__', '__version__', 'adapters', 'api', 'auth', 'certs', 'codes', 'compat', 'cookies', 'delete', 'exceptions', 'get', 'head', 'hooks', 'logging', 'models', 'options', 'packages', 'patch', 'post', 'put', 'request', 'session', 'sessions', 'status_codes', 'structures', 'utils']
dir(requests.request)
['__call__', '__class__', '__closure__', '__code__', '__defaults__', '__delattr__', '__dict__', '__doc__', '__format__', '__get__', '__getattribute__', '__globals__', '__hash__', '__init__', '__module__', '__name__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'func_closure', 'func_code', 'func_defaults', 'func_dict', 'func_doc', 'func_globals', 'func_name']
help(requests)
Help on package requests: NAME requests FILE c:\users\kiss\anaconda\lib\site-packages\requests\__init__.py DESCRIPTION requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> r.status_code 200 >>> 'Python is a programming language' in r.content True ... or POST: >>> payload = dict(key1='value1', key2='value2') >>> r = requests.post('http://httpbin.org/post', data=payload) >>> print(r.text) { ... "form": { "key2": "value2", "key1": "value1" }, ... } The other HTTP methods are supported - see `requests.api`. Full documentation is at <http://python-requests.org>. :copyright: (c) 2014 by Kenneth Reitz. :license: Apache 2.0, see LICENSE for more details. PACKAGE CONTENTS adapters api auth certs compat cookies exceptions hooks models packages (package) sessions status_codes structures utils DATA __author__ = 'Kenneth Reitz' __build__ = 132353 __copyright__ = 'Copyright 2014 Kenneth Reitz' __license__ = 'Apache 2.0' __title__ = 'requests' __version__ = '2.5.1' codes = <lookup 'status_codes'> VERSION 2.5.1 AUTHOR Kenneth Reitz
page.text
u'<!DOCTYPE html>\n<html lang="ru-RU" prefix="og: http://ogp.me/ns#">\n<head>\n\t<meta http-equiv="x-ua-compatible" content="IE=edge">\n\t<meta charset="utf-8">\n\n\t<!-- \u0424\u0438\u043a\u0441, \u0434\u043b\u044f \u044e\u0437\u0435\u0440\u043e\u0432 \u0441 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u043a\u0443\u043a\u0430\u043c\u0438 -->\n\t\n\t\n\n\t<title>\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 - Cars Mail.Ru</title>\n\t<meta name="description" content="">\n\n\t<!--[if gt IE 8]><!-->\n\t\t<link rel="stylesheet" href="/css/all.css?26.09">\n\t<!--<![endif]-->\n\n\t<!--[if IE 9]>\n\t\t<link rel="stylesheet" href="/css/all_ie-9.css?26.09">\n\t<![endif]-->\n\n\t<!--[if IE 8]>\n\t\t<link rel="stylesheet" href="/css/all_ie-8.css?26.09">\n\t<![endif]-->\n\n\t<!--[if lt IE 8]>\n\t\t<link rel="stylesheet" href="/css/all_ie.css?26.09">\n\t<![endif]-->\n\n\t<link rel="shortcut icon" href="/favicon.ico?2.10" type="image/x-icon">\n\t<link rel="icon" href="/favicon.ico?2.10" type="image/ico">\n\n\t<!--[if lt IE 9]>\n\t\t<script src="/js/common/html5.js"></script>\n\t<![endif]-->\n\n\t<script src="/js/common/vendor/jquery.min.js"></script>\n\t<script src="/js/cpf/lib/basic.js"></script>\n\t<script src="/js/cpf/lib/types/types.Object.js"></script>\n\t<script src="/js/cpf/lib/types/types.Array.js"></script>\n\t<script src="/js/cpf/lib/types/types.String.js"></script>\n\t<script src="/js/cpf/lib/types/types.String.Url.js"></script>\n\t<script src="/js/cpf/lib/types/types.String.Html.js"></script>\n\t<script src="/js/cpf/lib/polyfills/es5.basic.js"></script>\n\t<script src="/js/cpf/lib/polyfills/es5.array.js"></script>\n\t<script src="/js/cpf/lib/polyfills/raf.js"></script>\n\t<script src="/js/cpf/tools/tools.Callbacks.js"></script>\n\t<script src="/js/cpf/lib/constructors.js"></script>\n\t<script src="/js/cpf/lib/plugins.js"></script>\n\t<script src="/js/cpf/tools/jquery/jquery.compElems.js"></script>\n\t<script src="/js/cpf/tools/jquery/jquery.compTools.js"></script>\n\t<script src="/js/cpf/tools/jquery/counters/jquery.countersCtrl.js"></script>\n\t<script src="/js/cpf/tools/jquery/counters/jquery.pageCounters.js"></script>\n\t<script src="/js/cpf/tools/jquery/counters/jquery.trackEvents.js"></script>\n\t<script src="/js/cpf/tools/jquery/jquery.dropDown.js"></script>\n\t<script src="/js/cpf/tools/tools.Forms.js"></script>\n\t<script src="/js/cpf/tools/tools.Deferred.js"></script>\n\t<script src="/js/cpf/tools/tools.dataRouter.js"></script>\n\t<script src="/js/cars/jquery.dataRouter.js"></script>\n\t<script src="/js/cpf/tools/polyfills/jquery/jquery.mouseWheel.js"></script>\n\t<script src="/js/cpf/components/scrollbar/jquery.scrollBar.js"></script>\n\t<script src="/js/cpf/components/scrollbar/jquery.customScroll.js"></script>\n\t<script src="/js/cpf/components/select/jquery.customSelect.js"></script>\n\n\t<!--[if lt IE 9]>\n\t\t<script src="/js/cpf/tools/polyfills/jquery/jquery.checkedClass.js"></script>\n\t<![endif]-->\n</head>\n<body>\n\t<div class="counters js-counters">\n\t\t<!--noindex-->\n\t\t<img src="https://rs.mail.ru/d13215258.gif?rnd=934180258&ts=1421256794" style="width:0;height:0;position:absolute;" alt=""/>\n<!-- tns-counter.ru -->\r\n<script type="text/javascript">\r\n(new Image()).src = \'//www.tns-counter.ru/V13a***R>\' + document.referrer.replace(/\\*/g,\'%2a\') + \'*mail_ru/ru/UTF-8/tmsec=mail_auto/\' + Math.round(Math.random()*1E9);\r\n</script>\r\n<noscript>\r\n\t<img src="//www.tns-counter.ru/V13a****mail_ru/ru/UTF-8/tmsec=mail_auto/" width="1" height="1" alt="">\r\n</noscript>\r\n<!--/ tns-counter.ru -->\n\t\t<!--/noindex-->\n\n\t\t<img src="//rs.mail.ru/d8516915.gif" alt="" />\n\t</div>\n\n\t<div class="page page_error js-page">\n\t\t<!--OPEN:HEADER-->\n\t\t<header class="page__head js-headline">\n\t\t\t\n\n\t\t\t<!-- [% # \u041f\u043b\u0430\u0448\u043a\u0430 \u043f\u0440\u043e \u0441\u0442\u0430\u0440\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b %] -->\n\t\t\t\n\n\t\t\t\r\n\r\n<!--noindex-->\r\n\r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\r\n\r\n\t\r\n\t\r\n\r\n\r\n\r\n<style>.x-ph{position:relative;z-index:1003;margin:0;padding:0;font:12px/16px Helvetica,Arial,sans-serif;white-space:nowrap;text-align:left;background:#fff;height:28px;*zoom:1}.w-x-ph{width:100%;margin:0;padding:0;border:0;border-spacing:0;border-collapse:collapse;font:12px/16px Helvetica,Arial,sans-serif;background:#fff}.w-x-ph__col{height:28px;padding:0;margin:0;border:0;border-spacing:0;vertical-align:top;white-space:nowrap;font:12px/16px Helvetica,Arial,sans-serif}.w-x-ph__col_left{width:1%;padding-right:20px;text-align:left}.w-x-ph__col_right{text-align:right}.x-ph__menu{position:relative;z-index:1004;display:inline-block;padding-right:2px;font:12px/16px Helvetica,Arial,sans-serif;vertical-align:top}.w-x-ph__menu__placeholder{position:absolute;top:100%;left:50%;width:0;height:0;font:0/0 a}.x-ph__menu__button,.x-ph__menu__button:link,.x-ph__menu__button:visited,.x-ph__menu__button:hover,.x-ph__menu__button:active,.x-ph__menu__button:focus{position:relative;z-index:1005;display:inline-block;width:100%;padding:6px 0 5px 0;border-right:1px solid #fff;border-left:1px solid #fff;font:12px/16px Helvetica,Arial,sans-serif;text-decoration:none;cursor:pointer;outline:none}.x-ph-ff.x-ph-win .x-ph__menu__button,.x-ph-ff.x-ph-win .x-ph__menu__button:link,.x-ph-ff.x-ph-win .x-ph__menu__button:visited,.x-ph-ff.x-ph-win .x-ph__menu__button:hover,.x-ph-ff.x-ph-win .x-ph__menu__button:active,.x-ph-ff.x-ph-win .x-ph__menu__button:focus{padding-top:5px;padding-bottom:7px}.x-ph__menu__button__text,.x-ph__menu_open .x-ph__menu__button:hover .x-ph__menu__button__text{display:inline-block;width:100%;padding:0 14px 0 6px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#1378bf;font-style:normal;text-decoration:none;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;text-align:left;vertical-align:top}.x-ph__menu__button:hover .x-ph__menu__button__text,.x-ph__menu__button:focus .x-ph__menu__button__text,.x-ph__menu__button:active .x-ph__menu__button__text,.x-ph__menu_open .x-ph__menu__button:focus .x-ph__menu__button__text,.x-ph__menu_open .x-ph__menu__button:active .x-ph__menu__button__text{color:#f26d00}.x-ph__menu__button__icon,.x-ph__menu_open .x-ph__menu__button:hover .x-ph__menu__button__icon{position:absolute;right:5px;top:13px;width:0;height:0;border-width:4px;border-style:solid;border-color:#1378bf #fff #fff;font:0/0 a}.x-ph__menu__button:hover .x-ph__menu__button__icon,.x-ph__menu__button:focus .x-ph__menu__button__icon,.x-ph__menu__button:active .x-ph__menu__button__icon,.x-ph__menu_open .x-ph__menu__button:focus .x-ph__menu__button__icon,.x-ph__menu_open .x-ph__menu__button:active .x-ph__menu__button__icon{border-color:#f26d00 #fff #fff}.w-x-ph__menu__button__shadow{position:absolute;z-index:1007;top:0;opacity:0;width:50px;height:0;background:#fff;-webkit-box-shadow:0 4px 15px rgba(0,0,0,0.2);-moz-box-shadow:0 4px 15px rgba(0,0,0,0.2);box-shadow:0 4px 15px rgba(0,0,0,0.2)}.x-ph__link,.x-ph__link:link,.x-ph__link:visited,.x-ph__link:hover,.x-ph__link:active,.x-ph__link:focus{display:inline-block;margin-right:6px;color:#1378bf;text-decoration:none;white-space:nowrap;*zoom:1;outline:none;padding:6px 6px 6px;*padding:5px 6px 7px;font:12px/16px Helvetica,Arial,sans-serif}.x-ph-ff.x-ph-win .x-ph__link,.x-ph-ff.x-ph-win .x-ph__link:link,.x-ph-ff.x-ph-win .x-ph__link:visited,.x-ph-ff.x-ph-win .x-ph__link:hover,.x-ph-ff.x-ph-win .x-ph__link:active,.x-ph-ff.x-ph-win .x-ph__link:focus{padding:5px 6px 7px}.x-ph__auth__link_icon,.x-ph__auth__link_icon:link,.x-ph__auth__link_icon:visited,.x-ph__auth__link_icon:hover,.x-ph__auth__link_icon:active,.x-ph__auth__link_icon:focus{width:16px;height:28px;padding:0 6px 0 !important;overflow:hidden;background:url("//img.imgsmail.ru/p/h/d/0.34.9/blocks/link/icons.png") no-repeat 0 0;text-indent:30px;vertical-align:top}.x-ph__auth__link_icon_exit,.x-ph__auth__link_icon_exit:link,.x-ph__auth__link_icon_exit:visited{background-position:8px 8px}@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min-device-pixel-ratio: 1.5){.x-ph__auth__link_icon_exit,.x-ph__auth__link_icon_exit:link,.x-ph__auth__link_icon_exit:visited{background-size:15px auto;background-position:8px -10px}}.x-ph__link:hover,.x-ph__link:focus,.x-ph__link:active{color:#f26d00}.x-ph__link_first,.x-ph__link_first:link,.x-ph__link_first:visited,.x-ph__link_first:hover,.x-ph__link_first:active,.x-ph__link_first:focus{margin-left:14px}.x-ph__link_last,.x-ph__link_last:link,.x-ph__link_last:visited,.x-ph__link_last:hover,.x-ph__link_last:active,.x-ph__link_last:focus{margin-right:12px}.x-ph__link_ext,.x-ph__link_ext:link,.x-ph__link_ext:visited,.x-ph__link_ext:hover,.x-ph__link_ext:active,.x-ph__link_ext:focus{padding-right:1px;text-decoration:none}.x-ph__link_selected,.x-ph__link_selected:link,.x-ph__link_selected:visited,.x-ph__link_selected:hover,.x-ph__link_selected:active,.x-ph__link_selected:focus{font-weight:bold}.x-ph__link__text{font-style:normal;text-decoration:none;cursor:pointer}.x-ph__link:hover .x-ph__link__text{color:#f26d00;text-decoration:none}.x-ph__link__balloon{display:none;min-width:9px;margin-left:3px;color:#fff;font-weight:normal;font-style:normal;text-align:center;font-size:11px;background-color:#ffa930;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;line-height:13px;overflow:hidden;height:13px;padding:1px 3px 1px 3px;vertical-align:baseline;margin-bottom:-4px;cursor:pointer;-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:500ms;-moz-animation-duration:500ms;-ms-animation-duration:500ms;-o-animation-duration:500ms;animation-duration:500ms}.x-ph-ff.x-ph-mac .x-ph__link__balloon,.x-ph-opera .x-ph__link__balloon{line-height:14px}.x-ph__link_ext .x-ph__link__balloon{display:inline-block;*display:inline;*zoom:1}.x-ph-ios .x-ph__link__balloon{padding:0px 3px 2px 3px;margin-bottom:-5px}.x-ph__auth{width:100%;border:0;margin:0;padding:0;border:0;border-spacing:0;font:12px/16px Helvetica,Arial,sans-serif}.w-x-ph__auth__col{border:0;margin:0;padding:0;border:0;border-spacing:0;vertical-align:top;text-align:right;white-space:nowrap;font:12px/16px Helvetica,Arial,sans-serif}.w-x-ph__auth__col_left{width:99%}.w-x-ph__auth__col_right{padding-right:2px}.x-ph__auth__user{position:relative;display:block;width:100%;min-width:100px;height:28px;overflow:hidden}.w-x-ph__auth__user_inner{position:absolute;right:0;text-align:left;max-width:100%}.x-ph__auth__user__text{color:#000;display:inline-block;padding:6px 10px 6px 0;_padding:5px 10px 7px 0;font:12px/16px Helvetica,Arial,sans-serif}.x-ph__auth__user__fade{position:absolute;top:0;right:-6px;width:16px;height:28px;overflow:hidden;background:url("//img.imgsmail.ru/p/h/d/0.34.9/blocks/auth/fade2.png") repeat-y 0 0;_display:none}.x-ph__auth__link,.x-ph__auth__link:link,.x-ph__auth__link:visited,.x-ph__auth__link:hover,.x-ph__auth__link:active,.x-ph__auth__link:focus{font:12px/16px Helvetica,Arial,sans-serif}.w-x-ph__auth__dropdown{position:relative;display:block;min-width:100px;width:100%;height:1px;text-align:right}.w-x-ph__auth__dropdown__inner{position:absolute;right:6px;width:100%;min-width:100px;text-align:right}.x-ph__menu_auth{max-width:100%}.x-ph__menu__button_auth,.x-ph__menu__button_auth:link,.x-ph__menu__button_auth:visited,.x-ph__menu__button_auth:hover,.x-ph__menu__button_auth:active,.x-ph__menu__button_auth:focus{max-width:100%}.x-ph__menu__button__text_auth{position:relative}.x-ph__menu__button__text_auth,.x-ph__menu_open .x-ph__menu__button:hover .x-ph__menu__button__text_auth{max-width:560px}.x-ph__menu_auth_unread .x-ph__menu__button__text_auth,.x-ph__menu_auth_unread.x-ph__menu_open .x-ph__menu__button:hover .x-ph__menu__button__text_auth{padding-left:14px}.x-ph__menu__button_auth__unread{display:none;position:absolute;left:3px;top:11px;width:8px;height:8px;background:url("//img.imgsmail.ru/p/h/d/0.34.9/blocks/auth/icons.gif") no-repeat 0 -92px}.x-ph__menu_auth_unread .x-ph__menu__button_auth__unread{display:block}\r\n</style><div class="x-ph portal-headline" id="portal-headline"><table class="w-x-ph" cellspacing="0"><tr><td class="w-x-ph__col w-x-ph__col_left"><a rel="nofollow" class="x-ph__link x-ph__link_first" href="https://r.mail.ru/n106451221?sz=36&rnd=193229278">Mail.Ru</a>\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t<a rel="nofollow" id="ph_mail" class="x-ph__link" href="https://r.mail.ru/cls584259/e.mail.ru/messages/inbox/?siteid=195&_1ld=1_1000043_1000475_0?rnd=193229278"><span class="x-ph__link__text">\u041f\u043e\u0447\u0442\u0430</span><i class="x-ph__link__balloon" id="g_mail_events"></i></a>\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t<a style="" rel="nofollow" id="ph_my" class="x-ph__link" href="https://r.mail.ru/clb584259/my.mail.ru/?from=content&_1ld=1_1000006_1000476_0&rnd=193229278"><span class="x-ph__link__text">\u041c\u043e\u0439 \u041c\u0438\u0440</span><i class="x-ph__link__balloon" id="g_my_events"></i></a><a style="" rel="nofollow" class="x-ph__link" href="https://r.mail.ru/n165232962?sz=36&rnd=193229278"><span class="x-ph__link__text">\u041e\u0434\u043d\u043e\u043a\u043b\u0430\u0441\u0441\u043d\u0438\u043a\u0438</span><i class="x-ph__link__balloon" id="g_ok_events"></i></a><a style="" rel="nofollow" class="x-ph__link" href="https://r.mail.ru/n107086380?sz=36&rnd=193229278"><span class="x-ph__link__text">\u0418\u0433\u0440\u044b</span><i class="x-ph__link__balloon" id="g_games_events"></i></a><a style="" rel="nofollow" class="x-ph__link" href="https://r.mail.ru/n83121672?sz=36&rnd=193229278">\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0430<i class="x-ph__link__balloon" id="g_love_events"></i></a><a style="" rel="nofollow" class="x-ph__link" href="https://r.mail.ru/n83121673?sz=36&rnd=193229278">\u041d\u043e\u0432\u043e\u0441\u0442\u0438</a><a style="" rel="nofollow" class="x-ph__link" href="https://r.mail.ru/n83121674?sz=36&rnd=193229278">\u041f\u043e\u0438\u0441\u043a</a><a style="display: none;" id="PH_allProjects" rel="nofollow" class="x-ph__link" href="https://r.mail.ru/n106451223?sz=36&rnd=193229278">\u0412\u0441\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b</a><span class="x-ph__menu" id="PH_projectsMenu" style="display:none;"><i class="w-x-ph__menu__button__shadow w-x-ph__menu__button__shadow_left"></i><i class="w-x-ph__menu__button__shadow w-x-ph__menu__button__shadow_right"></i><a rel="nofollow" class="x-ph__menu__button" id="PH_projectsMenu_button" href="#"><i class="x-ph__menu__button__icon"></i><i class="x-ph__menu__button__text">\u0412\u0441\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b</i></a></span></td><td class="w-x-ph__col w-x-ph__col_right"><div id="PH_authView" style="display:none;"><table class="x-ph__auth" cellspacing="0"><tr><td class="w-x-ph__auth__col w-x-ph__auth__col_left"><span id="PH_singleuser" class="x-ph__auth__user"><span class="w-x-ph__auth__user_inner"><span id="PH_user-email_disabled" class="x-ph__auth__user__text"></span><span class="x-ph__auth__user__fade"></span></span></span><div id="PH_miltiuser" style="display:none;" class="w-x-ph__auth__dropdown"><div class="w-x-ph__auth__dropdown__inner"><div class="x-ph__menu x-ph__menu_auth" id="PH_authMenu"><i id="PH_bub_place" class="w-x-ph__menu__placeholder"></i><i class="w-x-ph__menu__button__shadow w-x-ph__menu__button__shadow_left"></i><i class="w-x-ph__menu__button__shadow w-x-ph__menu__button__shadow_right"></i><a rel="nofollow" class="x-ph__menu__button x-ph__menu__button_auth" id="PH_authMenu_button" href="#"><i class="x-ph__menu__button_auth__unread" title=""></i><i class="x-ph__menu__button__icon x-ph__menu__button__icon_auth"></i><i class="x-ph__menu__button__text x-ph__menu__button__text_auth" id="PH_user-email"></i></a></div></div></div></td><td class="w-x-ph__auth__col w-x-ph__auth__col_right"><a id="PH_logoutLink" rel="nofollow" class="x-ph__link x-ph__link_last x-ph__auth__link" xname="clb10460311" href="https://auth.mail.ru/cgi-bin/logout?Page=" xname="clb1074201" title="\u0432\u044b\u0445\u043e\u0434" style="">\u0432\u044b\u0445\u043e\u0434</a></td></tr></table></div><div id="PH_noAuthView"><table class="x-ph__auth" cellspacing="0"><tr><td class="w-x-ph__auth__col w-x-ph__auth__col_right"><a id="PH_regLink" rel="nofollow" class="x-ph__link x-ph__auth__link" href="https://r.mail.ru/cls584259/r.mail.ru/clb1126011/e.mail.ru/signup?_1ld=1_1000000_1000477_0&from=navi&lang=ru_RU&siteid=195&rnd=193229278">\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f</a><a id="PH_authLink" rel="nofollow" class="x-ph__link x-ph__link_last x-ph__auth__link" href="https://e.mail.ru/login?page=" xname="clb951827">\u0412\u0445\u043e\u0434</a></td></tr></table></div></td></tr></table></div><div id="PH_innerHTML" style="display:none;"></div><div id="PH_links" style="display:none;"><a id="PH_link_bizmail" href="https://r.mail.ru/n165232963?sz=36&rnd=193229278"></a><a id="PH_link_edumail" href="https://r.mail.ru/n165232964?sz=36&rnd=193229278"></a><a id="PH_link_cars" href="https://r.mail.ru/n126922249?sz=36&rnd=193229278"></a><a id="PH_link_target" href="https://r.mail.ru/n165232965?sz=36&rnd=193229278"></a><a id="PH_link_dobro" href="https://r.mail.ru/n115576148?sz=36&rnd=193229278"></a><a id="PH_link_biz" href="https://r.mail.ru/n115576149?sz=36&rnd=193229278"></a><a id="PH_link_finance" href="https://r.mail.ru/n118799026?sz=36&rnd=193229278"></a><a id="PH_link_moto" href="https://r.mail.ru/n110094350?sz=36&rnd=193229278"></a><a id="PH_link_auto" href="https://r.mail.ru/n83121675?sz=36&rnd=193229278"></a><a id="PH_link_afisha" href="https://r.mail.ru/n83121690?sz=36&rnd=193229278"></a><a id="PH_link_video" href="https://r.mail.ru/n83121691?sz=36&rnd=193229278"></a><a id="PH_link_horo" href="https://r.mail.ru/n83121688?sz=36&rnd=193229278"></a><a id="PH_link_money" href="https://r.mail.ru/n112250854?sz=36&rnd=193229278"></a><a id="PH_link_deti" href="https://r.mail.ru/n83121684?sz=36&rnd=193229278"></a><a id="PH_link_health" href="https://r.mail.ru/n83121685?sz=36&rnd=193229278"></a><a id="PH_link_calendar" href="https://r.mail.ru/n153067950?sz=36&rnd=193229278"></a><a id="PH_link_maps" href="https://r.mail.ru/n83121694?sz=36&rnd=193229278"></a><a id="PH_link_lady" href="https://r.mail.ru/n83121683?sz=36&rnd=193229278"></a><a id="PH_link_realty" href="https://r.mail.ru/n115576150?sz=36&rnd=193229278"></a><a id="PH_link_answer" href="https://r.mail.ru/n83121676?sz=36&rnd=193229278"></a><a id="PH_link_cards" href="https://r.mail.ru/n83121687?sz=36&rnd=193229278"></a><a id="PH_link_pogoda" href="https://r.mail.ru/n83121689?sz=36&rnd=193229278"></a><a id="PH_link_travel" href="https://r.mail.ru/n112250856?sz=36&rnd=193229278"></a><a id="PH_link_work" href="https://r.mail.ru/n115198977?sz=36&rnd=193229278"></a><a id="PH_link_raiting" href="https://r.mail.ru/n107086381?sz=36&rnd=193229278"></a><a id="PH_link_sport" href="https://r.mail.ru/n106451225?sz=36&rnd=193229278"></a><a id="PH_link_tv" href="https://r.mail.ru/n106451226?sz=36&rnd=193229278"></a><a id="PH_link_torg" href="https://r.mail.ru/n112250857?sz=36&rnd=193229278"></a><a id="PH_link_files" href="https://r.mail.ru/n83121682?sz=36&rnd=193229278"></a><a id="PH_link_hitech" href="https://r.mail.ru/n83121680?sz=36&rnd=193229278"></a><a id="PH_link_agent" href="https://r.mail.ru/n94822919?sz=36&rnd=193229278"></a><a id="PH_link_browser" href="https://r.mail.ru/n118990175?sz=36&rnd=193229278"></a><a id="PH_link_sputnik" href="https://r.mail.ru/n96156715?sz=36&rnd=193229278"></a><a id="PH_link_icq" href="https://r.mail.ru/n94822920?sz=36&rnd=193229278"></a><a id="PH_link_cloud" href="https://r.mail.ru/n118990176?sz=36&rnd=193229278"></a></div><!--[if IE 6]><script>\r\n\tvar ____________ie6 = true;\r\n</script><![endif]--><!--[if IE 7]><script>\r\n\tvar ____________ie7 = true;\r\n</script><![endif]--><script>\r\nif (!window.__PHS){\r\n\tvar __PHS = {};\r\n}\r\n(function(s){\r\n\t\r\n\ts.authFormExtDomainsEnabled = false;\r\n\ts.portalAuthEnabled = true;\r\n\ts.disableGamesCounter = false;\r\n\ts.staticDir = \'//img.imgsmail.ru/p/h/d/0.34.9/\';\r\n\ts.loginLink = \'https://e.mail.ru/login?page=\';\r\n\ts.loginLinkXName = \'clb1126067\';\r\n\ts.externalJS = \'//img.imgsmail.ru/p/h/d/0.34.9/external.min.js\';\r\n\ts.externalNewJS = \'//img.imgsmail.ru/p/h/d/0.34.9/external.new.min.js\';\r\n\ts.pv = \'\';\r\n\ts.eid = \'\';\r\n\ts.siteid = \'195\';\r\n\ts.registerBackUrl = false;\r\n\ts.bizLinks = false;\r\n\ts.newOK = true;\r\n\ts.loveCounter = true;\r\n\ts.mailEvents = false;\r\n\ts.disableIFCheck = true;\r\n\ts.mailSplashUpdate = false;\r\n\ts.newDesign = false;\r\n\ts.exitInside = false;\r\n\ts.newExit = false;\r\n\ts.region = \'\u041c\u043e\u0441\u043a\u0432\u0430\';\r\n\ts.regionEnabled = false;\r\n\ts.settingsText = s.settingsText || false;\r\n\r\n\tif (!s.lang){\r\n\t\ts.lang = "ru_RU";\r\n\t}\r\n})(window[\'__PHS\']);\r\n(function(){function I(a){for(var a=a||{},d=1,b=arguments.length;d<b;d++){var e=arguments[d],c;for(c in e)e.hasOwnProperty(c)&&(a[c]=e[c])}return a}function Y(a,d){for(var b in d)Object.prototype.hasOwnProperty.call(d,b)&&!Object.prototype.hasOwnProperty.call(a,b)&&(a[b]=d[b]);return a}function J(a){return document.getElementById(a)}function Z(a,d,b){var e=[],c=0;if("string"===typeof a)e.push([a,d]),c+=d;else{for(var i in a)a.hasOwnProperty(i)&&(e.push([i,a[i]]),c+=a[i]);b=d}a=0;for(d=e.length;a<\r\nd;a++)e[a]=e[a].join(":");(new Image).src="//headline.radar.imgsmail.ru/update?p=headline&t="+(b||K)+"&v="+c+"&i="+e.join(",")+"&rnd="+Math.random()+(document.referrer?"&r="+escape(document.referrer):"")}function $(a,d){return a.bind.apply(a,D.call(arguments,1))}function aa(a,d,b){function e(){a();i||(c=E(e,d))}var c,i;b&&a();c=E(e,d);return function(){i=!0;L(c)}}function ba(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;a.preventDefault?a.preventDefault():a.returnValue=!1}function ca(a){a.preventDefault?\r\na.preventDefault():a.returnValue=!1}function M(a,d,b,c){if(d)if(d.addEventListener)d[a?"addEventListener":"removeEventListener"](b,c,!1);else d[a?"attachEvent":"detachEvent"]("on"+b,c)}function t(a){return a&&1==a.nodeType}function N(a){(function(){for(var a,b=arguments,e=b.length;e--;){a=b[e].split(",");for(var g=a.length;g--;){var i=a[g],l=void 0,k=parseInt(1E9*Math.random()),j=void 0;if(l=i.match(/^(?:cl([bn])|([adgin]))(\\d+)(?:sz(\\d+))?/))l[1]?j="s"+l[1]:"n"==l[2]?j="nc":("i"==l[2]&&(k=null),\r\nj=l[2]),j+=l[3]+".gif?",l[4]&&(j+="sz="+l[4]),k&&(j+="&rnd="+k),c.settings.eid&&(j+="&test_id="+c.settings.eid),(new Image).src="//rs.mail.ru/"+j}}})(a)}function da(a){M(1,a,"mousedown",function(a){a||(a=window.event);for(a=a.target||a.srcElement;a;)a.getAttribute&&a.getAttribute("xname")&&N(a.getAttribute("xname")),a=a.parentNode})}function ea(a,d){var b;b=t(d)?function(a,b){return a==b}:function(a,b){return w(a,b)};for(var c=a.parentNode;c;){if(b(c,d))return c;c=c.parentNode}return!1}function fa(a){for(;a.firstChild;)a.removeChild(a.firstChild)}\r\nfunction w(a,b){return t(a)&&x?a.classList.contains(b):!!~(" "+a.className+" ").indexOf(" "+b+" ")}function y(a,b){t(a)&&(x?a.classList.add(b):!w(a,b)&&(a.className+=" "+b))}function O(a,b){t(a)&&(x?a.classList.remove(b):a.className=a.className.replace(RegExp("(^|\\\\s)"+b+"(\\\\s|$)","g"),"$1"))}function ga(a,b){if(t(a))return x?a.classList.toggle(b):w(a,b)?(O(a,b),!1):(y(a,b),!0)}function ha(a){return"string"!==typeof a||!a?null:(new Function("return "+a))()}function ia(){return!!b.SCookie.getGlobal(P)}\r\nfunction z(a,b,f){if(void 0!==b){var c,f=f||{};null===b&&(b="",f.expires=-1);b+="";document.cookie=a+"="+b+(f.expires&&(c="number"==typeof f.expires&&(c=new Date),c.setTime(c.getTime()+864E5*f.expires),c||"toUTCString"in f.expires&&f.expires)&&"; expires="+c.toUTCString()||"")+(f.path?"; path="+f.path:"")+(f.domain?"; domain="+f.domain:"")+(f.secure?"; secure":"");return b}if(""!==(document.cookie||""))return b=(document.cookie.match(RegExp("(?:^| )"+a+"\\\\=(\\\\S*)(?:; |$)"))||[])[1],void 0===b?void 0:\r\nb}function Q(){this._invocations=[];this._context=this._fn=null}function s(){}function F(a){this._node=b.byId(a);this._container=this._node.parentNode}function ja(a){this._counters=a;for(var b in this._counters)this._counters.hasOwnProperty(b)&&(this._counters[b]=new F(this._counters[b]));this.update=function(a,b){if("string"==typeof a){var d={};d[a]=b;this.update(d)}else for(d in a)a.hasOwnProperty(d)&&(this._counters[d].update(a[d]),this._counters[d]._enableAnims=c.activeUser())}}function m(a){m.__all.push(this);\r\nthis._opts=a;this._open=b.bind(this._open,this);this._baseClass=a.baseClass;this._rootNode=a.rootNode;this._dropdown=a.dropdown;this._button=a.button;this._openCounter=a.openCounter||null;this._hideTimeout=null;this._orientation=this._opts.orientation;this._openClass=this._baseClass+"_open";this._rightClass=this._openClass+"_right";this._leftClass=this._openClass+"_left";this._inited=!!this._dropdown;this._triggerHideOnInit=this._triggerShowOnInit=!1;b.event(1,this._button,"click",b.bind(this.show,\r\nthis))}function n(a,b){b=b||{};this._url=a;this._encoding=b.encoding;this._JSONPCallbackParam=b.JSONPCallbackParam||"callback";this._xhrEnabled=b.xhrEnabled||!1;this._processing=!1;this._requestSource=b.requestSource;this._xhr2Supported=!1;try{XMLHttpRequest&&"withCredentials"in new XMLHttpRequest&&(this._xhr2Supported=!0)}catch(c){}}function ka(a){function d(){g!==(g=location.hash.replace(/^#/,"")||null)&&c()}this._userEmail=a.userEmail;this.____user=this._userEmail.innerHTML||void 0;this._user=\r\nnull;this._updateByTimeout=a.updateByTimeout;this.updateLastRequest=0;this._noAuthView=a.noAuthView;this._authView=a.authView;this.updateAccountInfo();var c=b.bind(this.updateAccountInfo,this),e=!1;if(!this._updateByTimeout)if(window.jsHistory&&window.jsHistory.change)window.jsHistory.change(function(){e&&c();e=!0});else if("onhashchange"in window)b.event(1,window,"hashchange",c);else{var g=location.hash.replace(/^#/,"")||null;b.setIntervalByTimeout(d,50)}}var u=window.console||{};u.log=u.log||function(){};\r\nu.time=u.time||function(){};u.timeEnd=u.timeEnd||function(){};u.time("headline.inline.js");if(!window.__PH){var c=window.__PH={},b={};c.settings=window.__PHS;c.settings.swaDomain="//portal.mail.ru";c.settings.authDomain="https://auth.mail.ru";/^https?:\\/\\/[^/]*?\\.dev\\.?mail\\.ru($|\\/\\S*)/i.test(location.href)&&(/^https?:\\/\\/[^/]*?\\.devmail\\.ru($|\\/\\S*)/i.test(location.href)?(c.settings.swaDomain="//portal.devmail.ru",c.settings.authDomain="https://auth.devmail.ru"):(c.settings.swaDomain="//portal.dev.mail.ru",\r\nc.settings.authDomain="https://auth.dev.mail.ru"));c.settings.swaTest&&(c.settings.swaDomain="//portal.test.mail.ru",c.settings.authDomain="https://test.auth.mail.ru");c._=b;if(!c.settings.disableIFCheck)try{top.location.toString()}catch(ra){top.location=location}var K="smallprojects",E=window.setTimeout,L=window.clearTimeout,q=J("portal-headline"),G=!1,r=navigator.userAgent,p=[];-1!=r.indexOf("Firefox")?p.push("x-ph-ff"):-1!=r.indexOf("Opera")&&p.push("x-ph-opera");if(-1!=r.indexOf("iPad")||-1!=\r\nr.indexOf("iPhone")||-1!=r.indexOf("iPod"))p.push("x-ph-ios"),G=!0;-1!=r.indexOf("Mac OS")&&!G?p.push("x-ph-mac"):-1!=r.indexOf("Windows")?p.push("x-ph-win"):p.push("x-ph-not-desk");"ontouchstart"in window?p.push("x-ph-touch"):p.push("x-ph-no-touch");q.className+=" "+p.join(" ");var D=Array.prototype.slice;void 0===Function.prototype.bind&&(Function.prototype.bind=function(a){var b=D.call(arguments,1),c=this;return function(){return c.apply(a,b.concat(D.call(arguments,0)))}});var x="classList"in document.documentElement,\r\nr=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b)}:function(a,b){for(var c=0,e=a.length;c<e;c++)if(a[c]==b)return c;return-1},p=window.devicePixelRatio,la=void 0!=document.createElement("div").style.backgroundSize&&1<p,P="s_c",H,R=document.createElement("div"),S=["Khtml","Ms","O","Moz","Webkit"],T=S.length;H=function(a){if(a in R.style)return!0;for(a=a.replace(/^[a-z]/,function(a){return a.toUpperCase()});T--;)if(S[T]+a in R.style)return!0;return!1};H("textShadow")?\r\ny(q,"x-ph-box-shadow"):y(q,"x-ph-no-box-shadow");var A=1*new Date+"",ma=A.substring(A.length-2),A=b,na=K,oa=/\\s*(\\S+)\\s*/g,pa=!/\\[native\\s+code\\]/i.test(document.getElementsByClass+""),qa=/\\./g;I(A,{percent:function(a){return ma<a},supports:H,extend:I,append:Y,dpr:p,retina:la,project:na,setTimeout:function(a,b){return E(a,b)},clearTimeout:function(a){return L(a)},rootNode:q,byId:J,byClassName:function(a,b,c){var e,g;"string"===typeof a&&(c=b,b=a,a=document);c=c||"";if(!a||null==b)return[];b=b.replace(/\\s+/ig,\r\n".");"."!=b[0]&&(b="."+b);if("querySelectorAll"in a){c=a.querySelectorAll(c+b);if(pa){e=-1;for(a=[];g=c[++e];)a.push(g);return a}return c}c=a.getElementsByTagName(c||"*");b&&(b=b.replace(qa," "),b=RegExp(b.replace(oa,"(?=(^|.*\\\\s)$1(\\\\s|$))")));e=-1;for(a=[];g=c[++e];)1===g.nodeType&&(!b||b.test(g.className))&&a.push(g);return a},radar:Z,bind:$,setIntervalByTimeout:aa,eventCancel:ba,eventPreventDefault:ca,event:M,isNode:t,emptyNode:fa,count:N,countEl:da,hasParent:ea,hasClass:w,removeClass:O,addClass:y,\r\ntoggleClass:ga,ArrayIndexOf:r,parseJson:ha,isCorp:ia,isCorpCookie:P,iOs:G});var h={_S_cookie_set_get_remove:function(a,b,c,e){var g,i=RegExp("(^|\\\\|)("+c+"=)(.*?)(\\\\||$)"),l={domain:b,expires:365,path:"/"};if(c){b=z(a)||"";g=(b.match(i)||[])[3];var k=null;void 0!==e?(z(a,void 0!==g||null===e?k=b.replace(i,null===e?function(a,b,d,c,f,e,g){return 0===g.indexOf(a)?"":f}:"$1$2"+e+"$4"):(b?b+"|":"")+c+"="+e,l),""===k&&z(a,null,l)):e=g;return e}},_throw_noValue_Error:function(){throw Error("need value");\r\n},__prefix:null,__domain:null,setProject:function(a,b){if(!a||!b)throw Error("project is not valid");"."!==b.substr(0,1)&&(b="."+b);h.__prefix=a;h.__domain=b},_getPrefix:function(a){a||(a={});a.prefix=a.prefix||h.__prefix;a.domain=a.domain||h.__domain;if(!a.prefix||!a.domain)throw Error("run setProject before");return a},getGlobal:function(a){return h._S_cookie_set_get_remove("s",".mail.ru",a)},setGlobal:function(a,b){void 0===b&&h._throw_noValue_Error();h._S_cookie_set_get_remove("s",".mail.ru",\r\na,b);return h.getGlobal(a)},removeGlobal:function(a){var b=h.getGlobal(a);h._S_cookie_set_get_remove("s",".mail.ru",a,null);return b},getLocal:function(a,b){b=h._getPrefix(b);return h._S_cookie_set_get_remove("s_"+b.prefix,b.domain,a)},setLocal:function(a,b,c){c=h._getPrefix(c);void 0===b&&h._throw_noValue_Error();h._S_cookie_set_get_remove("s_"+c.prefix,c.domain,a,b);return h.getLocal(a,c)},removeLocal:function(a,b){var b=h._getPrefix(b),c=h.getLocal(a,b);h._S_cookie_set_get_remove("s_"+b.prefix,\r\nb.domain,a,null);return c}};b.SCookie=h;Q.prototype={getQuery:function(){var a=b.bind(this.invoke,this);a.replace=b.bind(this.replace,this);return a},invoke:function(){this._fn?this._fn.apply(this._context,arguments):this._invocations.push(arguments)},replace:function(a,b){if(!this._fn){for(var b=b||window,c=0,e=this._invocations.length;c<e;c++)a.apply(b,this._invocations[c]);delete this._invocations;this._fn=a;this._context=b}}};b.extend(b,{DeferredQuery:Q});s.prototype={emit:function(a,b,c){function e(){--i||\r\nc&&c()}void 0==b&&(b={});var g=this.listeners(a);if(g)for(var g=g.slice(),a=new s.Event(a,b),i=g.length,b=0,l=i;b<l;b++){var k=g[b];if("function"===typeof k)try{k.call(this,a,e)}catch(j){e()}}else c&&c()},listeners:function(a){return this._events&&this._events[a]&&this._events[a].length&&this._events[a]},addListener:function(a,b){if("function"!==typeof b)throw Error("invalid argument");this._events||(this._events={});this._events[a]||(this._events[a]=[]);this._events[a].push(b);this.emit("newlistener",\r\n{type:a});return this},once:function(a,b){function c(){this.removeListener(a,c);b.apply(this,arguments)}if("function"!==typeof b)throw Error("invalid argument");this.on(a,c);return this},removeListener:function(a,c){if("function"!==typeof c)throw Error("invalid argument");if(!this._events[a])return this;var f=this._events[a],e=b.ArrayIndexOf(f,c);if(0>e)return this;f.splice(e,1);0===f.length&&delete this._events[a];return this}};s.prototype.on=s.prototype.addListener;s.Event=function(a,b){this.type=\r\na;this.data=b};s.relay=function(a,b,c){for(var e=0,g=a.length;e<g;e++){var i=a[e];b.on(i,function(a){return function(){c.emit(a)}}(i))}};b.EventEmitter=s;(function(){function a(){var a=d();a.id++;id=a.id;4095<id&&(id=0);f(id);a=d();return a.id}function d(){var a=h.getGlobal(r),b;if(!a)return f(0,0,{id:0,current:0}),{id:0,current:0};b=parseInt(a.substr(0,3),16);a=parseInt(a.substr(3,6),16);return{id:b,current:a}}function f(a,b,c){(c=c||d())||(c={});void 0!==a&&(c.id=a);c.id=void 0!=c.id&&c.id.toString(16);\r\nswitch(c.id.length){case 1:c.id="00"+c.id;break;case 2:c.id="0"+c.id}void 0!==b&&(c.current=b);c.current=void 0!=c.current&&c.current.toString(16);switch(c.current.length){case 1:c.current="00"+c.current;break;case 2:c.current="0"+c.current}h.setGlobal(r,c.id+c.current)}function e(a,e){function j(a){l!==a&&(l=a,c.emit("visibilitychange",{hidden:a,visible:!a}))}var h;if(e)h=e.hidden,j(h);else if(h="focus"==a.type||"focusin"==a.type?!1:"blur"==a.type||"focusout"==a.type?!0:!!document[g],"focusout"==\r\na.type)i=b.setTimeout(function(){i=void 0;j(h)},0);else if("focusin"==a.type)void 0!==i?b.clearTimeout(i):j(h),i=void 0;else if((p||q)&&!k)if(h)i=b.setTimeout(function(){i=void 0;try{d().current===n||j(h)}catch(a){b.radar("cookieError",1)}},200);else{try{d().current!==n&&(f(void 0,n),j(h))}catch(m){b.radar("cookieError",1)}b.clearTimeout(i);i=void 0}else j(h)}var g,i,l=!1,k,j={hidden:"visibilitychange",mozHidden:"mozvisibilitychange",webkitHidden:"webkitvisibilitychange",msHidden:"msvisibilitychange",\r\noHidden:"ovisibilitychange"};for(g in j)if(j.hasOwnProperty(g)&&g in document){k=j[g];break}var j=navigator.userAgent,m=-1<j.indexOf("iPad")||-1<j.indexOf("iPhone")||-1<j.indexOf("iPod"),p=!k&&-1<j.indexOf("Opera"),q=0<j.indexOf("Safari")&&-1===j.indexOf("Chrome"),r="t";try{if((p||m||q)&&!k){var n=a();f(void 0,n)}}catch(u){b.radar("cookieError",1)}if(k)b.event(1,document,k,e);else if(window.eval&&eval("/*@cc_on!@*/false"))b.event(1,document,"focusin",e),b.event(1,document,"focusout",e);else if(m){var s=\r\nnew Date,t=function(){b.clearTimeout(50);b.setTimeout(t,50);var a=new Date;100<a.getTime()-s.getTime()&&d().current!==n&&(f(void 0,n),l=!1,e({},{hidden:!0}),l=!0,e({},{hidden:!1}));s=a};b.setTimeout(t,50)}else b.event(1,window,"focus",e),b.event(1,window,"blur",e)})();F.prototype={visibleClass:"x-ph__link_ext",show:function(){b.addClass(this._container,this.visibleClass);b.clearTimeout(this._animTimeout);b.clearTimeout(this._animResetTimeout);this._anim&&this._enableAnims&&(this._animTimeout=b.setTimeout(function(){b.addClass(this._node,\r\n"x-ph-animated_flash");this._animResetTimeout=b.setTimeout(function(){b.removeClass(this._node,"x-ph-animated_flash")}.bind(this),1E3)}.bind(this),100))},hide:function(){b.removeClass(this._container,this.visibleClass)},value:function(a){void 0!==a&&(this._node.innerHTML=this.prepare(a));return parseInt(this._node.innerHTML,10)||0},prepare:function(a){a=parseInt(a);return 0<a?a:0},update:function(a){var b=this.value(),a=this.value(a);if(a>b||c.activeUser()!=this._enableAnims)this._anim=!0;this[a?\r\n"show":"hide"]();this._anim=!1}};b.Couners=ja;b.Couner=F;m.__all=[];m.resetShowOnInit=function(a){for(var b=0,c=m.__all.length;b<c;b++){var e=m.__all[b];if(!a||e!==a)e._triggerShowOnInit=!1,e._triggerHideOnInit=!1}};m.hideAll=function(){for(var a=0,b=m.__all.length;a<b;a++){var c=m.__all[a];c._triggerShowOnInit=!1;c._triggerHideOnInit=!1;c.hide()}};b.extend(m.prototype,b.EventEmitter.prototype,{init:function(a){!this._dropdown&&a&&(this._dropdown=a,this._rootNode.appendChild(a),this._inited=!0,this._triggerShowOnInit&&\r\nthis.show(),this._triggerHideOnInit&&this.hide(),this._triggerHideOnInit=this._triggerShowOnInit=!1)},_mouseIn:function(){b.clearTimeout(this._hideTimeout)},_mouseOut:function(){b.clearTimeout(this._hideTimeout);this._hideTimeout=b.setTimeout(b.bind(this.hide,this),4E3)},isVisible:function(){return b.hasClass(this._rootNode,this._openClass)},show:function(a){b.clearTimeout(this._hideTimeout);a&&b.eventPreventDefault(a);this._inited?this.isVisible()||this.emit("show",{},b.bind(function(){this.__toggle(!0)},\r\nthis)):(this._triggerShowOnInit=!0,m.resetShowOnInit(this))},hide:function(){this._inited?this.isVisible()&&this.emit("hide",{},b.bind(function(){this.__toggle(!1)},this)):this._triggerShowOnInit?this._triggerShowOnInit=!1:this._triggerHideOnInit=!0},_hideOther:function(){for(var a=0,b=m.__all.length;a<b;a++){var c=m.__all[a];c!=this&&c.isVisible()&&c.hide();c._triggerShowOnInit=!1}},_click:function(a){var c=a.target||a.srcElement;c==this._dropdown||b.hasParent(c,this._dropdown)?this.emit("click",\r\n{clickEvent:a},b.bind(this.hide,this)):"click"==a.type&&(b.hasParent(c,this._rootNode)&&b.eventPreventDefault(a),this.hide())},_open:function(){b.clearTimeout(this._openTimeout);this._openTimeout=b.setTimeout(b.bind(function(){if(this._orientation)b.addClass(this._rootNode,this._openClass),b.addClass(this._rootNode,this["_"+this._orientation+"Class"]);else{var a=this._dropdown.clientWidth,d=this._rootNode.offsetLeft,f=a+(this._rootNode.offsetParent==b.rootNode?d:1E4),e=document.body.offsetWidth;b.addClass(this._rootNode,\r\nthis._openClass);b.removeClass(this._rootNode,f<=e?this._rightClass:this._leftClass);b.addClass(this._rootNode,f>e?this._rightClass:this._leftClass);c.settings.newDesign&&(this._dropdown.style.right=d+this._rootNode.clientWidth<a&&f>e?-(a-(d+this._rootNode.clientWidth)+10)+"px":"")}a=b.bind(function(){window.webkitURL&&(this._dropdown.style.width=this._dropdown.clientWidth+1+"px",this._dropdown.style.width=null)},this);a();b.setTimeout(a,0)},this),0)},__toggle:function(a){b.clearTimeout(this.__eventsTimeout);\r\nthis.__eventsTimeout=b.setTimeout(b.bind(function(){b.event(a,document,"click",this.__click||(this.__click=b.bind(this._click,this)));b.event(a,this._rootNode,"mouseout",this.__mouseOut||(this.__mouseOut=b.bind(this._mouseOut,this)));b.event(a,this._rootNode,"mouseover",this.__mouseIn||(this.__mouseIn=b.bind(this._mouseIn,this)))},this),10);a?(this._openCounter&&b.count(this._openCounter),"block"!==this._dropdown.style.display&&(this._dropdown.style.display="block"),this._open(),b.event(1,window,\r\n"resize",this._open)):(b.removeClass(this._rootNode,this._openClass),b.removeClass(this._rootNode,this._leftClass),b.removeClass(this._rootNode,this._rightClass),b.event(0,window,"resize",this._open))}});b.Menu=m;var U=document.getElementsByTagName("head")[0];n.prototype={get:function(a){a=b.extend({encoding:this._encoding,params:{},complete:function(){}},a);this.cancel();return this[this._isXHR2()?"_getXHR":"_getScript"](this._url,a)},_isXHR2:function(){return this._xhrEnabled&&this._xhr2Supported},\r\n_getUrl:function(a,b){var c=!!~a.indexOf("?");b.rnd=(new Date).getTime();for(var e in b)if(b.hasOwnProperty(e)){var g=b[e];"function"==typeof g&&(g=g(b));void 0!==g&&(a+=(c?"&":"?")+e+"="+encodeURIComponent(g),c=!0)}return a},_getXHR:function(a,c){var f=new XMLHttpRequest;f.onreadystatechange=b.bind(function(){if(this._processing){var a;if(4===f.readyState){b.clearTimeout(this._xhrTimeout);this._processing=!1;if(200==f.status){var g;try{g=b.parseJson(f.responseText)}catch(i){a=i}}!a&&200==f.status?\r\n(a=g,a.error&&!a.errorType&&(a.errorType="serverError")):a=a?{status:"error",errorType:"parseError"}:200!=f.status?{status:"error",errorType:"netError"}:{status:"error"};this._requestSource&&(a.requestSource=this._requestSource);c.complete(a)}}},this);this._processing=!0;b.clearTimeout(this._xhrTimeout);c.timeout&&(this._xhrTimeout=b.setTimeout(b.bind(function(){this._processing&&(b.clearTimeout(this._xhrTimeout),this._processing=!1,this.cancel(),c.complete({status:"error",errorType:"timeout"}))},\r\nthis),c.timeout));f.open("get",this._getUrl(a,c.params),!0);f.withCredentials=!0;f.send(null);this._xhr=f},_getScript:function(a,c){function f(){U.appendChild(g);b.setTimeout(function(){U.removeChild(g)},6E4)}var e=this._cbName="__PHJSONPCallback_"+n.getUuid(),g=document.createElement("script"),i,h=c.timeout;c.params[this._JSONPCallbackParam]=e;a=this._getUrl(a,c.params);window[e]=b.bind(function(a){b.clearTimeout(i);window[e]=n.__PHEmptyCallback;this._cbName=null;this._processing=!1;this._requestSource&&\r\n(a.requestSource=this._requestSource);a.error&&!a.errorType&&(a.errorType="serverError");"cancel"!=a.status&&c.complete(a)},this);g.defer="defer";g.async="async";g.type="text/javascript";c.encoding&&(g.charset=c.encoding);g.src=a;!("opera"in window)||"complete"===document.readyState?(this._processing=!0,f()):window.addEventListener("DOMContentLoaded",b.bind(function(){this._processing=!0;f()},this),!1);h&&(i=b.setTimeout(b.bind(function(){window[this._cbName]({status:"error",errorType:"timeout"})},\r\nthis),h))},isProcessing:function(){return this._processing},cancel:function(){this._isXHR2()?this._cancelXHR():this._cancelScript()},_cancelXHR:function(){this._xhr&&this._xhr.abort()},_cancelScript:function(){this._cbName&&window[this._cbName]&&window[this._cbName]({status:"cancel"})}};n.__uuid=0;n.getUuid=function(){return n.__uuid++};n.__PHEmptyCallback=function(){};b.extend(b,{Transport:n});b.AccountManager=ka;b.extend(b.AccountManager.prototype,b.EventEmitter.prototype,{activeUser:function(){return this._user},\r\nupdateLogin:function(a){this._user=a;(this._userEmail.innerHTML=a)?(this._noAuthView.style.display="none",this._authView.style.display=""):(this._authView.style.display="none",this._noAuthView.style.display="")},isCorp:b.isCorp,isCorpCookie:b.isCorpCookie,setCorp:function(a){for(var c=0,f=a.length;c<f;c++)if("corp.mail.ru"===a[c].split("@")[1])return b.SCookie.setGlobal(this.isCorpCookie,(new Date).getTime()),!0;if((a=b.SCookie.getGlobal(this.isCorpCookie))&&(new Date).getTime()>1*a+864E5)return b.SCookie.removeGlobal(this.isCorpCookie),\r\n!1}});var V=!1,B=b.byId("ph_mail"),C=b.byId("ph_my");b.extend(b.AccountManager.prototype,{updateLinks:function(a){B.href=B.href.split("?")[0];var d=[];c.settings.siteid&&!a.email&&d.push("siteid="+c.settings.siteid);"mail"===b.project&&d.push("lang="+c.settings.lang);a.email||d.push("_1ld=1_1000043_1000475_0");d.length&&(B.href=B.href+"?"+d.join("&"));C.href=C.href.split("?")[0];d=[];a.email||d.push("_1ld=1_1000006_1000476_0");d.length&&(C.href=C.href+"?"+d.join("&"))},updateCounters:function(a){var d=\r\n{},a=a||{};if("mail"!=b.project&&!("home"==b.project&&c.settings.mailSplashUpdate)||!V&&"mail"==b.project&&!c.settings.mailEvents)d.mail=a.mail_cnt||0;V=!0;d.my=a.my_cnt||0;c.settings.disableGamesCounter||(d.games=a.games_cnt||0);this.updateNotifier(a);b.counters.update(d)},updateNotifier:function(a){var c=b.byId("PH_authMenu"),a=a.mail_notifier?parseInt(a.mail_notifier,10):0;b[(0==a?"remove":"add")+"Class"](c,"x-ph__menu_auth_unread")},_sendError:function(a){var c={updateError:1};a.errorType&&(c["updateError_"+\r\na.errorType]=1);a.requestSource&&(c["updateError_"+a.requestSource]=1,a.errorType&&(c["updateError_"+a.errorType+"_"+a.requestSource]=1));b.radar(c);this.emit("updateError")},_PHUpdater:function(a,d,f){function e(a){this.updateLinks(i);"ok"!=b.project&&c.settings.portalAuthEnabled&&this.updateLogin(k);this.updateCounters(i);"function"===typeof a&&a()}var d=d||function(){},g=a.status;if("error"==g)this._sendError(a),d();else{var i=a.data,h=i.action,k=i.email,j=b.bind(e,this);this.setCorp(i.list||[]);\r\nc.settings.portalAuthEnabled?"switch"==h?"disabled"==g?f?(b.radar({disabledUser:1,disabledUserRestore:1}),d()):(this.emit("disabledUser"),c.emit("disabledUser",a.data,function(){b.radar({disabledUser:1,disabledUserSendToLogin:1});window.location="https://e.mail.ru/login?fail=1&d1&page="+encodeURIComponent(location.href)+"&email="+encodeURIComponent(k)})):"ok"==g&&k!=this.activeUser()?(this.emit("authChange"),c.listeners("authChange")?(b.radar("authChange",1),!k||void 0!==i.mail_cnt?c.emit("authChange",\r\na.data,function(){j(d)}):this.loadAccountInfo(b.bind(function(a){"error"==a.status?(this._sendError(a),d()):(i=b.extend(a.data,i),c.emit("authChange",i,function(){j(d)}))},this),k)):f?(b.radar("authChangeReloadDis",1),!k||void 0!==i.mail_cnt?j(d):this.loadAccountInfo(b.bind(function(a){"error"==a.status?(this._sendError(a),d()):(i=b.extend(a.data,i),j(d))},this),k)):(b.radar("authChangeReload",1),b.setTimeout(function(){location.reload()},10))):"noauth"==g&&k!=this.activeUser()?("home"===b.project&&\r\n(g=[],g.push("headlineAuthLost"),g.push("mpop="+(c.cookie("Mpop")?"1":"0")),g.push("activeEmail="+this.activeUser()),g.push("newEmail="+k),(new Image).src="//gstat.imgsmail.ru/gstat?ua=1&logme="+encodeURIComponent(g.join(";"))+"&rnd="+(new Date).getTime()+Math.random()),b.radar("authLost",1),this.emit("authLost"),c.emit("authLost",a.data,b.bind(function(){a.status="ok";a.data.action="switch";this._PHUpdater(a,d,f)},this))):(b.radar("authRestore",1),"function"===typeof d&&d()):"list"==h&&("____user"in\r\nthis&&(this.____user!==k&&"mail"===b.project&&((new Image).src="//gstat.imgsmail.ru/gstat?logme="+encodeURIComponent("headlineFail;headlineEmail="+k+";projectEmail="+this.____user)+"&rnd="+(new Date).getTime()+Math.random(),h={userMismatch:1},h["userMismatch_"+(k?"":"no")+"HeadlineUser"]=1,h["userMismatch_"+(this.____user?"":"no")+"ProjectUser"]=1,h["userMismatch_"+(this.____user?"":"no")+"PUser_"+(k?"":"no")+"HUser"]=1,b.radar(h)),delete this.____user),null===this.activeUser()?(c.settings.enableUpdateRadars&&\r\nb.radar("update",1),this.emit("update"),c.emit("update",a.data,function(){j(d)})):k==this.activeUser()?((h=c.cookie("Mpop"))&&("ok"==g&&this.activeUser()&&-1==h.indexOf(this.activeUser()))&&b.count("d1409289"),c.settings.enableUpdateRadars&&b.radar("update",1),this.emit("update"),c.emit("update",a.data,function(){j(d)})):(a.data.action="switch",this._PHUpdater(a,d,!0))):(c.settings.enableUpdateRadars&&b.radar("update",1),this.emit("update"),c.emit("update",a.data,function(){j(d)}))}}});b.extend(b.AccountManager.prototype,\r\n{_authTransport:new b.Transport(c.settings.authDomain+"/cgi-bin/auth?mac=1",{JSONPCallbackParam:"JSONP_call",xhrEnabled:!0,requestSource:"auth"}),switchAccount:function(a,c,f){var e={};if(a){e.Login=a;var g=this.updateResume(c||function(){});this._authTransport.get({params:e,complete:b.bind(function(a){this._PHUpdater(a,g,f)},this),timeout:3E4})}},_logoutTransport:new b.Transport(c.settings.authDomain+"/cgi-bin/logout?mac=1",{JSONPCallbackParam:"JSONP_call",xhrEnabled:!0,requestSource:"logout"}),\r\nlogoutAccount:function(a,b){var c={};if(a&&a!==this.activeUser())c.Login=a;else throw Error("Can not logout. Not active account expected.");this._logoutTransport.get({params:c,complete:b})}});b.extend(b.AccountManager.prototype,{_accountInfoTransport:new b.Transport(c.settings.swaDomain+"/NaviData?mac=1&gamescnt=1",{JSONPCallbackParam:"JSONP_call",xhrEnabled:!0,requestSource:"accountInfo"}),loadAccountInfo:function(a,b){var f={};if(b=!c.settings.multiAuthEnabled?void 0:b||this.activeUser())f.Login=\r\nb;this._accountInfoTransport.get({params:f,complete:function(b){"function"===typeof a&&a(b)},timeout:3E4})},updateAccountInfo:function(a,c){var f=+new Date;if(this._updateByTimeout||!this._updateByTimeout&&this.updateLastRequest<f-this.updateRequestTimeout||c)!this._updateByTimeout&&this.updateLastRequest&&((new Image).src="//rs.mail.ru/d"+"584259".replace("%","")+".gif?"+f),this.updateLastRequest=f,f=this.updateResume(b.bind(function(b){this._PHUpdater(b,a)},this)),this.loadAccountInfo(f)},updateRequestTimeout:6E4,\r\nupdateReset:function(a){this._updateByTimeout&&(a?(a=this.updateRequestTimeout-(new Date).getTime()+this.updateLastRequest,0>a&&(a=0)):a=this.updateRequestTimeout,b.clearTimeout(this._listAccountTimeout),this._listAccountTimeout=b.setTimeout(b.bind(this.updateAccountInfo,this),a))},updateResume:function(a){if(this._updateByTimeout){var c=this._accountInfoTransport.isProcessing();this._accountInfoTransport.cancel();this.updateReset();var f=!1;this.once("authChange",function(a,b){f=!0;"function"===\r\ntypeof b&&b()})}return b.bind(function(b){this._updateByTimeout&&(c?f?this.updateReset():this.updateAccountInfo():f?this.updateReset():this.updateReset(!0));"function"==typeof a&&a(b)},this)}});b.SCookie.removeGlobal("s_mu");b.SCookie[(b.retina?"set":"remove")+"Global"]("rt",1);b.SCookie[(b.retina?"set":"remove")+"Global"]("dpr",b.dpr);c.settings.enableUpdateRadars=b.percent(1);c.settings.authFormEnabled=c.settings.multiAuthEnabled=c.settings.portalAuthEnabled;q=!1;if(~navigator.userAgent.indexOf("Opera")&&\r\n(!~navigator.userAgent.indexOf("Opera/9.8")||~navigator.userAgent.indexOf("Version/10"))||window.____________ie7||window.____________ie6||~navigator.userAgent.indexOf("Firefox/3."))c.settings.multiAuthEnabled=!1,c.settings.authFormEnabled=!1,q=!0;b.byId("PH_singleuser").style.display=c.settings.multiAuthEnabled?"none":"block";b.byId("PH_miltiuser").style.display=c.settings.multiAuthEnabled?"block":"none";c.settings.projectsMenuEnabled=!1;q||(c.settings.projectsMenuEnabled=!0,b.byId("PH_projectsMenu").style.display=\r\n"inline-block",b.byId("PH_allProjects").style.display="none");c.settings.bizLinks&&(b.byId("PH_projectsMenu").style.display="none",b.byId("PH_allProjects").style.display="none");b.countEl(b.byId("PH_loginLink")||b.byId("PH_authLink"));b.countEl(b.byId("PH_logoutLink"));b.extend(c,b.EventEmitter.prototype,{cookie:z});if(~navigator.userAgent.toLowerCase().indexOf("iphone")||~navigator.userAgent.toLowerCase().indexOf("ipad")||~navigator.userAgent.toLowerCase().indexOf("ipod")||~navigator.userAgent.toLowerCase().indexOf("android"))document.body.style.cursor=\r\n"pointer";c.cookie.s={};b.extend(c.cookie.s,{getLocal:h.getLocal,setLocal:h.setLocal,removeLocal:h.removeLocal,getGlobal:h.getGlobal,setGlobal:h.setGlobal,removeGlobal:h.removeGlobal,setProject:h.setProject});var W="mail"!==b.project;b.accountManager=new b.AccountManager({noAuthView:b.byId("PH_noAuthView"),authView:b.byId("PH_authView"),userEmail:b.byId(c.settings.multiAuthEnabled?"PH_user-email":"PH_user-email_disabled"),updateByTimeout:W});b.counters=new b.Couners({mail:"g_mail_events",my:"g_my_events",\r\nok:"g_ok_events",games:"g_games_events",love:"g_love_events"});c.updateCounter=function(a){"sting"===typeof a||"number"===typeof a||void 0===a||null===a?b.counters._counters[b.project]&&b.counters.update(b.project,a):b.counters.update(a);W||b.accountManager.updateAccountInfo()};"mail"==b.project&&window.jQuery&&window.jQuery(window).bind("updatemessagescount",function(a,b){c.updateCounter(b)});c.isMultiAuth=function(){return c.settings.multiAuthEnabled};c.activeUser=function(){if(c.settings.portalAuthEnabled){var a=\r\nb.accountManager.activeUser();return null===a?b.accountManager.____user:a}return b.byId("PH_user-email_disabled").innerHTML||void 0};c.settings.portalAuthEnabled&&(c.isCorp=function(){var a=c.activeUser();return"corp.mail.ru"==(a&&a.split("@")[1])},c.switchAccount=function(a,c){b.accountManager.switchAccount(a,c)},c.logoutAccount=function(a,c){b.accountManager.logoutAccount(a,function(){b.accountManager.loadAccountsList(c)})});c.settings.multiAuthEnabled&&(c.loadAccountsList=(new b.DeferredQuery).getQuery(),\r\nc.on("visibilitychange",function(a){!a.data.hidden&&null!==b.accountManager.activeUser()&&(b.accountManager.activeUser()?b.accountManager.switchAccount(b.accountManager.activeUser(),null,!0):b.accountManager.updateAccountInfo(function(){},!0))}));q=new b.Menu({baseClass:"x-ph__menu",orientation:"right",rootNode:b.byId("PH_authMenu"),button:b.byId("PH_authMenu_button"),openCounter:"home"==b.project?"d1126003":"mail"==b.project?"d1126002":"my"==b.project?"d1270901":"d1126005"});b.authMenu=q;c.authMenu=\r\nnew b.EventEmitter;c.settings.multiAuthEnabled&&(c.authMenu.show=b.bind(b.authMenu.show,b.authMenu),c.authMenu.hide=b.bind(b.authMenu.hide,b.authMenu));c.authForm=new b.EventEmitter;c.settings.authFormEnabled?(c.authForm.show=(new b.DeferredQuery).getQuery(),c.authForm.hide=(new b.DeferredQuery).getQuery()):(c.authForm.show=function(a){var c=[];a||(a={});a.login&&a.domain&&c.push("email="+a.login+"@"+a.domain);c.push("page="+encodeURIComponent(a.successPage?a.successPage:"mail"==b.project||"home"==\r\nb.project?"https://e.mail.ru/messages/inbox":window.location.href));window.location="https://e.mail.ru/login?"+c.join("&")},c.authForm.hide=function(){});c.authForm.isVisible=function(){return b.authForm?b.authForm.isVisible():!1};b.authLinkClickHandler=function(a){c.listeners("loginRequest")?(b.eventPreventDefault(a),c.emit("loginRequest")):c.settings.authFormEnabled&&(b.eventPreventDefault(a),c.authForm.show())};b.event(1,b.byId("PH_authLink"),"click",b.authLinkClickHandler);b.registerLinkClickHandler=\r\nfunction(a){c.listeners("registerRequest")&&(b.eventPreventDefault(a),c.authForm.hide(),c.emit("registerRequest"))};b.event(1,b.byId("PH_regLink"),"click",b.registerLinkClickHandler);c.isAuthFormEnabled=function(){return c.settings.authFormEnabled};b.projectsMenu=new b.Menu({baseClass:"x-ph__menu",rootNode:b.byId("PH_projectsMenu"),button:b.byId("PH_projectsMenu_button"),openCounter:"d584251"});if(c.settings.projectsMenuEnabled||c.settings.multiAuthEnabled||c.settings.authFormEnabled){var v=\r\ndocument.createElement("script"),X=document.getElementsByTagName("head")[0];v.defer="defer";v.async="async";v.type="text/javascript";v.src=c.settings.newDesign?c.settings.externalNewJS:c.settings.externalJS;!("opera"in window)||"complete"===document.readyState?X.appendChild(v):window.addEventListener("DOMContentLoaded",function(){X.appendChild(v)},!1)}u.timeEnd("headline.inline.js")}})();\r\n</script><!--/noindex-->\n\n\t\t\t<!--OPEN:PORTAL-HEADLINE-->\n\t\t\t<div class="hidden_all">\n\t\t\t\t<!-- [% # \u0421\u043b\u043e\u0442 \u0434\u043b\u044f \u0433\u0435\u043e-\u0432\u044b\u0431\u0438\u0440\u0430\u043b\u043a\u0438 \u0448\u0430\u043f\u043a\u0438 %] -->\n\t\t\t\t<script>this.__PortalRegions = {\r\n\t\teffRegion: {\r\n\t\t\tlevels: 3,\r\n\r\n\t\t\tcurrentLevel: 2,\r\n\r\n\t\t\tlevel1: 188,\r\n\t\t\tlevel2: 70,\r\n\t\t\tlevel3: null,\r\n\t\t\tlevel1Name: "\u041c\u043e\u0441\u043a\u0432\u0430",\r\n\t\t\tlevel2Name: "\u041c\u043e\u0441\u043a\u0432\u0430",\r\n\t\t\tlevel3Name: "",\r\n\r\n\t\t\tid: 70,\r\n\t\t\tparentId: 188,\r\n\t\t\tgrandId: null,\r\n\r\n\t\t\tname: "\u041c\u043e\u0441\u043a\u0432\u0430",\r\n\t\t\tparentName: "\u041c\u043e\u0441\u043a\u0432\u0430",\r\n\t\t\tgrandName: "null"\t\r\n\t\t},\r\n\t\tipRegion: {\r\n\t\t\tlevels: 3,\r\n\r\n\t\t\tcurrentLevel: 2,\r\n\r\n\t\t\tlevel1: 188,\r\n\t\t\tlevel2: 70,\r\n\t\t\tlevel3: null,\r\n\t\t\tlevel1Name: "\u041c\u043e\u0441\u043a\u0432\u0430",\r\n\t\t\tlevel2Name: "\u041c\u043e\u0441\u043a\u0432\u0430",\r\n\t\t\tlevel3Name: "",\r\n\r\n\t\t\tid: 70,\r\n\t\t\tparentId: 188,\r\n\t\t\tgrandId: null,\r\n\r\n\t\t\tname: "\u041c\u043e\u0441\u043a\u0432\u0430",\r\n\t\t\tparentName: "\u041c\u043e\u0441\u043a\u0432\u0430",\r\n\t\t\tgrandName: ""\t\r\n\t\t}\r\n\t};\r\n</script>\n\n\t\t\t\t<!-- [% # \u0421\u043b\u043e\u0442 \u0431\u0430\u043d\u043d\u0435\u0440\u0430 \u0432 \u0448\u0430\u043f\u043a\u0435 %] -->\n\t\t\t\t<textarea id="banner_4945">\n\t\t\t\t\t<img src="https://rs.mail.ru/d13078601.gif?rnd=706344249&ts=1421256794" style="width:0;height:0;position:absolute;" alt=""/>\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<a data-id="13078601" data-type="1" href="https://r.mail.ru/n176940347?&rnd=706344249" class="pm-banner__url" data-color="y" data-color-variant="1">\u041a\u043e\u043d\u043a\u0443\u0440\u0441</a>\n\t\t\t\t</textarea>\n\t\t\t</div>\n\n\t\t\t\n\n<style>.portal-menu{position:relative;z-index:1;display:block;-webkit-font-smoothing:antialiased}.portal-menu_width{display:block;margin:0 auto;position:relative;z-index:2}.w-pm-menu{position:relative;z-index:3;display:block;width:100%;height:52px}.w-pm-menu_submenu{z-index:2;height:40px}.w-pm-menu__shadow{position:absolute;left:0;z-index:1;bottom:-6px;height:6px;width:100%;overflow:hidden;-webkit-pointer-events:none;-moz-pointer-events:none;-ms-pointer-events:none;-o-pointer-events:none;pointer-events:none}.pm-menu{display:table;width:100%;margin:0 auto;height:52px;font:15px/18px Helvetica Neue Light,Arial,Tahoma,sans-serif}.pm-menu_submenu{height:40px}.pm-menu__left{text-align:left;width:1%;padding-right:20px}.pm-menu__left,.pm-menu__center{display:table-cell;vertical-align:top}.pm-menu__center{text-align:center}.pm-menu__center__inner{visibility:hidden}.pm-menu__left__inner,.pm-menu__center__inner{display:block;position:relative;height:52px;white-space:nowrap}.pm-menu__left__inner__leg,.pm-menu__center__inner__leg{display:inline-block;height:0;overflow:hidden;visibility:hidden}.pm-menu__left__inner_submenu,.pm-menu__center__inner_submenu{height:40px}.w-pm-menu{background:#168de2}.w-pm-menu_submenu{background:#333}.w-pm-menu__shadow{background:0 0;background:-webkit-linear-gradient(90deg,rgba(0,0,0,0)0%,rgba(0,0,0,.059)80%,rgba(0,0,0,.2)100%);background:-moz-linear-gradient(90deg,rgba(0,0,0,0)0%,rgba(0,0,0,.059)80%,rgba(0,0,0,.2)100%);background:-o-linear-gradient(90deg,rgba(0,0,0,0)0%,rgba(0,0,0,.059)80%,rgba(0,0,0,.2)100%);background:linear-gradient(0,rgba(0,0,0,0)0%,rgba(0,0,0,.059)80%,rgba(0,0,0,.2)100%)}.pm-menu{background:#168de2;color:#333}.pm-menu_submenu,.pm-menu__left__inner_submenu,.pm-menu__center__inner_submenu{background:#333}</style>\n\n<div id="portal-menu" class="portal-menu">\n <div class="pm-css-checker" id="pm-css-checker" style="display: none;"></div>\n <div id="portal-menu__toolbar" class="portal-menu__toolbar w-pm-menu">\n <div class="portal-menu_width">\n <div class="pm-menu">\n <div class="pm-menu__left">\n <div class="pm-menu__left__inner">\n </div>\n </div>\n <div class="pm-menu__center">\n <div class="pm-menu__center__inner">\n <i class="pm-menu__center__inner__leg" style="visibility: hidden">s</i>\n </div>\n </div>\n </div>\n </div>\n <div id="w-pm-menu__shadow" class="w-pm-menu__shadow"></div>\n </div>\n <div id="portal-menu__submenu" class="portal-menu__submenu w-pm-menu w-pm-menu_submenu" style="display: none;">\n <div class="portal-menu_width">\n <div class="pm-menu pm-menu_submenu">\n <div class="pm-menu__center pm-menu__center_submenu">\n <div class="pm-menu__center__inner pm-menu__center__inner_submenu">\n <i class="pm-menu__center__inner__leg pm-menu__center__inner__leg_submenu" style="visibility: hidden">s</i>\n </div>\n </div>\n </div>\n </div>\n <div class="w-pm-menu__shadow"></div>\n </div>\n</div>\n\n<script>(function(){function a(a){a=a||{};for(var b=1,c=arguments.length;c>b;b++){var d=arguments[b];for(var e in d)d.hasOwnProperty(e)&&(a[e]=d[e])}return a}function b(a){return document.getElementById(a)}function c(a){return a.bind.apply(a,H.call(arguments,1))}function d(a,b,c){function d(){a(),f||(e=E(d,b))}var e,f;return c&&a(),e=E(d,b),function(){f=!0,F(e)}}function e(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,a.preventDefault?a.preventDefault():a.returnValue=!1}function f(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function g(a,b,c,d){b&&(b.addEventListener?b[a?"addEventListener":"removeEventListener"](c,d,!1):b[a?"attachEvent":"detachEvent"]("on"+c,d))}function h(a){return a&&1==a.nodeType}function i(a,b){var c=[],d=0;if("string"==typeof a)c.push([a,b]),d+=b;else for(var e in a)a.hasOwnProperty(e)&&(c.push([e,a[e]]),d+=a[e]);for(var f=0,g=c.length;g>f;f++)c[f]=c[f].join(":")}function j(a){function b(a){var b,c,d=parseInt(1e9*Math.random(),10);(b=a.match(/^(?:cl([bn])|([adgin]))(\\d+)(?:sz(\\d+))?/))&&(b[1]?c="s"+b[1]:"n"==b[2]?c="nc":"i"==b[2]?(d=null,c=b[2]):c=b[2],c+=b[3]+".gif?",b[4]&&(c+="sz="+b[4]),d&&(c+="&rnd="+d),(new Image).src="//r.my.com/"+c)}for(var c=a.split(","),d=c.length;d--;)b(c[d])}function k(a){g(1,a,"mousedown",function(a){a||(a=window.event);for(var b=a.target||a.srcElement;b;)b.getAttribute&&b.getAttribute("xname")&&j(b.getAttribute("xname")),b=b.parentNode})}function l(a,b){var c;c=h(b)?function(a,b){return a==b}:function(a,b){return n(a,b)};for(var d=a.parentNode;d;){if(c(d,b))return d;d=d.parentNode}return!1}function m(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function n(a,b){return h(a)&&I?a.classList.contains(b):!!~(" "+a.className+" ").indexOf(" "+b+" ")}function o(a,b){h(a)&&(I?a.classList.add(b):!n(a,b)&&(a.className+=" "+b))}function p(a,b){h(a)&&(I?a.classList.remove(b):a.className=a.className.replace(new RegExp("(^|\\\\s)"+b+"(\\\\s|$)","g"),"$1"))}function q(a,b){return h(a)?I?a.classList.toggle(b):n(a,b)?(p(a,b),!1):(o(a,b),!0):void 0}function r(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&!Object.prototype.hasOwnProperty.call(a,c)&&(a[c]=b[c]);return a}function s(a,b,c){function d(e){(c&&e.propertyName===c||!c)&&(g(0,a,B.Modernizr.transitionend,d),b())}var e;return c&&(c=B.Modernizr.prefixedCss(c)),B.Modernizr.csstransitions?g(1,a,B.Modernizr.transitionend,d):e=B.setTimeout(function(){b()},0),{prop:c,callback:b,node:a,cancel:function(){e?clearTimeout(e):g(0,a,B.Modernizr.transitionend,d)}}}function t(a){return a||(a={}),"function"!=typeof a.fn?!1:a}function u(a,b,c){function d(b){(j&&(b.propertyName||b.originalEvent.propertyName)===j||!j)&&(B.$(a).unbind(B.Modernizr.transitionend,d),i.fn())}function e(){k||(clearTimeout(g),clearTimeout(f),B.$(a).unbind(B.Modernizr.transitionend,d),k=!0)}c||(c={});var f,g,h=c.before&&(c.before=t(c.before)),i=c.after&&(c.after=t(c.after)),j=i&&i.prop&&B.Modernizr.prefixedCss(i.prop);h&&h.fn(),g=setTimeout(function(){b()},B.Modernizr.csstransitions?20:0),i&&(B.Modernizr.csstransitions?B.$(a).bind(B.Modernizr.transitionend,d):f=setTimeout(function(){i.fn()},0));var k=!1;return{cancel:e}}function v(){this._invocations=[],this._fn=null,this._context=null}function w(){}function x(){function a(){c.appendChild(b)}var b=document.createElement("script"),c=document.getElementsByTagName("head")[0];b.async="async",b.defer="defer",b.type="text/javascript",b.charset="utf-8";var d=-1==location.href.indexOf("PMDebug")?".min":"";b.src=A.settings.staticDir+(A.settings.noCss?"nocss":"external")+d+".js","opera"in window&&"complete"!==document.readyState?window.addEventListener("DOMContentLoaded",function(){a()},!1):a()}var y=window.__PH&&__PH.cookie&&"1"===__PH.cookie.s.getGlobal("s_debug"),z=y&&window.console||{};if(z.log=y&&z.log||function(){},z.time=y&&z.time||function(){},z.timeEnd=y&&z.timeEnd||function(){},z.time("portal-menu.inline.js"),!window.__PM){var A=window.__PM={},B={};A.settings=window.__PMS||{},A.settings.staticDir="//img.imgsmail.ru/p/pm/d/0.1.41/",A.settings.noCss=!1,A.settings.rootClass="portal-menu",A.settings.cssPrefix="pm",A._=B;var C=B.Modernizr=function(a,b,c){function d(a){s.cssText=a}function e(a,b){return typeof a===b}function f(a,b){return!!~(""+a).indexOf(b)}function g(a,b){for(var d in a){var e=a[d];if(!f(e,"-")&&s[e]!==c)return"pfx"==b?e:!0}return!1}function h(a,b,d){for(var f in a){var g=b[a[f]];if(g!==c)return d===!1?a[f]:e(g,"function")?g.bind(d||b):g}return!1}function i(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),f=(a+" "+v.join(d+" ")+d).split(" ");return e(b,"string")||e(b,"undefined")?g(f,b):(f=(a+" "+w.join(d+" ")+d).split(" "),h(f,b,c))}var j,k,l,m="2.8.3",n={},o=!0,p=b.documentElement,q="modernizr",r=b.createElement(q),s=r.style,t=({}.toString," -webkit- -moz- -o- -ms- ".split(" ")),u="Webkit Moz O ms",v=u.split(" "),w=u.toLowerCase().split(" "),x={},y=[],z=y.slice,A=function(a,c,d,e){var f,g,h,i,j=b.createElement("div"),k=b.body,l=k||b.createElement("body");if(parseInt(d,10))for(;d--;)h=b.createElement("div"),h.id=e?e[d]:q+(d+1),j.appendChild(h);return f=["­",\'<style id="s\',q,\'">\',a,"</style>"].join(""),j.id=q,(k?j:l).innerHTML+=f,l.appendChild(j),k||(l.style.background="",l.style.overflow="hidden",i=p.style.overflow,p.style.overflow="hidden",p.appendChild(l)),g=c(j,a),k?j.parentNode.removeChild(j):(l.parentNode.removeChild(l),p.style.overflow=i),!!g},B=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b)&&c(b).matches||!1;var d;return A("@media "+b+" { #"+q+" { position: absolute; } }",function(b){d="absolute"==(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position}),d},C={}.hasOwnProperty;l=e(C,"undefined")||e(C.call,"undefined")?function(a,b){return b in a&&e(a.constructor.prototype[b],"undefined")}:function(a,b){return C.call(a,b)},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=z.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(z.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(z.call(arguments)))};return d}),x.backgroundsize=function(){return i("backgroundSize")},x.boxshadow=function(){return i("boxShadow")},x.csstransitions=function(){return i("transition")};for(var D in x)l(x,D)&&(k=D.toLowerCase(),n[k]=x[D](),y.push((n[k]?"pm-":"pm-no-")+k));return n.addTest=function(a,b){if("object"==typeof a)for(var d in a)l(a,d)&&n.addTest(d,a[d]);else{if(a=a.toLowerCase(),n[a]!==c)return n;b="function"==typeof b?b():b,"undefined"!=typeof o&&o&&(p.className+=" "+(b?"pm-":"pm-no-")+a),n[a]=b}return n},d(""),r=j=null,n._version=m,n._prefixes=t,n._domPrefixes=w,n._cssomPrefixes=v,n.mq=B,n.testProp=function(a){return g([a])},n.testAllProps=i,n.testStyles=A,n.prefixed=function(a,b,c){return b?i(a,b,c):i(a,"pfx")},p.className=p.className.replace(/(^|\\s)no-js(\\s|$)/,"$1$2")+(o?" js "+y.join(" "):""),n}(window,window.document);C.addTest("classlist","classList"in document.documentElement),C.addTest("raf",!!C.prefixed("requestAnimationFrame",window));var D="{{ project }}",E=window.setTimeout,F=window.clearTimeout,G=b(A.settings.rootClass);Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});var H=Array.prototype.slice;void 0===Function.prototype.bind&&(Function.prototype.bind=function(a){var b=H.call(arguments,1),c=this;return function(){return c.apply(a,b.concat(H.call(arguments,0)))}});var I=B.Modernizr.classlist;Array.prototype.indexOf||(Array.prototype.indexOf=function(a){for(var b=this,c=0,d=b.length;d>c;c++)if(b[c]==a)return c;return-1}),a(B,{extend:a,animate:u,project:D,setTimeout:function(a,b){return E(a,b)},clearTimeout:function(a){return F(a)},rootNode:G,byId:b,bind:c,radar:i,setIntervalByTimeout:d,eventCancel:e,eventPreventDefault:f,event:g,isNode:h,emptyNode:m,count:j,countEl:k,hasParent:l,hasClass:n,removeClass:p,addClass:o,toggleClass:q,animateEnd:s,append:r}),B.Modernizr.prefixedCss=function(){var a=B.Modernizr.prefixed.apply(this,arguments);return a&&a.replace(/([A-Z])/g,function(a,b){return"-"+b.toLowerCase()}).replace(/^ms-/,"-ms-")},B.Modernizr.addTest("transitionend",function(){var a,b=document.createElement("fakeelement"),c={OTransition:"otransitionend",MSTransition:"msTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd",transition:"transitionend"};for(a in c)if(void 0!==b.style[a])return b=null,c[a]}),B.Modernizr.addTest("dpr",function(){return window.devicePixelRatio}),B.Modernizr.addTest("retina",function(){return B.Modernizr.dpr>1&&B.Modernizr.backgroundsize}),B.Modernizr.addTest("ie",function(){return navigator.userAgent.indexOf("MSIE")>0}),B.Modernizr.addTest("requestAnimationFrame",function(){return B.Modernizr.prefixed("requestAnimationFrame",window)}),B.extend(B,{}),B.SCookie=window.__PH&&window.__PH.cookie&&window.__PH.cookie.s,v.prototype={getQuery:function(){var a=B.bind(this.invoke,this);return a.replace=B.bind(this.replace,this),a},invoke:function(){this._fn?this._fn.apply(this._context,arguments):this._invocations.push(arguments)},replace:function(a,b){if(!this._fn){b=b||window;for(var c=0,d=this._invocations.length;d>c;c++)a.apply(b,this._invocations[c]);delete this._invocations,this._fn=a,this._context=b}}},B.DeferredQuery=v,w.prototype={emit:function(a,b,c){function d(){--g||c&&c()}void 0==b&&(b={});var e=this.listeners(a);if(!e)return void(c&&c());e=e.slice();for(var f=new w.Event(a,b),g=e.length,h=0,i=g;i>h;h++){var j=e[h];if("function"==typeof j)try{j.call(this,f,d)}catch(k){d()}}},listeners:function(a){return this._events&&this._events[a]&&this._events[a].length&&this._events[a]},addListener:function(a,b){if("function"!=typeof b)throw new Error("invalid argument");return this._events||(this._events={}),this._events[a]||(this._events[a]=[]),this._events[a].push(b),this.emit("newlistener",{type:a,listener:b}),this},once:function(a,b){function c(){this.removeListener(a,c),b.apply(this,arguments)}if("function"!=typeof b)throw new Error("invalid argument");return this.on(a,c),this},removeListener:function(a,b){if("function"!=typeof b)throw new Error("invalid argument");if(!this._events[a])return this;var c=this._events[a],d=c.indexOf(b);return 0>d?this:(c.splice(d,1),0===c.length&&delete this._events[a],this)}},w.prototype.on=w.prototype.addListener,w.Event=function(a,b){this.type=a,this.data=b},w.relay=function(a,b,c){for(var d=0,e=a.length;e>d;d++){var f=a[d];b.on(f,function(a){return function(){c.emit(a)}}(f))}},B.EventEmitter=w,B.extend(A,B.EventEmitter.prototype,{}),A.isLoaded=function(){return A._loaded||!1},A.whenLoaded=function(a){A.isLoaded()?a():A.on("load",a)},A.regionSelector=new B.EventEmitter,B.extend(A.regionSelector,{show:(new B.DeferredQuery).getQuery(),hide:(new B.DeferredQuery).getQuery(),enabled:function(){return A.settings.regionsSelectorEnabled}}),A.draw=(new B.DeferredQuery).getQuery(),A.getItems=(new B.DeferredQuery).getQuery(),A.batchActions=(new B.DeferredQuery).getQuery(),B.initInline=function(){B.addClass(B.rootNode,A.settings.rootClass+"_boxshadow-"+(B.Modernizr.boxshadow?"yes":"no")),A.settings.regionsSelectorEnabled=!!window.__PortalRegions,A.settings.submenu&&(document.getElementById(A.settings.rootClass+"__submenu").style.display="",document.getElementById("w-"+A.settings.cssPrefix+"-menu__shadow").style.display="none"),B.rootNode.style.height="",B.rootNode.style.height=B.rootNode.clientHeight+"px"},B.rootNode?B.initInline():A.init=(new B.DeferredQuery).getQuery(),x(),z.timeEnd("portal-menu.inline.js")}}).call(window);</script>\n\n<script>\nvar oOptsHeadline = {\n logo: {\n image: \'https://cars.mail.ru/img/logotype-cars.png\',\n image_x2: \'https://cars.mail.ru/img/logotype-cars@2x.png?0\',\n width: 156,\n title: \'Cars Mail.Ru\',\n href: \'https://cars.mail.ru\',\n attrs: {\n name: \'clb4871991\'\n }\n },\n toolbar: {\n items: [\n {\n type: \'button\',\n buttonType: \'region\',\n attrs: {\n name: \'clb4872018\'\n }\n },\n {\n type: \'group\',\n collapsible: true,\n items: [\n {\n type: \'button\',\n href: \'https://cars.mail.ru/sale/msk/all/\',\n name: \'buttonBuy\',\n text: \'\u041a\u0443\u043f\u0438\u0442\u044c\',\n title: \'\u041a\u0443\u043f\u0438\u0442\u044c\',\n iconCls: \'headline-ico-buy\',\n attrs: {\n name: \'clb4872065\'\n },\n \n },\n {\n type: \'button\',\n href: \'https://cars.mail.ru/sell/\',\n name: \'buttonSell\',\n text: \'\u041f\u0440\u043e\u0434\u0430\u0442\u044c\',\n title: \'\u041f\u0440\u043e\u0434\u0430\u0442\u044c\',\n iconCls: \'headline-ico-sell\',\n attrs: {\n name: \'clb4872067\'\n },\n \n },\n {\n type: \'button\',\n href: \'https://cars.mail.ru/catalog/\',\n name: \'buttonCatalog\',\n text: \'\u041a\u0430\u0442\u0430\u043b\u043e\u0433\',\n title: \'\u041a\u0430\u0442\u0430\u043b\u043e\u0433\',\n iconCls: \'headline-ico-catalog\',\n attrs: {\n name: \'clb4872068\'\n },\n \n current: true\n \n },\n {\n type: \'button\',\n href: \'https://cars.mail.ru/reviews/\',\n name: \'buttonReviews\',\n text: \'\u041e\u0442\u0437\u044b\u0432\u044b\',\n title: \'\u041e\u0442\u0437\u044b\u0432\u044b\',\n iconCls: \'headline-ico-review\',\n attrs: {\n name: \'clb4872069\'\n },\n \n },\n {\n type: \'button\',\n href: \'https://cars.mail.ru/dealers/msk/\',\n name: \'buttonDealers\',\n text: \'\u0414\u0438\u043b\u0435\u0440\u044b\',\n title: \'\u0414\u0438\u043b\u0435\u0440\u044b\',\n iconCls: \'headline-ico-dealer\',\n attrs: {\n name: \'clb4872083\'\n },\n \n }\n ],\n },\n\n {\n type: \'spacer\',\n flex: 1\n },\n\n {\n type: \'banner\',\n slot: [document.getElementById(\'banner_4945\').value]\n },\n\n \n \n \n\n \n\n {\n type: \'group\',\n collapsible: false,\n name: \'userEntities\',\n items: [\n {\n type: \'button\',\n name: \'offers\',\n iconCls: \'headline-ico-my-offer\',\n iconClsInverted: \'headline-ico-my-offer headline-ico-my-offer_invert\',\n title: \'\u041c\u043e\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f\',\n\n dropdown: {\n items: [\n [\'<span class="headline-drop js-user_offers">\',\n \n \'</span>\'].join(\'\'),\n\n {\n href: \'https://cars.mail.ru/sell/\',\n text: \'\u0420\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435\',\n attrs: {\n name: \'clb4872087\'\n }\n }\n \n ]\n }\n },\n {\n type: \'button\',\n name: \'reviews\',\n iconCls: \'headline-ico-my-review\',\n iconClsInverted: \'headline-ico-my-review headline-ico-my-review_invert\',\n title: \'\u041c\u043e\u0438 \u043e\u0442\u0437\u044b\u0432\u044b\',\n\n dropdown: {\n items: [\n [\'<span class="headline-drop js-user_reviews">\',\n \n \'</span>\'].join(\'\'),\n\n {\n href: \'https://cars.mail.ru/reviews/add_edit_review/\',\n text: \'\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0442\u0437\u044b\u0432\',\n attrs: {\n \'name\': \'clb4872089\',\n \'data-auth\': \'check\'\n }\n }\n ]\n }\n },\n {\n type: \'button\',\n name: \'compare\',\n href: \'https://cars.mail.ru/compare/\',\n iconCls: \'headline-ico-my-compare\',\n iconClsInverted: \'headline-ico-my-compare headline-ico-my-compare_invert\',\n title: \'\u041c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\',\n attrs: {\n name: \'clb4872090\'\n },\n \n disabled: true\n \n }\n ]\n }\n ]\n }\n};\n\n__PM.draw(oOptsHeadline, function(menuItems){\n var jReviewButton = $(menuItems.toolbar.itemsByName.userEntities.itemsByName.reviews.el);\n jReviewButton.find(\'.js-item[data-auth="check"] .js-link\').addClass(\'js-check_auth\');\n});\n</script>\n\n\n\t\t\t<!--CLOSE:PORTAL-HEADLINE-->\n\t\t</header>\n\t\t<!--CLOSE:HEADER-->\n\n\t\t<script src="/js/cars/fest/headline/offers.js"></script>\n\t\t<script src="/js/cars/fest/headline/reviews.js"></script>\n\t\t<script src="/js/cars/jquery.Headline.js"></script>\n\t\t<script src="/js/cpf/tools/tools.Auth.js"></script>\n\t\t<script src="/js/cpf/tools/tools.pageState.js"></script>\n\t\t<script src="/js/cpf/tools/jquery/jquery.loginForms.js"></script>\n\n\t\t<div class="page__body clear js-page__body">\n\t\t\t<div class="page__body__unit">\n\t\t\t\t<div class="page__body__unit__in">\n\t\t\t\t\t<div class="page__body__unit__box">\n\n\t\t\t\t\t\t<div class="foul">\n\t\t\t\t\t\t\t<div class="foul__pic">\n\t\t\t\t\t\t\t\t<div class="foul__pic__in"></div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class="foul__info">\n\t\t\t\t\t\t\t\t<div class="foul__info__box">\n\t\t\t\t\t\t\t\t\t<div class="foul__title">\u041e\u0448\u0438\u0431\u043a\u0430 404</div>\n\t\t\t\t\t\t\t\t\t<div class="foul__text">\u0412\u0438\u0434\u0438\u043c\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a, \u043c\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0432\u0441\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c.</div>\n\t\t\t\t\t\t\t\t\t<div class="foul__text foul__text_note">\n\t\t\t\t\t\t\t\t\t\t\u041d\u043e \u044d\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e, \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:\n\t\t\t\t\t\t\t\t\t\t<div class="foul__note">\n\t\t\t\t\t\t\t\t\t\t\t<div class="foul__note__item">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href="/sell/">\u041f\u043e\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0435</a>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class="foul__note__item">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href="/sale/">\u041d\u0430\u0439\u0442\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c</a>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<footer class="page__foot">\n\t\t\t<div class="footer">\n\t\t\t\t<div class="footer__portal">\n\t\t\t\t\t<a href="//mail.ru/" class="footer__link">Mail.Ru</a><!--noindex--><a href="//corp.mail.ru/" class="footer__link">\u041e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438</a><!--/noindex-->\n\t\t\t\t</div>\n\n\t\t\t\t<!--noindex-->\n\t\t\t\t<div class="footer__project">\n\t\t\t\t\t<a href="http://sales.mail.ru/ru/russia/cars/latest/#price" class="footer__link" target="_blank">\u0420\u0435\u043a\u043b\u0430\u043c\u043e\u0434\u0430\u0442\u0435\u043b\u044f\u043c</a><a href="/cabinet/" class="footer__link">\u041b\u0438\u0447\u043d\u044b\u0439 \u043a\u0430\u0431\u0438\u043d\u0435\u0442</a><span class="footer__link js-feedback" id="footer_feedback">\u041e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c</span><a href="/about/" class="footer__link">\u041e \u043f\u0440\u043e\u0435\u043a\u0442\u0435</a>\n\t\t\t\t</div>\n\t\t\t\t<!--/noindex-->\n\t\t\t</div>\n\n\t\t\t<script src="/js/cars/opts/opts.Popup.js"></script>\n\t\t\t<script src="/js/cars/forms/opts.customScroll.js"></script>\n\t\t\t<script src="/js/cars/forms/opts.customSelect.js"></script>\n\t\t\t<script src="/js/cars/forms/jquery.Tools.js"></script>\n\t\t\t<script src="/js/cars/jquery.asyncForms.js"></script>\n\t\t\t<script src="/js/cars/fest/common/feedback.js"></script>\n\t\t\t<script src="/js/cpf/tools/jquery/jquery.Popup.js"></script>\n\t\t\t<script src="/js/cars/jquery.Feedback.js"></script>\n\t\t</footer>\n\t</div>\n\n\t<div class="counters js-counters">\n\t\t<!--noindex-->\n\t\t<img src="https://rs.mail.ru/d3000726.gif?rnd=182260506&ts=1421256794" style="width:0;height:0;position:absolute;" alt=""/>\n<!-- mr_counter type="liru" personal="personal-auto" -->\r\n<!--LiveInternet counter--><script type="text/javascript"><!--\r\nnew Image().src = "//counter.yadro.ru/hit;personal-auto/cars/desktop?r"+\r\nescape(document.referrer)+((typeof(screen)=="undefined")?"":\r\n";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?\r\nscreen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+\r\n";"+Math.random();//--></script><!--/LiveInternet-->\r\n<!-- /mr_counter -->\r\n<!-- mr_counter type="topmail" domain="df.c4.b1.a0.top.mail.ru" id="85837" -->\r\n<!-- Rating@Mail.ru counter -->\r\n<script type="text/javascript">//<![CDATA[\r\nvar _tmr = _tmr || [];\r\n_tmr.push({id: \'85837\', type: \'pageView\', start: (new Date()).getTime()});\r\n(function (d, w) {\r\n var ts = d.createElement(\'script\'); ts.type = \'text/javascript\'; ts.async = true;\r\n ts.src = (d.location.protocol == \'https:\' ? \'https:\' : \'http:\') + \'//top-fwz1.mail.ru/js/code.js\';\r\n var f = function () {var s = d.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ts, s);};\r\n if (w.opera == "[object Opera]") { d.addEventListener("DOMContentLoaded", f, false); } else { f(); }\r\n})(document, window);\r\n//]]></script><noscript><div style="position:absolute;left:-10000px;">\r\n<img src="//top-fwz1.mail.ru/counter?id=85837;js=na;r=" style="border:0;" height="1" width="1" alt="\u0420\u0435\u0439\u0442\u0438\u043d\u0433@Mail.ru" />\r\n</div></noscript>\r\n<!-- //Rating@Mail.ru counter -->\r\n<!-- /mr_counter -->\r\n<!-- mr_counter type="topmail" domain="top-fwz1.mail.ru" id="2382459" -->\r\n<!-- Rating@Mail.ru counter -->\r\n<script type="text/javascript">//<![CDATA[\r\nvar _tmr = _tmr || [];\r\n_tmr.push({id: "2382459", type: "pageView", start: (new Date()).getTime()});\r\n(function (d, w) {\r\n var ts = d.createElement("script"); ts.type = "text/javascript"; ts.async = true;\r\n ts.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//top-fwz1.mail.ru/js/code.js";\r\n var f = function () {var s = d.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ts, s);};\r\n if (w.opera == "[object Opera]") { d.addEventListener("DOMContentLoaded", f, false); } else { f(); }\r\n})(document, window);\r\n//]]></script><noscript><div style="position:absolute;left:-10000px;">\r\n<img src="//top-fwz1.mail.ru/counter?id=2382459;js=na;r=" style="border:0;" height="1" width="1" alt="\u0420\u0435\u0439\u0442\u0438\u043d\u0433@Mail.ru" />\r\n</div></noscript>\r\n<!-- //Rating@Mail.ru counter -->\r\n<!-- /mr_counter -->\r\n<!-- mr_counter type="googl" id="UA-37196307-5" -->\r\n<script>\r\n (function(i,s,o,g,r,a,m){i[\'GoogleAnalyticsObject\']=r;i[r]=i[r]||function(){\r\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\r\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\r\n })(window,document,\'script\',\'//www.google-analytics.com/analytics.js\',\'ga\');\r\n\r\n ga(\'create\', \'UA-37196307-5\', \'cars.mail.ru\');\r\n ga(\'send\', \'pageview\');\r\n\r\n</script>\r\n<!-- /mr_counter -->\r\n<!-- mr_counter type="rbmail" src=".scorecardresearch.com/b?c1=2&c2=9999305&ns__t=" -->\r\n<!-- Begin comScore Tag -->\r\n<script>\r\ntry {\r\n(function(w,d,s) {\r\n s = w.encodeURIComponent || escape;\r\n new Image().src = "http" + ((d.URL.charAt(4) == "s") ? "s://sb" : "://b") + ".scorecardresearch.com/b?c1=2&c2=9999305&ns__t=" + +(new Date) + "&ns_c=" + (d.characterSet || d.defaultCharset || "") + "&c7=" + s(d.URL) + "&c9=" + s(d.referrer);\r\n})(window,document);\r\n} catch(e) {}\r\n</script>\r\n<!-- End comScore Tag -->\r\n<!-- /mr_counter --> \n\t\t<!--/noindex-->\n\n\t\t<!--noindex-->\n\t\t\r\n\r\n<script type="text/javascript">\r\n//<![CDATA[\r\n(function(w, d) {\r\n if (w.rb_counter) return;\r\n function h() {\r\n var n, a = arguments;\r\n for(var i=a.length;i--;){\r\n n = a[i].split(\',\');\r\n for(var j=n.length;j--;){\r\n c(n[j]);\r\n }\r\n }\r\n }\r\n function c(n) {\r\n var m, r = parseInt(Math.random()*1E9), s;\r\n if (!(m = n.match(/^(?:cl([bn])|([adgin]))(\\d+)(?:sz(\\d+))?/))) return;\r\n if (m[1]) {\r\n s = "s" + m[1];\r\n }\r\n else if(m[2] == "n") {\r\n s = "nc";\r\n }\r\n else if(m[2]=="i") {\r\n r = null;\r\n s = m[2];\r\n }\r\n else {\r\n s = m[2];\r\n }\r\n s += m[3] + ".gif?";\r\n if (m[4]) s += "sz=" + m[4];\r\n if (r) s += "&rnd=" + r;\r\n (new Image).src = "//rs.mail.ru/" + s;\r\n }\r\n (function(o, e, fn) {\r\n if (o.addEventListener) o.addEventListener(e, fn, false);\r\n else if (o.attachEvent) o.attachEvent(\'on\' + e, fn);\r\n else o[\'on\' + e] = fn;\r\n })(d, \'mousedown\', function(e) {\r\n var n;\r\n e = e || w.event;\r\n e = e.target || e.srcElement;\r\n while (e.parentNode){\r\n if ((n = e.getAttribute(\'name\')) && (n = n.toString())){\r\n h(n);\r\n }\r\n e = e.parentNode;\r\n }\r\n });\r\n w.rb_counter = h;\r\n})(window, document);\r\n//]]>\r\n</script>\r\n\r\n\r\n\r\n\r\n\n\t\t<!--/noindex-->\n\t</div>\n\n\t<!--OPEN:OVERLAY-->\n\t<div class="overlay js-popup" style="display:none;">\n\t\t<div class="overlay__box js-popup_close">\n\t\t\t<div class="overlay__box__cell js-box_cont">\n\t\t\t\t<div class="overlay__box__in">\n\t\t\t\t\t<div class="overlay__loading js-popup_loader">\n\t\t\t\t\t\t<img src="/img/overlay__loading-spinner.gif" alt="" class="overlay__loading__spinner"><br>\n\t\t\t\t\t\t\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="overlay__content js-popup_blocks">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<!--CLOSE:OVERLAY-->\n\n</body>\n</html>\n'
Посты чуть ниже также могут вас заинтересовать
Добрый день. Было бы очень интересно увидеть сравнение библиотек requests с grab для задач парсинга сайтов.
ОтветитьУдалитьДобрый день.
ОтветитьУдалитьУ меня сложились следующие представления:
grab - обертка для мощнейшей curl (по словам автора) - подключаешь список прокси и быстро выкашиваешь тяжеленный медиа-сайт.
Но мне не надо было выкашивать большие объемы информации, потому я предпочел scrapy (там мне больше понравились настройки для вырезания нескольких текстовых фрагментов с html страниц).
Мои задачи - грузим сотню, другую страниц и делаем из них таблицы для дальнейшего статистического анализа.
А requests я попробовал для единичных задач - нашел страничку с готовой таблицей. Вырезал таблицу и тут же построил диаграмму по этим данным.
Информация и ссылки по всем этим библиотекам есть на сайте (используйте поиск или облако меток на главной странице).