function displayBookTable(bookTypeID,bookTypeName,bookID,bookName,volumeName,lastChapterID,textTitle,userInfoExtID,penName,bookUpdateDateTime)
{
	var htmlPath	= "/Book/BookShowDetail.aspx?bookid="+bookID;
	var chtmlPath	= "/Book/BookReadChapter.aspx?Chapterid="+lastChapterID;
	document.write("<tr><td  style='line-height:180%'><a href=\"../Book/"+ bookTypeID +"\" target=\"_blank\">["+ bookTypeName.substring(0,2) +"]</a>");
	document.write("&nbsp;<a title=\"\" href=\""+htmlPath+"\" target=_blank><font color=#006600>"+bookName.substring(0,8)+"</font></a>&nbsp;");
	document.write("<a href=\""+chtmlPath+"\" target=_blank>"+volumeName.substring(0,4)+"&nbsp;"+textTitle.substring(0,13)+"</a>");
	document.write("</td><td width=20% align=right nowrap valign=middle><a href=\"../Author/"+userInfoExtID+".html\" target=_blank>"+ penName.substring(0,4) +"</a>");
	document.write("<"+bookUpdateDateTime+">&nbsp;</td></tr>");
}
function displayVIPBookTable(bookTypeID,bookTypeName,bookID,bookName,volumeName,lastChapterID,textTitle,userInfoExtID,penName,bookUpdateDateTime)
{
	var htmlPath	= "/Book/BookShowDetail.aspx?bookid="+bookID;
	document.write("<tr><td  height=24 ><a href=\"../VIPBook/VIPBookList.aspx?BookTypeID="+ bookTypeID +"\" target=\"_blank\">["+ bookTypeName.substring(0,2) +"]</a>");
	document.write("&nbsp;<a title=\"\" href=\""+htmlPath+"\" target=_blank><font color=#006600>"+bookName.substring(0,8)+"</font></a>&nbsp;");
	document.write("<a href=\"../VIPBook/VIPBookReadChapter.aspx?BookID="+bookID+"&ChapterID="+lastChapterID+"&LastChapterFlag=1\" target=_blank>"+volumeName.substring(0,4)+"&nbsp;"+textTitle.substring(0,13)+"</a><img src='/Lib/images/vip.gif'>");
	document.write("</td><td width=20% align=right nowrap valign=middle ><a href=\"../Author/"+userInfoExtID+".html\" target=_blank>"+ penName.substring(0,4) +"</a>");
	document.write("<"+bookUpdateDateTime+">&nbsp;</td></tr>");
}

function displayVIPBookTableBuy(bookTypeID,bookTypeName,bookID,bookName,volumeName,lastChapterID,textTitle,userInfoExtID,penName,bookUpdateDateTime)
{
	var htmlPath	= "/Book/BookShowDetail.aspx?bookid="+bookID;
	document.write("<tr><td  height=26 class='tdLine'><a href=\"../VIPBook/VIPBookList.aspx?BookTypeID="+ bookTypeID +"\" target=\"_blank\">["+ bookTypeName.substring(0,2) +"]</a>");
	document.write("&nbsp;<a title=\"\" href=\""+htmlPath+"\" target=_blank><font color=#006600>"+bookName.substring(0,8)+"</font></a>&nbsp;");
	document.write("<a href=\"../VIPBook/VIPBookReadChapter.aspx?BookID="+bookID+"&ChapterID="+lastChapterID+"&LastChapterFlag=1\" target=_blank>"+volumeName.substring(0,4)+"&nbsp;"+textTitle.substring(0,13)+"</a><img src='/Lib/images/vip.gif'>");
	document.write("</td><td width=20% align=right nowrap valign=middle class='tdLine'><a href=\"../Author/"+userInfoExtID+".html\" target=_blank>"+ penName.substring(0,4) +"</a>");
	document.write("<"+bookUpdateDateTime+">&nbsp;<A href=\"../VIPBook/VIPBookReadBook.aspx?BookID="+bookID+" \" target=_blank><FONT color=red>订阅</FONT></A></td></tr>");
}

