
//////////////////////////////////////  StringBuilder Object ///////////////////////////////////

//定义StringBuilder
function StringBuilder(value){
	this.strings = new Array("");
	this.append(value);
}

//定义StringBuilder的append方法
StringBuilder.prototype.append = function (value){
	if (value)this.strings.push(value);
}

//定义StringBuilder的clear方法
StringBuilder.prototype.clear = function (){
	this.strings.length = 1;
}

//定义StringBuilder的toString方法
StringBuilder.prototype.toString = function (){
	return this.strings.join("");
}

//////////////////////////////////////  按着指定长度截断字符串 ///////////////////////////////////
function format6(str)
{
    return sub(str,6);
}

function format7(str)
{
    return sub(str,7);
}  
   
function sub(str,len)
{
    if(str==null || str.length==0) {
       return str;
    }
    if(str.length <= len){
       return str;
    }
    return str.substring(0,len -1)+"..";
}

//////////////////////////////////////  定义     Book    实体 ///////////////////////////////////
function Book(bookId,bookName,authorId,authorName,amount,
              chapterId,chapterName,
              channelId,channelName,
              categoryId,categoryName,
              showDateTime,isVip)
{
    this.BookId       = bookId;//书籍ID
    this.BookName     = bookName;//书籍名称    
    this.AuthorId     = authorId;//作者ID
    this.AuthorName   = authorName;//作者名
    this.Amount       = amount;//票数
    this.ChapterId    = chapterId;//章节ID
    this.ChapterName  = chapterName;//章节名
    this.ChannelId    = channelId;//频道ID 
    this.ChannelName  = channelName;//频道名    
    this.CategoryId   = categoryId;//类别ID 
    this.CategoryName = categoryName;//类别名    
    this.ShowDateTime = showDateTime;
    this.IsVip        = isVip; 
}





