function getHashParametr() {
	var url = location.href;
	var pos = url.indexOf('#');
	return url.substr(pos + 1);
}

$(document).ready(function() {
	
	
    $('.roller').each(function() {
        $('h2', this).click(function(event, option) {
            
            $('.roller').each(function() {
                $(this).removeClass('selected');
                $('.roll', this).attr('src', 'images/roll_down.png');
            });
            
            $(this).parent().addClass('selected');
            $('.roll', this).attr('src', 'images/roll_up.png');
            
            //hide other 
            $('.roller').each(function() {
                if(!$(this).hasClass('selected')) {
                    $('div', this).each(function() {
                    	if(option == 'NotAnimate') {
                    		$(this).hide();
                    	}
                    	else {
                    		$(this).animate({ height: 'hide', opacity: 'hide' }, 'slow');
                    	}
                    });
                }
            });
            
            $('div', $(this).parent()).each(function() {
                $(this).animate({ height: 'show', opacity: 'show' }, 'slow');  
            });
        });
        
    });
    
    var parametr = getHashParametr();
    
    $('#' + parametr + ' h2').trigger('click', ['NotAnimate']);
});
