//关键字查询代码开始
var point = null;
var curentpagenumber =1;
var priorpagenumber =1;
var  totpagenum =1;
var jsondata;
//判断输入是否为空格
function Trim(s) {
	s = s.replace(/(^\s+)|(\s+$)/ig,"");
	s = s.replace(/\u3000+/g, " ");
	s = s.replace(/\s+/g," ");
	return s;
}
function zoom(x,y,i){//TIP中的"定位放大"
	mapObj.setZoomAndCenter(17,new MLngLat(x,y));
	mapObj.openOverlayTip(i);
}

function searchByKeyword(curpage){
	if(p_citycode == ""){
		alert("请选择城市!");
		$('f_city1').setfocus;
		return false;
	}
	if(p_keyword == ""){
		alert("请填写查询关键字!");
		$('f_hotelname').setfocus;
		return false;
	}
	mapObj.removeAllOverlays();//在每次执行新查询时，先删除已经查出的POI点
	//以下是从文本框中得到查询参数
	var p_citycode = $('f_city1').value;
	var p_keyword = $('f_hotelname').value;
	var p_searchType = '';
	var p_number = 10;
	var p_batch = curpage;
	curentpagenumber=curpage;

	var mls = new MLocalSearch();   
    var mlsp = new MLocalSearchOptions();   
    mls.setCallbackFunction(keywordCallBack);   
		
	mlsp.dataSources = MLocalSearch.USERPOI;
	mlsp.dataType = "住宿服务";
	mlsp.eid = "5630";//企业ID
	mlsp.userId = "35072";//用户ID
	
	mlsp.recordsPerPage = 10;
	mlsp.pageNum = curpage;	
    mls.poiSearchByKeywords(p_keyword,p_citycode,mlsp);   //32345
}

