//获取当前页面
var this_url = location.href;

function ct_zone(){
		var ct_html = "";
		var cities = citylist.city;
		var isHotcity = false;
		for (var t in cities){
			if (cities[t].length > 0){
				ct_html += "<ul><li class='letters'>" + t + "</li>";
				for (var i = 0;i < cities[t].length; ++i){
					isHotcity = false;
					for (var j = 0; j < citylist.hot_city.length; ++j){
						if (cities[t][i] == citylist.hot_city[j]){
							isHotcity = true;
							break;
						}
					}
					ct_html += "<li><a" + (isHotcity?" class=\"red\"":"") + " href=\"javascript:void(0)\" onclick=\"setCurrentCity('" + cities[t][i] + "')\">" + cities[t][i] + "</a></li>";
				}
				ct_html += "</ul>";
			}
		}
		$("status").style.display = "none";
		$("no_action").style.display = "block";
		$("cityzone").innerHTML = ct_html;
		setZoom("");
}

function setZoom(n){
	var args = $("zoom").childNodes;
	for (var i = 0; i < args.length; ++i){
		//args[i].onClick = "";
		args[i].className = "";
	}
	if(n!=""){mapObj.setZoomLevel(n);}
}

function around_search(s,x,y,id){//显示周边搜索界面
	$('result').style.display="none";
	$('page').style.display="none";
	$('result_info').style.display="none";
	$('around_div').style.display="block";
	$('point_name').value = s;
	$('point_key').focus();
	poiname = s;
	poix = x;
	poiy = y;
	sw_searchbox($("around_tab"));
	$("around_center").value = s;
	show_all_poi(0);
	poi_one(id);
}

function backtoresult(){
	$('around_div').style.display="none";
	$('result_info').style.display="block";
	$('result').style.display="block";
	$('page').style.display="block";
	sw_searchbox($("around_tab"));
	show_all_poi(1);
}

function no_result(){
		//$('result_info').style.display="none";
		removeAllOverlays();
		$('around_div').style.display="none";
		$('page').style.display="none";
		$('result').style.display = "block";
}

function jumpurl(s){
	location.href = s;
}
//tip点操作
function show_all_poi(ii){//显示地图位置点
	for(var i=0;i<number;i++){
		try{
			mapObj.showPointById(i+1,ii==0?false:true);
		}catch(e){}
	}
	try{mapObj.showPointById("1000",ii==0?false:true);}catch(e){}

}

function poi_one(i){//显示某个POI点在地图的位置
		mapObj.showPointById(i,true);
		//mapObj.openTipById(i);
}


//To avoid mapfmp errors
function removeAllOverlays(){
	if('undefined' != typeof mapObj){
		mapObj.removeAllOverlays();
	}
}

function addOverlay(o){
	if('undefined' != typeof mapObj){
		mapObj.addOverlay(o, true);
	}
}

function drawCustomPoints(o){
	if('undefined' != typeof mapObj){
		mapObj.drawCustomPoints(o, true);
	}
}

/*                               功能结束                                   */

//字符串处理
function checkurl(t){
	if(!t||t==null||t==""||t==" "||t=="null"){
		return "NAN";
	}else{
		return t;
	}
}

//		0类型
//		1起点城市
//		2终点城市
//		3起点关键字
//		4钟点关键字
//		5起点X
//		6起点Y
//		7终点X
//		8终点Y
//		9起点地址
//		10终点地址
//		11起点电话
//		12终点电话
//		13起点类型
//		14终点类型
//		15起点poiid
//		16终点poiid
//		17中心点关键字
//		18中心点X
//		19中心点Y
//获取结束
var page_now = 1,typenow,citycode,cityname,centerkeyword,keyword,searchType,number = 10,batch=1,range=3000,mapIntitedCheck,mapInfo={},poix,poiy,poiname;

urlinfo = location.href;
urlinfo = decodeURI(urlinfo);
try{
	urlinfo=urlinfo.split("?");
	urlinfo=urlinfo[1].split(",");
}catch(e){}

