function ClassTimeBar()
{
    this.getImg = new createjs.Container();

    this.time = 120*30;
    this.progress = 0;

    this.bg = ss_data.clone();
    this.bg.gotoAndStop("progress_bar_bonus2");
    this.bg.x = 154*devise_size;
    this.getImg.addChild(this.bg);

    this.center = ss_data.clone();
    this.center.gotoAndStop("progress_center2");
    this.center.x = (13+154)*devise_size;
    this.center.scaleX = 1;
    this.getImg.addChild(this.center);

    this.end = ss_data.clone();
    this.end.gotoAndStop("progress_end2");
    this.end.x = (154 + 13)*devise_size + this.center.scaleX;
    this.getImg.addChild(this.end);

    var text = ss_data.clone();
    text.gotoAndStop("text_white_time");
    text.x = 30*devise_size;
    this.getImg.addChild(text);

    this.text_time = new ClassText("", 3);
    this.text_time.getImg.x = 80*devise_size;
    this.text_time.getImg.y = -9*devise_size;
    this.getImg.addChild(this.text_time.getImg);

    this.corn = [ss_data.clone(), ss_data.clone(), ss_data.clone()];
    this.corn[0].gotoAndStop("corn");
    this.corn[1].gotoAndStop("corn");
    this.corn[2].gotoAndStop("corn");
    this.corn[0].x = (154 + 13 + 117*0.6)*devise_size;
    this.corn[1].x = (154 + 13 + 117*0.75)*devise_size;
    this.corn[2].x = (154 + 13 + 117)*devise_size;
    this.corn[0].y = -devise_size;
    this.corn[1].y = -devise_size;
    this.corn[2].y = -devise_size;
    this.corn[0].alpha = 0.5;
    this.corn[1].alpha = 0.5;
    this.corn[2].alpha = 0.5;
    this.corn[0].scaleX = this.corn[0].scaleY = 0.6;
    this.corn[1].scaleX = this.corn[1].scaleY = 0.6;
    this.corn[2].scaleX = this.corn[2].scaleY = 0.6;

    this.getImg.addChild(this.corn[0]);
    this.getImg.addChild(this.corn[1]);
    this.getImg.addChild(this.corn[2]);
}

ClassTimeBar.prototype.Drw = function()
{
    if(this.progress != game.score.score)
    {
        this.progress = Math.min(this.progress+9, game.score.score);
        this.center.scaleX = ((117*devise_size)*Math.min(1, this.progress/config.lvls[game.level_num].max))<<0;
        this.end.x = (154 + 13)*devise_size + this.center.scaleX;

        if(this.progress >= config.lvls[game.level_num].max*0.6 && (this.progress-9) < config.lvls[game.level_num].max*0.6)
            this.corn[0].alpha = 1;
        if(this.progress >= config.lvls[game.level_num].max*0.75 && (this.progress-9) < config.lvls[game.level_num].max*0.75)
            this.corn[1].alpha = 1;
        if(this.progress >= config.lvls[game.level_num].max && (this.progress-9) < config.lvls[game.level_num].max)
            this.corn[2].alpha = 1;
    }

    this.time--;
    if(this.time<=0 && !(game.grid.swap && game.grid.anim_destroy == 0 && game.grid.anim_lock))
        game.all_job.isEnd();
    this.text_time.setText((Math.max(0, this.time/30)<<0).toString());
};

ClassTimeBar.prototype.Create = function()
{
    this.time = config.lvls[game.level_num].bonus_lvl*30;
    this.progress = 0;
    this.corn[0].alpha = 0.5;
    this.corn[1].alpha = 0.5;
    this.corn[2].alpha = 0.5;
    this.center.scaleX = 0;
    this.end.x = (154 + 13)*devise_size + this.center.scaleX;
    this.text_time.setText(config.lvls[game.level_num].bonus_lvl.toString());
};

ClassTimeBar.prototype.isEnd = function()
{
    return (this.time <= 0);
};