$(document).ready(init_accordion);
function init_accordion() {
    $('.accordion_title :first').css({ 'border-top': '1px solid #DADADA' });
    $('.accordion_title a.toggle').each(function(i) {
        $(this).bind('click', function(event) {
            event.preventDefault();
            var my_id = $(this).attr('id').replace('acc_', '');
            activate_slider('#ac_' + $(this).attr('id'), '.accordion_content', '#' + $(this).attr('id'), '.accordion_title a.toggle', '.accordion_title');
            return false;
        });
    });
}
function activate_slider(target, targetGroup, anchor, anchorGroup, highlightRow) {
    if (!$(anchor).hasClass('selected')) {
        $(anchorGroup + ',' + highlightRow).removeClass('selected');
        $(anchor).addClass('selected');
        $(anchor).parents(highlightRow).addClass('selected');
        $(targetGroup).slideUp();
        if ($(target).css('display') == 'block') {
            $(target).slideDown();
        }
        else {
            $(target).css('display', 'block');
            $(target).hide().slideDown();
        }
    }
    else {
        $(targetGroup).slideUp();
        $(anchorGroup + ',' + highlightRow).removeClass('selected');
        $(anchor).blur();
    }
}