mapInfo['url']={};
for(var i=0;i<20;i++){
	mapInfo['url']['u'+i] = checkurl(urlinfo[i]);
}
var mapProperty = mapInfo['url'];

if (this_url.indexOf("?") != -1){
	searchtype = mapProperty.u0;
	cityname = mapProperty.u1;
	citycode = city.ctn2c(cityname);
	centerkeyword = mapProperty.u17;
	keyword = mapProperty.u3;
	poix = mapProperty.u4;
	poiy = mapProperty.u5;
	poiname = mapProperty.u6;
	range = mapProperty.u7;
	if(range=="NAN"){range=3000;}
	if(searchtype == "a" && citycode != "" && keyword != "" && centerkeyword != ""){
		search_around(citycode,keyword,centerkeyword);
		$('around_center').className="input4 Icolor";
		$('around_keyword').className="input2 Icolor";
		$('around_center').value = centerkeyword;
		$('around_keyword').value = keyword;
		sw_searchbox($("around_tab"));
		setCurrentCity(cityname);
	}else if(searchtype == "l" && citycode != "" && keyword != ""){
		search_index(citycode,keyword);
		$('local_keyword').className="input2 Icolor";
		$('local_keyword').value = keyword;
		setCurrentCity(cityname);
	}else if(searchtype == "map" && cityname != ""){
		setCurrentCity(cityname);
		setZoom("");
		ct_zone();
		if (cityname=="全国"){setZoom(5)};
		hide_left();
		$('geturl').innerHTML = "<a href=\"getURL.html?localsearch.shtml?map,"+cityname+"\" class=\"black\" target=\"_blank\">获取本页链接</a>";
	}else if(searchtype == "traffic" && cityname != ""){
		setCurrentCity(cityname);
		ct_zone();
		bj_ssjt(cityname);
		hide_left();
		$('geturl').innerHTML = "<a href=\"getURL.html?localsearch.shtml?traffic,"+cityname+"\" class=\"black\" target=\"_blank\">获取本页链接</a>";
	}else if(searchtype == "xy" && citycode != "" && keyword != "" && poix != "" && poiy != "" && range !=""){
		search_xy(citycode,poix,poiy,keyword);
		$('around_center').className="input4 Icolor";
		$('around_keyword').className="input2 Icolor";
		$('around_center').value = poiname;
		$('around_keyword').value = keyword;
		sw_searchbox($("around_tab"));
		setCurrentCity(cityname);
	}else{
		ct_zone();//加载默认提示项
	}

}else{
		ct_zone();//加载默认提示项
}

function changerange(){
	var ar = arguments[0];
	if (typeof ar != "undefined"){
		range = ar;
	}else{
		range = parseInt($('range').value);
	}
		if(typenow == "xy"){
			search_xy(citycode,poix,poiy,keyword);
		}else{
			search_around(citycode,keyword,centerkeyword);
		}
}

function left_search_around(){
	var cityname = $("around_cityname").value;
	keyword = $("point_key").value;
	centerkeyword = poiname;
	center_x = poix;
	center_y = poiy;
	$("around_keyword").value = keyword;
	//searchType = $F("searchType");
	//batch = $F("batch");
	if(cityname == ""){
		//alert("请填写城市，此处不能为空!");
		return;
	}
	if(keyword == ""||keyword == "输入关键字：银行，加油站…"){
		//alert("请填写查询关键子，此处不能为空!");
		return;
	}
	if(centerkeyword == ""){
		//alert("请填写中心点关键子，此处不能为空!");
		return;
	}
	citycode = city.ctn2c(cityname);
	if(citycode == null){return false;}
	search_xy(citycode,center_x,center_y,keyword);
}
//关键字查询代码开始

