ddaccordion.init({
  headerclass: "sublink",
  contentclass: "submenu",
  revealtype: "click",
  mouseoverdelay: 200,
  collapseprev: true,
  defaultexpanded: [],
  onemustopen: false,
  animatedefault: false,
  persiststate: false,
  toggleclass: ["closed", "opened"],
  togglehtml: ["none", "", ""],
  animatespeed: "fast",
  oninit:function(expandedindices){ //custom code to run when headers have initalized
    //do nothing
  },
  onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
    //do nothing
  }
})

    function sorter_top (type)
    {
        ShowLoading("");
        $("#top_rated").animate({opacity: 0.001}, 500, function(){
            $.post ("/index.php",
            {
                top_time: type
            },
            function (data)
            {
                $("#top_rated").html(data).animate({opacity: 1.0}, 500);
                HideLoading("");
            });
        });

    }

function del_top2011 (id, name, datas)
{
     DLEconfirm ("Удалить фильм \"<b>"+name+"</b>\" из топа 2011 года?", "Подтверждение", function(){
            ShowLoading("");
            $.post ("/engine/ajax/actors_control.php",
                    {
                        "id"  : id,
                        "act"   : "del_top"
                    },
                    function (data){
                        eval(data);
                        HideLoading("");
                        $(datas).parent().parent().parent().parent().slideUp("slow");
                    });
        });

}

function ajax_page (page, news)
{
    $("#ajax_com_list").fadeTo("slow", 0.01).slideUp();
    $("html"+(!$.browser.opera?",body":"")).animate({scrollTop:$("#ajax_com_nav").position().top-70},700);
    ShowLoading("");
    $.post ("/engine/ajax/actors_control.php",
            {
                "act": "ajax_com",
                "page": page,
                "id": news
            },
            function (data)
            {
                json = jQuery.parseJSON(data);
                $("#ajax_com_list").html(json.list);
                $("#ajax_com_list").fadeTo("slow", 1.0);
                $("#ajax_com_nav").fadeTo("0.001");
                $("#ajax_com_nav").html(json.nav);
                $("#ajax_com_nav").fadeTo("1.0");
                HideLoading("");
            });
}
