/**
 * @author Pavel Alexandrov <pavel@vmt.ru>
 * @copyright Copyright (c) 2010, Pavel Alexandrov
 * @license http://opensource.org/licenses/gpl-2.0.php The GNU Public License (GPL) Version 2, June 1991
 */
(function(b){b.fn.cutter=function(f){var d=b.extend({selector:".cut",txt:["\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435...","\u0441\u043a\u0440\u044b\u0442\u044c","\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c"]},f);b(this).each(function(){b(d.selector,this).each(function(){var c,a=0,e;e=(e=b(this).attr("title"))?d.txt[2]+" &quot;"+e+"&quot;":d.txt[0];if(this.tagName=="TR"||this.tagName=="TBODY"){c=b(this);if(this.tagName=="TBODY")c=b("tr",this).first();b("td",c).each(function(){a+=
b(this).attr("colspan")?b(this).attr("colspan"):1});a=a>1?' colspan="'+a+'"':"";c="<tr><td"+a+' class="cutter"><a href="#">'+e+"</a></td></tr>";if(this.tagName=="TBODY")c="<tbody>"+c+"</tbody>"}else c='<div class="cutter"><a href="#">'+e+"</a></div>";b(this).hide().after(c)})});b(".cutter a").click(function(c){var a=b(this).parent();if(a[0].tagName=="TD")a=a.parent().parent();a=a.prev();a.toggle();b(this).html(a.css("display")=="none"?a.attr("title")?d.txt[2]+" &quot;"+a.attr("title")+"&quot;":d.txt[0]:
d.txt[1]);c.preventDefault();c.stopPropagation();return false})}})(jQuery);