/*
	Format: typenow,citycode,keyword,centerkeyword,centerX,centerY

*/
function base_search(typenow,c,k,ck,cenX,cenY){
	if (typeof MSISSearch == "undefined"){
		$('loading').style.display = "none";
		$('result').innerHTML = ("数据查询服务连接异常，请<a href=\"javascript:void(0);\" onclick=\"location.reload();\">刷新</a>页面后重试!");
		return;
	}
	sis = new MSISSearch();
	sp = new MSearchPointPara();
	sis.setSISCallbackFunction(keywordCallBack); 
	sp.setCitycode(c);
	sp.setKeyword(k);
	sp.setNumber(number);
	sp.setPageSum(number);
	sp.setBatch(batch);
	sp.setSearchType(searchType);

	switch (typenow){
	case "index":
		sis.searchByKeyword(sp);
		break;
	case "around":
		sp.setRange(range);
		sp.setCenterKeyword(ck);
		sis.localSearchByKeyword(sp);
		break;
	case "xy":
		sp.setRange(range);
		sp.setCenX(cenX);
		sp.setCenY(cenY);
		sis.localSearchByXY(sp);
		break;
	default:
		return;
	}
}

function search_index(c,k){//本地搜索
	if(c=="全国"){c="total";}
	var cityArray = new Array();
	cityArray = city.ctall(c);
	cityname = cityArray[0];
	$('result_info').style.display="block";
	$('result_info').innerHTML = "在&nbsp;<b>" + cityArray[0] + "</b>&nbsp;搜索&nbsp;<b>" + (k.length>15?(k.substring(0,15)+"..."):k) + "</b>";
	$('print').innerHTML="<a href=\"http://"+ location.host+"/print.html?"+cityArray[0]+","+k+",10,"+page_now+"\" target=\"_blank\">打印</a>";
	page_now = 1;
	$('loading').style.display = "";
	keyword = k;
	$('local_keyword').value = keyword;
	typenow = "index";
	var u = "localsearch.shtml?l,"+cityname+",,"+k;
	$('geturl').innerHTML = "<a href=\"getURL.html?"+u+"\" class=\"black\" target=\"_blank\">获取本页链接</a>";
	base_search("index",c,k,'','','')
}

function search_around(c,k,ck){//关键字周边搜索
	var cityArray = new Array();
	cityArray = city.ctall(c);
	cityname = cityArray[0];
	$('result_info').style.display="block";
	$('result_info').innerHTML = "在&nbsp;<b>" + ck + "</b>&nbsp;附近搜索&nbsp;<b>" + (k.length>12?(k.substring(0,12)+"..."):k) + "</b><span class='area'>范围&nbsp;<select id=\"range\"  onchange='changerange();' style='display:inline;vertical-align:middle'><option value=1000>1公里</option><option value=3000>3公里</option><option value=5000>5公里</option></select></span>";
	$('range').value = range;
	$('print').innerHTML="<a href=\"http://"+ location.host+"/print_a.html?"+city.ctall(c)[0]+","+k+",10,"+page_now+","+ck+","+range+"\" target=\"_blank\">打印</a>";
	centerkeyword = ck;
	keyword = k;
	$('around_center').value = centerkeyword;
	$('around_keyword').value = keyword;
	page_now = 1;
	$('loading').style.display = "";
	typenow = "around";
	var u = "localsearch.shtml?a,"+cityname+",,"+k+",,,,,,,,,,,,,,"+ck;
	$('geturl').innerHTML = "<a href=\"getURL.html?"+u+"\" class=\"black\" target=\"_blank\">获取本页链接</a>";
	base_search("around",c,k,ck,'','')
}

