function debug(msg){
    //console.log('++++++++++  '+msg+'  ++++++++++');
}

function banner(){
    this.index           = 0;
    this.banner_num      = 3;
    this.timeline		 = 8000;
    this.intervalProcess = null;
    debug('new');
    this.init();
}
banner.prototype.init = function(){
    debug('init');
    $('#index_focus_page').show();
    $('#1index_focus_ietm'+this.index).show();
    this.change_handle();
    this.start();
}
banner.prototype.start = function(){
    debug('start');
    var _this = this;
    this.intervalProcess = setInterval(function(){
        _this.change_handle();
    },this.timeline);
}

banner.prototype.stop = function(){
    debug('stop');
    clearInterval(this.intervalProcess);
}
banner.prototype.change_handle = function(){
    if (this.index > this.banner_num-1) {
        this.index = 0;
    }
    debug('change_handle__'+this.index);
    this.change(this.index)
    this.index += 1;
}
banner.prototype.change = function(index){
	$('#co_focus .co_focus_nav a').removeClass('focus_hover');
    $('#co_focus .co_focus_nav a').eq(index).addClass('focus_hover');
    var top = -200*index;
    $('#co_focus .co_focus_big_box').animate( { top:top+'px' },500)
}
$(function(){
    var Banner = new banner();
    $('#co_focus .co_focus_nav a').click(function(){
        var index = $('#co_focus .co_focus_nav a').index(this);
        Banner.change(index);
        debug('button__'+index);
        Banner.index = parseInt(index)+1;
    });
});

