if(null == Info){
	var Info = {};
}

/* 
 * 新闻系统的服务器路径,在本地使用/info,
 * 如果是其他服务器，请使用其他服务器地址，例如 http:／／??／info
 */
Info.hostUrl     = "http://localhost";
Info.contextPath = Info.hostUrl + "/dhdj";

function columnObject(){
	this.id = "";
	this.name = "";
	this.area = "";
	this.total=0;
	this.informations = new Array();
	this.columns = new Array();
}
function inforObject(){
	this.id  = "";
	this.bt  = "";
	this.stid = "";
	this.face = "";
	this.top = "";
	this.time= "";
	this.link= "";
	this.zz  = "";
	this.img = "";
}

var InfoPage = {};

InfoPage.pageSize   = 14; //每页条数
InfoPage.pageSize1   = 6;
//InfoPage.infoLength  = 40;
InfoPage.pageNumber  = 0;  //总条数
InfoPage.pageCurrent = 0;  //当前页数

/*
 * 显示分页 信息文字
 * listNum
 * listPage
 * nextPage
 * countMidd  分页范围
 */
function getCountPageInfo(listNum,listPage,nextPage,countMidd){
	var arr = countPageForParam(listNum,listPage,nextPage,countMidd);
	var pageCount = arr[0];
	var firstPage = arr[1];
	var lastPage  = arr[2];
	var currentPage = arr[3];
	//alert(listNum + " : " + pageCount + " : " + firstPage + " : " + lastPage + " : " + currentPage);
	var str = '<span class="prev">';
		str += ' 总共 '+'<span class="current">'+(pageCount)+' </span>页 / '+listNum+ ' 条 ';
	if(currentPage > 0 ){
		str += ' <a href="javascript:void(0)"   onclick="InfoPage.flashNews(0);return false;" title="最前页"> 最前页 </a>';
		str += ' <a href="javascript:void(0)" onclick="InfoPage.flashNews('+(currentPage-1)+');return false;" title="上一页"> 上一页 </a>';
	}
	for(var j=firstPage;j<lastPage;j++){
		if(j==0 && j==lastPage-1)
			break;
		if( j == currentPage )
			str += ' <b>'+ (j+1) +'</b>' ;
		else
			str += ' <a href="javascript:void(0)"  onclick="InfoPage.flashNews('+j+');return false;">'+(j+1)+'</a>';
	}

	if(currentPage < pageCount-1){
		str += ' <a href="javascript:void(0)"  onclick="InfoPage.flashNews('+parseInt(currentPage+1,10)+');return false;" title="下一页"> 下一页 </a>';
		str += ' <a href="javascript:void(0)"  onclick="InfoPage.flashNews('+(pageCount-1)+');return false;" title="最后页"> 最后页 </a>';
	}
	return str+'</span>';
}

function countPageForParam(listNum,listPage,nextPage,countMidd){
	if(isNaN(listNum))
		return '';
	var pageCount = parseInt( listNum / listPage,10)+1
	//alert(listNum + " : " + listPage);
	if( listNum % listPage == 0) 
		pageCount = pageCount -1 ;	
	if(nextPage < 0)
		nextPage = 0;
	if(nextPage >= pageCount)
		nextPage = pageCount - 1;	

	var firstPage= nextPage - countMidd;
	var lastPage = nextPage + countMidd;
	if(firstPage <= 0){	
		lastPage -= firstPage;
		firstPage = 0;
	}
	if(lastPage > pageCount){	  
		firstPage-=lastPage-pageCount						
		lastPage = pageCount;
	}
	if(firstPage < 0)
		firstPage=0

	var beginNum = nextPage * listPage;
	var endNum   = beginNum + listPage;
	if(endNum > listNum)
		endNum = listNum;
	return new Array(pageCount,firstPage,lastPage,nextPage,beginNum,endNum);
}

