var toggleElements_animating = false;
$(document).ready(function(){
$('div.toggler-c').toggleElements({ fxAnimation:'slide', fxSpeed:'normal', className:'toggler' } );
});
(function($) {
jQuery.fn.toggleElements = function(settings) {
// Settings
settings = jQuery.extend({
fxAnimation: "slide",   // slide, show, fade
fxSpeed: "normal",   // slow, normal, fast or number of milliseconds
className: "toggler",
removeTitle: true,
showTitle: false,
onClick: null,
onHide: null,
onShow: null
}, settings);
var onClick = settings.onClick, onHide = settings.onHide, onShow = settings.onShow;
if ((settings.fxAnimation!='slide')&&(settings.fxAnimation!='show')&&(settings.fxAnimation!='fade'))
settings.fxAnimation='slide';
// First hide all elements without class 'opened'
this.each(function(){
if (jQuery(this).attr('class').indexOf("opened")==-1){
jQuery(this).hide();
}
});
// Add Toggle-Links before elements
this.each(function(){
wtitle='';
wlinktext=jQuery(this).attr('title');
if (settings.showTitle==true) wtitle=wlinktext;
if (settings.removeTitle==true) jQuery(this).attr('title','');
if (jQuery(this).attr('class').indexOf("opened")!=-1){
jQuery(this).before('<a class="'+settings.className+' '+settings.className+'-opened" href="#" title="'+ wtitle +'">' + wlinktext + '</a>');
jQuery(this).addClass(settings.className+'-c-opened');
} else {
jQuery(this).before('<a class="'+settings.className+' '+settings.className+'-closed" href="#" title="'+ wtitle +'">' + wlinktext + '</a>');
jQuery(this).addClass(settings.className+'-c-closed');
}
// Click-Function for Toggle-Link
jQuery(this).prev('a.'+settings.className).click(function() {
if (toggleElements_animating) return false;
thelink = this;
jQuery(thelink)[0].blur();
if (thelink.animating||toggleElements_animating) return false;
toggleElements_animating = true;
thelink.animating = true;
// Hide Element
if (jQuery(this).next().css('display')=='block') {
jQuery(this).next().each(function(){
if (settings.fxAnimation == 'slide') jQuery(this).slideUp(settings.fxSpeed,function(){
jQuery.toggleElementsHidden(this,settings.className,onHide,thelink);
});
if (settings.fxAnimation == 'show') jQuery(this).hide(settings.fxSpeed,function(){
jQuery.toggleElementsHidden(this,settings.className,onHide,thelink);
});
if (settings.fxAnimation == 'fade') jQuery(this).fadeOut(settings.fxSpeed,function(){
jQuery.toggleElementsHidden(this,settings.className,onHide,thelink);
});
//color zagolovka
this.parentNode.getElementsByTagName('span').item(0).style.color="#afb7bf";
this.parentNode.getElementsByTagName('i').item(0).style.display="inline";
});
// Show Element
} else {
jQuery(this).next().each(function(){
if (settings.fxAnimation == 'slide') jQuery(this).slideDown(settings.fxSpeed,function(){
jQuery.toggleElementsShown(this,settings.className,onShow,thelink);
});
if (settings.fxAnimation == 'show')  jQuery(this).show(settings.fxSpeed,function(){
jQuery.toggleElementsShown(this,settings.className,onShow,thelink);
});
if (settings.fxAnimation == 'fade')  jQuery(this).fadeIn(settings.fxSpeed,function(){
jQuery.toggleElementsShown(this,settings.className,onShow,thelink);
});
//color zagolovka
this.parentNode.getElementsByTagName('span').item(0).style.color="#000";
this.parentNode.getElementsByTagName('i').item(0).style.display="none";
});
}
return false;
});
});
};
// Remove/Add classes to Toggler-Link
jQuery.toggleElementsHidden = function(el,cname,onHide,thelink) {
jQuery(el).prev('a.'+cname).removeClass(cname+'-opened').addClass(cname+'-closed').blur();
if ( typeof onHide == 'function') onHide(this); // Callback onHide
jQuery(el).removeClass(cname+'-c-opened').addClass(cname+'-c-closed');
toggleElements_animating = false;
thelink.animating = false;
};
jQuery.toggleElementsShown = function(el,cname,onShow,thelink) {
jQuery(el).prev('a.'+cname).removeClass(cname+'-closed').addClass(cname+'-opened').blur();
if ( typeof onShow == 'function') onShow(this); // Callback onShow
jQuery(el).removeClass(cname+'-c-closed').addClass(cname+'-c-opened');
toggleElements_animating = false;
thelink.animating = false;
};
})(jQuery);

<!--script dlya pokaza tablic statistics-->
$(document).ready(function(){
$("span.statisticShowTable").mousedown(
function()
{

var locale = getVarValueFromURL(document.URL, 'locale');

if($(this).prev().css("display")=="none")
{
	$(this).prev().slideDown(200);
	$(this).text($(this).attr("hide")).addClass("statisticHideTable");
	$(this).attr("title", $(this).attr("hide"));
	document.getElementById($(this).attr("name")).style.display = "none";
}
else
{
	$(this).prev().slideUp(200);
	$(this).text($(this).attr("show")).removeClass("statisticHideTable");
	$(this).attr("title", $(this).attr("show"));
	document.getElementById($(this).attr("name")).style.display = "block";
}
return false;
});
});
<!--end script dlay pokaza tablic statistics-->

function getVarValueFromURL(url, varName) {
	var query = url.substring(url.indexOf('?') + 1);
	var vars = query.split("&");
	for (var i=0;i<vars.length;i++) {
		var pair = vars[i].split("=");
		if (pair[0] == varName) {
			return pair[1];
		}
	}
	return 'ru';
}

function hideListLocale(locale)
{
	var arr = new Array();

    arr['ru'] = 'Свернуть список';
    arr['en'] = 'Hide the list';
    arr['de'] = 'Zurück';
    arr['fr'] = 'Réduire';

    return arr[ locale ];
}

function showListLocale(locale)
{
	var arr = new Array();

    arr['ru'] = 'Весь список';
    arr['en'] = 'Show all list';
    arr['de'] = 'Alle Länder';
    arr['fr'] = 'Toute la liste';

    return arr[ locale ];
}