function search_xy(c,cenX,cenY,k){//中心点周边搜索
	var cityArray = new Array();
	cityArray = city.ctall(c);
	cityname = cityArray[0];
	$('result_info').style.display="block";
	$('result_info').innerHTML = "在&nbsp;<b>" + poiname + "</b>&nbsp;附近搜索&nbsp;<b>" + (k.length>12?(k.substring(0,12)+"..."):k) + "</b><span class='area' >范围&nbsp;<select id=\"range\"  onchange='changerange();' style='display:inline;vertical-align:middle'><option value=1000>1公里</option><option value=3000>3公里</option><option value=5000>5公里</option></select></span>";
	$('range').value = range;
	$('print').innerHTML="<a href=\"http://"+ location.host+"/print_xy.html?"+city.ctall(c)[0]+","+k+","+cenX+","+cenY+",10,"+page_now+","+poiname+","+range+"\" target=\"_blank\">打印</a>";
	poix = cenX;
 	poiy = cenY;
	keyword = k;
	poiname = $('around_center').value;
	centerkeyword = poiname;
	page_now = 1;
	$('loading').style.display = "";
	typenow = "xy";
	var u = "localsearch.shtml?xy,"+cityname+",,"+k+","+cenX+","+cenY+","+poiname;
	$('geturl').innerHTML = "<a href=\"getURL.html?"+u+"\" class=\"black\" target=\"_blank\">获取本页链接</a>";
	base_search("xy",c,k,'',cenX,cenY)
}

function keywordCallBack(data){
	hide_left(1);
	//show_loading(1);
	var points = "";
	var rs = data;
	//rs.message
switch(rs.message){
	case 'ok':
	var allcount = rs.count;
	var html = "",href_from_here = "",herf_to_here = "",href_detail = "";
	var pguid = new MPoiHtmlUtil();

	mapInfo['url1']={};
	for(var i=0;i<20;i++){
		mapInfo['url1']['u'+i] = "NAN";
	}
	mapProperty = mapInfo['url1'];

//拼音纠错开始
	var search_ls_pinyin = "";
	var arr = sis.getLocalSearchByPinyin(rs);
	if(arr.length=="0"){
		search_ls_pinyin="";
	}else{
		var suggest="";
		for (var i = 0; i < arr.length; i++) {
			var pinyin = arr[i];
			suggest += "<a href=\"javascript:void(0);\" onclick=\"" + (typenow == "index"?"search_index('" + citycode + "','" + pinyin + "')":"search_around('" + citycode + "','" + pinyin + "','" + $('around_center').value + "')") + "\" style=\"text-decoration:underline;font-weight:bold;color:#2155bc;\">"+pinyin+"</a>&nbsp;&nbsp;";
		}
		search_ls_pinyin = "<span style=\"text-indent:10px;\">您要找的是不是：" + suggest + "</span>";
	}
//拼音纠错结束

	if (allcount == 0){
		no_result();
		var no_result_html = search_ls_pinyin + "<div class=\"default\"><div class=\"default_title\">未查找到任何结果!</div><div class=\"d_link\"><div class=\"d_right\"></div><div class=\"suggest\"><strong>建议：</strong><br />1.请确保所有字词拼写正确。<br />2.尝试不同的关键字。<br />3.尝试更宽泛的关键字。</div></div><div class=\"bold\">您可以尝试以下链接：<span class=\"inner\"><a href='localsearch.shtml?a,北京,,车站,,,,,,,,,,,,,,西单'>在 北京 西单 附近找 车站</a><br /></span><span class=\"inner\"><a href='localsearch.shtml?a,北京,,银行,,,,,,,,,,,,,,北三环'>在 北京 北三环 附近找 银行</a></div></span><div class=\"new_msg \"><a href=\"javascript:void(0);\" onclick=\"CorrectBox(1,'','','','','','')\">提交新的位置点</a></div></div>";
		$("result").innerHTML = no_result_html;
	}else{
			removeAllOverlays();
			var pointStyle = new Array();
			var customPoint = new Array();
			var sContent = "";
			var centerPoint;
			var s_time = (rs.searchtime=="0"?"0.001":rs.searchtime/1000);
			var s_total = rs.total;
			var centX,centY;
			//$("result_info").innerHTML = "共" + s_total + "条结果 耗时" + s_time + "秒";

			if((typenow == "xy"||typenow == "around") && 'undefined' != typeof mapObj){//仅加点操作
				//XY周边查询中心点tip
				var centerPointStyle = new MStyle();
				centerPointStyle.lineColor = 0xff230b;
				centerPointStyle.lineSize = 2;
				centerPointStyle.fillColor = 0xffffff;
				centerPointStyle.fillOpacity = 100;
				centerPointStyle.labelColor = 0xffffff;

				centerPointStyle.labels = "中心点";
				centerPointStyle.isShowLabels = true;
				centerPointStyle.isShowTip = false;
				centerPointStyle.textSize = 13;
				centerPointStyle.isLabelsFontBold = true;
				centerPointStyle.backgroundColor = 0xff230b;
				centerPointStyle.isLabelsBackground = true;
				centerPointStyle.textColor = 0xffffff;
					if(rs.cenpoi){
						//关键字周边查询中心点tip
						var cpoi = rs.cenpoi;
						sContent = "<font color='#000000'><b>中心点 "+ cpoi.name + "</b><br>";
						//sContent += "地址：" + (cpoi.address?cpoi.address:"暂无") + "<br>";
						//sContent += "电话：" + (cpoi.tel?cpoi.tel:"暂无") + " <br>";
						centX = cpoi.x;
						centY = cpoi.y;
					}else{
						sContent = "<font color='#000000'>" + poiname + "</font><br>";
						centX = poix;
						centY = poiy;
					}
				centerPointStyle.textContent = sContent;
				centerPoint = new MCustomPointOverlay(new MLatLng(centY, centX), "http://" + location.host + "/images/center.swf", centerPointStyle, "1000");
				//mapObj.drawCustomPoints(centerPoint, true);
					addOverlay(centerPoint);
			}


			var address_link,tel_link,ars,pname,pid,data_citycode,cityname,x,y,type,address,tel,href_detail,poi_url,poi_img;
			for (var i = 0; i < rs.poilist.length; i++) {
				ars = rs.poilist[i];
				pname = ars.name;
				pid = ars.pguid;
				data_citycode = ars.citycode;
				cityname = city.ctc2n(data_citycode);
				x = ars.x;
				y = ars.y;

				type = ars.type;
				if (type == "" || type == "undefined" || type == null || type == " undefined"){type = "暂无";}
				address = (!ars.address?"":ars.address);
				tel = (!ars.tel?"":ars.tel);

				//address_link = (address==""?"<a href=\"javascript:CorrectBox(1,'" + ars.pguid + "','" + ars.name + "','" + address + "','" + tel + "','" + cityname + "','" + x + "','" + y + "','"+type+"');\">提交信息</a>":address);
				//tel_link = (tel==""?"<a href=\"javascript:CorrectBox(1,'" + pid + "','" + ars.name + "','" + address + "','" + tel + "','" + cityname + "','" + x + "','" + y + "','"+type+"');\">提交信息</a>":tel);

				address_link = (address==""?"<a href=\"javascript:CorrectBox(1,'" + ars.pguid + "','" + ars.name + "','" + address + "','" + tel + "','" + cityname + "','" + x + "','" + y + "','"+type+"');\">提交信息</a>":address);
				tel_link = (tel==""?"<a href=\"javascript:CorrectBox(1,'" + pid + "','" + ars.name + "','" + address + "','" + tel + "','" + cityname + "','" + x + "','" + y + "','"+type+"');\">提交信息</a>":tel);

				//href_detail = pguid.getPoiStaticPath(data_citycode,pid);//获取详细页地址
				href_detail = "detail/"+data_citycode+"/"+pid+".html";//新详细页地址
				//判断是否为基础数据还是编辑器数据
				poi_url = "";
				poi_img = "";
				if(ars.srctype == "basepoi"){
					poi_url = "http://www.mapabc.com/" + href_detail;
				}
				if(ars.srctype=="enpoi"){
					poi_url = ars.dn;
					poi_img = "<img src=\"/images/enpoi.gif\">";
				}

				href_from_here = "search.shtml?b_e," + cityname + "," + cityname + "," + pname + "," + mapProperty.u4 + "," + x + "," + mapProperty.u7 + "," + y + "," + mapProperty.u8 + "," + (address==""?"暂无":address) + "," + mapProperty.u10 + "," + (tel==""?"暂无":tel) + "," + mapProperty.u12 + "," + type + "," + mapProperty.u14 + "," +pid+ "," + mapProperty.u16 + "," + poi_url + "," + mapProperty.u18 + "," + mapProperty.u19;
				href_to_here = "search.shtml?b_s," + cityname + "," + cityname + "," + mapProperty.u3 + "," + ars.name + "," + mapProperty.u5 + "," + x + "," + mapProperty.u6 + "," + y + "," + mapProperty.u10 + "," + (address==""?"暂无":address) + "," + mapProperty.u12 + "," + (tel==""?"暂无":tel) + "," + mapProperty.u13 + "," + type + "," + mapProperty.u15 + "," + pid + "," + mapProperty.u17 + "," + poi_url + "," + mapProperty.u19;

				sContent = "<font color='#000000'><b>" + (i+1) + ". "+ pname + "</b><br>";
				sContent += "地址：" + address_link + "<br>";
				sContent += "电话：" + tel_link + " <br>";
				sContent += "<a href=\"javascript:around_search('" + pname + "','" + x + "','" + y + "','" + (i+1) + "');\">周边搜索</a>　<a href=\"javascript:jumpurl('" + href_from_here + "');\">从这里出发</a>　<a href=\"javascript:jumpurl('" + href_to_here + "');\">到这里去</a>　<a href=\"javascript:CorrectBox(1,'" + pid + "','" + pname + "','" + address + "','" + tel + "','" + cityname + "','" + x + "','" + y + "','"+type+"');\">纠错</a>　<a href=\"javascript:zoom('"+y+"','"+x+"')\">定位放大</a></font>";
				//drawCustomPointImg(sContent,x,y,"http://www.mapabc.com/images/1.gif",i)
			if('undefined' != typeof mapObj){
				pointStyle[i] = new MStyle();
				pointStyle[i].lineColor = 0xff230b;
				pointStyle[i].lineSize = 2;
				pointStyle[i].fillColor = 0xffffff;
				pointStyle[i].fillOpacity = 100;
				pointStyle[i].labelColor = 0x000000;
				//pointStyle.showTip = false;
				pointStyle[i].textContent = sContent;

				var temp_img = "";
				if(ars.match=="10"){
					customPoint[i] = new MCustomPointOverlay(new MXY(x,y), "http://" + location.host + "/images/num/" + (i+1) + "_10.gif?070701", pointStyle[i], (i+1));
					temp_img = "<img src=\"/images/num/" + (i+1) + "_10.gif?070701\" title=\"精确位置\"/>";
				}else{
					customPoint[i] = new MCustomPointOverlay(new MXY(x,y), "http://" + location.host + "/images/num/" + (i+1) + ".gif?070701", pointStyle[i], (i+1));
					temp_img = "<img src=\"/images/num/" + (i+1) + ".gif?070701\" title=\"估计位置\"/>";
				}
			}
				//加点操作结束

				html += "<div onclick=\"mapObj.setCenterByLatLng('"+ y +"','"+ x +"');mapObj.openTipById('"+(i+1)+"')\"\"><table id=\"div" + (i+1) + "\" class=\"Lsearch\"cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" onmouseover=\"this.style.backgroundColor='#eeeeee'\" onmouseout=\"this.style.backgroundColor='#ffffff'\"><tr><td colspan=4 height=6></td></tr><tr><td width=\"34\" height=27 align=\"center\">"+temp_img+"</td><td width=304><h5>" + pname + "&nbsp;" + poi_img + "</h5></td><td width=\"86\" align=\"center\" ><a href=\"" + poi_url + "\" target=\"_blank\">详细&raquo;</a></td><td width=20></td></tr><tr><td></td><td colspan=\"2\" class=\"gray2\">地址："+ address_link +"<br />电话："+ tel_link +"</td><td width=20></td></tr><tr><td></td><td colspan=2><a href=\"javascript:void(0);\" onclick=\"around_search('" + pname + "','" + x + "','" + y + "','" + (i+1) + "');\">周边搜索</a>&nbsp;&nbsp;&nbsp;<a href=\"" + href_from_here + "\">从这里出发</a> 或 <a href=\"" + href_to_here + "\">到这里去</a>&nbsp;&nbsp;&nbsp;<a href=\"javascript:CorrectBox(1,'" + ars.pguid + "','" + pname + "','" + address + "','" + tel + "','"+cityname+"','" + x + "','" + y + "','" + type + "','"+ars.match+"')\">纠错</a></td><td></td></tr><tr><td colspan=4 height=9></td></tr></table></div>";
		}
			drawCustomPoints(customPoint);

		html += "<div class=\"info\">没有您要找的?<a href=\"javascript:void(0)\" onclick=\"CorrectBox('1','','','','','"+cityname+"','','','')\">提交信息</a><br />　　<img src=\"/images/num/0_10.gif?070701\" title=\"精确位置\"/>&nbsp;精确位置　　<img src=\"/images/num/0.gif?070701\" title=\"估计位置\"/>&nbsp;估计位置</div>";


		$('around_div').style.display = "none";
		$('result').style.display = "block";
		$('page').style.display = "block";
		$('result').innerHTML= search_ls_pinyin + "&nbsp;&nbsp;共" + s_total + "条结果 耗时" + s_time + "秒<div class='brand'><a id='brand'></a></div>" + html;
		page_allnum = Math.floor((allcount + number-1) / number);//页数
		ShowoPage("上一页","下一页","<font color='red'>","</font>","[<font color='red'>","</font>]",allcount,number,4,page_now,"page");
		brand_inf(keyword);//加载品牌
	}
	//show_loading(0);
	$('loading').style.display = "none";
	break;
	case 'error'://公交搜索（起点只有关键字，终点信息详细）
		no_result();
		var no_result_html = "<div class=\"default\"><div class=\"default_title\">服务器异常！请重新尝试！</div><div class=\"d_link\"><div class=\"d_right\"></div><div class=\"suggest\"><strong>建议：</strong><br />如果您刷新页后仍无法显示结果，请过几分钟后再次尝试或者与我们的服务人员联系。<br />Email：service@mapabc.com <br />电话：400 810 0080</div></div></span></div>";
		$("result").innerHTML = no_result_html;
		$('loading').style.display = "none";
	break;
	default:
       no_result();
		var no_result_html = "<div class=\"default\"><div class=\"default_title\">对不起！您的ip被禁止！请稍后重新尝试！</div><div class=\"d_link\"><div class=\"d_right\"></div><div class=\"suggest\"><strong>建议：</strong><br />如果您刷新页后仍无法显示结果，请过几分钟后再次尝试或者与我们的服务人员联系。<br />Email：service@mapabc.com <br />电话：400 810 0080</div></div></span></div>";
		$("result").innerHTML = no_result_html;
		$('loading').style.display = "none";
}
}

