function loadok(){
	if(channel_ok){
		morego = false;
		if(recCount==0){
			recCount=buffer.ItemsCount;
			showPages();
		}
		var i;
		var content="";
		if (buffer.items.length>0){
			content+="<table width=100% border=0 cellspacing=0 cellpadding=0 align=center bgcolor=#000000>";
			for(i=0 ; i<buffer.items.length;i++){
				var item = buffer.items[i];
				var itemURL=item[buffer.items_URL];
				var shijianv = item[items_SUBTITLE];
				/*
				if( item[items_TYPE1] == "3")
					itemURL	= item[items_URL];
				else if( item[items_TYPE1] == "2")
					itemURL	= item[items_URL];
				else if( item[items_TYPE1] == "1")
					itemURL	= item[items_URL];
				else{
					alert("文档类型错误。");
					return;
				}
				*/
				if (checknew(item[items_SUBTITLE])){
		       			content+="<tr bgcolor=#FFFFFF><td height=20 width=4% align=center><img src='/ciec/gb/images/new.gif'></td>";
					content+="<td width=96%><a href = '" + itemURL+ "' target='_blank'>" + item[items_TITLE] + "</a></td>";
					//content+="&nbsp;&nbsp;" + longToDateMDHM(item[items_ASSESS_DATE]);
		       			content+="</tr>";
	       			}else{
		       			content+="<tr bgcolor=#FFFFFF><td height=20 width=4% align=center><li></td>";
					content+="<td width=96%><a href = '" + itemURL+ "' target='_blank'>" + item[items_TITLE] + "</a></td>";
					//content+="&nbsp;&nbsp;" + longToDateMDHM(item[items_ASSESS_DATE]);
		       			content+="</tr>";
	       			}
	        	}
	     		content+="</table>";
        	}
        	//alert(content)
        	document.getElementById("contentDiv").innerHTML=content;
	}
}

//显示分页列表
function showPages(){
var pageContent="";
if((recCount%pageSize)>0)
	pageCount=parseInt(recCount/pageSize)+1;
else
	pageCount=recCount/pageSize;
for(var i=1;i<=pageCount;i++)
    pageContent+="<span style=\"cursor:hand\" onclick=goPage("+i+")>"+i+"</span>. ";
document.getElementById("pageList").innerHTML=pageContent;
}

//显示指定的页面数据
function goPage(pCount){
    if(pCount<1||pCount>pageCount)
        return false;
    var curPage=(pCount-1)*pageSize+1
    buffer.location.href="/servlet/com.deepsoft.cms.CMSServlet?action=getPageItems&cid="+cid+"&start="+curPage+"&len="+pageSize;
}

//从地质栏中得到cid的值
function getId(urlStr){
return parseInt(urlStr.substr(urlStr.indexOf("cid=")+4,urlStr.length));
}
function checknew(riqivv){
	try {
	var Today = new Date();
	var yearnow = Today.getYear();
	var monnow = Today.getMonth() + 1;
	var daynow = Today.getDate();
	var daynows = 0;
	daynows = yearnow*365+monnow*30+daynow
	
	var yearnow = parseInt(riqivv.substring(0,4),10);
	var monnow = parseInt(riqivv.substring(5,7),10);
	var daynow = parseInt(riqivv.substring(8,10),10);
	var daynowinputs = 0;
	daynowinputs = yearnow*365+monnow*30+daynow
	
	if (daynows-daynowinputs<8){return true;}
	else{return false;}
		
	}
	catch(e){
		return false;
	}
}