function keywordCallBack(data)
{
	//在html里加入表格
	var html = "	<div class='main_r_b_t'><img src='/image/emap07.gif' alt='查询结果' /></div>";
	html += "			<div class='main_r_b_m'>";
	html += "			<ul class='hotel_ul' >";
	//判断返回值是否为空
	document.getElementById("aaaaa").innerHTML = JSON.stringify(data);   
	if (data.count != 0) {
		totpagenum= Math.ceil(data.count/10)   ;
		var pointarr = new Array();
		for (var i = 0; i < data.poilist.length; i++) {
			//用data.poilist[i].属性名称 得到值
			var pid = data.poilist[i].pguid;
			var data_citycode = data.poilist[i].citycode;
			var x = data.poilist[i].x;
			var y = data.poilist[i].y;
			var v_page;
			
			var pointStyle = new MMarkerOptions();     
            pointStyle.canShowTip = true;   
            pointStyle.isDimorphic = true;
			pointStyle.dimorphicColor = "0x00ff00"
			pointStyle.imageUrl ="http://map.tabimado.net.cn/image/marker_"+(i+1)+".png";  
			
		    var type = data.poilist[i].type;
		    if (type == "" || type == "undefined" || type == null) {
		    	type = "";
		    }
		    var address = data.poilist[i].address;
			/*if (address.indexOf('$')>0){
				address = address.substring(0,address.indexOf('$'));}*/

		    if (address == "" || address == "undefined" || address == null) {
		    	address = "";
		    }
		    /*var urlid = data.poilist[i].url;
		    if (urlid == "" || urlid == "undefined" || urlid == null) {
		    	urlid = "暂无";
		    }*/	    
		    var tel = data.poilist[i].tel;
		    if (tel == "" || tel == "undefined" || tel == null) {
		    	tel = "";
		    }	    
			var href_around_here ="aroundsearch.html?a,"+data_citycode+","+escape(data.poilist[i].name)+","+x+","+y+",NAN";//+$('f_hotelname').value;
			var href_from_here = "transport.html?b," + data_citycode + "," + data_citycode + "," + escape(data.poilist[i].name) + "," + escape("NAN") ;
			var href_to_here =  "transport.html?b," + data_citycode + "," + data_citycode + "," + escape("NAN")+ "," + escape(data.poilist[i].name)   ;
			
		    var sContent = "<br/>";

		   	if (!address == "" && address != null) {
				sContent += "&nbsp;<font color='#000000'>地址:"+address+"</font><br/>";
			}
			if (!tel == "" && tel != null) {
				sContent += "&nbsp;<font color='#000000'>电话:"+tel+"</font><br/>";
			}
			/*if (!urlid == "" && urlid != null) {
				if (urlid == "暂无")
				{sContent += "&nbsp;<font color='#000000'>"+urlid+"</font><br/>";
				}else{	
				sContent += "&nbsp;<u><font color='#000000'>"+urlid+"</font></u><br/>";}
			}*/
			//sContent += "<font color='#000000'><a href=\"javascript:jumpurl('" + href_around_here + "');\"><u>周边搜索</u></a>&nbsp;<a href=\"javascript:jumpurl('" + href_from_here + "');\"><u>从这里去</u></a>&nbsp;<a href=\"javascript:jumpurl('" + href_to_here + "');\"><u>到这里来</u></a>&nbsp;<a href=\"javascript:zoom('"+x+"','"+y+"')\"><u>定位放大</u></a></font>";
			sContent += "&nbsp;<font color='#000000'><a href=\"" + hosturl + "/hotelinfo/" + data.poilist[i].extid + "\"  target=\"_blank\"><u>详细信息</u></a>&nbsp;<a href=\"javascript:jumpurl('" + href_around_here + "');\"><u>周边搜索</u></a>&nbsp;<a href=\"javascript:jumpurl('" + href_from_here + "');\"><u>从这里去</u></a>&nbsp;<a href=\"javascript:jumpurl('" + href_to_here + "');\"><u>到这里来</u></a>&nbsp;<a href=\"javascript:zoom('"+x+"','"+y+"','+(i+1)+')\"><u>定位放大</u></a></font>";
			
			var tipOption = new MTipOptions();   
            tipOption.title="<a href=\"" + hosturl + "/hotelinfo/" + data.poilist[i].extid + "\"  target=\"_blank\">"+(i+1)+".  <u>"+data.poilist[i].name+"</u></a>";
			var mfontstyle=new MFontStyle();
			mfontstyle.size=14;
			mfontstyle.bold=true;
			tipOption.titleFontStyle=mfontstyle;
            tipOption.content=sContent;  //tip内容   
            var mfillstyle=new MFillStyle();  //定义填充类   
                mfillstyle.color=0x99FF33;   
                mfillstyle.alpha = 1;   
            tipOption.titleFillStyle = mfillstyle;   
            var linestyle = new MLineStyle();   
                linestyle.thickness = 2;    
                linestyle.color = 0x00BD0A;   
                linestyle.alpha = 1;   
            tipOption.borderStyle = linestyle;   
            pointStyle.tipOption = tipOption;    
			
			var ll=new MLngLat(x,y);   
            var pointsearch =  new MMarker(ll,pointStyle);   
			pointsearch.id=(i+1);  
			
			pointarr.push(pointsearch);
			
			html += "<li class='hotel_li' onclick=\"mapObj.setCenter(new MLngLat('"+x+"','"+y+"'));mapObj.openOverlayTip('"+(i+1)+"')\"   style='cursor:pointer'>"+(i+1)+".  "+data.poilist[i].name+"</li>";
		}
		mapObj.addOverlays(pointarr, true); 
		html +="<li class='hotel_li1'>[&nbsp;";
		var lastIntNum;
		var totIntNum;
		if(totpagenum%5==0){totIntNum = totpagenum/5 - 1;}
		else{totIntNum = Math.floor(totpagenum/5);}
		if (curentpagenumber%5==0){lastIntNum=curentpagenumber/5-1;}
		else{lastIntNum=Math.floor(curentpagenumber/5);	}
		
		if  (lastIntNum>0 ) {html +="<a href='javascript:searchByKeyword("+(5*lastIntNum)+")'><<&nbsp;</a>";};
		for (var i = (5*lastIntNum);  i < (5*lastIntNum+5); i++) { 
			if ( (i+1) == curentpagenumber) {html +=""+(i+1)+"&nbsp;</a>";}
			else
			{html +="<a href='javascript:searchByKeyword("+(i+1)+")'>"+(i+1)+"&nbsp;</a>";	}
			if ( (i+1) == totpagenum ) {break;}
		};
		if (lastIntNum<totIntNum) {
			html +="<a href='javascript:searchByKeyword("+( 5*lastIntNum+6)+")'>>>&nbsp;</a>";
		};
		html +="]</li>";
		html +="<li class='hotel_li1'>page("+curentpagenumber+"/<a href='javascript:searchByKeyword("+totpagenum+")'>"+totpagenum+"</a>)&nbsp;<a href='javascript:searchByKeyword(1)'>返回</a></li>";
	} else {
		alert("对不起！此城市没有您要查找的关键字");
	}

	html += "</ul>";
	html += "		</div>";
	html += "	<div class='main_r_b_b'><img src='/image/emap22.gif'></div>";
	$('result').innerHTML= html;
	priorpagenumber = curentpagenumber;		
}
function PubSearchByKeyword(curpage){
	mapObj.removeAllOverlays();//在每次执行新查询时，先删除已经查出的POI点
	//以下是从文本框中得到查询参数
	var p_citycode = $('f_city1').value;//document.form1.f_city.options[document.form1.f_city.selectedIndex].value;
	var p_searchType = $('f_type').value;
	var p_keyword = $('f_hotelname').value;
	var p_number = 10;
	var p_batch = curpage;
	curentpagenumber=curpage;
	if(p_citycode == ""){
		alert("请选择城市!");
		$('f_city1').setfocus;
		return false;
	}
	if(p_keyword == ""){
		alert("请填写查询关键字!");
		$('f_hotelname').setfocus;
		return false;
	}
	
	var mls = new MLocalSearch();   
    var mlsp = new MLocalSearchOptions();  
	mls.setCallbackFunction(PubkeywordCallBack);   
	
	mlsp.dataType = p_searchType;
	mlsp.recordsPerPage = 10;
	mlsp.pageNum = curpage;	
	
	mls.poiSearchByKeywords(p_keyword,p_citycode,mlsp);
}
function AllSearchByKeyword(page){
	//mapObj.addEventListener(mapObj,ZOOM_END,endZoom);
	var p_searchType = $('f_type').value;
	if(p_searchType == "旅之窗酒店"){
		searchByKeyword(page);} //按私有数据进行搜索
	else{
		PubSearchByKeyword(page);//搜索共有数据.
	}
}
function endZoom()
{
	//PubkeywordCallBack(jsondata);
}
function PubkeywordCallBack(data)
{
	//alert(data.count);
	//在html里加入表格
	var html = "	<div class='main_r_b_t'><img src='/image/emap07.gif' alt='查询结果' /></div>";
	html += "			<div class='main_r_b_m'>";
	html += "			<ul class='hotel_ul' >";
	//判断返回值是否为空
	if (data.count > 0) {
		//jsondata = data;
		totpagenum= Math.ceil(data.count/10)   ;
		var pointarr = new Array();
		for (var i = 0; i < data.poilist.length; i++) {
			//用data.poilist[i].属性名称 得到值
			var pid = data.poilist[i].pguid;
			var data_citycode = data.poilist[i].citycode;
			var x = data.poilist[i].x;
			var y = data.poilist[i].y;
			var v_page;
			
			var pointStyle = new MMarkerOptions(); 
            pointStyle.canShowTip = true;
            pointStyle.isDimorphic = true;
			pointStyle.dimorphicColor = "0x00ff00"
			pointStyle.imageUrl ="http://map.tabimado.net.cn/image/marker_"+(i+1)+".png";   
			
			var href_around_here ="aroundsearch.html?a,"+data_citycode+","+escape(data.poilist[i].name)+","+x+","+y+",NAN";//+$('f_hotelname').value;
			var href_from_here= "transport.html?b," + data_citycode + "," + data_citycode + "," + escape(data.poilist[i].name) + "," + escape('NAN');
			var href_to_here =  "transport.html?b," + data_citycode + "," + data_citycode + "," + escape('NAN')+ "," + escape(data.poilist[i].name);
		    var type = data.poilist[i].type;
		    if (type == "" || type == "undefined" || type == null) {
		    	type = "";
		    }
		    var address = data.poilist[i].address;
		    if (address == "" || address == "undefined" || address == null) {
		    	//address = "暂无";
				address = "";
		    }
		    var urlid = data.poilist[i].url;
		    if (urlid == "" || urlid == "undefined" || urlid == null) {
		    	urlid = "暂无";
		    }	    
		    var tel = data.poilist[i].tel;
		    if (tel == "" || tel == "undefined" || tel == null) {
		    	//tel = "暂无";
				tel = "";
		    }	     
			var sContent = "<br/>";
		   	if (!address == "" && address != null) {
				sContent += "&nbsp;<font color='#000000'>地址:"+address+"</font><br/>";
			}
			if (!tel == "" && tel != null) {
				sContent += "&nbsp;<font color='#000000'>电话:"+tel+"</font><br/>";
			}
			//sContent += "&nbsp;<font color='#000000'><a href=\"javascript:jumpurl('" + href_around_here + "');\"><u>周边搜索</u></a>&nbsp;<a href=\"javascript:jumpurl('" + href_from_here + "');\"><u>从这里去</u></a>&nbsp;<a href=\"javascript:jumpurl('" + href_to_here + "');\"><u>到这里来</u></a>&nbsp;<a href=\"javascript:mapObj.closeTip();zoom('"+x+"','"+y+"')\"><u>定位放大</u></a></font>";
			sContent += "&nbsp;<font color='#000000'><a href=\"javascript:jumpurl('" + href_around_here + "');\"><u>周边搜索</u></a>&nbsp;<a href=\"javascript:jumpurl('" + href_from_here + "');\"><u>从这里去</u></a>&nbsp;<a href=\"javascript:jumpurl('" + href_to_here + "');\"><u>到这里来</u></a>&nbsp;<a href=\"javascript:zoom('"+x+"','"+y+"','+i+1+')\"><u>定位放大</u></a></font>";

			var tipOption = new MTipOptions();   
            tipOption.title=i+1+".  "+data.poilist[i].name;
			//tipOption.title="<a href=\"http://www.163.com\"  target=\"_blank\">"+(i+1)+".  <u>"+data.poilist[i].name+"</u></a>";
			var mfontstyle=new MFontStyle();
			mfontstyle.size=14;
			mfontstyle.bold=true;
			tipOption.titleFontStyle=mfontstyle;
            tipOption.content=sContent;  //tip内容   
            var mfillstyle=new MFillStyle();  //定义填充类   
                mfillstyle.color=0x99FF33;   
                mfillstyle.alpha = 1;   
            tipOption.titleFillStyle = mfillstyle;   
            var linestyle = new MLineStyle();   
                linestyle.thickness = 2;    
                linestyle.color = 0x00BD0A;   
                linestyle.alpha = 1;   
            tipOption.borderStyle = linestyle;   
            pointStyle.tipOption = tipOption;    
			
			var ll=new MLngLat(x,y);   
			
			/*var lboptions = new MLabelOptions();
			var lbfontstyle=new MFontStyle();
			lbfontstyle.color = "0xffffff";
			lbfontstyle.size = 12;
			lbfontstyle.bold = false;
			lboptions.fontStyle = lbfontstyle;
			lboptions.backgroundColor = "0x00BD0A";
			lboptions.borderColor = "0xffffff";
			lboptions.content =  "" + (i + 1);
			var mlb = new MLabel(ll,lboptions);
			mlb.id = "lb" + (i+1);
			mapObj.addOverlay(mlb);*/
			
            var pointsearch =  new MMarker(ll,pointStyle);   
			pointsearch.id=(i+1);  
			//mapObj.addOverlay(pointsearch, true);	
			pointarr.push(pointsearch);		
			html += "<li class='hotel_li' onclick=\"mapObj.setCenter(new MLngLat('"+x+"','"+y+"'));mapObj.openOverlayTip('"+(i+1)+"')\"   style='cursor:pointer'>"+(i+1)+".  "+data.poilist[i].name+"</li>";
		}
		mapObj.addOverlays(pointarr, true);	
		
		html +="<li class='hotel_li1'>[&nbsp;";
		var lastIntNum;
		var totIntNum;
		if(totpagenum%5==0){totIntNum = totpagenum/5 - 1;}
		else{totIntNum = Math.floor(totpagenum/5);}
		if (curentpagenumber%5==0){lastIntNum=curentpagenumber/5-1;}
		else{lastIntNum=Math.floor(curentpagenumber/5);	}
		if  (lastIntNum > 0) {html +="<a href='javascript:PubSearchByKeyword("+(5*lastIntNum)+")'><<&nbsp;</a>";};
		for (var i = (5*lastIntNum);  i < (5*lastIntNum+5); i++) { 
			if ( (i+1) == curentpagenumber) {html +=""+(i+1)+"&nbsp;</a>";}
			else
			{html +="<a href='javascript:PubSearchByKeyword("+(i+1)+")'>"+(i+1)+"&nbsp;</a>";	}
			if ( (i+1) == totpagenum ) {break;}
		};
		if (lastIntNum < totIntNum) {
			html +="<a href='javascript:PubSearchByKeyword("+( 5*lastIntNum+6)+")'>>>&nbsp;</a>";
		};
		html +="]</li>";
		html +="<li class='hotel_li1'>page("+curentpagenumber+"/<a href='javascript:PubSearchByKeyword("+totpagenum+")'>"+totpagenum+"</a>)&nbsp;<a href='javascript:PubSearchByKeyword(1)'>返回</a></li>";
		} else {
		alert("对不起！此城市没有您要查找的关键字");
	}

	html += "</ul>";
	html += "		</div>";
	html += "	<div class='main_r_b_b'><img src='/image/emap22.gif'></div>";
	$('result').innerHTML= html;
	priorpagenumber = curentpagenumber;		
}