function pageNum(num){//分页
	$('loading').style.display = "";
	$('result').innerHTML = "";
	page_now = num;
	sp.setBatch(num);
	//sp.setPageSum(num);
	switch (typenow){
		case "index":
			$('print').innerHTML="　<a href=\"http://"+ location.host+"/print.html?"+cityname+","+keyword+",10,"+num+"\" target=\"_blank\">打印</a>";	
			sis.searchByKeyword(sp);
		break;
		case "around":
			$('print').innerHTML="　<a href=\"http://"+ location.host+"/print_a.html?"+cityname+","+keyword+",10,"+num+","+centerkeyword+","+range+"\" target=\"_blank\">打印</a>";
			sis.localSearchByKeyword(sp);
		break;
		case "xy":
			$('print').innerHTML="<a href=\"http://"+ location.host+"/print_a.html?"+cityname+","+keyword+","+x+","+y+",10,"+page_now+","+ck+","+range+"\" target=\"_blank\">打印</a>";	
			sis.localSearchByXY(sp);
		break;
		default:;
	}
}

function nextPageNum(){
		if(page_now < page_allnum){
				pageNum(page_now+1);
		}
}

function lastPageNum(){
	if(page_now > 0){
			pageNum(page_now-1);
	}
}

function addpoint_key(point_name){
	$('point_key').value = point_name;
}