var _c = _h = 0;

jQuery(document).ready(function(){
    
    jQuery('#focus_change_btn > a').click(function(){
    
        var i = jQuery(this).attr('alt') - 1;
        
        clearInterval(_h);
        
        _c = i;
        
        play();
        
        change(i);
        
    })
    
    jQuery("#focus_change_list img").hover(function(){
    
        clearInterval(_h);
        
    }, function(){
    
        play();
        
    });
    
    function play(){
    
        _h = setInterval("auto()", 5000);
        
        
        
    }
    
    play();
    
});



function change(i){

    jQuery('#focus_change_btn > a > img').attr('src', 'img/bannerS.png');
    
    jQuery('#focus_change_btn > a > img').eq(i).attr('src', 'img/bannerB.png');
    
    jQuery('#focus_change_btn > a').eq(i).blur();
    
    jQuery("#focus_change_list img").hide().eq(i).fadeIn('slow');
    
}

function auto(){

    _c = _c > 2 ? 0 : _c + 1;
   
    change(_c);
    
}