function eventfun(param)
{
	alert(param.mapId);
	alert(param.overlayId);
}
//关键字查询代码结束-->
//按ID 进行查询	 BEGIN
function searchByID(){
	mapObj.removeAllOverlays();//在每次执行新查询时，先删除已经查出的POI点
	//以下是从文本框中得到查询参数
	var p_hotelid = location.href.GetQueryString("hid");
	var p_cityno = location.href.GetQueryString("cno");
 //上海旅之窗
 document.getElementById('f_city1').value = p_cityno;
 
	 /*var len=$('f_city1').options.length;
	   //设置城市选项
		for(i=0;len>0&&i<len;i++){
		   if ($('f_city1').options[i].value == p_cityno){   
			   $('f_city1').options[i].setAttribute("selected",true); 
			// $('f_city').options[i].selected = true ;
			 break;
		   } 
		}*/
	
	var mls = new MLocalSearch();   
    var mlsp = new MLocalSearchOptions();   
    mls.setCallbackFunction(IDCallBack);   
	
	mlsp.dataSources = MLocalSearch.USERPOI;
	mlsp.eid = "5630"; 
	mlsp.extId = p_hotelid;
	mlsp.userId = "35072";
	//mlsp.recordsPerPage = 10;
	//mlsp.pageNum = curpage;	
	
    mls.poiSearchByKeywords("宾馆",p_cityno,mlsp);   
}

