var swicherInit = function() {
    var switchers = $('.swicher > a')
                        .click(function() {
                            active.removeClass('active');
                            active = $(this).addClass('active');
                            window.location = $(this).attr('href');
                            }),
        active = switchers.eq(0),
        count = switchers.size()-1,
        wait = 3000,
        timer;
        
    var show = function(target) {
        var slide = $(".main_article > div div."+target);
            
        if(slide) {
            $(".main_article > div div.active")
                .removeClass('active')
                .fadeOut();
            slide
                .addClass('active')
                .fadeIn();
            }
        };
        
    var pause = function() {
        clearTimeout(timer);
        };
        
    var start = function() {
        timer = setTimeout(next, wait);
        };
        
    var next = function() {
        active.removeClass('active');
        
        if(active.next().size() > 0) active = active.next();
        else active = switchers.eq(0);
        
        active
            .click()
            .addClass('active');
        
        timer = setTimeout(next, wait);
        };
        
    var jumpTo = function(target) {
        switchers.eq(active).removeClass('active');
        target.addClass('active');
        };
        
    $(window).bind('hashchange', function() {
        var p = window.location.hash.substr(1);
        show(p);
        });

    $('.main_article')
        .mouseenter(pause)
        .mouseleave(start);

    start();
    };

$(document).ready(swicherInit);

