jQuery(document).ready(function() {

$acc_items = jQuery('.easyaccordion li.acc-item');
$acc_content = jQuery('.acc-content');
$acc_global = jQuery('.acc-global');

pageLocation = location.href;
if (pageLocation.indexOf('#') != -1) {
anchorID = pageLocation.substr(pageLocation.indexOf('#'));
jQuery(anchorID).parent().parent('li').addClass('acc-opened');
window.setTimeout("window.scrollBy(0,-100)",200);
};

jQuery('.acc-opened .acc-content').show();

$acc_content.width($acc_items.width());

jQuery('.acc-header').click(function(){
   if(jQuery(this).siblings('.acc-content').css('display') == 'none') {
        $acc_content.slideUp(1000);
        $acc_items.removeClass('acc-opened');
        jQuery(this).siblings('.acc-content').slideDown(1000).parent().addClass('acc-opened');    
    } else {
        $acc_items.removeClass('acc-opened');
        $acc_content.slideUp(1000);
        } 
});

jQuery('.acc-expandall').click(function(){
        $acc_items.addClass('acc-opened');        
        $acc_content.slideDown(1000);
        jQuery(this).fadeOut(500);
        jQuery(this).siblings().fadeIn(500);
        });

jQuery('.acc-collapseall').click(function(){
        $acc_items.removeClass('acc-opened');
        $acc_content.slideUp(1000);
        jQuery(this).fadeOut(500);
        jQuery(this).siblings().fadeIn(500);
        });

jQuery('.acc-closer').click(function(){
        $acc_items.removeClass('acc-opened');
        $acc_content.slideUp(1000);
        jQuery('.acc-global .acc-collapseall').fadeOut(500);
        jQuery('.acc-global .acc-expandall').fadeIn(500);
        });

});