function displayArticleTable(articleTypeID,articleTypeName,contentName,articleID,textTitle,articleWordCount,clickCount,commentCount, userInfoExtID,penName,articleUpdateDateTime)
{
	var htmlPath	= "../Article/ArticleShowDetail.aspx?articleid="+articleID;
	document.write("<tr><td width='50%' class=tdLine height=26px style='padding-left:5px'><a href='../Article/ArticleList.aspx?ArticleTypeID="+articleTypeID+"'>["+articleTypeName.substring(0,4)+"]</a> ");
	document.write("&nbsp;"+fnDisplayCommend(contentName)+"<a href='"+htmlPath+"' title='"+ textTitle +"' ><font color=#006600>"+textTitle.substring(0,35)+"</font></a> </td>");
	document.write("<td width=100 align=right nowrap valign=middle class=tdLine><a href='../Author/"+ userInfoExtID +".html' title='"+penName+"'>"+penName.substring(0,16)+"</a></td>");
	document.write("<td nowrap align=right class=tdLine style='padding-left:2px'>"+ articleWordCount +"</td>");
	document.write("<td nowrap align=right class=tdLine style='padding-left:2px'>"+ clickCount +"</td>");
	document.write("<td nowrap align=right class=tdLine style='padding-left:2px;'>"+ commentCount);
	document.write("<td nowrap align=right class=tdLine style='padding-right:5px'><"+ articleUpdateDateTime +"></td>");
}									
function displayArticleTableByWriting(articleTypeID,articleTypeName,articleID,textTitle,articleWordCount,clickCount,userInfoExtID,penName,articleUpdateDateTime)
{
	var htmlPath	= "../Article/ArticleShowDetail.aspx?articleid="+articleID;	document.write("<tr><td width='70%' class=tdLine height=26px style='padding-left:5px'><a href='../Article/ArticleList.aspx?ArticleTypeID="+articleTypeID+"'>["+articleTypeName.substring(0,4)+"]</a> ");
	document.write("&nbsp;<a href='"+htmlPath+"' title='"+ textTitle +"' ><font color=#006600>"+textTitle.substring(0,35)+"</font></a> </td>");
	document.write("<td width=100 align=right nowrap valign=middle class=tdLine><a href='../Author/"+ userInfoExtID +".html' title='"+penName+"'>"+penName.substring(0,16)+"</a></td>");
	document.write("<td nowrap align=right class=tdLine style='padding-left:2px'>"+ articleWordCount +"</td>");
	document.write("<td nowrap align=right class=tdLine style='padding-left:2px'>"+ clickCount +"</td>");
	document.write("<td nowrap align=right class=tdLine style='padding-right:5px'><"+ articleUpdateDateTime +"></td>");
}	
function fnDisplayCommend(ContentName)
{
	if(ContentName!="")
	{
		return "<font color=red>[荐]</font>";
	}
	else
	{
		return "";
	}
}

function fnDisplayCommendJsWrite(ContentName)
{
	if(ContentName!="")
	{
		document.write( "<font color=red>[荐]</font>");
	}
}

function fnBuildNewBook()
{
	document.write("<table width=100% Cellpadding=0 Cellspacing=0 border=0>");
	for(var i=0;i<jsNewBook.length;i++){
		var bookID			= jsNewBook[i][2];
		var lastChapterID	= jsNewBook[i][5];
		var htmlPath	= "/Book/BookShowDetail.aspx?bookid="+bookID;
		var chtmlPath	= "/Book/BookReadChapter.aspx?Chapterid="+lastChapterID;	
		document.write("<tr><td  style='line-height:180%'><a href=\"../Book/"+ jsNewBook[i][0] +"\" target=\"_blank\">["+ jsNewBook[i][1].substring(0,2) +"]</a>");
		document.write("&nbsp;<a title=\"\" href=\""+htmlPath+"\" target=_blank><font color=#006600>"+jsNewBook[i][3].substring(0,8)+"</font></a>&nbsp;");
		document.write("<a href=\""+chtmlPath+"\" target=_blank>"+jsNewBook[i][4].substring(0,4)+"&nbsp;"+jsNewBook[i][6].substring(0,13)+"</a>");
		document.write("</td><td width=20% align=right nowrap valign=middle><a href=\"../Author/"+jsNewBook[i][7]+".html\" target=_blank>"+ jsNewBook[i][8].substring(0,4) +"</a>");
		document.write("<"+jsNewBook[i][9]+">&nbsp;</td></tr>");
	}
	document.write("</table>");
}