function IDCallBack(data)
{
	//document.getElementById("aaaaa").innerHTML = JSON.stringify(data);   
	//判断返回值是否为空
	if (data.count != 0) {
		totpagenum= Math.ceil(data.count/10)   ;
		var pointarr = new Array();
		for (var i = 0; i < data.poilist.length; i++) {
			//用data.poilist[i].属性名称 得到值
			var pid = data.poilist[i].pguid;
			var data_citycode = data.poilist[i].citycode;
			var x = data.poilist[i].x;
			var y = data.poilist[i].y;
			var v_page;
			
			var pointStyle = new MMarkerOptions();   
            pointStyle.canShowTip = true;   
            pointStyle.isDimorphic = true;
			pointStyle.dimorphicColor = "0x00ff00"
			pointStyle.imageUrl ="http://map.tabimado.net.cn/image/marker.png";  
			
		    var type = data.poilist[i].type;
		    if (type == "" || type == "undefined" || type == null) {
		    	type = "";
		    }
		    var address = data.poilist[i].address;
			/*if (address.indexOf('$')>0){
				address = address.substring(0,address.indexOf('$'));}*/

		    if (address == "" || address == "undefined" || address == null) {
		    	address = "";
		    }
		    /*var urlid = data.poilist[i].url;
		    if (urlid == "" || urlid == "undefined" || urlid == null) {
		    	urlid = "暂无";
		    }	*/    
		    var tel = data.poilist[i].tel;
		    if (tel == "" || tel == "undefined" || tel == null) {
		    	tel = "";
		    }	    
            /*var memo = data.poilist[i].memo;
            var star = memo.email;
		    if (star == "" || star == "undefined" || star == null) {
		    	star = "";
		    }*/	    
		    var sContent = "<br/>";
			

		   	if (!address == "" && address != null) {
				sContent += "&nbsp;<font color='#000000'>地址:"+address+"</font><br/>";
			}
			if (!tel == "" && tel != null) {
				sContent += "&nbsp;<font color='#000000'>电话:"+tel+"</font><br/>";
			}
			/*if (!urlid == "" && urlid != null) {
				if (urlid == "暂无")
				{sContent += "<font color='#000000'>"+urlid+"</font><br/>";
				}else{	
				sContent += "<u><font color='#000000'>"+urlid+"</font></u><br/>";}
			}*/
			
			var href_around_here ="aroundsearch.html?a,"+data_citycode+","+escape(data.poilist[i].name)+","+x+","+y+",NAN";//+$('f_hotelname').value;
			var href_from_here = "transport.html?b," + data_citycode + "," + data_citycode + "," + escape(data.poilist[i].name) + "," + escape("NAN") ;
			var href_to_here =  "transport.html?b," + data_citycode + "," + data_citycode + "," + escape("NAN")+ "," + escape(data.poilist[i].name)   ;
						
			sContent += "&nbsp;<font color='#000000'><a href=\"" + hosturl + "/hotelinfo/" + data.poilist[i].extid + "\"  target=\"_blank\"><u>详细信息</u></a>&nbsp;<a href=\"javascript:jumpurl('" + href_around_here + "');\"><u>周边搜索</u></a>&nbsp;<a href=\"javascript:jumpurl('" + href_from_here + "');\"><u>从这里去</u></a>&nbsp;<a href=\"javascript:jumpurl('" + href_to_here + "');\"><u>到这里来</u></a>&nbsp;<a href=\"javascript:zoom('"+x+"','"+y+"','+(i+1)+')\"><u>定位放大</u></a></font>";
			
			$('f_hotelname').value=data.poilist[i].name;
			
			var tipOption = new MTipOptions();   
            tipOption.title="<a href=\"" + hosturl + "/hotelinfo/" + data.poilist[i].extid + "\"  target=\"_blank\">"+(i+1)+".  <u>"+data.poilist[i].name+"</u></a>";
			var mfontstyle=new MFontStyle();
			mfontstyle.size=14;
			mfontstyle.bold=true;
			tipOption.titleFontStyle=mfontstyle;
            tipOption.content=sContent;  //tip内容   
            var mfillstyle=new MFillStyle();  //定义填充类   
                mfillstyle.color=0x99FF33;   
                mfillstyle.alpha = 1;   
            tipOption.titleFillStyle = mfillstyle;   
            var linestyle = new MLineStyle();   
                linestyle.thickness = 2;    
                linestyle.color = 0x00BD0A;   
                linestyle.alpha = 1;   
            tipOption.borderStyle = linestyle;   
            pointStyle.tipOption = tipOption;    
			
			var ll=new MLngLat(x,y);   
            var pointsearch =  new MMarker(ll,pointStyle);   
			pointsearch.id=(i+1);  
			//mapObj.addOverlay(pointsearch, true);	
			pointarr.push(pointsearch);
			
		}
		mapObj.addOverlays(pointarr, true);	
	} else {
		alert("对不起！此城市没有您要查找的关键字");
	}
}

