/**
 * Библиотека FLINE (FonBet Line)
 */

/**
 * Анонс события
 */
function FLINE_Anons(id, num, sportName, name, state, startTime){
    this.id = id;
    this.num = num;
    this.sportName = sportName;
    this.name = name;
    this.state = state;
    this.startTime = startTime;
}
FLINE_Anons.prototype.getFromatedDate = function(){
    return formatDate(this.startTime,'dd.MM HH:mm');
}
FLINE_Anons.prototype.getFromatedName = function(lang){
    switch(this.state){
        case 1:
            return lang.get('anons_name_s1', this.num, this.sportName, this.name);
        case 2:
            return lang.get('anons_name_s2', this.num, this.sportName, this.name);
    }
}
FLINE_Anons.prototype.isExpired = function(){
    return (new Date()).valueOf() > this.startTime.valueOf();
}


/**
 * Таблица с анонсами
 */
function FLINE_AnonsTable(contentBlockId, storage, lang){
    this.contentBlockId = contentBlockId;
    this.lang = lang;
    this.storage = storage;
    this.isExpanded=true;
    this._anonsIndex = new Array();
}
FLINE_AnonsTable.prototype.paint = function(){
    this._anonsIndex.length = 0;
    for(var i in storage._anonsTable){
        var a = storage._anonsTable[i];
        this._anonsIndex[a.num] = a.id;
    }
    ds.updateTable();
}
FLINE_AnonsTable.prototype.findAnons = function(num){
    if(this._anonsIndex[num] != null){
      var a = storage.getAnons(this._anonsIndex[num]);
      if(a != null) return a;
    }
    return null;
}
loadingJSLoaded++;