function fnBuildCommendBook(typeID)
{
	var exeJs = "";
	exeJs	+= "document.write(\"<table width=100% Cellpadding=0 Cellspacing=0 border=0>\");";
	exeJs	+= "for(var i=0;i<jsCommendBook"+typeID+".length;i++){";
	exeJs	+= "var bookID = jsCommendBook"+typeID+"[i][2];";
	exeJs	+= "var htmlPath	= \"/Book/BookShowDetail.aspx?bookid=\"+bookID;";	
	exeJs	+= "	document.write(\"<tr><td>· <a href=\\\"\"+htmlPath+\"\\\" target=_blank >\"+ jsCommendBook"+typeID+"[i][3].substring(0,11) +\"</a></td></tr>\");";
	exeJs	+= "}";
	exeJs	+= "document.write(\"</table>\");";
	eval(exeJs);
}

function fnBuildCommendBookImg(typeID)
{
	var exeJs = "";
	exeJs	+= "document.write(\"<table width=100% Cellpadding=0 Cellspacing=0 border=0>\");";
	exeJs	+= "for(var i=0;i<jsCommendBook"+typeID+".length;i++){";
	exeJs	+= "var bookID = jsCommendBook"+typeID+"[i][2];";
	exeJs	+= "var htmlPath	= \"/Book/BookShowDetail.aspx?bookid=\"+bookID;";	
	exeJs	+= "	document.write(\"<tr><td ><img src=\\\"/Lib/BookImages/pic_6.jpg\\\" width=11 height=11> <a href=\\\"\"+htmlPath+\"\\\"  target=_blank >\"+ jsCommendBook"+typeID+"[i][3].substring(0,11) +\"</a></td><td><a href=\\\"../Author/\"+ jsCommendBook"+typeID+"[i][6]+\"\\\" target=_blank>\"+ jsCommendBook"+typeID+"[i][7].substring(0,6)+\"</a></td></tr>\");";
	exeJs	+= "}";
	exeJs	+= "document.write(\"</table>\");";
	eval(exeJs);
}


function fnBuildLongCommendBook()
{
	document.write("<table width=100% Cellpadding=0 Cellspacing=0 border=0>");
	for(var i=0;i<jsLongBookCommend.length;i++){
		var bookID = jsLongBookCommend[i][2];
		var htmlPath	= "/Book/BookShowDetail.aspx?bookid="+bookID;	
		document.write("<tr><td >· <a href=\""+htmlPath+"\" target=_blank >"+ jsLongBookCommend[i][3].substring(0,11) +"</a></td></tr>");
	}
	document.write("</table>");
}
function fnBuildLongCommendBookImg()
{
	document.write("<table width=100% Cellpadding=0 Cellspacing=0 border=0>");
	for(var i=0;i<jsLongBookCommend.length;i++){
		var bookID = jsLongBookCommend[i][2];
		var htmlPath	= "/Book/BookShowDetail.aspx?bookid="+bookID;	
		document.write("<tr><td><img src=\"/Lib/BookImages/pic_6.jpg\" width=11 height=11><a href=\""+htmlPath+"\" target=_blank >"+ jsLongBookCommend[i][3].substring(0,11) +"</a></td><td><a href=\"/Author/"+ jsLongBookCommend[i][6] +".html\" target=\"_blank\">"+ jsLongBookCommend[i][7].substring(0,6)  +"</a></td></tr>");
	}
	document.write("</table>");
}