function busSearch(){//公交查询
	var busC = $('f_city2').value; 
	var busStartN =$('startkey').value;  
	var busEndN = $('endkey').value; 
	var bc = Trim(busC);
	var bs = Trim(busStartN);
	var be = Trim(busEndN);
	var che = "";
    var i = 1 ;
    if(busStartN=="请输入起点" || busStartN=="" || bs == ""){
        che += i + "．请输入起点\n" ;
        i = i + 1 ;
    }
    if(busEndN=="" || busEndN=="请输入终点" || be == ""){
        che += i + "．请输入终点\n" ;
        i = i + 1 ;
    }
    if(busC=="" || bc == ""){
        che += i + "．请选择您要查询的城市\n" ;
        i = i + 1 ;
    }
	if(i == 1){

			location.href = 'bussearch.html?b,' + busC+',' + busC+',' + escape(busStartN) + ',' +escape(busEndN);
	}else{
		alert(che);
	}
}
function routesearchSub(){//驾车
	routeC1 = $('f_startcity').value;
	routeC2 = $('f_endcity').value;
	routeStartN = $('r_startkey').value;
	routeEndN = $('r_endkey').value;
	var rc1 = Trim(routeC1);
	var rc2 = Trim(routeC2);
	var rs = Trim(routeStartN);
	var re = Trim(routeEndN);
	var che = "";
    var i = 1 ;
    if(routeStartN=="请输入起点" || routeStartN=="" || rc1 == ""){
        che += i + "．请输入起点\n" ;
        i = i + 1 ;
    }
    if(routeEndN=="" || routeEndN=="请输入终点" || rc2 == ""){
        che += i + "．请输入终点\n" ;
        i = i + 1 ;
    }
    if(routeC1==""  || rs == ""){
        che += i + "．请选择起点城市\n" ;
        i = i + 1 ;
    }
	if(routeC1=="" || re == ""){
        che += i + "．请选择终点城市\n" ;
        i = i + 1 ;
    }
	if(i==1){
		location.href = 'routesearch.html?r,'+routeC1+','+routeC2+','+escape(routeStartN)+','+escape(routeEndN)+'';
	}else{
		alert(che);
	}
}

function around_search(){//周边搜索
	a_city = Trim($('f_city').value);
	a_center = Trim($('around_center').value);
	a_keyword = Trim($('around_keyword').value);
	a_x = Trim($('around_x').value);
	a_y = Trim($('around_y').value);
	var che = "";
    var i = 1 ;
    if(a_city=="" || a_city=="请选择城市" ){
        che += i + "．请选择城市\n" ;
        i = i + 1 ;
    }
    if(a_center=="" || a_center=="请输入中心点"){
        che += i + "．请输入中心点\n" ;
        i = i + 1 ;
    }
    if(a_keyword=="请输入关键词"  || a_keyword == ""){
        che += i + "．请输入关键词\n" ;
        i = i + 1 ;
    }
	if(i==1){
		location.href = "aroundsearch.html?a,"+a_city+","+escape(a_center)+","+a_x+","+a_y+","+escape(a_keyword)+"";
	}else{
		alert(che);
	}
}
function jumpurl(s){
	location.href = s;
}
