$(document).ready(function() {
  $('ul#menu_current ul').each(function(index) {
    if(!$(this).hasClass("active")){$(this).hide();}
    if(!$(this).hasClass("noopen")){

	$(this).prev().addClass('collapsible').click(function() {
      if ($(this).next().css('display') == 'none')
		  {
			$(this).next().slideDown(200, function () 
				{
					$(this).prev().removeClass('collapsed').addClass('expanded');
				}
				);
		  }
	  else {
        $(this).next().slideUp(200, function () {
          $(this).prev().removeClass('expanded').addClass('collapsed');
          $(this).find('ul').each(function() {
          $(this).hide().prev().removeClass('expanded').addClass('collapsed');
          });
        });
      }
      return false;
    });
}
  });

$(".matryoshka div p:not(:first)").hide();
$(".matryoshka span").click(function()
	{
		$(".matryoshka div p:visible").slideUp("slow");
		$(this).next("p").slideToggle("slow");
	})
});


function eventsArchiveShow(offset, id){
		$("#eventsSeeMore").remove();
		$("#loaderImg").show();
		$.ajax({
		type: "POST", 
		url: "../action_events_archive.php",
		data: "offset=" + offset + "&id=" +id,
		success: function(response){
			$("#eventsArchive").html(response)
			$("#loaderImg").remove();
			$("#eventsArchive").show("1000");
			} 
		})
}