function fnBuildCommendArticle(typeID)
{
	var exeJs = "";
	exeJs	+= "document.write(\"<table width=100% Cellpadding=0 Cellspacing=0 border=0>\");";
	exeJs	+= "for(var i=0;i<jsCommendArticle"+typeID+".length;i++){"
	exeJs	+= "var articleID = jsCommendArticle"+typeID+"[i][1];";
	exeJs	+= "var htmlPath	= \"/Article/ArticleShowDetail.aspx?articleid=\"+articleID;";	
	exeJs	+= "	document.write(\"<tr><td >· <a href=\\\"\"+htmlPath+\"\\\" target=_blank >\"+ jsCommendArticle"+typeID+"[i][2].substring(0,11) +\"</a></td></tr>\");";
	exeJs	+= "}";
	exeJs	+= "document.write(\"</table>\");	";
	eval(exeJs);
}

function fnBuildCommendArticleImg()
{
	document.write("<table width=100% Cellpadding=0 Cellspacing=0 border=0>");
	for(var i=0;i<jsCommendArticle0.length;i++){
		var articleID	= jsCommendArticle0[i][1];
		var htmlPath	= "../Article/ArticleShowDetail.aspx?articleid="+articleID;	
		document.write("<tr><td > <a href=\""+htmlPath+"\" target=_blank >"+ jsCommendArticle0[i][2].substring(0,10) +"</a></td><td > <a href=\"/Author/"+ jsCommendArticle0[i][5] +".html\" target=_blank >"+ jsCommendArticle0[i][6].substring(0,5) +"</a></td></tr>");
	}
	document.write("</table>");	
}

function fnBuildShortCommendArticle()
{
	document.write("<table width=100% Cellpadding=0 Cellspacing=0 border=0>");
	for(var i=0;i<jsShortCommendArticle.length;i++){
		var articleID	= jsShortCommendArticle[i][1];
		var htmlPath	= "../Article/ArticleShowDetail.aspx?articleid="+articleID;	
		document.write("<tr><td >· <a href=\""+htmlPath+"\" target=_blank >"+ jsShortCommendArticle[i][2].substring(0,11) +"</a></td></tr>");
	}
	document.write("</table>");		
}

function fnBuildShortCommendArticleImg()
{
	document.write("<table width=100% Cellpadding=0 Cellspacing=0 border=0>");
	for(var i=0;i<jsShortCommendArticle.length;i++){
		var articleID	= jsShortCommendArticle[i][1];
		var htmlPath	= "../Article/ArticleShowDetail.aspx?articleid="+articleID;	
		document.write("<tr><td class=jsTd> <a href=\""+htmlPath+"\" target=_blank >"+ jsShortCommendArticle[i][2].substring(0,10) +"</a></td><td class=jsTd> <a href=\"/Author/"+ jsShortCommendArticle[i][5] +".html\" target=_blank >"+ jsShortCommendArticle[i][6].substring(0,6) +"</a></td></tr>");
	}
	document.write("</table>");	
}

