Hormold

VK Change (#1386870303)

Dec 12th, 2013
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 62.75 KB | None | 0 0
  1. Файл - aes_light.css (Старый размер - 12168 | Новый - 0):
  2. 0.  - #aes_light_css { display: none; }
  3. 1.  -
  4. 2.  - /* Size */
  5. 3.  -
  6. 4.  - .ads_ads_box.size_small {
  7. 5.  -   font-size: 11px;
  8. 6.  - }
  9. 7.  - .ads_ads_box.size_medium {
  10. 8.  -   font-size: 12px;
  11. 9.  - }
  12. 10.  - .ads_ads_box.size_big {
  13. 11.  -   font-size: 13px;
  14. 12.  - }
  15. 13.  -
  16. 14.  - .ads_ad_box.ver.repeat_ver.size_site {
  17. 15.  -   width: 118px;
  18. 16.  - }
  19. 17.  - .ads_ad_box.ver.repeat_ver.size_site.news {
  20. 18.  -   width: 172px;
  21. 19.  - }
  22. 20.  - .ads_ad_box.ver.repeat_ver.size_small {
  23. 21.  -   width: 120px;
  24. 22.  - }
  25. 23.  - .ads_ad_box.ver.repeat_ver.size_medium {
  26. 24.  -   width: 135px;
  27. 25.  - }
  28. 26.  - .ads_ad_box.ver.repeat_ver.size_big {
  29. 27.  -   width: 150px;
  30. 28.  - }
  31. 29.  - .ads_ad_box.ver.repeat_hor.size_small {
  32. 30.  -   width: 132px;
  33. 31.  - }
  34. 32.  - .ads_ad_box.ver.repeat_hor.size_medium {
  35. 33.  -   width: 141px;
  36. 34.  - }
  37. 35.  - .ads_ad_box.ver.repeat_hor.size_big {
  38. 36.  -   width: 150px;
  39. 37.  - }
  40. 38.  - .ads_ad_box2.ver.repeat_ver.size_site {
  41. 39.  -   width: 112px;
  42. 40.  -   padding-left: 3px;
  43. 41.  -   padding-right: 3px;
  44. 42.  - }
  45. 43.  - .ads_ad_box2.ver.repeat_ver.size_site.news {
  46. 44.  -   width: 172px;
  47. 45.  -   padding: 0;
  48. 46.  - }
  49. 47.  - .ads_ad_box2.ver.repeat_ver.size_small {
  50. 48.  -   width: 112px;
  51. 49.  -   padding-left: 4px;
  52. 50.  -   padding-right: 4px;
  53. 51.  - }
  54. 52.  - .ads_ad_box2.ver.repeat_ver.size_medium {
  55. 53.  -   width: 121px;
  56. 54.  -   padding-left: 7px;
  57. 55.  -   padding-right: 7px;
  58. 56.  - }
  59. 57.  - .ads_ad_box2.ver.repeat_ver.size_big {
  60. 58.  -   width: 130px;
  61. 59.  -   padding-left: 10px;
  62. 60.  -   padding-right: 10px;
  63. 61.  - }
  64. 62.  - .ads_ad_box2.ver.repeat_hor.size_small,
  65. 63.  - .ads_ad_box2.ver.repeat_hor.size_medium,
  66. 64.  - .ads_ad_box2.ver.repeat_hor.size_big {
  67. 65.  -   padding-left: 10px;
  68. 66.  -   padding-right: 10px;
  69. 67.  - }
  70. 68.  -
  71. 69.  - .ads_ad_box.hor.repeat_ver.size_small {
  72. 70.  -   max-width: 390px;
  73. 71.  - }
  74. 72.  - .ads_ad_box.hor.repeat_ver.size_medium {
  75. 73.  -   max-width: 410px;
  76. 74.  - }
  77. 75.  - .ads_ad_box.hor.repeat_ver.size_big {
  78. 76.  -   max-width: 430px;
  79. 77.  - }
  80. 78.  - .ads_ad_box.hor.repeat_hor.size_small {
  81. 79.  -   max-width: 260px;
  82. 80.  - }
  83. 81.  - .ads_ad_box.hor.repeat_hor.size_medium {
  84. 82.  -   max-width: 280px;
  85. 83.  - }
  86. 84.  - .ads_ad_box.hor.repeat_hor.size_big {
  87. 85.  -   max-width: 300px;
  88. 86.  - }
  89. 87.  - .ads_ad_box2.hor.repeat_ver {
  90. 88.  -   padding: 10px;
  91. 89.  - }
  92. 90.  - .ads_ad_box2.hor.repeat_hor {
  93. 91.  -   padding: 0 10px;
  94. 92.  - }
  95. 93.  - .ads_ad_box2.hor.repeat_ver.size_small {
  96. 94.  -   max-width: 370px;
  97. 95.  - }
  98. 96.  - .ads_ad_box2.hor.repeat_ver.size_medium {
  99. 97.  -   max-width: 390px;
  100. 98.  - }
  101. 99.  - .ads_ad_box2.hor.repeat_ver.size_big {
  102. 100.  -   max-width: 410px;
  103. 101.  - }
  104. 102.  - .ads_ad_box2.hor.repeat_hor.size_small {
  105. 103.  -   max-width: 240px;
  106. 104.  - }
  107. 105.  - .ads_ad_box2.hor.repeat_hor.size_medium {
  108. 106.  -   max-width: 260px;
  109. 107.  - }
  110. 108.  - .ads_ad_box2.hor.repeat_hor.size_big {
  111. 109.  -   max-width: 280px;
  112. 110.  - }
  113. 111.  - .ads_ad_text_box.hor.repeat_ver.size_small {
  114. 112.  -   max-width: 270px;
  115. 113.  - }
  116. 114.  - .ads_ad_text_box.hor.repeat_ver.size_medium {
  117. 115.  -   max-width: 290px;
  118. 116.  - }
  119. 117.  - .ads_ad_text_box.hor.repeat_ver.size_big {
  120. 118.  -   max-width: 310px;
  121. 119.  - }
  122. 120.  - .ads_ad_text_box.hor.repeat_hor.size_small {
  123. 121.  -   max-width: 140px;
  124. 122.  - }
  125. 123.  - .ads_ad_text_box.hor.repeat_hor.size_medium {
  126. 124.  -   max-width: 160px;
  127. 125.  - }
  128. 126.  - .ads_ad_text_box.hor.repeat_hor.size_big {
  129. 127.  -   max-width: 180px;
  130. 128.  - }
  131. 129.  -
  132. 130.  - .ads_ad_box.hor.repeat_hor.size_small {
  133. 131.  -   height: 105px;
  134. 132.  -   max-height: 105px;
  135. 133.  - }
  136. 134.  - .ads_ad_box.hor.repeat_hor.size_medium {
  137. 135.  -   height: 110px;
  138. 136.  -   max-height: 110px;
  139. 137.  - }
  140. 138.  - .ads_ad_box.hor.repeat_hor.size_big {
  141. 139.  -   height: 115px;
  142. 140.  -   max-height: 115px;
  143. 141.  - }
  144. 142.  - .ads_ad_box2.hor.repeat_hor.size_small {
  145. 143.  -   height: 105px;
  146. 144.  - }
  147. 145.  - .ads_ad_box2.hor.repeat_hor.size_medium {
  148. 146.  -   height: 110px;
  149. 147.  - }
  150. 148.  - .ads_ad_box2.hor.repeat_hor.size_big {
  151. 149.  -   height: 115px;
  152. 150.  - }
  153. 151.  -
  154. 152.  - .ads_ad_box5_spacer.hor.repeat_hor.size_small {
  155. 153.  -   height: 95px;
  156. 154.  - }
  157. 155.  - .ads_ad_box5_spacer.hor.repeat_hor.size_medium {
  158. 156.  -   height: 100px;
  159. 157.  - }
  160. 158.  - .ads_ad_box5_spacer.hor.repeat_hor.size_big {
  161. 159.  -   height: 105px;
  162. 160.  - }
  163. 161.  -
  164. 162.  - /* Ads */
  165. 163.  -
  166. 164.  - .ads_ads_box {
  167. 165.  -   display: table;
  168. 166.  -   width: 100%;
  169. 167.  - }
  170. 168.  - .ads_ads_box2 {
  171. 169.  -   display: table-cell;
  172. 170.  - }
  173. 171.  - .ads_ads_box2.hor {
  174. 172.  -   vertical-align: middle;
  175. 173.  - }
  176. 174.  - .ads_ads_box2.ver,
  177. 175.  - .ads_ads_box2.hor.repeat_ver {
  178. 176.  -   text-align: center;
  179. 177.  - }
  180. 178.  - .ads_ads_box3 {
  181. 179.  -   display: inline-block;
  182. 180.  - }
  183. 181.  - .ads_ads_box3.mosaic,
  184. 182.  - .ads_ads_box3.news {
  185. 183.  -   display: block;
  186. 184.  -   width: 100%;
  187. 185.  -   position: relative;
  188. 186.  -   padding-bottom: 8px;
  189. 187.  - }
  190. 188.  - .ads_ads_box4.repeat_hor {
  191. 189.  -   white-space: nowrap;
  192. 190.  - }
  193. 191.  - .ads_ads_box4.ver.repeat_hor {
  194. 192.  -   overflow: hidden;
  195. 193.  -   padding-bottom: 20px;
  196. 194.  - }
  197. 195.  - .ads_ads_box4.ver.repeat_hor.with_ads_border {
  198. 196.  -   padding-bottom: 15px;
  199. 197.  - }
  200. 198.  - .ads_ads_box4.mosaic,
  201. 199.  - .ads_ads_box4.news {
  202. 200.  -   display: table;
  203. 201.  -   width: 100%;
  204. 202.  - }
  205. 203.  -
  206. 204.  - .ads_ads_border {
  207. 205.  -   position: absolute;
  208. 206.  -   background-color: #FFFFFF;
  209. 207.  -   border: 1px solid transparent;
  210. 208.  -   top: 0;
  211. 209.  -   bottom: 0;
  212. 210.  -   left: 0;
  213. 211.  -   right: 0;
  214. 212.  -   z-index: -10;
  215. 213.  - }
  216. 214.  - .ads_ads_border.mosaic {
  217. 215.  -   border-bottom: 1px solid #DCE3E9;
  218. 216.  -   z-index: auto;
  219. 217.  - }
  220. 218.  -
  221. 219.  - .ads_ads_help {
  222. 220.  -   padding: 3px 0 4px 0;
  223. 221.  -   font-size: 0.91em;
  224. 222.  -   text-align: center;
  225. 223.  - }
  226. 224.  -
  227. 225.  - .ads_ads_all_ads {
  228. 226.  -   padding: 3px 0 4px 0;
  229. 227.  -   font-size: 0.91em;
  230. 228.  -   text-align: center;
  231. 229.  - }
  232. 230.  - .ads_ads_all_ads_link {
  233. 231.  -   color: #777777;
  234. 232.  - }
  235. 233.  -
  236. 234.  - .ads_ads_about {
  237. 235.  -   height: 24px;
  238. 236.  -   padding-bottom: 1px;
  239. 237.  -   font-size: 0.91em;
  240. 238.  -   text-align: center;
  241. 239.  -   display: table;
  242. 240.  -   width: 100%;
  243. 241.  -   position: relative;
  244. 242.  -   z-index: 6;
  245. 243.  - }
  246. 244.  - .ads_ads_about2 {
  247. 245.  -   display: table-cell;
  248. 246.  -   vertical-align: middle;
  249. 247.  - }
  250. 248.  - .ads_ads_about.repeat_hor {
  251. 249.  -   height: 19px;
  252. 250.  -   padding-left: 10px;
  253. 251.  -   text-align: left;
  254. 252.  - }
  255. 253.  - .ads_ads_about2.repeat_hor {
  256. 254.  -   vertical-align: top;
  257. 255.  - }
  258. 256.  - .ads_ads_about.ver.repeat_hor {
  259. 257.  -   margin-top: -20px;
  260. 258.  - }
  261. 259.  - .ads_ads_about.ver.repeat_hor.with_ads_border {
  262. 260.  -   margin-top: -15px;
  263. 261.  - }
  264. 262.  -
  265. 263.  - /* Ad wrap */
  266. 264.  -
  267. 265.  - .ads_ad_box_wrap.mosaic,
  268. 266.  - .ads_ad_box_wrap.news {
  269. 267.  -   display: table-cell;
  270. 268.  -   vertical-align: top;
  271. 269.  -   overflow: hidden;
  272. 270.  - }
  273. 271.  - .ads_ad_box_wrap.news {
  274. 272.  -   padding-right: 10px;
  275. 273.  - }
  276. 274.  -
  277. 275.  - /* Ad */
  278. 276.  -
  279. 277.  - .ads_ad_box {
  280. 278.  -   display: block;
  281. 279.  -   position: relative;
  282. 280.  -   white-space: normal;
  283. 281.  - }
  284. 282.  - .ads_ad_box.ver.repeat_hor,
  285. 283.  - .ads_ad_box.ver.repeat_ver.mosaic {
  286. 284.  -   overflow: hidden;
  287. 285.  -   padding-bottom: 300px;
  288. 286.  -   margin-bottom: -300px;
  289. 287.  - }
  290. 288.  - .ads_ad_box.repeat_hor {
  291. 289.  -   display: inline-block;
  292. 290.  -   vertical-align: top;
  293. 291.  - }
  294. 292.  - .ads_ad_box2 {
  295. 293.  -   overflow: hidden;
  296. 294.  -   word-wrap: break-word;
  297. 295.  -   position: relative;
  298. 296.  -   z-index: 2;
  299. 297.  - }
  300. 298.  - .ads_ad_box2.ver {
  301. 299.  -   display: block;
  302. 300.  -   text-align: center;
  303. 301.  -   padding-top: 8px;
  304. 302.  -   padding-bottom: 11px;
  305. 303.  - }
  306. 304.  - .ads_ad_box2.ver.news {
  307. 305.  -   text-align: left;
  308. 306.  - }
  309. 307.  - .ads_ad_box2.hor {
  310. 308.  -   display: inline-block;
  311. 309.  -   text-align: left;
  312. 310.  - }
  313. 311.  - .ads_ad_box2.ver.repeat_hor,
  314. 312.  - .ads_ad_box2.ver.repeat_ver.mosaic {
  315. 313.  -   padding-bottom: 311px;
  316. 314.  -   margin-bottom: -300px;
  317. 315.  - }
  318. 316.  - .ads_ad_box2.hor.repeat_ver {
  319. 317.  -   width: 100%;
  320. 318.  - }
  321. 319.  - a.ads_ad_box2:hover {
  322. 320.  -   text-decoration: none;
  323. 321.  - }
  324. 322.  - .ads_ad_box3 {
  325. 323.  -   display: inline-block;
  326. 324.  -   overflow: hidden;
  327. 325.  -   height: 100%;
  328. 326.  - }
  329. 327.  - .ads_ad_box3.ver {
  330. 328.  -   width: 100%;
  331. 329.  - }
  332. 330.  - .ads_ad_box4 {
  333. 331.  -   display: table;
  334. 332.  -   height: 100%;
  335. 333.  - }
  336. 334.  - .ads_ad_box4.ver {
  337. 335.  -   table-layout: fixed;
  338. 336.  -   width: 100%;
  339. 337.  - }
  340. 338.  - .ads_ad_box5 {
  341. 339.  -   display: table-cell;
  342. 340.  -   vertical-align: middle;
  343. 341.  - }
  344. 342.  - .ads_ad_box5.hor.repeat_hor.max_size {
  345. 343.  -   white-space: nowrap;
  346. 344.  - }
  347. 345.  - .ads_ad_box5_spacer {
  348. 346.  -   display: none;
  349. 347.  - }
  350. 348.  - .ads_ad_box5_spacer.hor.repeat_hor {
  351. 349.  -   display: block;
  352. 350.  -   float: left;
  353. 351.  -   width: 0;
  354. 352.  - }
  355. 353.  - .ads_ad_box6.hor {
  356. 354.  -   display: table;
  357. 355.  -   padding-top: 6px;
  358. 356.  - }
  359. 357.  -
  360. 358.  - .ads_ad_box_border {
  361. 359.  -   border: 0 solid #DCE3E9;
  362. 360.  -   position: absolute;
  363. 361.  -   top: 0;
  364. 362.  -   bottom: 0;
  365. 363.  -   left: 0;
  366. 364.  -   right: 0;
  367. 365.  -   z-index: 1;
  368. 366.  - }
  369. 367.  - .ads_ad_box_border.repeat_ver {
  370. 368.  -   border-bottom-width: 1px;
  371. 369.  - }
  372. 370.  - .ads_ad_box_border.repeat_ver.with_ads_border {
  373. 371.  -   left: 5px;
  374. 372.  -   right: 5px;
  375. 373.  - }
  376. 374.  - .ads_ad_box_border.repeat_ver.first {
  377. 375.  -   border-top-width: 1px;
  378. 376.  - }
  379. 377.  - .ads_ad_box_border.repeat_ver.first.with_ads_border {
  380. 378.  -   border-top-width: 0;
  381. 379.  - }
  382. 380.  - .ads_ad_box_border.repeat_ver.mosaic.first {
  383. 381.  -   border-width: 0;
  384. 382.  - }
  385. 383.  - .ads_ad_box_border.repeat_hor {
  386. 384.  -   border-right-width: 1px;
  387. 385.  -   bottom: -20px;
  388. 386.  - }
  389. 387.  - .ads_ad_box_border.repeat_hor.with_ads_border {
  390. 388.  -   top: 5px;
  391. 389.  -   bottom: -15px;
  392. 390.  - }
  393. 391.  - .ads_ad_box_border.repeat_hor.last {
  394. 392.  -   border-right-width: 0;
  395. 393.  - }
  396. 394.  -
  397. 395.  - /* Ad parts */
  398. 396.  -
  399. 397.  - .ads_ad_photo_box {
  400. 398.  -   position: relative;
  401. 399.  - }
  402. 400.  - .ads_ad_photo_box.ver {
  403. 401.  -   padding-top: 9px;
  404. 402.  - }
  405. 403.  - .ads_ad_photo_box.ver.news {
  406. 404.  -   padding: 0;
  407. 405.  - }
  408. 406.  - .ads_ad_photo_box.hor {
  409. 407.  -   display: table-cell;
  410. 408.  -   vertical-align: top;
  411. 409.  -   padding: 3px 0;
  412. 410.  - }
  413. 411.  - .ads_ad_photo_box.promotion {
  414. 412.  -   max-height: 90px;
  415. 413.  -   overflow: hidden;
  416. 414.  - }
  417. 415.  -
  418. 416.  - .ads_ad_text_box.hor {
  419. 417.  -   display: table-cell;
  420. 418.  -   vertical-align: top;
  421. 419.  -   padding-left: 10px;
  422. 420.  - }
  423. 421.  -
  424. 422.  - .ads_ad_photo {
  425. 423.  -   display: block;
  426. 424.  -   max-width: 90px;
  427. 425.  - }
  428. 426.  - .ads_ad_photo.ver {
  429. 427.  -   margin: 0 auto;
  430. 428.  - }
  431. 429.  - .ads_ad_photo.ver.news {
  432. 430.  -   margin: 0;
  433. 431.  -   max-width: 172px;
  434. 432.  -   border-radius: 3px;
  435. 433.  - }
  436. 434.  -
  437. 435.  - .ads_ad_play {
  438. 436.  -   position: absolute;
  439. 437.  -   top: 46px;
  440. 438.  -   left: 33px;
  441. 439.  -   width: 46px;
  442. 440.  -   height: 46px;
  443. 441.  -   background: url(/images/ad_video_play.png) no-repeat 0 0;
  444. 442.  -   background-size: 46px 46px;
  445. 443.  - }
  446. 444.  - .is_2x .ads_ad_play {
  447. 445.  -   background-image: url(/images/ad_video_play_2x.png);
  448. 446.  - }
  449. 447.  - .ads_ad_play.big {
  450. 448.  -   top: 66px;
  451. 449.  - }
  452. 450.  -
  453. 451.  - .ads_ad_play_app {
  454. 452.  -   display: none;
  455. 453.  -   position: absolute;
  456. 454.  -   top: 33px;
  457. 455.  -   left: 26px;
  458. 456.  -   width: 54px;
  459. 457.  -   height: 16px;
  460. 458.  -   padding: 12px 54px 12px 12px;
  461. 459.  -   border-radius: 6px;
  462. 460.  -   color: #FFFFFF;
  463. 461.  -   font-weight: bold;
  464. 462.  -   white-space: nowrap;
  465. 463.  -   word-wrap: normal;
  466. 464.  -   text-align: center;
  467. 465.  -   background: url(/images/joy_white.png) no-repeat 78px 10px rgba(0, 0, 0, 0.55);
  468. 466.  -   background-size: 31px 20px;
  469. 467.  -
  470. 468.  -   opacity: 0;
  471. 469.  -   -webkit-transition: opacity 200ms ease-out;
  472. 470.  -   -moz-transition: opacity 200ms ease-out;
  473. 471.  -   -o-transition: opacity 200ms ease-out;
  474. 472.  -   transition: opacity 200ms ease-out;
  475. 473.  - }
  476. 474.  - .is_2x .ads_ad_play_app {
  477. 475.  -   background-image: url(/images/joy_white_2x.png);
  478. 476.  - }
  479. 477.  - .ads_ad_play_app:active {
  480. 478.  -   padding-top: 13px;
  481. 479.  -   padding-bottom: 11px;
  482. 480.  -   background-position: 78px 11px;
  483. 481.  - }
  484. 482.  -
  485. 483.  - .ads_ad_title_box {
  486. 484.  -   color: #36638E;
  487. 485.  -   font-weight: bold;
  488. 486.  - }
  489. 487.  - .ads_ad_title_box.ver.repeat_hor,
  490. 488.  - .ads_ad_title_box.mosaic {
  491. 489.  -   display: table;
  492. 490.  -   width: 100%;
  493. 491.  - }
  494. 492.  - .ads_ad_title_box.news {
  495. 493.  -   padding-top: 7px;
  496. 494.  - }
  497. 495.  - .ads_ad_title_spacer1.ver.repeat_hor,
  498. 496.  - .ads_ad_title_spacer1.mosaic {
  499. 497.  -   display: table-cell;
  500. 498.  - }
  501. 499.  - .ads_ad_title_spacer2.ver.repeat_hor,
  502. 500.  - .ads_ad_title_spacer2.mosaic {
  503. 501.  -   visibility: hidden;
  504. 502.  -   white-space: pre;
  505. 503.  -   width: 0;
  506. 504.  - }
  507. 505.  - .ads_ad_title.ver.repeat_hor,
  508. 506.  - .ads_ad_title.mosaic {
  509. 507.  -   display: table-cell;
  510. 508.  -   vertical-align: bottom;
  511. 509.  - }
  512. 510.  - .ads_ad_title.news:hover {
  513. 511.  -   text-decoration: underline;
  514. 512.  - }
  515. 513.  - .ads_ad_description {
  516. 514.  -   color: #000000;
  517. 515.  - }
  518. 516.  - .ads_ad_description.ver {
  519. 517.  -   padding-top: 10px;
  520. 518.  - }
  521. 519.  -
  522. 520.  - .ads_ad_community_join {
  523. 521.  -   color: #2B587A;
  524. 522.  -   padding-top: 10px;
  525. 523.  - }
  526. 524.  - .ads_ad_community_join:hover {
  527. 525.  -   text-decoration: underline;
  528. 526.  -   cursor: pointer;
  529. 527.  - }
  530. 528.  -
  531. 529.  - .ads_ad_domain {
  532. 530.  -   color: #777777;
  533. 531.  -   font-size: 0.91em;
  534. 532.  -   padding-top: 3px;
  535. 533.  - }
  536. 534.  - .ads_ad_domain.news {
  537. 535.  -   font-size: 1em;
  538. 536.  -   padding-top: 1px;
  539. 537.  - }
  540. 538.  -
  541. 539.  - .ads_ad_disclaimers {
  542. 540.  -   color: #777777;
  543. 541.  -   font-size: 0.82em;
  544. 542.  -   line-height: 130%;
  545. 543.  - }
  546. 544.  - .ads_ad_disclaimer_medical.ver,
  547. 545.  - .ads_ad_disclaimer_specialist.ver {
  548. 546.  -   padding-top: 10px;
  549. 547.  - }
  550. 548.  - .ads_ad_disclaimer_medical.hor,
  551. 549.  - .ads_ad_disclaimer_specialist.hor {
  552. 550.  -   padding-top: 3px;
  553. 551.  - }
  554. 552.  -
  555. 553.  - /* Ad extra */
  556. 554.  -
  557. 555.  - .ads_ad_external_stats {
  558. 556.  -   display: none;
  559. 557.  - }
  560. 558.  -
  561. 559.  - /* Ad close */
  562. 560.  -
  563. 561.  - .ads_ad_close_info {
  564. 562.  -   color: #808080;
  565. 563.  -   font-size: 0.91em;
  566. 564.  -   background-color: #F7F7F7;
  567. 565.  -   height: 100%;
  568. 566.  -   width: 100%;
  569. 567.  -   overflow: hidden;
  570. 568.  -   text-align: center;
  571. 569.  -   position: absolute;
  572. 570.  -   z-index: 5;
  573. 571.  -   display: none;
  574. 572.  -   word-wrap: break-word;
  575. 573.  - }
  576. 574.  - .ads_ad_close_info2 {
  577. 575.  -   padding: 0 3px;
  578. 576.  -   overflow: hidden;
  579. 577.  -   height: 100%;
  580. 578.  -   position: relative;
  581. 579.  -   z-index: 2;
  582. 580.  - }
  583. 581.  - .ads_ad_close_info3 {
  584. 582.  -   display: table;
  585. 583.  -   table-layout: fixed;
  586. 584.  -   height: 100%;
  587. 585.  -   width: 100%;
  588. 586.  - }
  589. 587.  - .ads_ad_close_info4 {
  590. 588.  -   display: table-cell;
  591. 589.  -   vertical-align: middle;
  592. 590.  -   overflow: hidden;
  593. 591.  - }
  594. 592.  - .ads_ad_close_complain {
  595. 593.  -   padding-top: 10px;
  596. 594.  - }
  597. 595.  - .ads_ad_close_complain_link {
  598. 596.  -   color: #2B587A;
  599. 597.  - }
  600. 598.  - .ads_ad_close_complain_link:hover {
  601. 599.  -   text-decoration: underline;
  602. 600.  -   cursor: pointer;
  603. 601.  - }
  604. 602.  -
  605. 603.  - /* All ads box */
  606. 604.  -
  607. 605.  - #ads_ads_all_ads_rows {
  608. 606.  -   overflow: hidden;
  609. 607.  - }
  610. 608.  - .ads_ads_all_ads_box_row {
  611. 609.  -   margin-right: -10px;
  612. 610.  - }
  613. 611.  - .ads_ads_all_ads_box_cell {
  614. 612.  -   padding: 14px 10px 8px 0;
  615. 613.  -   vertical-align: top;
  616. 614.  -   overflow: hidden;
  617. 615.  - }
  618. 616.  - .ads_ads_all_ads_box_border {
  619. 617.  -   position: relative;
  620. 618.  - }
  621. 619.  -
  622. 620.  - /* News */
  623. 621.  -
  624. 622.  - .ads_ads_news_wrap {
  625. 623.  -   border-bottom: 1px solid #DCE3E9;
  626. 624.  -   padding-top: 10px;
  627. 625.  -   position: relative;
  628. 626.  - }
  629. 627.  - .ads_ads_news_left {
  630. 628.  -   position: absolute;
  631. 629.  - }
  632. 630.  - .ads_ads_news_right {
  633. 631.  -   padding-left: 60px;
  634. 632.  - }
  635. 633.  - .ads_ads_news_image {
  636. 634.  -   display: block;
  637. 635.  -   width: 50px;
  638. 636.  -   height: 50px;
  639. 637.  -   background: url(/images/joy_50.png) no-repeat 0 0;
  640. 638.  -   background-size: 50px 50px;
  641. 639.  - }
  642. 640.  - .is_2x .ads_ads_news_image {
  643. 641.  -   background-image: url(/images/joy_100.png);
  644. 642.  - }
  645. 643.  - .ads_ads_news_title {
  646. 644.  -   font-weight: bold;
  647. 645.  - }
  648. 646.  - .ads_ads_news_content {
  649. 647.  -   padding-top: 8px;
  650. 648.  -   padding-bottom: 2px;
  651. 649.  -   margin-right: -10px;
  652. 650.  - }
  653. 651.  - .ads_ads_news_close {
  654. 652.  -   position: absolute;
  655. 653.  -   background: url(/images/pics/statusx_op.gif) no-repeat scroll 0 0;
  656. 654.  -   background-size: 11px 11px;
  657. 655.  -   width: 11px;
  658. 656.  -   height: 11px;
  659. 657.  -   top: 10px;
  660. 658.  -   right: 0;
  661. 659.  -   opacity: 0;
  662. 660.  -   cursor: pointer;
  663. 661.  - }
  664. 662.  - .is_2x .ads_ads_news_close {
  665. 663.  -   background-image: url(/images/pics/statusx_op_2x.gif);
  666. 664.  - }
  667. 665.  - .ads_ads_news_close_tooltip {
  668. 666.  -   display: none;
  669. 667.  - }
  670. 668.  -
  671. 669.  - .ads_ads_news_wrap .ads_ad_box_border.news {
  672. 670.  -   border: 0;
  673. 671.  - }
  674. 672.  - .ads_ads_news_wrap .ads_ad_play_app {
  675. 673.  -   display: block;
  676. 674.  - }
  677. 675.  - .ads_ads_news_wrap .ads_ad_box:hover .ads_ad_play_app {
  678. 676.  -   opacity: 1;
  679. 677.  - }
  680. ------
  681. Файл - aes_light.js (Старый размер - 36758 | Новый - 0):
  682. 0.  - (function() {
  683. 1.  -
  684. 2.  - var AdsLight = {};
  685. 3.  -
  686. 4.  - var isVkDomain = (document.domain === 'vk.com');
  687. 5.  -
  688. 6.  - var uaLight = navigator.userAgent.toLowerCase();
  689. 7.  - var browserLight = {
  690. 8.  -   msie6: (/msie 6/i.test(uaLight) && !/opera/i.test(uaLight)),
  691. 9.  -   msie7: (/msie 7/i.test(uaLight) && !/opera/i.test(uaLight)),
  692. 10.  -   msie8: (/msie 8/i.test(uaLight) && !/opera/i.test(uaLight))
  693. 11.  - };
  694. 12.  -
  695. 13.  - if (isVkDomain) {
  696. 14.  -   if (!('__adsLoaded' in window)) window.__adsLoaded = vkNow();
  697. 15.  -   window.AdsLight = AdsLight;
  698. 16.  - }
  699. 17.  -
  700. 18.  - AdsLight.init = function() {
  701. 19.  -   if (window.vk__adsLight) {
  702. 20.  -     return;
  703. 21.  -   }
  704. 22.  -
  705. 23.  -   window.vk__adsLight = {};
  706. 24.  -
  707. 25.  -   AdsLight.initUserHandlers();
  708. 26.  -
  709. 27.  -   vk__adsLight.widgetsIds       = {};
  710. 28.  -   vk__adsLight.observersInited  = false;
  711. 29.  -   vk__adsLight.publishTimers    = {};
  712. 30.  -
  713. 31.  -   vk__adsLight.windowId         = Math.round(Math.random() * 1000000000 + 1);
  714. 32.  -   vk__adsLight.activeTab        = 0;
  715. 33.  -   vk__adsLight.userEventTime    = 0;
  716. 34.  -   vk__adsLight.wrapVisible      = false;
  717. 35.  -   vk__adsLight.imagesTimer      = false;
  718. 36.  -   vk__adsLight.reloadTimer      = false;
  719. 37.  -   vk__adsLight.updateBlockTimer = false;
  720. 38.  -
  721. 39.  -   vk__adsLight.adsCanShow       = 1;
  722. 40.  -   vk__adsLight.adsSection       = false;
  723. 41.  -   vk__adsLight.adsShowed        = '';
  724. 42.  -   vk__adsLight.adsShowedHash    = +new Date;
  725. 43.  -   vk__adsLight.adsParams        = false;
  726. 44.  -
  727. 45.  -   vk__adsLight.updateProgress   = 0;
  728. 46.  -   vk__adsLight.adsShowedAll     = {};
  729. 47.  -
  730. 48.  -   vk__adsLight.loadComplete     = false;
  731. 49.  -   vk__adsLight.loaderParams     = false;
  732. 50.  -
  733. 51.  -   if ('onfocusin' in window) { // IE
  734. 52.  -     if (window.addEventListener) { // IE >= 9
  735. 53.  -       window.addEventListener('focusin',  vk__adsLight.userHandlers.onFocusWindow, false);
  736. 54.  -       window.addEventListener('focusout', vk__adsLight.userHandlers.onBlurWindow, false);
  737. 55.  -     } else {
  738. 56.  -       if (window.attachEvent) { // IE < 9
  739. 57.  -         window.attachEvent('onfocusin',  vk__adsLight.userHandlers.onFocusWindow);
  740. 58.  -         window.attachEvent('onfocusout', vk__adsLight.userHandlers.onBlurWindow);
  741. 59.  -       }
  742. 60.  -     }
  743. 61.  -   } else {
  744. 62.  -     if (window.addEventListener) { // Firefox, Opera, Google Chrome and Safari
  745. 63.  -       window.addEventListener('focus', vk__adsLight.userHandlers.onFocusWindow, true);
  746. 64.  -       window.addEventListener('blur',  vk__adsLight.userHandlers.onBlurWindow, true);
  747. 65.  -     }
  748. 66.  -   }
  749. 67.  -   if (document.addEventListener) {
  750. 68.  -     window.addEventListener('scroll',      vk__adsLight.userHandlers.onScrollWindow, true);
  751. 69.  -     document.addEventListener('mousedown', vk__adsLight.userHandlers.onMouseDownDocument, true);
  752. 70.  -   } else if (document.attachEvent) {
  753. 71.  -     window.attachEvent('onscroll',      vk__adsLight.userHandlers.onScrollWindow);
  754. 72.  -     document.attachEvent('onmousedown', vk__adsLight.userHandlers.onMouseDownDocument);
  755. 73.  -   }
  756. 74.  -
  757. 75.  -   if (!isVkDomain && window.VK && VK.addCallback) {
  758. 76.  -     VK.addCallback('adsPublish', AdsLight.handleEvent);
  759. 77.  -   }
  760. 78.  -
  761. 79.  -   vk__adsLight.userHandlers.onInit(true);
  762. 80.  - }
  763. 81.  -
  764. 82.  - AdsLight.initUserHandlers = function() {
  765. 83.  -
  766. 84.  -   vk__adsLight.userHandlers = {
  767. 85.  -     onInit:                    onInit,
  768. 86.  -     onHasFocus:                onHasFocus,
  769. 87.  -     onFocusWindow:             onFocusWindow,
  770. 88.  -     onBlurWindow:              onBlurWindow,
  771. 89.  -     onScrollWindow:            onScrollWindow,
  772. 90.  -     onMouseDownDocument:       onMouseDownDocument,
  773. 91.  -     onMouseDownDocumentAction: onMouseDownDocumentAction,
  774. 92.  -     onActiveTab:               onActiveTab
  775. 93.  -   };
  776. 94.  -
  777. 95.  -   var needBlur       = false;
  778. 96.  -   var afterClickLink = false;
  779. 97.  -   var focusTime      = false;
  780. 98.  -   var updateTimer    = false;
  781. 99.  -   var scrollTimer    = false;
  782. 100.  -
  783. 101.  -   function onInit(eventStub) {
  784. 102.  -     AdsLight.initObservers();
  785. 103.  -
  786. 104.  -     if (eventStub) {
  787. 105.  -       AdsLight.handleEvent('ads.onEvent', 'onInit', 0);
  788. 106.  -     }
  789. 107.  -
  790. 108.  -     if (!eventStub) {
  791. 109.  -       AdsLight.loadAds();
  792. 110.  -     }
  793. 111.  -
  794. 112.  -     if (document.hasFocus && document.hasFocus()) {
  795. 113.  -       onHasFocus(true);
  796. 114.  -     }
  797. 115.  -   }
  798. 116.  -   function onHasFocus(eventStub) {
  799. 117.  -     if (eventStub) {
  800. 118.  -       AdsLight.handleEvent('ads.onEvent', 'onHasFocus', 0);
  801. 119.  -     }
  802. 120.  -
  803. 121.  -     onActiveTab();
  804. 122.  -   }
  805. 123.  -   function onFocusWindow(event) {
  806. 124.  -     if (event) {
  807. 125.  -       AdsLight.handleEvent('ads.onEvent', 'onFocusWindow', 0);
  808. 126.  -     }
  809. 127.  -
  810. 128.  -     // Opera fix
  811. 129.  -     // May be obsolete
  812. 130.  -     if (needBlur) {
  813. 131.  -       return;
  814. 132.  -     }
  815. 133.  -     needBlur = true;
  816. 134.  -
  817. 135.  -     focusTime = (window.vkNow && vkNow() || 0);
  818. 136.  -
  819. 137.  -     vk__adsLight.userEventTime = (window.vkNow && vkNow() || 0);
  820. 138.  -
  821. 139.  -     onActiveTab();
  822. 140.  -   }
  823. 141.  -   function onBlurWindow(event) {
  824. 142.  -
  825. 143.  -     needBlur = false;
  826. 144.  -
  827. 145.  -     if (window.vkNow && vkNow() - focusTime < 1000) {
  828. 146.  -       return;
  829. 147.  -     }
  830. 148.  -
  831. 149.  -     if (event) {
  832. 150.  -       AdsLight.handleEvent('ads.onEvent', 'onBlurWindow', 0);
  833. 151.  -     }
  834. 152.  -
  835. 153.  -     vk__adsLight.activeTab = (window.vkNow && -vkNow() || 0);
  836. 154.  -   }
  837. 155.  -   function onScrollWindow(event, delayed) {
  838. 156.  -     if (event && !delayed) {
  839. 157.  -       clearTimeout(scrollTimer);
  840. 158.  -       scrollTimer = setTimeout(function() {
  841. 159.  -         onScrollWindow(event, true);
  842. 160.  -       }, 100);
  843. 161.  -       return;
  844. 162.  -     }
  845. 163.  -
  846. 164.  -     if (event) {
  847. 165.  -       AdsLight.handleEvent('ads.onEvent', 'onScrollWindow', 0);
  848. 166.  -     }
  849. 167.  -
  850. 168.  -     vk__adsLight.userEventTime = (window.vkNow && vkNow() || 0);
  851. 169.  -
  852. 170.  -     onActiveTab();
  853. 171.  -
  854. 172.  -     if (isVkDomain && window.vkNow && window.vk && vk.ads_rotate_interval && isTimeToUpdate()) {
  855. 173.  -       clearTimeout(updateTimer);
  856. 174.  -       updateTimer = setTimeout(function() {
  857. 175.  -         if (isTimeToUpdate()) {
  858. 176.  -           __adsLoaded = 0;
  859. 177.  -           AdsLight.updateBlock();
  860. 178.  -         }
  861. 179.  -       }, 10);
  862. 180.  -     }
  863. 181.  -
  864. 182.  -     function isTimeToUpdate() {
  865. 183.  -       return vk__adsLight.adsSection === 'web' && vkNow() - __adsLoaded >= vk.ads_rotate_interval || vkNow() - __adsLoaded >= vk.ads_rotate_interval * 5;
  866. 184.  -     }
  867. 185.  -   }
  868. 186.  -   function onMouseDownDocument(event) {
  869. 187.  -     if (event) {
  870. 188.  -       AdsLight.handleEvent('ads.onEvent', 'onMouseDownDocument', 0);
  871. 189.  -     }
  872. 190.  -
  873. 191.  -     vk__adsLight.userEventTime = (window.vkNow && vkNow() || 0);
  874. 192.  -
  875. 193.  -     onActiveTab();
  876. 194.  -
  877. 195.  -     if (!event) {
  878. 196.  -       return;
  879. 197.  -     }
  880. 198.  -     var elem = event.target;
  881. 199.  -     while (elem) {
  882. 200.  -       if (elem.tagName == 'A') {
  883. 201.  -         break;
  884. 202.  -       }
  885. 203.  -       if (elem.onclick) {
  886. 204.  -         break;
  887. 205.  -       }
  888. 206.  -       elem = elem.parentNode;
  889. 207.  -     }
  890. 208.  -     if (!elem) {
  891. 209.  -       return;
  892. 210.  -     }
  893. 211.  -
  894. 212.  -     onMouseDownDocumentAction(true);
  895. 213.  -   }
  896. 214.  -   function onMouseDownDocumentAction(eventStub) {
  897. 215.  -     if (eventStub) {
  898. 216.  -       AdsLight.handleEvent('ads.onEvent', 'onMouseDownDocumentAction', 0);
  899. 217.  -     }
  900. 218.  -
  901. 219.  -     clearTimeout(updateTimer);
  902. 220.  -
  903. 221.  -     afterClickLink = true;
  904. 222.  -     setTimeout(function() {
  905. 223.  -       afterClickLink = false;
  906. 224.  -     }, 10);
  907. 225.  -   }
  908. 226.  -   function onActiveTab(eventStub) {
  909. 227.  -     if (isVkDomain && window.vkNow && window.vk && vk.ads_rotate_interval && !afterClickLink && vk__adsLight.activeTab < 0 && vkNow() + vk__adsLight.activeTab >= 15000 && isTimeToUpdate()) {
  910. 228.  -       clearTimeout(updateTimer);
  911. 229.  -       updateTimer = setTimeout(function() {
  912. 230.  -         if (isTimeToUpdate()) {
  913. 231.  -           __adsLoaded = 0;
  914. 232.  -           AdsLight.updateBlock();
  915. 233.  -         }
  916. 234.  -       }, 10);
  917. 235.  -     }
  918. 236.  -     vk__adsLight.activeTab = 1;
  919. 237.  -
  920. 238.  -     function isTimeToUpdate() {
  921. 239.  -       return vkNow() - __adsLoaded >= vk.ads_rotate_interval;
  922. 240.  -     }
  923. 241.  -   }
  924. 242.  - }
  925. 243.  -
  926. 244.  - AdsLight.initWeb = function(adsSection, loaderParams, adsScriptVersion, adsParamsExport) {
  927. 245.  -   vk__adsLight.adsSection = adsSection;
  928. 246.  -
  929. 247.  -   if (top === window) {
  930. 248.  -     return;
  931. 249.  -   }
  932. 250.  -
  933. 251.  -   var rpcMethods = {
  934. 252.  -     adsPublish: function() {
  935. 253.  -       AdsLight.handleEvent.apply(AdsLight, arguments);
  936. 254.  -     },
  937. 255.  -     onAdsAttached: function() {
  938. 256.  -       vk__adsLight.rpc.callMethod('publish', 'ads.subscribeEvents');
  939. 257.  -     },
  940. 258.  -     onInit: function() {
  941. 259.  -       vk__adsLight.rpc.callMethod('publish', 'ads.subscribeEvents');
  942. 260.  -     }
  943. 261.  -   };
  944. 262.  -   try {
  945. 263.  -     vk__adsLight.rpc = new fastXDM.Client(rpcMethods);
  946. 264.  -     vk__adsLight.rpc.callMethod('adsOnInitLoader', adsScriptVersion);
  947. 265.  -     vk__adsLight.loaderParams = loaderParams;
  948. 266.  -     vk__adsLight.adsParamsExport = adsParamsExport;
  949. 267.  -   } catch (e) {
  950. 268.  -     debugLog(e);
  951. 269.  -   }
  952. 270.  - }
  953. 271.  -
  954. 272.  - AdsLight.initObservers = function() {
  955. 273.  -   if (!window.VK || !VK.Observer || !VK.Observer.subscribe) {
  956. 274.  -     return;
  957. 275.  -   }
  958. 276.  -   if (vk__adsLight.observersInited) {
  959. 277.  -     return;
  960. 278.  -   }
  961. 279.  -   vk__adsLight.observersInited = true;
  962. 280.  -
  963. 281.  -   VK.Observer.subscribe('ads.isVisibleBlockWrap', getHandler('ads.isVisibleBlockWrap'));
  964. 282.  -   VK.Observer.subscribe('ads.subscribeEvents',    getHandler('ads.subscribeEvents'));
  965. 283.  -   VK.Observer.subscribe('ads.onEvent',            getHandler('ads.onEvent'));
  966. 284.  -   VK.Observer.subscribe('ads.onAdsShowed',        getHandler('ads.onAdsShowed'));
  967. 285.  -
  968. 286.  -   for (var widgetId in VK.Widgets.RPC) {
  969. 287.  -     if (VK.Widgets.RPC[widgetId].methods.adsOnInit) {
  970. 288.  -       VK.Widgets.RPC[widgetId].callMethod('onAdsAttached');
  971. 289.  -     }
  972. 290.  -   }
  973. 291.  -
  974. 292.  -   function getHandler(publishEventName) {
  975. 293.  -     return function() {
  976. 294.  -       var args = Array.prototype.slice.call(arguments);
  977. 295.  -       args.unshift(publishEventName);
  978. 296.  -       AdsLight.handleEvent.apply(AdsLight, args);
  979. 297.  -     };
  980. 298.  -   }
  981. 299.  - }
  982. 300.  -
  983. 301.  - AdsLight.handleEvent = function() {
  984. 302.  -   var args = Array.prototype.slice.call(arguments);
  985. 303.  -   var publishEventName = args.shift();
  986. 304.  -   switch (publishEventName) {
  987. 305.  -     case 'ads.isVisibleBlockWrap':
  988. 306.  -       AdsLight.isVisibleBlockWrapRpc.apply(AdsLight, args);
  989. 307.  -       break;
  990. 308.  -     case 'ads.subscribeEvents':
  991. 309.  -       var widgetId = args[0];
  992. 310.  -       if (widgetId && !vk__adsLight.widgetsIds[widgetId]) {
  993. 311.  -         vk__adsLight.widgetsIds[widgetId] = true;
  994. 312.  -       }
  995. 313.  -       vk__adsLight.userHandlers.onInit(true);
  996. 314.  -       break;
  997. 315.  -     case 'ads.onEvent':
  998. 316.  -       AdsLight.onEvent.apply(AdsLight, args);
  999. 317.  -       break;
  1000. 318.  -     case 'ads.onAdsShowed':
  1001. 319.  -       AdsLight.onAdsShowed.apply(AdsLight, args);
  1002. 320.  -       break;
  1003. 321.  -   }
  1004. 322.  - }
  1005. 323.  -
  1006. 324.  - AdsLight.onEvent = function(eventName, windowsIds) {
  1007. 325.  -   if (windowsIds === 0) {
  1008. 326.  -     windowsIds = [];
  1009. 327.  -     //windowsIds.push(Math.round(Math.random() * -1000)); // For debug
  1010. 328.  -   } else {
  1011. 329.  -     var isWindowCur = false;
  1012. 330.  -     for (var i in windowsIds) {
  1013. 331.  -       if (windowsIds[i] == vk__adsLight.windowId) {
  1014. 332.  -         isWindowCur = true;
  1015. 333.  -         break;
  1016. 334.  -       }
  1017. 335.  -     }
  1018. 336.  -     if (isWindowCur) {
  1019. 337.  -       return;
  1020. 338.  -     }
  1021. 339.  -     if (vk__adsLight.userHandlers[eventName]) {
  1022. 340.  -       vk__adsLight.userHandlers[eventName](false);
  1023. 341.  -     }
  1024. 342.  -   }
  1025. 343.  -   windowsIds.push(vk__adsLight.windowId);
  1026. 344.  -
  1027. 345.  -   AdsLight.publish(false, 'ads.onEvent', eventName, windowsIds);
  1028. 346.  - }
  1029. 347.  -
  1030. 348.  - AdsLight.onAdsShowed = function(adsShowedAll) {
  1031. 349.  -   if (adsShowedAll === 0) {
  1032. 350.  -     adsShowedAll = {};
  1033. 351.  -   }
  1034. 352.  -
  1035. 353.  -   // Sort windows ids to correct compare received messages
  1036. 354.  -   {
  1037. 355.  -     var windowsIds = [];
  1038. 356.  -     for (var windowId in adsShowedAll) {
  1039. 357.  -       windowsIds.push(parseInt(windowId));
  1040. 358.  -     }
  1041. 359.  -     windowsIds.sort();
  1042. 360.  -   }
  1043. 361.  -
  1044. 362.  -   // Check for identical message was send
  1045. 363.  -   {
  1046. 364.  -     var publishHash = [];
  1047. 365.  -     for (var i = 0, len = windowsIds.length; i < len; i++) {
  1048. 366.  -       var windowId = windowsIds[i];
  1049. 367.  -       publishHash.push(adsShowedAll[windowId].ads_showed_hash);
  1050. 368.  -     }
  1051. 369.  -     publishHash = publishHash.join('_');
  1052. 370.  -
  1053. 371.  -     var noPublish = (publishHash && adsShowedAll[vk__adsLight.windowId] && publishHash === adsShowedAll[vk__adsLight.windowId].publish_hash);
  1054. 372.  -   }
  1055. 373.  -
  1056. 374.  -   // Add known showed ads to message
  1057. 375.  -   {
  1058. 376.  -     var nowTime = +new Date;
  1059. 377.  -
  1060. 378.  -     if (!adsShowedAll[vk__adsLight.windowId]) {
  1061. 379.  -       adsShowedAll[vk__adsLight.windowId] = {};
  1062. 380.  -       windowsIds.push(vk__adsLight.windowId);
  1063. 381.  -       windowsIds.sort();
  1064. 382.  -     }
  1065. 383.  -     adsShowedAll[vk__adsLight.windowId].ads_showed      = vk__adsLight.adsShowed;
  1066. 384.  -     adsShowedAll[vk__adsLight.windowId].ads_showed_hash = vk__adsLight.adsShowedHash;
  1067. 385.  -     adsShowedAll[vk__adsLight.windowId].update_progress = vk__adsLight.updateProgress;
  1068. 386.  -
  1069. 387.  -     for (var windowId in vk__adsLight.adsShowedAll) {
  1070. 388.  -       if ((!adsShowedAll[windowId] || vk__adsLight.adsShowedAll[windowId].publish_time > adsShowedAll[windowId].publish_time) && nowTime - vk__adsLight.adsShowedAll[windowId].publish_time < 10000) {
  1071. 389.  -         adsShowedAll[windowId] = vk__adsLight.adsShowedAll[windowId];
  1072. 390.  -       }
  1073. 391.  -     }
  1074. 392.  -
  1075. 393.  -     var publishHash = [];
  1076. 394.  -     for (var i = 0, len = windowsIds.length; i < len; i++) {
  1077. 395.  -       var windowId = windowsIds[i];
  1078. 396.  -       publishHash.push(adsShowedAll[windowId].ads_showed_hash);
  1079. 397.  -     }
  1080. 398.  -     publishHash = publishHash.join('_');
  1081. 399.  -
  1082. 400.  -     adsShowedAll[vk__adsLight.windowId].publish_time = nowTime;
  1083. 401.  -     adsShowedAll[vk__adsLight.windowId].publish_hash = publishHash;
  1084. 402.  -   }
  1085. 403.  -
  1086. 404.  -   // Update all showed ads
  1087. 405.  -   for (var windowId in adsShowedAll) {
  1088. 406.  -     vk__adsLight.adsShowedAll[windowId] = adsShowedAll[windowId];
  1089. 407.  -   }
  1090. 408.  -
  1091. 409.  -   if (!noPublish) {
  1092. 410.  -     AdsLight.publish(true, 'ads.onAdsShowed', adsShowedAll);
  1093. 411.  -   }
  1094. 412.  - }
  1095. 413.  -
  1096. 414.  - AdsLight.publish = function(delayBigPublish, publishEventName) {
  1097. 415.  -
  1098. 416.  -   var args  = Array.prototype.slice.call(arguments, 1);
  1099. 417.  -   var args1 = args.slice();
  1100. 418.  -   var args2 = args.slice();
  1101. 419.  -   var args3 = args.slice();
  1102. 420.  -   var args4 = args.slice();
  1103. 421.  -   args1.unshift('adsPublish');
  1104. 422.  -   args2.unshift('adsPublish');
  1105. 423.  -   args3.unshift('adsPublish');
  1106. 424.  -   args4.unshift('publish');
  1107. 425.  -
  1108. 426.  -   var func;
  1109. 427.  -   var funcs = [];
  1110. 428.  -   if (window.VK && VK.Widgets && VK.Widgets.RPC) {
  1111. 429.  -     for (var widgetId in vk__adsLight.widgetsIds) {
  1112. 430.  -       if (VK.Widgets.RPC[widgetId] && VK.Widgets.RPC[widgetId].callMethod) {
  1113. 431.  -         func = (function() {
  1114. 432.  -           var widgetIdCur = widgetId;
  1115. 433.  -           return function() {
  1116. 434.  -             VK.Widgets.RPC[widgetIdCur].callMethod.apply(VK.Widgets.RPC[widgetIdCur], args1);
  1117. 435.  -           }
  1118. 436.  -         })();
  1119. 437.  -         funcs.push(func);
  1120. 438.  -       }
  1121. 439.  -     }
  1122. 440.  -   }
  1123. 441.  -   if (!isVkDomain && window.VK && VK.callMethod) {
  1124. 442.  -     func = function() {
  1125. 443.  -       VK.callMethod.apply(VK, args2);
  1126. 444.  -     }
  1127. 445.  -     funcs.push(func);
  1128. 446.  -   }
  1129. 447.  -   if (isVkDomain && vk__adsLight.adsSection !== 'web' && window.cur && cur.app && cur.app.runCallback) {
  1130. 448.  -     func = function() {
  1131. 449.  -       cur.app.runCallback.apply(cur.app, args3);
  1132. 450.  -     }
  1133. 451.  -     funcs.push(func);
  1134. 452.  -   }
  1135. 453.  -   if (isVkDomain && vk__adsLight.adsSection === 'web' && vk__adsLight.rpc && vk__adsLight.rpc.callMethod) {
  1136. 454.  -     func = function() {
  1137. 455.  -       vk__adsLight.rpc.callMethod.apply(vk__adsLight.rpc, args4);
  1138. 456.  -     }
  1139. 457.  -     funcs.push(func);
  1140. 458.  -   }
  1141. 459.  -
  1142. 460.  -   clearTimeout(vk__adsLight.publishTimers[publishEventName]);
  1143. 461.  -   if (funcs.length > 1 && delayBigPublish) {
  1144. 462.  -     vk__adsLight.publishTimers[publishEventName] = setTimeout(publishAll, 50);
  1145. 463.  -   } else {
  1146. 464.  -     publishAll();
  1147. 465.  -   }
  1148. 466.  -
  1149. 467.  -   function publishAll() {
  1150. 468.  -     for (var i = 0, len = funcs.length; i < len; i++) {
  1151. 469.  -       funcs[i]();
  1152. 470.  -     }
  1153. 471.  -   }
  1154. 472.  - }
  1155. 473.  -
  1156. 474.  - AdsLight.canUpdate = function(forAjax) {
  1157. 475.  -
  1158. 476.  -   var containerElem = ge('left_ads');
  1159. 477.  -
  1160. 478.  -   var initialAjax = (forAjax && __adsLoaded === false);
  1161. 479.  -
  1162. 480.  -   var result = true;
  1163. 481.  -
  1164. 482.  -   // Is visible
  1165. 483.  -   result = (result && containerElem && isVisible(containerElem) && (vk__adsLight.activeTab > 0 && AdsLight.isVisibleBlockWrap() || initialAjax));
  1166. 484.  -   // Is reasonable
  1167. 485.  -   result = (result && vk.id && (vk__adsLight.adsCanShow >= 1 || vkNow() + vk__adsLight.adsCanShow > 3600000)); // hour
  1168. 486.  -
  1169. 487.  -   if (vk__adsLight.adsSection === 'web') {
  1170. 488.  -     // Is reasonable
  1171. 489.  -     result = (result && vk__adsLight.loadComplete === 2);
  1172. 490.  -   } else {
  1173. 491.  -     // Is visible
  1174. 492.  -     result = (result && isVisible('side_bar') && !layers.visible && !isVisible('left_friends'));
  1175. 493.  -     // Is reasonable
  1176. 494.  -     result = (result && !vk.no_ads && (vk.loaded || initialAjax));
  1177. 495.  -   }
  1178. 496.  -
  1179. 497.  -   return result;
  1180. 498.  - }
  1181. 499.  -
  1182. 500.  - AdsLight.getAjaxParams = function(ajaxParams, ajaxOptions) {
  1183. 501.  -   var ajaxParamsNew = {};
  1184. 502.  -   var canUpdateBlock = AdsLight.canUpdate(true);
  1185. 503.  -   if (ajaxOptions.noAds) {
  1186. 504.  -     ajaxParamsNew.al_ad = 0;
  1187. 505.  -   } else if (canUpdateBlock || ajaxOptions.ads) {
  1188. 506.  -     if (ajaxOptions.ads || window.vkNow && window.vk && vk.ads_rotate_interval && vk__adsLight.adsSection !== 'web' && vkNow() - __adsLoaded >= vk.ads_rotate_interval) {
  1189. 507.  -       __adsLoaded = vkNow();
  1190. 508.  -       ajaxParamsNew.al_ad = 1;
  1191. 509.  -     }
  1192. 510.  -     if (ajaxParams.al_ad || ajaxParamsNew.al_ad) {
  1193. 511.  -       ajaxParamsNew.ads_section = vk__adsLight.adsSection;
  1194. 512.  -       ajaxParamsNew.ads_showed = AdsLight.getAdsShowed();
  1195. 513.  -     }
  1196. 514.  -   } else {
  1197. 515.  -     ajaxParamsNew.al_ad = null;
  1198. 516.  -   }
  1199. 517.  -   return ajaxParamsNew;
  1200. 518.  - }
  1201. 519.  -
  1202. 520.  - AdsLight.doRequest = function(requestFunc, delayed) {
  1203. 521.  -
  1204. 522.  -   var isWebLoad = (vk__adsLight.adsSection === 'web' && vk__adsLight.loadComplete === 1);
  1205. 523.  -
  1206. 524.  -   if (!delayed) {
  1207. 525.  -     vk__adsLight.updateProgress = 1;
  1208. 526.  -     AdsLight.onAdsShowed(0);
  1209. 527.  -     setTimeout(AdsLight.doRequest.pbind(requestFunc, true), 300);
  1210. 528.  -     return;
  1211. 529.  -   }
  1212. 530.  -
  1213. 531.  -   var lastRequestWindowId = 0;
  1214. 532.  -   var lastRequestWindowsIds = {};
  1215. 533.  -   var intervalTimer;
  1216. 534.  -   var timeoutTimer;
  1217. 535.  -
  1218. 536.  -   checkRequest();
  1219. 537.  -
  1220. 538.  -   function checkRequest(force) {
  1221. 539.  -     var nowTime = +new Date;
  1222. 540.  -     var currentRequestWindowId = 0;
  1223. 541.  -     for (var windowId in vk__adsLight.adsShowedAll) {
  1224. 542.  -       var windowAdsShowed = vk__adsLight.adsShowedAll[windowId];
  1225. 543.  -       if (nowTime - windowAdsShowed.publish_time >= 30000) {
  1226. 544.  -         delete vk__adsLight.adsShowedAll[windowId];
  1227. 545.  -       } else if (!isWebLoad || !lastRequestWindowsIds[windowId]) {
  1228. 546.  -         if (windowAdsShowed.update_progress == 2) {
  1229. 547.  -           currentRequestWindowId = windowId;
  1230. 548.  -           break;
  1231. 549.  -         } else if (windowAdsShowed.update_progress == 1 && (!currentRequestWindowId || windowId < currentRequestWindowId)) {
  1232. 550.  -           currentRequestWindowId = windowId;
  1233. 551.  -         }
  1234. 552.  -       }
  1235. 553.  -     }
  1236. 554.  -
  1237. 555.  -     if (force || !currentRequestWindowId || currentRequestWindowId == vk__adsLight.windowId) {
  1238. 556.  -       clearInterval(intervalTimer);
  1239. 557.  -       clearTimeout(timeoutTimer);
  1240. 558.  -       vk__adsLight.updateProgress = 2;
  1241. 559.  -       AdsLight.onAdsShowed(0);
  1242. 560.  -       requestFunc();
  1243. 561.  -     } else if (currentRequestWindowId != lastRequestWindowId) {
  1244. 562.  -       lastRequestWindowId = currentRequestWindowId;
  1245. 563.  -       clearInterval(intervalTimer);
  1246. 564.  -       clearTimeout(timeoutTimer);
  1247. 565.  -       intervalTimer = setInterval(checkRequest, isWebLoad ? 100 : 200);
  1248. 566.  -       timeoutTimer = setTimeout(checkRequest.pbind(true), 5000 + 50);
  1249. 567.  -     }
  1250. 568.  -
  1251. 569.  -     lastRequestWindowsIds[currentRequestWindowId] = (lastRequestWindowsIds[currentRequestWindowId] ? lastRequestWindowsIds[currentRequestWindowId] + 1 : 1);
  1252. 570.  -   }
  1253. 571.  - }
  1254. 572.  -
  1255. 573.  - AdsLight.getAdsShowed = function() {
  1256. 574.  -   var adsShowed = [];
  1257. 575.  -   for (var windowId in vk__adsLight.adsShowedAll) {
  1258. 576.  -     var windowAdsShowed = vk__adsLight.adsShowedAll[windowId];
  1259. 577.  -     if (windowAdsShowed.ads_showed) {
  1260. 578.  -       adsShowed.push(windowAdsShowed.ads_showed);
  1261. 579.  -     }
  1262. 580.  -   }
  1263. 581.  -   adsShowed = adsShowed.join(',');
  1264. 582.  -   return adsShowed;
  1265. 583.  - }
  1266. 584.  -
  1267. 585.  - AdsLight.updateBlock = function(force, delayed) {
  1268. 586.  -
  1269. 587.  -   if (force === 'very_lazy') {
  1270. 588.  -     __adsLoaded = 0;
  1271. 589.  -     return;
  1272. 590.  -   }
  1273. 591.  -   if (force === 'lazy') {
  1274. 592.  -     if (__adsLoaded) {
  1275. 593.  -       __adsLoaded = 0;
  1276. 594.  -       return;
  1277. 595.  -     } else {
  1278. 596.  -       __adsLoaded = 0; // if __adsLoaded === false
  1279. 597.  -     }
  1280. 598.  -   }
  1281. 599.  -   if (force === 'force') {
  1282. 600.  -     __adsLoaded = 0;
  1283. 601.  -   }
  1284. 602.  -   if (force === 'already') {
  1285. 603.  -     __adsLoaded = vkNow();
  1286. 604.  -     return;
  1287. 605.  -   }
  1288. 606.  -
  1289. 607.  -   if (__adsLoaded || __adsLoaded === false) {
  1290. 608.  -     return;
  1291. 609.  -   }
  1292. 610.  -
  1293. 611.  -   if (!delayed) {
  1294. 612.  -     clearTimeout(vk__adsLight.updateBlockTimer);
  1295. 613.  -     vk__adsLight.updateBlockTimer = setTimeout(AdsLight.updateBlock.pbind(false, 1), 1000);
  1296. 614.  -     return;
  1297. 615.  -   }
  1298. 616.  -
  1299. 617.  -   var canUpdateBlock = AdsLight.canUpdate();
  1300. 618.  -
  1301. 619.  -   if (delayed == 1) {
  1302. 620.  -     setTimeout(AdsLight.updateBlock.pbind(false, 2), 500); // Period must be greater than in isVisibleBlockWrapCoords
  1303. 621.  -     return;
  1304. 622.  -   }
  1305. 623.  -
  1306. 624.  -   if (!canUpdateBlock) {
  1307. 625.  -     return;
  1308. 626.  -   }
  1309. 627.  -
  1310. 628.  -   __adsLoaded = vkNow();
  1311. 629.  -
  1312. 630.  -   var ajaxParams = {};
  1313. 631.  -   for (var i in vk__adsLight.adsParams) {
  1314. 632.  -     ajaxParams[i] = vk__adsLight.adsParams[i];
  1315. 633.  -   }
  1316. 634.  -
  1317. 635.  -   AdsLight.doRequest(function(){
  1318. 636.  -     ajaxParams.ads_showed = AdsLight.getAdsShowed();
  1319. 637.  -     ajax.post('/ads_rotate.php?act=al_update_ad', ajaxParams, {ads: 1, onDone: onComplete, onFail: onComplete});
  1320. 638.  -   });
  1321. 639.  -
  1322. 640.  -   function onComplete() {
  1323. 641.  -     vk__adsLight.updateProgress = 3;
  1324. 642.  -   }
  1325. 643.  - }
  1326. 644.  -
  1327. 645.  - AdsLight.setNewBlock = function(adsHtml, adsSection, adsCanShow, adsShowed, adsParams) {
  1328. 646.  -   if (typeof(adsSection) === 'string') {
  1329. 647.  -     vk__adsLight.adsSection = adsSection;
  1330. 648.  -   }
  1331. 649.  -   vk__adsLight.adsCanShow = ((adsCanShow || adsCanShow === '0') ? 1 : -vkNow());
  1332. 650.  -   vk__adsLight.adsShowed     = adsShowed;
  1333. 651.  -   vk__adsLight.adsShowedHash = +new Date;
  1334. 652.  -   if (adsParams) {
  1335. 653.  -     vk__adsLight.adsParams = adsParams;
  1336. 654.  -   }
  1337. 655.  -
  1338. 656.  -   if (!adsHtml) {
  1339. 657.  -     if (vk.no_ads) {
  1340. 658.  -       adsHtml = '';
  1341. 659.  -     } else if (vk__adsLight.adsSection === 'im' && __seenAds == 0) {
  1342. 660.  -       adsHtml = '';
  1343. 661.  -     } else {
  1344. 662.  -       AdsLight.resizeBlockWrap([0,0], false, false, true);
  1345. 663.  -       return;
  1346. 664.  -     }
  1347. 665.  -   }
  1348. 666.  -
  1349. 667.  -   __adsLoaded = vkNow();
  1350. 668.  -
  1351. 669.  -   var containerElem = ge('left_ads');
  1352. 670.  -   var isContainerVisible = (containerElem && isVisible(containerElem) || vk.ad_preview);
  1353. 671.  -   if (!containerElem) {
  1354. 672.  -     var sideBarElem = ge('side_bar');
  1355. 673.  -     if (!sideBarElem) {
  1356. 674.  -       AdsLight.resizeBlockWrap([0,0], false, false, true);
  1357. 675.  -       return;
  1358. 676.  -     }
  1359. 677.  -     containerElem = sideBarElem.appendChild(ce('div', {id: 'left_ads'}, {display: isContainerVisible ? 'block' : 'none'}));
  1360. 678.  -   }
  1361. 679.  -
  1362. 680.  -   AdsLight.showNewBlock(containerElem, adsHtml, isContainerVisible);
  1363. 681.  -
  1364. 682.  -   if (window.vk && vk.ads_rotate_interval && vk__adsLight.adsSection === 'web') {
  1365. 683.  -     clearInterval(vk__adsLight.reloadTimer);
  1366. 684.  -     vk__adsLight.reloadTimer = setInterval(function(){
  1367. 685.  -       if (vkNow() - __adsLoaded >= vk.ads_rotate_interval && vkNow() - vk__adsLight.userEventTime <= vk.ads_rotate_interval * 3 / 4) { // Check part of ads_rotate_interval for user actions to prevent side effects when rotating ads cause window to scroll
  1368. 686.  -         __adsLoaded = 0;
  1369. 687.  -         AdsLight.updateBlock();
  1370. 688.  -       }
  1371. 689.  -     }, vk.ads_rotate_interval);
  1372. 690.  -   }
  1373. 691.  -
  1374. 692.  -   setTimeout(function() {
  1375. 693.  -     vk__adsLight.updateProgress = 3;
  1376. 694.  -     AdsLight.onAdsShowed(0);
  1377. 695.  -   }, 100);
  1378. 696.  - }
  1379. 697.  -
  1380. 698.  - AdsLight.showNewBlock = function(containerElem, adsHtml, isContainerVisible) {
  1381. 699.  -   if (!isContainerVisible || browserLight.msie6 || browserLight.msie7) {
  1382. 700.  -     if (!isContainerVisible) {
  1383. 701.  -       debugLog('Ads container is hidden');
  1384. 702.  -     }
  1385. 703.  -     containerElem.innerHTML = adsHtml;
  1386. 704.  -     var newSize = AdsLight.getBlockSize(containerElem);
  1387. 705.  -     AdsLight.resizeBlockWrap(newSize, false, false, true);
  1388. 706.  -     AdsLight.updateExternalStats(containerElem);
  1389. 707.  -     return;
  1390. 708.  -   }
  1391. 709.  -
  1392. 710.  -   var isNewBlockEmpty  = !adsHtml;
  1393. 711.  -   var speed            = (isNewBlockEmpty ? 0 : 200);
  1394. 712.  -   var oldSize          = AdsLight.getBlockSize(containerElem);
  1395. 713.  -   var lastSize         = [0, 0];
  1396. 714.  -   var newBlockElem     = containerElem.appendChild(ce('div', {innerHTML: adsHtml}, {display: 'none'}));
  1397. 715.  -   var newBlockSizeElem = (geByClass1('ads_ads_box3', newBlockElem) || newBlockElem);
  1398. 716.  -
  1399. 717.  -   var imagesElems   = geByTag('img', newBlockElem);
  1400. 718.  -   var imagesObjects = [];
  1401. 719.  -   for (var i = 0, len = imagesElems.length; i < len; i++) {
  1402. 720.  -     var imageObject = vkImage();
  1403. 721.  -     imageObject.onload  = delayedResizeBlockWrap;
  1404. 722.  -     imageObject.onerror = delayedResizeBlockWrap;
  1405. 723.  -     imageObject.src = imagesElems[i].src;
  1406. 724.  -     imagesObjects.push(imageObject);
  1407. 725.  -   }
  1408. 726.  -
  1409. 727.  -   // Wait images then show ads
  1410. 728.  -   clearInterval(vk__adsLight.imagesTimer);
  1411. 729.  -   vk__adsLight.imagesTimer = setInterval(waitIamges.pbind({count: 40}), 50); // 2 seconds
  1412. 730.  -
  1413. 731.  -   function waitIamges(context) {
  1414. 732.  -     if (--context.count > 0) {
  1415. 733.  -       for (var i in imagesObjects) {
  1416. 734.  -         if (!imagesObjects[i].width || !imagesObjects[i].height) {
  1417. 735.  -           return;
  1418. 736.  -         }
  1419. 737.  -       }
  1420. 738.  -     }
  1421. 739.  -     clearInterval(vk__adsLight.imagesTimer);
  1422. 740.  -     startShowing();
  1423. 741.  -   }
  1424. 742.  -   function delayedResizeBlockWrap() {
  1425. 743.  -     if (isVisible(newBlockElem)) {
  1426. 744.  -       var newSize = AdsLight.getBlockSize(newBlockSizeElem);
  1427. 745.  -       newSize = AdsLight.resizeBlockWrap(newSize, oldSize, lastSize);
  1428. 746.  -     }
  1429. 747.  -   }
  1430. 748.  -   function startShowing() {
  1431. 749.  -     setStyle(containerElem, {overflow: 'hidden'});
  1432. 750.  -     // zIndex: 10 - To be upper then previous block and hiders after closing ads
  1433. 751.  -     // width: '100%' - For correct horizontal centering.
  1434. 752.  -     setStyle(newBlockElem, {display: 'block', position: 'absolute', left: 0, top: 0, opacity: 0, zIndex: 10, width: '100%'});
  1435. 753.  -
  1436. 754.  -     var newSize = AdsLight.getBlockSize(newBlockSizeElem);
  1437. 755.  -     newSize = AdsLight.resizeBlockWrap(newSize, oldSize, lastSize);
  1438. 756.  -
  1439. 757.  -     // Resize container
  1440. 758.  -     animate(containerElem, {width: newSize[0], height: newSize[1]}, speed, showNewBlock.pbind());
  1441. 759.  -   }
  1442. 760.  -   function showNewBlock() {
  1443. 761.  -     cleanElems(containerElem);
  1444. 762.  -
  1445. 763.  -     var newSize = AdsLight.getBlockSize(newBlockSizeElem)
  1446. 764.  -     newSize = AdsLight.resizeBlockWrap(newSize, false, lastSize, true);
  1447. 765.  -
  1448. 766.  -     animate(newBlockElem, {opacity: 1}, speed, removeOldBlock);
  1449. 767.  -   }
  1450. 768.  -   function removeOldBlock() {
  1451. 769.  -     cleanElems(newBlockElem);
  1452. 770.  -
  1453. 771.  -     while (newBlockElem.previousSibling) {
  1454. 772.  -       re(newBlockElem.previousSibling);
  1455. 773.  -     }
  1456. 774.  -     setStyle(newBlockElem, {position: 'static', zIndex: '', width: ''});
  1457. 775.  -     setStyle(containerElem, {width: '', height: '', overflow: 'visible'});
  1458. 776.  -
  1459. 777.  -     // Update site layout
  1460. 778.  -     if (window.updSideTopLink) updSideTopLink();
  1461. 779.  -
  1462. 780.  -     AdsLight.updateExternalStats(containerElem);
  1463. 781.  -   }
  1464. 782.  - }
  1465. 783.  -
  1466. 784.  - AdsLight.updateExternalStats = function(containerElem) {
  1467. 785.  -   var elems = geByClass('ads_ad_external_stats', containerElem);
  1468. 786.  -   for (var i = 0, elem; elem = elems[i]; i++) {
  1469. 787.  -     if (elem.getAttribute('external_stats_complete')) {
  1470. 788.  -       continue;
  1471. 789.  -     }
  1472. 790.  -     elem.setAttribute('external_stats_complete', 1);
  1473. 791.  -     vkImage().src = elem.getAttribute('external_stats_src');
  1474. 792.  -   }
  1475. 793.  - }
  1476. 794.  -
  1477. 795.  - AdsLight.isVisibleBlockWrap = function(forceLocal) {
  1478. 796.  -   var containerElem = ge('left_ads');
  1479. 797.  -   var containerRect = containerElem.getBoundingClientRect();
  1480. 798.  -   var coords = [];
  1481. 799.  -   if (containerRect.right && containerRect.bottom) {
  1482. 800.  -     coords.push([containerRect.left + (containerRect.right - containerRect.left) * 1 / 5, containerRect.top + (containerRect.bottom - containerRect.top) * 1 / 5]);
  1483. 801.  -     coords.push([containerRect.left + (containerRect.right - containerRect.left) * 4 / 5, containerRect.top + (containerRect.bottom - containerRect.top) * 4 / 5]);
  1484. 802.  -   }
  1485. 803.  -
  1486. 804.  -   AdsLight.isVisibleBlockWrapCoords(coords, containerElem, onComplete, forceLocal);
  1487. 805.  -
  1488. 806.  -   return vk__adsLight.wrapVisible;
  1489. 807.  -
  1490. 808.  -   function onComplete(isVisibleWrap) {
  1491. 809.  -     vk__adsLight.wrapVisible = isVisibleWrap;
  1492. 810.  -   }
  1493. 811.  - }
  1494. 812.  -
  1495. 813.  - AdsLight.isVisibleBlockWrapCoords = function(coords, containerElem, onComplete, forceLocal) {
  1496. 814.  -
  1497. 815.  -   var isVisibleWrap = false;
  1498. 816.  -   var coordsNew = [];
  1499. 817.  -   for (var i = 0, len = coords.length; i < len; i++) {
  1500. 818.  -     var elem          = document.elementFromPoint(coords[i][0], coords[i][1]);
  1501. 819.  -     var isVisibleElem = (elem && (elem === containerElem || isAncestor(elem, containerElem)));
  1502. 820.  -     var isVisibleWrap = (isVisibleWrap || isVisibleElem);
  1503. 821.  -     if (isVisibleElem) {
  1504. 822.  -       coordsNew.push(coords[i]);
  1505. 823.  -     }
  1506. 824.  -   }
  1507. 825.  -   isVisibleWrap = !!isVisibleWrap;
  1508. 826.  -
  1509. 827.  -   var completeTimer;
  1510. 828.  -   var onCompleteCurrent = function(isVisibleWrapNew) {
  1511. 829.  -     clearTimeout(completeTimer);
  1512. 830.  -     onComplete((isVisibleWrapNew !== undefined) ? isVisibleWrapNew : isVisibleWrap);
  1513. 831.  -   }
  1514. 832.  -
  1515. 833.  -   if (!forceLocal && coordsNew.length && window != parent && isVkDomain && vk__adsLight.adsSection === 'web' && vk__adsLight.rpc && vk__adsLight.rpc.callMethod) {
  1516. 834.  -     vk__adsLight.rpc.callMethod('publish', 'ads.isVisibleBlockWrap', coordsNew, onCompleteCurrent);
  1517. 835.  -     completeTimer = setTimeout(onCompleteCurrent, 300); // Period must be lower than in updateBlock
  1518. 836.  -   } else if (!forceLocal && coordsNew.length && window != parent && !isVkDomain && window.VK && VK.callMethod) {
  1519. 837.  -     VK.callMethod('adsPublish', 'ads.isVisibleBlockWrap', coordsNew, onCompleteCurrent);
  1520. 838.  -     completeTimer = setTimeout(onCompleteCurrent, 300); // Period must be lower than in updateBlock
  1521. 839.  -   } else {
  1522. 840.  -     onCompleteCurrent();
  1523. 841.  -   }
  1524. 842.  -
  1525. 843.  -   function isAncestor(elem, ancestor) {
  1526. 844.  -     if (!elem || !ancestor) {
  1527. 845.  -       return false;
  1528. 846.  -     }
  1529. 847.  -     while (elem = elem.parentNode) {
  1530. 848.  -       if (elem === ancestor) {
  1531. 849.  -         return true;
  1532. 850.  -       }
  1533. 851.  -     }
  1534. 852.  -     return false;
  1535. 853.  -   }
  1536. 854.  - }
  1537. 855.  -
  1538. 856.  - AdsLight.isVisibleBlockWrapRpc = function(coords, onComplete, widgetId) {
  1539. 857.  -   var containerElem;
  1540. 858.  -   if (widgetId) {
  1541. 859.  -     containerElem = VK.Widgets.RPC[widgetId].frame;
  1542. 860.  -   } else {
  1543. 861.  -     containerElem = cur.app.frame;
  1544. 862.  -   }
  1545. 863.  -
  1546. 864.  -   var contanerRect = containerElem.getBoundingClientRect();
  1547. 865.  -
  1548. 866.  -   var coordsNew = [];
  1549. 867.  -   for (var i = 0, len = coords.length; i < len; i++) {
  1550. 868.  -     var newX = coords[i][0] + contanerRect.left;
  1551. 869.  -     var newY = coords[i][1] + contanerRect.top;
  1552. 870.  -     coordsNew.push([newX, newY]);
  1553. 871.  -   }
  1554. 872.  -
  1555. 873.  -   AdsLight.isVisibleBlockWrapCoords(coordsNew, containerElem, onComplete);
  1556. 874.  - }
  1557. 875.  -
  1558. 876.  - AdsLight.getBlockSize = function(blockElem) {
  1559. 877.  -   var adBoxes1 = geByClass('ads_ad_box', blockElem);
  1560. 878.  -   var adBoxes5 = geByClass('ads_ad_box5', blockElem);
  1561. 879.  -
  1562. 880.  -   each(adBoxes5, function(index, elem) { addClass(elem, 'max_size'); });
  1563. 881.  -
  1564. 882.  -   if (browserLight.msie8) {
  1565. 883.  -     each(adBoxes1, function(index, elem) {
  1566. 884.  -       var width = Math.ceil(floatval(getStyle(elem, 'width')));
  1567. 885.  -       var widthMax = Math.ceil(floatval(getStyle(elem, 'max-width')));
  1568. 886.  -       if (widthMax && widthMax > 200 && width >= widthMax) {
  1569. 887.  -         elem.style.width = widthMax + 'px';
  1570. 888.  -       }
  1571. 889.  -     });
  1572. 890.  -   }
  1573. 891.  -
  1574. 892.  -   var blockWidth  = Math.ceil(floatval(getStyle(blockElem, 'width')));
  1575. 893.  -   var blockHeight = Math.ceil(floatval(getStyle(blockElem, 'height')));
  1576. 894.  -   var blockSize = [blockWidth, blockHeight];
  1577. 895.  -
  1578. 896.  -   each(adBoxes5, function(index, elem) { removeClass(elem, 'max_size'); });
  1579. 897.  -
  1580. 898.  -   return blockSize;
  1581. 899.  - }
  1582. 900.  -
  1583. 901.  - AdsLight.resizeBlockWrap = function(newSize, oldSize, lastSize, forceResize) {
  1584. 902.  -   if (!newSize) {
  1585. 903.  -     return [0, 0];
  1586. 904.  -   }
  1587. 905.  -
  1588. 906.  -   var newWidth  = newSize[0];
  1589. 907.  -   var newHeight = newSize[1];
  1590. 908.  -   if (newWidth && vk__adsLight.adsParams && vk__adsLight.adsParams.ads_ad_unit_width_real > newWidth) {
  1591. 909.  -     newWidth = vk__adsLight.adsParams.ads_ad_unit_width_real;
  1592. 910.  -   }
  1593. 911.  -   if (newHeight && vk__adsLight.adsParams && vk__adsLight.adsParams.ads_ad_unit_height_real > newHeight) {
  1594. 912.  -     newHeight = vk__adsLight.adsParams.ads_ad_unit_height_real;
  1595. 913.  -   }
  1596. 914.  -   var isResizeWidth  = !!(forceResize || oldSize && newWidth > oldSize[0] || lastSize && lastSize[0] && newWidth > lastSize[0]);
  1597. 915.  -   var isResizeHeight = !!(forceResize || oldSize && newHeight > oldSize[1] || lastSize && lastSize[1] && newHeight > lastSize[1]);
  1598. 916.  -   if (!isResizeWidth && !isResizeHeight) {
  1599. 917.  -     return [newWidth, newHeight];
  1600. 918.  -   }
  1601. 919.  -   if (lastSize) {
  1602. 920.  -     if (isResizeWidth) {
  1603. 921.  -       lastSize[0] = newWidth;
  1604. 922.  -     }
  1605. 923.  -     if (isResizeHeight) {
  1606. 924.  -       lastSize[1] = newHeight;
  1607. 925.  -     }
  1608. 926.  -   }
  1609. 927.  -
  1610. 928.  -   if (isVkDomain && vk__adsLight.adsSection === 'web' && vk__adsLight.rpc && vk__adsLight.rpc.callMethod) {
  1611. 929.  -     vk__adsLight.rpc.callMethod('resizeWidget', isResizeWidth && newWidth, isResizeHeight && newHeight);
  1612. 930.  -   }
  1613. 931.  -
  1614. 932.  -   return [newWidth, newHeight];
  1615. 933.  - }
  1616. 934.  -
  1617. 935.  - AdsLight.loadAds = function() {
  1618. 936.  -   if (!isVkDomain || !vk__adsLight.loaderParams || vk__adsLight.loadComplete) {
  1619. 937.  -     return;
  1620. 938.  -   }
  1621. 939.  -   vk__adsLight.loadComplete = 1;
  1622. 940.  -
  1623. 941.  -   var adsParamsExport = vk__adsLight.adsParamsExport;
  1624. 942.  -   delete vk__adsLight.adsParamsExport;
  1625. 943.  -
  1626. 944.  -   var ajaxParams = {};
  1627. 945.  -
  1628. 946.  -   for (var i in vk__adsLight.loaderParams) {
  1629. 947.  -     ajaxParams[i] = vk__adsLight.loaderParams[i];
  1630. 948.  -   }
  1631. 949.  -
  1632. 950.  -   ajaxParams.url = document.referrer;
  1633. 951.  -   try { ajaxParams.url_top = top.location.toString(); } catch (e) {}
  1634. 952.  -
  1635. 953.  -   var isVisibleWeb = AdsLight.isVisibleBlockWrap(true);
  1636. 954.  -   if (!isVisibleWeb) {
  1637. 955.  -     ajaxParams.web_invisible = 1;
  1638. 956.  -   }
  1639. 957.  -
  1640. 958.  -   if (document.documentMode) {
  1641. 959.  -     ajaxParams.ie_document_mode = document.documentMode;
  1642. 960.  -   }
  1643. 961.  -
  1644. 962.  -   AdsLight.doRequest(function(){
  1645. 963.  -     ajaxParams.ads_showed = AdsLight.getAdsShowed();
  1646. 964.  -     ajax.post('/ads_rotate.php?act=ads_web', ajaxParams, {onDone: onComplete, onFail: onComplete});
  1647. 965.  -   });
  1648. 966.  -
  1649. 967.  -   function onComplete(response, nothing, js) {
  1650. 968.  -     vk__adsLight.updateProgress = 3;
  1651. 969.  -
  1652. 970.  -     if (response && isObject(response) && 'ads_html' in response) {
  1653. 971.  -       var styleElemOld = ge('ads_style_web_loader');
  1654. 972.  -       var sheetOld     = (styleElemOld.sheet ? styleElemOld.sheet : styleElemOld.styleSheet);
  1655. 973.  -       var deleteFunc   = (sheetOld.deleteRule ? 'deleteRule' : 'removeRule');
  1656. 974.  -       sheetOld[deleteFunc](0);
  1657. 975.  -
  1658. 976.  -       var styleElemNew = ce('style', {type: 'text/css'})
  1659. 977.  -       if (styleElemNew.styleSheet) {
  1660. 978.  -         styleElemNew.styleSheet.cssText = response.css;
  1661. 979.  -       } else {
  1662. 980.  -         styleElemNew.appendChild(document.createTextNode(response.css));
  1663. 981.  -       }
  1664. 982.  -       headNode.appendChild(styleElemNew);
  1665. 983.  -
  1666. 984.  -       AdsLight.setNewBlock(response.ads_html, response.ads_section, response.ads_can_show, response.ads_showed, response.ads_params);
  1667. 985.  -       vk__adsLight.rpc.callMethod('adsOnInit', response.ads_count, response.ads_params_export);
  1668. 986.  -
  1669. 987.  -       vk__adsLight.loadComplete = 2;
  1670. 988.  -     } else {
  1671. 989.  -       if (typeof(js) === 'string') {
  1672. 990.  -         try {
  1673. 991.  -           eval(js);
  1674. 992.  -         } catch (e) {
  1675. 993.  -           debugLog(e);
  1676. 994.  -         }
  1677. 995.  -       }
  1678. 996.  -       AdsLight.loadAdsFailed(-3001, adsParamsExport);
  1679. 997.  -     }
  1680. 998.  -   }
  1681. 999.  - }
  1682. 1000.  -
  1683. 1001.  - AdsLight.loadAdsFailed = function(errorCode, adsParamsExport) {
  1684. 1002.  -   if (!vk__adsLight.rpc) {
  1685. 1003.  -     return false;
  1686. 1004.  -   }
  1687. 1005.  -   if (vk__adsLight.loadComplete === -1) {
  1688. 1006.  -     return true;
  1689. 1007.  -   }
  1690. 1008.  -   vk__adsLight.loadComplete = -1;
  1691. 1009.  -
  1692. 1010.  -   vk__adsLight.rpc.callMethod('resizeWidget', 0, 0);
  1693. 1011.  -   vk__adsLight.rpc.callMethod('adsOnInit', errorCode, adsParamsExport);
  1694. 1012.  -
  1695. 1013.  -   return true;
  1696. 1014.  - }
  1697. 1015.  -
  1698. 1016.  - AdsLight.handleAllAds = function(box, adsIdsMore, adsIdsApply, adsHeightMore) {
  1699. 1017.  -
  1700. 1018.  -   var moreLocked    = false;
  1701. 1019.  -   var applyLocked   = false;
  1702. 1020.  -   var needAdsHeight = false;
  1703. 1021.  -   var needAdsApply  = {};
  1704. 1022.  -   var applyAllowed  = false;
  1705. 1023.  -
  1706. 1024.  -   boxLayerWrap.scrollTop = 0;
  1707. 1025.  -
  1708. 1026.  -   var boxOptions = {};
  1709. 1027.  -   boxOptions.onClean = deinit;
  1710. 1028.  -   box.setOptions(boxOptions);
  1711. 1029.  -
  1712. 1030.  -   if (adsIdsMore) {
  1713. 1031.  -     addEvent(boxLayerWrap, 'scroll', onScroll);
  1714. 1032.  -   }
  1715. 1033.  -   allowApply();
  1716. 1034.  -   onScroll();
  1717. 1035.  -
  1718. 1036.  -   function deinit() {
  1719. 1037.  -     removeEvent(boxLayerWrap, 'scroll', onScroll);
  1720. 1038.  -     hide('ads_ads_all_ads_more');
  1721. 1039.  -   }
  1722. 1040.  -   function checkDeinit() {
  1723. 1041.  -     if (!adsIdsMore && (!adsIdsApply || isEmpty(adsIdsApply) || adsIdsApply.length == 0)) {
  1724. 1042.  -       deinit();
  1725. 1043.  -     }
  1726. 1044.  -   }
  1727. 1045.  -   function allowApply(delayed) {
  1728. 1046.  -     if (!delayed) {
  1729. 1047.  -       setTimeout(allowApply.pbind(true), 1000);
  1730. 1048.  -       return;
  1731. 1049.  -     }
  1732. 1050.  -     applyAllowed = true;
  1733. 1051.  -     onScroll();
  1734. 1052.  -   }
  1735. 1053.  -   function onScroll() {
  1736. 1054.  -     var moreElem = ge('ads_ads_all_ads_more');
  1737. 1055.  -     if (!moreElem) {
  1738. 1056.  -       return;
  1739. 1057.  -     }
  1740. 1058.  -     var moreRect = moreElem.getBoundingClientRect()
  1741. 1059.  -     if (moreRect.top < lastWindowHeight + adsHeightMore) {
  1742. 1060.  -       needAdsHeight = Math.round(Math.max(needAdsHeight, lastWindowHeight - moreRect.top + adsHeightMore));
  1743. 1061.  -       moreAds();
  1744. 1062.  -     }
  1745. 1063.  -
  1746. 1064.  -     if (applyAllowed) {
  1747. 1065.  -       var isApplyAdsUpdated = false;
  1748. 1066.  -       for (var i in adsIdsApply) {
  1749. 1067.  -         if (needAdsApply[i]) {
  1750. 1068.  -           continue;
  1751. 1069.  -         }
  1752. 1070.  -         adsRowRect = ge(i).getBoundingClientRect();
  1753. 1071.  -         if (adsRowRect.bottom > 0 && adsRowRect.top < lastWindowHeight) {
  1754. 1072.  -           needAdsApply[i] = true;
  1755. 1073.  -           isApplyAdsUpdated = true;
  1756. 1074.  -         }
  1757. 1075.  -       }
  1758. 1076.  -       if (isApplyAdsUpdated) {
  1759. 1077.  -         applyAds();
  1760. 1078.  -       }
  1761. 1079.  -     }
  1762. 1080.  -   }
  1763. 1081.  -   function moreAds(delayed) {
  1764. 1082.  -     if (!delayed) {
  1765. 1083.  -       setTimeout(moreAds.pbind(true), 100);
  1766. 1084.  -       return;
  1767. 1085.  -     }
  1768. 1086.  -     if (!adsIdsMore) {
  1769. 1087.  -       return;
  1770. 1088.  -     }
  1771. 1089.  -     if (!needAdsHeight) {
  1772. 1090.  -       return;
  1773. 1091.  -     }
  1774. 1092.  -     if (moreLocked) {
  1775. 1093.  -       return;
  1776. 1094.  -     }
  1777. 1095.  -     moreLocked = true;
  1778. 1096.  -
  1779. 1097.  -     var ajaxParams = {};
  1780. 1098.  -     ajaxParams.ads_ids_more = adsIdsMore;
  1781. 1099.  -     ajaxParams.ads_height = needAdsHeight;
  1782. 1100.  -
  1783. 1101.  -     ajax.post('/ads_light.php?act=all_ads_more', ajaxParams, {onDone: onDoneMoreAds.pbind(), onFail: onFailMoreAds})
  1784. 1102.  -   }
  1785. 1103.  -   function onDoneMoreAds(response) {
  1786. 1104.  -     moreLocked = false;
  1787. 1105.  -     if (!response) {
  1788. 1106.  -       onFailMoreAds();
  1789. 1107.  -       return;
  1790. 1108.  -     }
  1791. 1109.  -     adsIdsMore = response.ads_ids_more;
  1792. 1110.  -     for (var i in response.ads_ids_apply) {
  1793. 1111.  -       adsIdsApply[i] = response.ads_ids_apply[i];
  1794. 1112.  -     }
  1795. 1113.  -     if (response.ads_html) {
  1796. 1114.  -       var adsElem = ge('ads_ads_all_ads_rows');
  1797. 1115.  -       var moreElem = ge('ads_ads_all_ads_more');
  1798. 1116.  -       if (adsElem) {
  1799. 1117.  -         adsElem.innerHTML += response.ads_html;
  1800. 1118.  -         needAdsHeight = false;
  1801. 1119.  -         onScroll();
  1802. 1120.  -       }
  1803. 1121.  -       if (moreElem) {
  1804. 1122.  -         moreElem.height = response.ads_more_height;
  1805. 1123.  -       }
  1806. 1124.  -     }
  1807. 1125.  -     checkDeinit();
  1808. 1126.  -   }
  1809. 1127.  -   function onFailMoreAds() {
  1810. 1128.  -     moreLocked = false;
  1811. 1129.  -     return true;
  1812. 1130.  -   }
  1813. 1131.  -   function applyAds(delayed) {
  1814. 1132.  -     if (!delayed) {
  1815. 1133.  -       setTimeout(applyAds.pbind(true), 100);
  1816. 1134.  -       return;
  1817. 1135.  -     }
  1818. 1136.  -     if (!adsIdsApply || isEmpty(adsIdsApply) || adsIdsApply.length == 0) {
  1819. 1137.  -       checkDeinit();
  1820. 1138.  -       return;
  1821. 1139.  -     }
  1822. 1140.  -     if (!needAdsApply || isEmpty(needAdsApply) || needAdsApply.length == 0) {
  1823. 1141.  -       return;
  1824. 1142.  -     }
  1825. 1143.  -     if (applyLocked) {
  1826. 1144.  -       return;
  1827. 1145.  -     }
  1828. 1146.  -     applyLocked = true;
  1829. 1147.  -
  1830. 1148.  -     var ajaxParams = {};
  1831. 1149.  -     ajaxParams.ads_ids_apply = [];
  1832. 1150.  -
  1833. 1151.  -     for (var i in needAdsApply) {
  1834. 1152.  -       ajaxParams.ads_ids_apply.push(adsIdsApply[i]);
  1835. 1153.  -       delete adsIdsApply[i];
  1836. 1154.  -     }
  1837. 1155.  -     needAdsApply = {};
  1838. 1156.  -
  1839. 1157.  -     ajaxParams.ads_ids_apply = ajaxParams.ads_ids_apply.join(';');
  1840. 1158.  -
  1841. 1159.  -     ajax.post('/ads_light.php?act=all_ads_apply', ajaxParams, {onDone: onCompleteApplyAds, onFail: onCompleteApplyAds})
  1842. 1160.  -   }
  1843. 1161.  -   function onCompleteApplyAds(response) {
  1844. 1162.  -     for (var blockIdSuffix in response) {
  1845. 1163.  -       var elem = ge('ads_ad_box2_' + blockIdSuffix);
  1846. 1164.  -       if (!elem) {
  1847. 1165.  -         continue;
  1848. 1166.  -       }
  1849. 1167.  -       for (var key in response[blockIdSuffix]) {
  1850. 1168.  -         elem.setAttribute(key, response[blockIdSuffix][key]);
  1851. 1169.  -       }
  1852. 1170.  -     }
  1853. 1171.  -
  1854. 1172.  -     applyLocked = false;
  1855. 1173.  -     applyAds();
  1856. 1174.  -   }
  1857. 1175.  - }
  1858. 1176.  -
  1859. 1177.  - AdsLight.blockOverOut = function(event, elemCur, targetClass) {
  1860. 1178.  -   var isOver = (event.type === 'mouseover');
  1861. 1179.  -   var elemTarget;
  1862. 1180.  -   var opacity = false;
  1863. 1181.  -   if (hasClass(elemCur, targetClass)) {
  1864. 1182.  -     elemTarget = elemCur;
  1865. 1183.  -     toggleClass(elemTarget, 'over', isOver);
  1866. 1184.  -     opacity = (isOver ? 1 : 0.3);
  1867. 1185.  -   } else {
  1868. 1186.  -     elemTarget = geByClass1(targetClass, elemTarget);
  1869. 1187.  -     elemTarget.over = 1;
  1870. 1188.  -     if (!hasClass(elemTarget, 'over')) {
  1871. 1189.  -       opacity = (isOver ? 0.3 : 0);
  1872. 1190.  -     }
  1873. 1191.  -   }
  1874. 1192.  -   if (opacity !== false) {
  1875. 1193.  -     animate(elemTarget, {opacity: opacity}, 200);
  1876. 1194.  -   }
  1877. 1195.  -   if (isOver && elemCur == elemTarget) {
  1878. 1196.  -     var tooltipTextElem = geByClass1('tooltip_text', elemTarget);
  1879. 1197.  -     if (tooltipTextElem) {
  1880. 1198.  -       showTooltip(elemTarget, {text: tooltipTextElem.innerHTML, showdt: 0, black: 1, shift: [14, 3, 3]});
  1881. 1199.  -     }
  1882. 1200.  -   }
  1883. 1201.  - }
  1884. 1202.  -
  1885. 1203.  - AdsLight.closeNewsBlock = function(elem, hash) {
  1886. 1204.  -   while (!hasClass(elem, 'feed_row')) elem = elem.parentNode;
  1887. 1205.  -   slideUp(elem, 200);
  1888. 1206.  -   ajax.post('/ads_light.php?act=close_news', {hash: hash}, {onDone: onComplete, onFail: onComplete});
  1889. 1207.  -   function onComplete() {
  1890. 1208.  -     return true;
  1891. 1209.  -   }
  1892. 1210.  - }
  1893. 1211.  -
  1894. 1212.  - AdsLight.init();
  1895. 1213.  -
  1896. 1214.  - })();
  1897. 1215.  -
  1898. 1216.  - try{stManager.done('aes_light.js');}catch(e){}
  1899. ------
Advertisement
Add Comment
Please, Sign In to add comment