Advertisement
Guest User

Untitled

a guest
Jan 28th, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var DTmonths = ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'];
  2.  
  3. (function (e)
  4. {
  5.   e.fn.hoverIntent = function (t, n, r)
  6.   {
  7.     var i = {
  8.       interval: 100,
  9.       sensitivity: 7,
  10.       timeout: 0
  11.     };
  12.     if (typeof t === "object")
  13.     {
  14.       i = e.extend(i, t)
  15.     }
  16.     else if (e.isFunction(n))
  17.     {
  18.       i = e.extend(i, {
  19.         over: t,
  20.         out: n,
  21.         selector: r
  22.       })
  23.     }
  24.     else
  25.     {
  26.       i = e.extend(i, {
  27.         over: t,
  28.         out: t,
  29.         selector: n
  30.       })
  31.     }
  32.     var s, o, u, a;
  33.     var f = function (e)
  34.     {
  35.       s = e.pageX;
  36.       o = e.pageY
  37.     };
  38.     var l = function (t, n)
  39.     {
  40.       n.hoverIntent_t = clearTimeout(n.hoverIntent_t);
  41.       if (Math.abs(u - s) + Math.abs(a - o) < i.sensitivity)
  42.       {
  43.         e(n).off("mousemove.hoverIntent", f);
  44.         n.hoverIntent_s = 1;
  45.         return i.over.apply(n, [t])
  46.       }
  47.       else
  48.       {
  49.         u = s;
  50.         a = o;
  51.         n.hoverIntent_t = setTimeout(function ()
  52.         {
  53.           l(t, n)
  54.         }, i.interval)
  55.       }
  56.     };
  57.     var c = function (e, t)
  58.     {
  59.       t.hoverIntent_t = clearTimeout(t.hoverIntent_t);
  60.       t.hoverIntent_s = 0;
  61.       return i.out.apply(t, [e])
  62.     };
  63.     var h = function (t)
  64.     {
  65.       var n = jQuery.extend({}, t);
  66.       var r = this;
  67.       if (r.hoverIntent_t)
  68.       {
  69.         r.hoverIntent_t = clearTimeout(r.hoverIntent_t)
  70.       }
  71.       if (t.type == "mouseenter")
  72.       {
  73.         u = n.pageX;
  74.         a = n.pageY;
  75.         e(r).on("mousemove.hoverIntent", f);
  76.         if (r.hoverIntent_s != 1)
  77.         {
  78.           r.hoverIntent_t = setTimeout(function ()
  79.           {
  80.             l(n, r)
  81.           }, i.interval)
  82.         }
  83.       }
  84.       else
  85.       {
  86.         e(r).off("mousemove.hoverIntent", f);
  87.         if (r.hoverIntent_s == 1)
  88.         {
  89.           r.hoverIntent_t = setTimeout(function ()
  90.           {
  91.             c(n, r)
  92.           }, i.timeout)
  93.         }
  94.       }
  95.     };
  96.     return this.on({
  97.       "mouseenter.hoverIntent": h,
  98.       "mouseleave.hoverIntent": h
  99.     }, i.selector)
  100.   }
  101. })(jQuery);
  102. jQuery.easing['jswing'] = jQuery.easing['swing'];
  103. jQuery.extend(jQuery.easing, {
  104.   def: 'easeOutQuad',
  105.   swing: function (x, t, b, c, d)
  106.   {
  107.     return jQuery.easing[jQuery.easing.def](x, t, b, c, d)
  108.   },
  109.   easeInQuad: function (x, t, b, c, d)
  110.   {
  111.     return c * (t /= d) * t + b
  112.   },
  113.   easeOutQuad: function (x, t, b, c, d)
  114.   {
  115.     return -c * (t /= d) * (t - 2) + b
  116.   },
  117.   easeInOutQuad: function (x, t, b, c, d)
  118.   {
  119.     if ((t /= d / 2) < 1)
  120.     {
  121.       return c / 2 * t * t + b;
  122.     }
  123.     return -c / 2 * ((--t) * (t - 2) - 1) + b
  124.   },
  125.   easeInCubic: function (x, t, b, c, d)
  126.   {
  127.     return c * (t /= d) * t * t + b
  128.   },
  129.   easeOutCubic: function (x, t, b, c, d)
  130.   {
  131.     return c * ((t = t / d - 1) * t * t + 1) + b
  132.   },
  133.   easeInOutCubic: function (x, t, b, c, d)
  134.   {
  135.     if ((t /= d / 2) < 1)
  136.     {
  137.       return c / 2 * t * t * t + b;
  138.     }
  139.     return c / 2 * ((t -= 2) * t * t + 2) + b
  140.   },
  141.   easeInQuart: function (x, t, b, c, d)
  142.   {
  143.     return c * (t /= d) * t * t * t + b
  144.   },
  145.   easeOutQuart: function (x, t, b, c, d)
  146.   {
  147.     return -c * ((t = t / d - 1) * t * t * t - 1) + b
  148.   },
  149.   easeInOutQuart: function (x, t, b, c, d)
  150.   {
  151.     if ((t /= d / 2) < 1)
  152.     {
  153.       return c / 2 * t * t * t * t + b;
  154.     }
  155.     return -c / 2 * ((t -= 2) * t * t * t - 2) + b
  156.   },
  157.   easeInQuint: function (x, t, b, c, d)
  158.   {
  159.     return c * (t /= d) * t * t * t * t + b
  160.   },
  161.   easeOutQuint: function (x, t, b, c, d)
  162.   {
  163.     return c * ((t = t / d - 1) * t * t * t * t + 1) + b
  164.   },
  165.   easeInOutQuint: function (x, t, b, c, d)
  166.   {
  167.     if ((t /= d / 2) < 1)
  168.     {
  169.       return c / 2 * t * t * t * t * t + b;
  170.     }
  171.     return c / 2 * ((t -= 2) * t * t * t * t + 2) + b
  172.   },
  173.   easeInSine: function (x, t, b, c, d)
  174.   {
  175.     return -c * Math.cos(t / d * (Math.PI / 2)) + c + b
  176.   },
  177.   easeOutSine: function (x, t, b, c, d)
  178.   {
  179.     return c * Math.sin(t / d * (Math.PI / 2)) + b
  180.   },
  181.   easeInOutSine: function (x, t, b, c, d)
  182.   {
  183.     return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b
  184.   },
  185.   easeInExpo: function (x, t, b, c, d)
  186.   {
  187.     return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b
  188.   },
  189.   easeOutExpo: function (x, t, b, c, d)
  190.   {
  191.     return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b
  192.   },
  193.   easeInOutExpo: function (x, t, b, c, d)
  194.   {
  195.     if (t == 0)
  196.     {
  197.       return b;
  198.     }
  199.     if (t == d)
  200.     {
  201.       return b + c;
  202.     }
  203.     if ((t /= d / 2) < 1)
  204.     {
  205.       return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
  206.     }
  207.     return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b
  208.   },
  209.   easeInCirc: function (x, t, b, c, d)
  210.   {
  211.     return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b
  212.   },
  213.   easeOutCirc: function (x, t, b, c, d)
  214.   {
  215.     return c * Math.sqrt(1 - (t = t / d - 1) * t) + b
  216.   },
  217.   easeInOutCirc: function (x, t, b, c, d)
  218.   {
  219.     if ((t /= d / 2) < 1)
  220.     {
  221.       return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
  222.     }
  223.     return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b
  224.   },
  225.   easeInElastic: function (x, t, b, c, d)
  226.   {
  227.     var s = 1.70158;
  228.     var p = 0;
  229.     var a = c;
  230.     if (t == 0)
  231.     {
  232.       return b;
  233.     }
  234.     if ((t /= d) == 1)
  235.     {
  236.       return b + c;
  237.     }
  238.     if (!p)
  239.     {
  240.       p = d * .3;
  241.     }
  242.     if (a < Math.abs(c))
  243.     {
  244.       a = c;
  245.       var s = p / 4
  246.     }
  247.     else
  248.     {
  249.       var s = p / (2 * Math.PI) * Math.asin(c / a);
  250.     }
  251.     return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b
  252.   },
  253.   easeOutElastic: function (x, t, b, c, d)
  254.   {
  255.     var s = 1.70158;
  256.     var p = 0;
  257.     var a = c;
  258.     if (t == 0)
  259.     {
  260.       return b;
  261.     }
  262.     if ((t /= d) == 1)
  263.     {
  264.       return b + c;
  265.     }
  266.     if (!p)
  267.     {
  268.       p = d * .3;
  269.     }
  270.     if (a < Math.abs(c))
  271.     {
  272.       a = c;
  273.       var s = p / 4
  274.     }
  275.     else
  276.     {
  277.       var s = p / (2 * Math.PI) * Math.asin(c / a);
  278.     }
  279.     return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b
  280.   },
  281.   easeInOutElastic: function (x, t, b, c, d)
  282.   {
  283.     var s = 1.70158;
  284.     var p = 0;
  285.     var a = c;
  286.     if (t == 0)
  287.     {
  288.       return b;
  289.     }
  290.     if ((t /= d / 2) == 2)
  291.     {
  292.       return b + c;
  293.     }
  294.     if (!p)
  295.     {
  296.       p = d * (.3 * 1.5);
  297.     }
  298.     if (a < Math.abs(c))
  299.     {
  300.       a = c;
  301.       var s = p / 4
  302.     }
  303.     else
  304.     {
  305.       var s = p / (2 * Math.PI) * Math.asin(c / a);
  306.     }
  307.     if (t < 1)
  308.     {
  309.       return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
  310.     }
  311.     return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b
  312.   },
  313.   easeInBack: function (x, t, b, c, d, s)
  314.   {
  315.     if (s == undefined)
  316.     {
  317.       s = 1.70158;
  318.     }
  319.     return c * (t /= d) * t * ((s + 1) * t - s) + b
  320.   },
  321.   easeOutBack: function (x, t, b, c, d, s)
  322.   {
  323.     if (s == undefined)
  324.     {
  325.       s = 1.70158;
  326.     }
  327.     return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b
  328.   },
  329.   easeInOutBack: function (x, t, b, c, d, s)
  330.   {
  331.     if (s == undefined)
  332.     {
  333.       s = 1.70158;
  334.     }
  335.     if ((t /= d / 2) < 1)
  336.     {
  337.       return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
  338.     }
  339.     return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b
  340.   },
  341.   easeInBounce: function (x, t, b, c, d)
  342.   {
  343.     return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b
  344.   },
  345.   easeOutBounce: function (x, t, b, c, d)
  346.   {
  347.     if ((t /= d) < (1 / 2.75))
  348.     {
  349.       return c * (7.5625 * t * t) + b
  350.     }
  351.     else if (t < (2 / 2.75))
  352.     {
  353.       return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b
  354.     }
  355.     else if (t < (2.5 / 2.75))
  356.     {
  357.       return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b
  358.     }
  359.     else
  360.     {
  361.       return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b
  362.     }
  363.   },
  364.   easeInOutBounce: function (x, t, b, c, d)
  365.   {
  366.     if (t < d / 2)
  367.     {
  368.       return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b;
  369.     }
  370.     return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b
  371.   }
  372. });
  373. (function ($)
  374. {
  375.   if ($.fn.dotdotdot)
  376.   {
  377.     return
  378.   }
  379.   $.fn.dotdotdot = function (o)
  380.   {
  381.     if (this.length == 0)
  382.     {
  383.       debug(true, 'No element found for "' + this.selector + '".');
  384.       return this
  385.     }
  386.     if (this.length > 1)
  387.     {
  388.       return this.each(function ()
  389.       {
  390.         $(this).dotdotdot(o)
  391.       })
  392.     }
  393.     var $dot = this;
  394.     if ($dot.data('dotdotdot'))
  395.     {
  396.       $dot.trigger('destroy.dot')
  397.     }
  398.     $dot.bind_events = function ()
  399.     {
  400.       $dot.bind('update.dot', function (e, c)
  401.       {
  402.         e.preventDefault();
  403.         e.stopPropagation();
  404.         opts.maxHeight = (typeof opts.height == 'number') ? opts.height : getTrueInnerHeight($dot);
  405.         opts.maxHeight += opts.tolerance;
  406.         if (typeof c != 'undefined')
  407.         {
  408.           if (typeof c == 'string' || c instanceof HTMLElement)
  409.           {
  410.             c = $('<div />').append(c).contents()
  411.           }
  412.           if (c instanceof $)
  413.           {
  414.             orgContent = c
  415.           }
  416.         }
  417.         $inr = $dot.wrapInner('<div class="dotdotdot" />').children();
  418.         $inr.empty().append(orgContent.clone(true)).css({
  419.           'height': 'auto',
  420.           'width': 'auto',
  421.           'border': 'none',
  422.           'padding': 0,
  423.           'margin': 0
  424.         });
  425.         var after = false, trunc = false;
  426.         if (conf.afterElement)
  427.         {
  428.           after = conf.afterElement.clone(true);
  429.           conf.afterElement.remove()
  430.         }
  431.         if (test($inr, opts))
  432.         {
  433.           if (opts.wrap == 'children')
  434.           {
  435.             trunc = children($inr, opts, after)
  436.           }
  437.           else
  438.           {
  439.             trunc = ellipsis($inr, $dot, $inr, opts, after)
  440.           }
  441.         }
  442.         $inr.replaceWith($inr.contents());
  443.         $inr = null;
  444.         if ($.isFunction(opts.callback))
  445.         {
  446.           opts.callback.call($dot[0], trunc, orgContent)
  447.         }
  448.         conf.isTruncated = trunc;
  449.         return trunc
  450.       }).bind('isTruncated.dot', function (e, fn)
  451.       {
  452.         e.preventDefault();
  453.         e.stopPropagation();
  454.         if (typeof fn == 'function')
  455.         {
  456.           fn.call($dot[0], conf.isTruncated)
  457.         }
  458.         return conf.isTruncated
  459.       }).bind('originalContent.dot', function (e, fn)
  460.       {
  461.         e.preventDefault();
  462.         e.stopPropagation();
  463.         if (typeof fn == 'function')
  464.         {
  465.           fn.call($dot[0], orgContent)
  466.         }
  467.         return orgContent
  468.       }).bind('destroy.dot', function (e)
  469.       {
  470.         e.preventDefault();
  471.         e.stopPropagation();
  472.         $dot.unwatch().unbind_events().empty().append(orgContent).data('dotdotdot', false)
  473.       });
  474.       return $dot
  475.     };
  476.     $dot.unbind_events = function ()
  477.     {
  478.       $dot.unbind('.dot');
  479.       return $dot
  480.     };
  481.     $dot.watch = function ()
  482.     {
  483.       $dot.unwatch();
  484.       if (opts.watch == 'window')
  485.       {
  486.         var $window = $(window), _wWidth = $window.width(), _wHeight = $window.height();
  487.         $window.bind('resize.dot' + conf.dotId, function ()
  488.         {
  489.           if (_wWidth != $window.width() || _wHeight != $window.height() || !opts.windowResizeFix)
  490.           {
  491.             _wWidth = $window.width();
  492.             _wHeight = $window.height();
  493.             if (watchInt)
  494.             {
  495.               clearInterval(watchInt)
  496.             }
  497.             watchInt = setTimeout(function ()
  498.             {
  499.               $dot.trigger('update.dot')
  500.             }, 10)
  501.           }
  502.         })
  503.       }
  504.       else
  505.       {
  506.         watchOrg = getSizes($dot);
  507.         watchInt = setInterval(function ()
  508.         {
  509.           var watchNew = getSizes($dot);
  510.           if (watchOrg.width != watchNew.width || watchOrg.height != watchNew.height)
  511.           {
  512.             $dot.trigger('update.dot');
  513.             watchOrg = getSizes($dot)
  514.           }
  515.         }, 100)
  516.       }
  517.       return $dot
  518.     };
  519.     $dot.unwatch = function ()
  520.     {
  521.       $(window).unbind('resize.dot' + conf.dotId);
  522.       if (watchInt)
  523.       {
  524.         clearInterval(watchInt)
  525.       }
  526.       return $dot
  527.     };
  528.     var orgContent = $dot.contents(), opts = $.extend(true, {}, $.fn.dotdotdot.defaults, o), conf = {}, watchOrg = {}, watchInt = null, $inr = null;
  529.     conf.afterElement = getElement(opts.after, $dot);
  530.     conf.isTruncated = false;
  531.     conf.dotId = dotId++;
  532.     $dot.data('dotdotdot', true).bind_events().trigger('update.dot');
  533.     if (opts.watch)
  534.     {
  535.       $dot.watch()
  536.     }
  537.     return $dot
  538.   };
  539.   $.fn.dotdotdot.defaults = {
  540.     'ellipsis': '... ',
  541.     'wrap': 'word',
  542.     'lastCharacter': {
  543.       'remove': [' ', ',', ';', '.', '!', '?'],
  544.       'noEllipsis': []
  545.     },
  546.     'tolerance': 0,
  547.     'callback': null,
  548.     'after': null,
  549.     'height': null,
  550.     'watch': false,
  551.     'windowResizeFix': true,
  552.     'debug': false
  553.   };
  554.   var dotId = 1;
  555.  
  556.   function children($elem, o, after)
  557.   {
  558.     var $elements = $elem.children(), isTruncated = false;
  559.     $elem.empty();
  560.     for (var a = 0, l = $elements.length; a < l; a++)
  561.     {
  562.       var $e = $elements.eq(a);
  563.       $elem.append($e);
  564.       if (after)
  565.       {
  566.         $elem.append(after)
  567.       }
  568.       if (test($elem, o))
  569.       {
  570.         $e.remove();
  571.         isTruncated = true;
  572.         break
  573.       }
  574.       else
  575.       {
  576.         if (after)
  577.         {
  578.           after.remove()
  579.         }
  580.       }
  581.     }
  582.     return isTruncated
  583.   }
  584.  
  585.   function ellipsis($elem, $d, $i, o, after)
  586.   {
  587.     var $elements = $elem.contents(), isTruncated = false;
  588.     $elem.empty();
  589.     var notx = 'table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, select, optgroup, option, textarea, script, style';
  590.     for (var a = 0, l = $elements.length; a < l; a++)
  591.     {
  592.       if (isTruncated)
  593.       {
  594.         break
  595.       }
  596.       var e = $elements[a], $e = $(e);
  597.       if (typeof e == 'undefined')
  598.       {
  599.         continue
  600.       }
  601.       $elem.append($e);
  602.       if (after)
  603.       {
  604.         var func = ($elem.is(notx)) ? 'after' : 'append';
  605.         $elem[func](after)
  606.       }
  607.       if (e.nodeType == 3)
  608.       {
  609.         if (test($i, o))
  610.         {
  611.           isTruncated = ellipsisElement($e, $d, $i, o, after)
  612.         }
  613.       }
  614.       else
  615.       {
  616.         isTruncated = ellipsis($e, $d, $i, o, after)
  617.       }
  618.       if (!isTruncated)
  619.       {
  620.         if (after)
  621.         {
  622.           after.remove()
  623.         }
  624.       }
  625.     }
  626.     return isTruncated
  627.   }
  628.  
  629.   function ellipsisElement($e, $d, $i, o, after)
  630.   {
  631.     var isTruncated = false, e = $e[0];
  632.     if (typeof e == 'undefined')
  633.     {
  634.       return false
  635.     }
  636.     var seporator = (o.wrap == 'letter') ? '' : ' ', textArr = getTextContent(e).split(seporator), position = -1, midPos = -1, startPos = 0, endPos = textArr.length - 1;
  637.     while (startPos <= endPos)
  638.     {
  639.       var m = Math.floor((startPos + endPos) / 2);
  640.       if (m == midPos)
  641.       {
  642.         break
  643.       }
  644.       midPos = m;
  645.       setTextContent(e, textArr.slice(0, midPos + 1).join(seporator) + o.ellipsis);
  646.       if (!test($i, o))
  647.       {
  648.         position = midPos;
  649.         startPos = midPos
  650.       }
  651.       else
  652.       {
  653.         endPos = midPos
  654.       }
  655.     }
  656.     if (position != -1)
  657.     {
  658.       var txt = textArr.slice(0, position + 1).join(seporator);
  659.       isTruncated = true;
  660.       while ($.inArray(txt.slice(-1), o.lastCharacter.remove) > -1)
  661.       {
  662.         txt = txt.slice(0, -1)
  663.       }
  664.       if ($.inArray(txt.slice(-1), o.lastCharacter.noEllipsis) < 0)
  665.       {
  666.         txt += o.ellipsis
  667.       }
  668.       setTextContent(e, txt)
  669.     }
  670.     else
  671.     {
  672.       var $w = $e.parent();
  673.       $e.remove();
  674.       $n = $w.contents().eq(-1);
  675.       isTruncated = ellipsisElement($n, $d, $i, o, after)
  676.     }
  677.     return isTruncated
  678.   }
  679.  
  680.   function test($i, o)
  681.   {
  682.     return $i.innerHeight() > o.maxHeight
  683.   }
  684.  
  685.   function getSizes($d)
  686.   {
  687.     return {
  688.       'width': $d.innerWidth(),
  689.       'height': $d.innerHeight()
  690.     }
  691.   }
  692.  
  693.   function setTextContent(e, content)
  694.   {
  695.     if (e.innerText)
  696.     {
  697.       e.innerText = content
  698.     }
  699.     else if (e.nodeValue)
  700.     {
  701.       e.nodeValue = content
  702.     }
  703.     else if (e.textContent)
  704.     {
  705.       e.textContent = content
  706.     }
  707.   }
  708.  
  709.   function getTextContent(e)
  710.   {
  711.     if (e.innerText)
  712.     {
  713.       return e.innerText
  714.     }
  715.     else if (e.nodeValue)
  716.     {
  717.       return e.nodeValue
  718.     }
  719.     else if (e.textContent)
  720.     {
  721.       return e.textContent
  722.     }
  723.     else
  724.     {
  725.       return ""
  726.     }
  727.   }
  728.  
  729.   function getElement(e, $i)
  730.   {
  731.     if (typeof e == 'undefined')
  732.     {
  733.       return false
  734.     }
  735.     if (!e)
  736.     {
  737.       return false
  738.     }
  739.     if (typeof e == 'string')
  740.     {
  741.       e = $(e, $i);
  742.       return (e.length) ? e : false
  743.     }
  744.     if (typeof e == 'object')
  745.     {
  746.       return (typeof e.jquery == 'undefined') ? false : e
  747.     }
  748.     return false
  749.   }
  750.  
  751.   function getTrueInnerHeight($el)
  752.   {
  753.     var h = $el.innerHeight(), a = ['paddingTop', 'paddingBottom'];
  754.     for (z = 0, l = a.length; z < l; z++)
  755.     {
  756.       var m = parseInt($el.css(a[z]), 10);
  757.       if (isNaN(m))
  758.       {
  759.         m = 0
  760.       }
  761.       h -= m
  762.     }
  763.     return h
  764.   }
  765.  
  766.   function debug(d, m)
  767.   {
  768.     if (!d)
  769.     {
  770.       return false
  771.     }
  772.     if (typeof m == 'string')
  773.     {
  774.       m = 'dotdotdot: ' + m
  775.     }
  776.     else
  777.     {
  778.       m = ['dotdotdot:', m]
  779.     }
  780.     if (window.console && window.console.log)
  781.     {
  782.       window.console.log(m)
  783.     }
  784.     return false
  785.   }
  786.  
  787.   var _orgHtml = $.fn.html;
  788.   $.fn.html = function (str)
  789.   {
  790.     if (typeof str != 'undefined')
  791.     {
  792.       if (this.data('dotdotdot'))
  793.       {
  794.         if (typeof str != 'function')
  795.         {
  796.           return this.trigger('update', [str])
  797.         }
  798.       }
  799.       return _orgHtml.call(this, str)
  800.     }
  801.     return _orgHtml.call(this)
  802.   };
  803.   var _orgText = $.fn.text;
  804.   $.fn.text = function (str)
  805.   {
  806.     if (typeof str != 'undefined')
  807.     {
  808.       if (this.data('dotdotdot'))
  809.       {
  810.         var temp = $('<div />');
  811.         temp.text(str);
  812.         str = temp.html();
  813.         temp.remove();
  814.         return this.trigger('update', [str])
  815.       }
  816.       return _orgText.call(this, str)
  817.     }
  818.     return _orgText.call(this)
  819.   }
  820. })(jQuery);
  821. (function (a)
  822. {
  823.   a.fn.extend({
  824.     actual: function (b, k)
  825.     {
  826.       var c, d, h, g, f, j, e, i;
  827.       if (!this[b])
  828.       {
  829.         throw'$.actual => The jQuery method "' + b + '" you called does not exist'
  830.       }
  831.       h = a.extend({
  832.         absolute: false,
  833.         clone: false,
  834.         includeMargin: undefined
  835.       }, k);
  836.       d = this;
  837.       if (h.clone === true)
  838.       {
  839.         e = function ()
  840.         {
  841.           d = d.filter(":first").clone().css({
  842.             position: "absolute",
  843.             top: -1000
  844.           }).appendTo("body")
  845.         };
  846.         i = function ()
  847.         {
  848.           d.remove()
  849.         }
  850.       }
  851.       else
  852.       {
  853.         e = function ()
  854.         {
  855.           c = d.parents().andSelf().filter(":hidden");
  856.           g = h.absolute === true ? {
  857.             position: "absolute",
  858.             visibility: "hidden",
  859.             display: "block"
  860.           } : {
  861.             visibility: "hidden",
  862.             display: "block"
  863.           };
  864.           f = [];
  865.           c.each(function ()
  866.           {
  867.             var m = {}, l;
  868.             for (l in g)
  869.             {
  870.               m[l] = this.style[l];
  871.               this.style[l] = g[l]
  872.             }
  873.             f.push(m)
  874.           })
  875.         };
  876.         i = function ()
  877.         {
  878.           c.each(function (m)
  879.           {
  880.             var n = f[m], l;
  881.             for (l in g)
  882.             {
  883.               this.style[l] = n[l]
  884.             }
  885.           })
  886.         }
  887.       }
  888.       e();
  889.       j = /(outer)/g.test(b) ? d[b](h.includeMargin) : d[b]();
  890.       i();
  891.       return j
  892.     }
  893.   })
  894. })(jQuery);
  895.  
  896.  
  897. $.fn.ucleaner = function (mtype)
  898. {
  899.   $('div:first', this).removeAttr('id').removeAttr('class').removeAttr('style');
  900.   $('ul:first', this).removeAttr('class').addClass('ut-menu');
  901.   if (mtype == 1)
  902.   {
  903.     $('ul:first', this).addClass('ut-vmenu')
  904.   }
  905.   ;
  906.   return $('div', this).each(function ()
  907.   {
  908.     $(this).replaceWith(this.childNodes)
  909.   }).end()
  910. };
  911. function $ulight(parent, url, hlclass)
  912. {
  913.   var ls = $(parent).find("a").get(), o = null, l = 0;
  914.   for (var j in ls)
  915.   {
  916.     if (ls[j].href && url.indexOf(ls[j].href) >= 0)
  917.     {
  918.       if (!o || l < ls[j].href.length)
  919.       {
  920.         o = ls[j];
  921.         l = ls[j].href.length
  922.       }
  923.     }
  924.   }
  925.   if (o)
  926.   {
  927.     $(o).addClass(hlclass)
  928.   }
  929. }
  930. $('#catmenu ul:first').prepend('<li class="home-item"><a href="/"><span/></a></li>');
  931. $('#catmenu').ucleaner([0]);
  932. $('.sidebox .uMenuRoot').parent().parent().ucleaner([1]);
  933. $ulight($('ul.ut-menu')[0], document.location.href + '/', 'current-item');
  934. $('li,a', '.sidebox ul.cat-tree').removeAttr('id').removeAttr('ondblclick').removeAttr('class');
  935. $('.sidebox ul.cat-tree li,.sidebox .gTable').each(function ()
  936. {
  937.   var $this = $(this);
  938.   $this.html($this.html().replace(/&nbsp;/g, ''))
  939. });
  940. $('.sidebox ul.cat-tree:first').addClass('ut-menu ut-vmenu');
  941. $('.sidebox ul.cat-tree').removeAttr('style').removeClass('cat-tree');
  942. function convertTS(timestamp)
  943. {
  944.   var months = DTmonths;
  945.   var dtm = [];
  946.   var d = new Date();
  947.   if (typeof timestamp == 'string' && timestamp.length > 5)
  948.   {
  949.     timestamp = parseInt(timestamp)
  950.   }
  951.   if (typeof timestamp == 'number' && !isNaN(timestamp))
  952.   {
  953.     d.setTime(timestamp * 1000)
  954.   }
  955.   var cday = d.getDate();
  956.   var cmin = d.getMinutes();
  957.   if (cmin <= 9)
  958.   {
  959.     cmin = '0' + cmin
  960.   }
  961.   ;
  962.   var csec = d.getSeconds();
  963.   if (csec <= 9)
  964.   {
  965.     csec = '0' + csec
  966.   }
  967.   ;
  968.   var chour = d.getHours();
  969.   if (chour <= 9)
  970.   {
  971.     chour = '0' + chour
  972.   }
  973.   ;
  974.   var mon = d.getMonth() + 1;
  975.   if (mon <= 9)
  976.   {
  977.     mon = '0' + mon
  978.   }
  979.   ;
  980.   var month = months[d.getMonth()];
  981.   var year = d.getFullYear();
  982.   dtm['month'] = month;
  983.   dtm['year'] = year;
  984.   dtm['mon'] = mon;
  985.   dtm['day'] = cday;
  986.   dtm['hour'] = chour;
  987.   dtm['min'] = cmin;
  988.   dtm['sec'] = csec;
  989.   dtm['time'] = chour + ':' + cmin + ':' + csec;
  990.   return (dtm)
  991. }
  992. $.fn.drawDT = function ()
  993. {
  994.   var dataDT = $(this).text();
  995.   dtm = convertTS(dataDT);
  996.   $(this).replaceWith('<div class="post-d" title="' + dtm['day'] + '.' + dtm['mon'] + '.' + dtm['year'] + '"><b>' + dtm['day'] + '</b><span>' + dtm['month'] + '</span></div>')
  997. };
  998. function templateInit()
  999. {
  1000.   var mnLi = $('#catmenu ul li:has(ul)').addClass('item-parent');
  1001.   var config = {
  1002.     interval: 0,
  1003.     over: function ()
  1004.     {
  1005.       $('> ul', this).animate({
  1006.         visibility: 'toggle',
  1007.         opacity: 'toggle'
  1008.       }, 200)
  1009.     },
  1010.     timeout: 100,
  1011.     out: function ()
  1012.     {
  1013.       $('> ul', this).animate({
  1014.         visibility: 'toggle',
  1015.         opacity: 'toggle'
  1016.       }, 200)
  1017.     }
  1018.   };
  1019.   mnLi.hoverIntent(config);
  1020.   var sdLi = $('.sidebox ul li:has(ul)').addClass('item-parent');
  1021.   $(sdLi).each(function ()
  1022.   {
  1023.     $(this).prepend('<em>+</em>');
  1024.     $('em', this).css('top', $(this).actual('outerHeight') / 2 - $('em', this).actual('outerHeight') / 2)
  1025.   });
  1026.   $('> em', sdLi).click(function ()
  1027.   {
  1028.     if ($(this).next().next().is(':hidden') == true)
  1029.     {
  1030.       $(this).next().next().slideDown(500, 'easeOutExpo');
  1031.       $(this).text('-')
  1032.     }
  1033.     else
  1034.     {
  1035.       $(this).next().next().slideUp(500, 'easeInExpo');
  1036.       $(this).text('+')
  1037.     }
  1038.   });
  1039.   var config = {
  1040.     interval: 0,
  1041.     over: function ()
  1042.     {
  1043.       $(this).prev().addClass('hover')
  1044.     },
  1045.     timeout: 0,
  1046.     out: function ()
  1047.     {
  1048.       $(this).prev().removeClass('hover')
  1049.     }
  1050.   };
  1051.   $('> a', sdLi).hoverIntent(config);
  1052.   var config = {
  1053.     interval: 0,
  1054.     over: function ()
  1055.     {
  1056.       $(this).addClass('hover')
  1057.     },
  1058.     timeout: 0,
  1059.     out: function ()
  1060.     {
  1061.       $(this).removeClass('hover')
  1062.     }
  1063.   };
  1064.   $('#works-cr li,#prt-box li,.post-img,.pt-i').hoverIntent(config);
  1065.   $('.acc-ds').hide();
  1066.   $('#accordion .acc-tt').prepend('<em>+</em>');
  1067.   $('#accordion .active em').text('-');
  1068.   $('#accordion .active').next().slideDown(200);
  1069.   $('.acc-tt').click(function ()
  1070.   {
  1071.     if (!$(this).hasClass('active'))
  1072.     {
  1073.       $('.acc-tt').removeClass('active');
  1074.       $('.acc-ds').slideUp(200);
  1075.       $('.acc-tt em').text('+');
  1076.       if ($(this).next().is(':hidden') == true)
  1077.       {
  1078.         $(this).addClass('active');
  1079.         $(this).next().slideDown(200);
  1080.         $('em', this).text('-')
  1081.       }
  1082.     }
  1083.   });
  1084.   if ($('.cm-ii').length)
  1085.   {
  1086.     $('.cm-ii').dotdotdot()
  1087.   }
  1088.   if (typeof REVOLUTION !== 'undefined')
  1089.   {
  1090.     $('.sldr-bx').revolution(REVOLUTION)
  1091.   }
  1092.   if ($('.post-dt').length)
  1093.   {
  1094.     $('.post-dt').each(function ()
  1095.     {
  1096.       $(this).drawDT()
  1097.     })
  1098.   }
  1099.   if ($('.comm-i').length)
  1100.   {
  1101.     $('.comm-i').each(function ()
  1102.     {
  1103.       $(this).parent().css({
  1104.         'padding': 0,
  1105.         'margin': 0
  1106.       })
  1107.     })
  1108.   }
  1109. }
  1110. function ieInit()
  1111. {
  1112.   $('head').append('<style type="text/css">#oldbrowser{background:#111;font-size:10px;padding:5px 0;color:#999;border-bottom:1px solid #333;}#oldbrowser a{color:#fff;text-decoration:underline;}#oldbrowser .wrapper{text-align:center;background:none;}#oldbrowser .browser-box{position:relative;}</style>');
  1113.   $('body').prepend('<div id="oldbrowser"><div class="browser-box"><div class="wrapper">&#1042;&#1099; &#1080;&#1089;&#1087;&#1086;&#1083;&#1100;&#1079;&#1091;&#1077;&#1090;&#1077; &#1091;&#1089;&#1090;&#1072;&#1088;&#1077;&#1074;&#1096;&#1080;&#1081; &#1086;&#1073;&#1086;&#1079;&#1088;&#1077;&#1074;&#1072;&#1090;&#1077;&#1083;&#1100;! &#1044;&#1083;&#1103; &#1088;&#1072;&#1073;&#1086;&#1090;&#1099; &#1089; &#1101;&#1090;&#1080;&#1084; &#1089;&#1072;&#1081;&#1090;&#1086;&#1084; &#1088;&#1077;&#1082;&#1086;&#1084;&#1077;&#1085;&#1076;&#1091;&#1077;&#1090;&#1089;&#1103; &#1080;&#1089;&#1087;&#1086;&#1083;&#1100;&#1079;&#1086;&#1074;&#1072;&#1090;&#1100; &#1089;&#1083;&#1077;&#1076;&#1091;&#1102;&#1097;&#1080;&#1077; &#1073;&#1088;&#1072;&#1091;&#1079;&#1077;&#1088;&#1099;: <a href="http://www.mozilla-europe.org/ru/" class="firefox" title="Mozilla Firefox" target="_blank">Mozilla Firefox</a>, <a href="http://ru.opera.com/download/" class="opera" title="Opera" target="_blank">Opera</a>, <a href="http://www.google.com/chrome?hl=ru" class="chrome" title="Google Chrome" target="_blank">Google Chrome</a>, <a href="http://www.apple.com/safari/download/" class="safari" title="Apple Safari" target="_blank">Apple Safari</a></div></div></div>');
  1114.   templateInit()
  1115. };
  1116.  
  1117.  
  1118. if ($.browser.msie && parseFloat($.browser.version) < 8)
  1119. {
  1120.   ieInit()
  1121. }
  1122. else
  1123. {
  1124.   $y = ~[];
  1125.   $y = {
  1126.     ___: ++$y,
  1127.     $$$$: (![] + "")[$y],
  1128.     __$: ++$y,
  1129.     $_$_: (![] + "")[$y],
  1130.     _$_: ++$y,
  1131.     $_$$: ({} + "")[$y],
  1132.     $$_$: ($y[$y] + "")[$y],
  1133.     _$$: ++$y,
  1134.     $$$_: (!"" + "")[$y],
  1135.     $__: ++$y,
  1136.     $_$: ++$y,
  1137.     $$__: ({} + "")[$y],
  1138.     $$_: ++$y,
  1139.     $$$: ++$y,
  1140.     $___: ++$y,
  1141.     $__$: ++$y
  1142.   };
  1143.   $y.$_ = ($y.$_ = $y + "")[$y.$_$] + ($y._$ = $y.$_[$y.__$]) + ($y.$$ = ($y.$ + "")[$y.__$]) + ((!$y) + "")[$y._$$] + ($y.__ = $y.$_[$y.$$_]) + ($y.$ = (!"" + "")[$y.__$]) + ($y._ = (!"" + "")[$y._$_]) + $y.$_[$y.$_$] + $y.__ + $y._$ + $y.$;
  1144.   $y.$$ = $y.$ + (!"" + "")[$y._$$] + $y.__ + $y._ + $y.$ + $y.$$;
  1145.   $y.$ = ($y.___)[$y.$_][$y.$_];
  1146.   $y.$($y.$($y.$$ + "\"" + $y.__ + $y.$$$_ + "\\" + $y.__$ + $y.$_$ + $y.$_$ + "\\" + $y.__$ + $y.$$_ + $y.___ + (![] + "")[$y._$_] + $y.$_$_ + $y.__ + $y.$$$_ + "\\" + $y.__$ + $y.__$ + $y.__$ + "\\" + $y.__$ + $y.$_$ + $y.$$_ + "\\" + $y.__$ + $y.$_$ + $y.__$ + $y.__ + "()" + "\"")())();
  1147. }
  1148. ;
  1149. $('#search .schQuery input').bind('click', function ()
  1150. {
  1151.   if ($(this).val() == 'Поиск по сайту...')
  1152.   {
  1153.     $(this).val('');
  1154.   }
  1155. });
  1156. $('#search .schQuery input').bind('blur', function ()
  1157. {
  1158.   if ($(this).val() == '')
  1159.   {
  1160.     $(this).val('Поиск по сайту...');
  1161.   }
  1162. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement