function ShowoPage(PrevFont,NextFont,PageNumFont1,PageNumFont2,PageNumFont3,PageNumFont4,RecCount,RecPerPage,PageNum,CurrPage,DivId){

	/************************************
	* 调用 eg: ShowoPage("上一页","下一页","<font color='red'>","</font>","[<font color='red'>","</font>]",allcount,10,4,page_now,"page_num");
	*
	* PrevFont 上一页标志
	* NextFont 下一页标志
	*
	* PageNumFont1,PageNumFont2 非当前页数字的样式
	* PageNumFont3,PageNumFont4 当前页数字的样式
	*
	* RecCount 记录总数
	* RecPerPage 每页记录个数
	* PageNum 当前页前后延伸显示4个
	* CurrPage 当前的页数
	* DivId 显示页数信息DOM的Id
	*
	*
	//PageCount 一共有几页
	****************************************/

	if(RecCount%RecPerPage==0){//判断一共有几页,如果是0,可以取整.如果不为0,不能取整.
		PageCount=RecCount/RecPerPage;
	}else{
		PageCount=(parseInt(RecCount/RecPerPage)+1);
	}

	if(PageCount<=1){//一共的页数小于等于1时,一共只有一页.PageCount=1;总页数为1
		PageCount=1;
	}

	prevpage=parseInt(CurrPage-1);
		if (prevpage<1) {
		prevpage=1;
	}
	nextpage=parseInt(CurrPage+1)
		if (nextpage>PageCount) {
		nextpage=PageCount;
	}

	if (CurrPage<=1&&PageCount==1) {

		CurrPage=1;
		PrevPageUrl="&nbsp;"+PrevFont+"&nbsp;";
		NextPageUrl="&nbsp;"+NextFont+"&nbsp;";
	}
	else if (CurrPage<=1) {
		CurrPage=1;
		PrevPageUrl="&nbsp;"+PrevFont+"&nbsp;";
		NextPageUrl="&nbsp;<A href=\"javascript:nextPageNum();\">"+NextFont+"</A>&nbsp;";
	}
	else if (CurrPage>=PageCount) {
		CurrPage=PageCount;
		PrevPageUrl="&nbsp;<A href=\"javascript:lastPageNum();\">"+PrevFont+"</A>&nbsp;";
		NextPageUrl="&nbsp;"+NextFont+"&nbsp;";
	}
	else {
		CurrPage=CurrPage;
		PrevPageUrl="&nbsp;<A href=\"javascript:lastPageNum();\">"+PrevFont+"</A>&nbsp;";
		NextPageUrl="&nbsp;<A href=\"javascript:nextPageNum();\">"+NextFont+"</A>&nbsp;";
	}


	PageStart = CurrPage-PageNum<=1?1:(CurrPage-PageNum-(CurrPage>PageCount-PageNum?PageNum+CurrPage-PageCount:0));

	PageEnd = CurrPage+PageNum>=PageCount?PageCount:(CurrPage+PageNum+(CurrPage-1<PageNum?PageNum-CurrPage+1:0));
	if (PageStart < 1) PageStart = 1;
	if (PageNum * 2 + 1 > PageCount)PageEnd = PageCount;

		//document.write (PrevPageUrl);
		$(DivId).innerHTML = PrevPageUrl;
	for (i=PageStart;i<=PageEnd;i++) {
	if (i==CurrPage) {
		//document.write ("&nbsp;"+PageNumFont3+i+PageNumFont4+"&nbsp;");
		$(DivId).innerHTML += "&nbsp;"+PageNumFont3+i+PageNumFont4+"&nbsp;";
	}else{
		//document.write ("&nbsp;<A href=\""+url+"Page="+i+"\">"+PageNumFont1+i+PageNumFont2+"</A>&nbsp;");
		$(DivId).innerHTML += "&nbsp;<A href=\"javascript:pageNum("+i+");\">"+PageNumFont1+i+PageNumFont2+"</A>&nbsp;";
	}
	}
		//document.write (NextPageUrl);
		$(DivId).innerHTML += NextPageUrl;
}

show_loading = function(state){
		this.loadingPane = $("search_loading");
		if (this.loadingPane == null) {
			var el = document.createElement('IMG');
			el.setAttribute("id","search_loading");
			el.setAttribute("src","images/loading.gif");
			el.style.cssText="position:absolute;top:300px;left:50%;margin-left:-136px;z-index:100;display:none";
			document.body.appendChild(el);
			this.loadingPane = el;
		}
		if (state ==1 ) {
			this.loadingPane.style.display="block";
			this.loadingPane.style.top = document.body.scrollTop+1;
		} else {
			this.loadingPane.style.display="none";
		}
}

function GetParam(name){//获取URL传递过来的参数
		var input = document.location.href.split('#')[0];
		var result = input.replace(/\?/g," ").replace(/\&/g," ");
		var items = result.split(' ');
		var m = new RegExp("^" + name + "=","i");
		var param = "";
		for(var i=0;i<items.length;i++)
			{
			var temp = items[i];
			temp = temp.replace(/\s/g,"");
			if(temp=="")
			continue;
			if(temp.match(m))
				{
				if(param!="")
				param += ",";
				param += temp.replace(m,"");
				}
			}
		return param;
}

function hide_left(){
	var isshow = arguments[0];
	if($('left').style.display == "none"||isshow == 1){
		$('left').style.display = "";
		$('mapObj').className = "mapObj";
		$('mapTitle').className = "title";
		$('hideResult').className = "hideResult";
	}else{
		$('left').style.display = "none";
		$('mapObj').className = "mapObj2";
		$('mapTitle').className = "title2";
		$('hideResult').className = "hideResult2";
	}
}

function bj_ssjt(cn){
		document.getElementsByName("sslk")[0].checked=true; 
		var xy = new Array();
		xy = city.ctxy(cn);
		mapObj.setZoomAndCenter(11, new MLngLat(xy[0],xy[1]));
		//mapObj.loadRealTimeTrafficButton();
		var tileLayer = new MTileLayer;
		tileLayer.layerType = TL_TRAFFIC;
		mapObj.addTileLayer(tileLayer);
}

function colse_ssjt(){
		if(document.getElementsByName("sslk")[0].checked){
			bj_ssjt('北京');
		}else{
			mapObj.removeTileLayer(TL_TRAFFIC);
			//mapObj.unloadRealTimeTrafficButton();
		}
}
//弹出纠错
function CorrectBox(Errtype,poiID,poiName,poiAddress,poiTel,cityname,poix,poiy,poitype){
	//alert(Errtype+"--"+poiID+""+poiName+"--"+poiAddress+"--"+poiTel+"--"+cityname);
	var iframeurl = "/include/correction.html?" + Errtype + "&&" + poiID + "&&" + encodeURI(poiName) + "&&"+ encodeURI(poiAddress) +"&&" + poiTel + "&&" + encodeURI(cityname) + "&&" + poix + "&&" + poiy + "&&"+encodeURI(poitype)+"&&" + Math.random();
	showMessageBox("correctErr",'纠错',iframeurl,380,500,1,0);
}
function zoom(y,x){//TIP中的"定位放大"
			mapObj.setCenter(new MLngLat(x,y));
			mapObj.setZoomLevel(14);
}