function fnBuildRankWeekClick()
{
	document.write("<table width=100% Cellpadding=0 Cellspacing=0 border=0>");
	for(var i=0;i<jsArr_1_3.length;i++){
		var bookID = jsArr_1_3[i][2];
		var htmlPath	= "/Book/BookShowDetail.aspx?bookid="+bookID;	
		document.write("<tr><td >· <a href=\""+htmlPath+"\" target=_blank >"+ jsArr_1_3[i][3].substring(0,10) +"</a></td></tr>");
	}
	document.write("</table>");				
}
function fnBuildRankWeekCommend()
{
	document.write("<table width=100% Cellpadding=0 Cellspacing=0 border=0>");
	for(var i=0;i<jsArr_1_7.length;i++){
		var bookID = jsArr_1_7[i][2];
		var htmlPath	= "/Book/BookShowDetail.aspx?bookid="+bookID;	
		document.write("<tr><td >· <a href=\""+htmlPath+"\" target=_blank >"+ jsArr_1_7[i][3].substring(0,10) +"</a></td></tr>");
	}
	document.write("</table>");				
}
function fnBuildRankNewBook()
{
	document.write("<table width=100% Cellpadding=0 Cellspacing=0 border=0>");
	for(var i=0;i<jsArr_1_11.length;i++){
		var bookID = jsArr_1_11[i][2];
		var htmlPath	= "/Book/BookShowDetail.aspx?bookid="+bookID;	
		document.write("<tr><td >· <a href=\""+htmlPath+"\" target=_blank >"+ jsArr_1_11[i][3].substring(0,11) +"</a></td></tr>");
	}
	document.write("</table>");				
}
function fnBuildRankNewBookImg()
{
	document.write("<table width=100% Cellpadding=0 Cellspacing=0 border=0>");
	for(var i=0;i<jsArr_1_11.length;i++){
		var bookID = jsArr_1_11[i][2];
		var htmlPath	= "/Book/BookShowDetail.aspx?bookid="+bookID;	
		document.write("<tr><td><img src=\"/Lib/BookImages/pic_6.jpg\" width=11 height=11> <a href=\""+htmlPath+"\" target=_blank >"+ jsArr_1_11[i][3].substring(0,11) +"</a></td><td><a href=\"/Author/"+ jsArr_1_11[i][5] +".html\" target=\"_blank\">"+ jsArr_1_11[i][6].substring(0,6)  +"</a></td></tr>");
	}
	document.write("</table>");			
}
function fnBuildBookUpDate()
{
	document.write("<table width=100% Cellpadding=0 Cellspacing=0 border=0>");
	for(var i=0;i<jsBookUpDate.length;i++){
		var bookID = jsBookUpDate[i][2];
		var htmlPath	= "/Book/BookShowDetail.aspx?bookid="+bookID;	
		document.write("<tr><td >· <a href=\""+htmlPath+"\" target=_blank >"+ jsBookUpDate[i][3].substring(0,11) +"</a></td></tr>");
	}
	document.write("</table>");				
}
function fnBuildBookUpDateImg()
{
	document.write("<table width=100% Cellpadding=0 Cellspacing=0 border=0>");
	for(var i=0;i<jsBookUpDate.length;i++){
		var bookID = jsBookUpDate[i][2];
		var htmlPath	= "/Book/BookShowDetail.aspx?bookid="+bookID;	
		document.write("<tr><td><img src=\"/Lib/BookImages/pic_6.jpg\" width=11 height=11> <a href=\""+htmlPath+"\" target=_blank >"+ jsBookUpDate[i][3].substring(0,11) +"</a></td><td><a href=\"/Author/"+ jsBookUpDate[i][7] +".html\" target=\"_blank\">"+ jsBookUpDate[i][8].substring(0,6)  +"</a></td></tr>");
	}
	document.write("</table>");					
}

function fnBuildArticleNews()
{
	for(var i=0;i<jsArticleNews.length;i++){
		document.write("<div style=\"height:20px\"><img src=\"/Lib/BookImages/pic_6.jpg\" width=\"11\" height=\"11\" />");
		document.write("<a href='/News/NewsContent.aspx?NewsID="+jsArticleNews[i][0]+"' target=\"_blank\" title='"+jsArticleNews[i][1]+"'>");
		execScript("n = DateDiff('d','"+ jsArticleNews[i][2]  +"',Now)","vbscript");
		if (n==0) {
			document.write("<b>"+ jsArticleNews[i][1].substring(0,11) +"</b>");
		}
		else
		{
			document.write(jsArticleNews[i][1].substring(0,11));
		}		 	
		document.write("</a></div>");
	}
}

function fnImgload()
{
	var oImg = document.images;
	var oClientSreen=0;
	for(var i=0;i<oImg.length;i++) 
	{
		if ( oImg[i].src.indexOf("Cache") != -1 )
		{
			// 基本上是限制贴中图片的大小
			oClientSreen=500;
			if(oImg[i].height>300 && oImg[i].width<oClientSreen) {oImg[i].style.height=300;}
			if(oImg[i].width>oClientSreen) {oImg[i].style.width=oClientSreen-10;}
		}
	}
}
