﻿var selHangye = "餐饮服务" ;

//指定搜索
function search2( unname )
{
	hiddenAll();//隐藏显示区域
	
	//QNS.cityname = "0631";
	//QNS.keyword = unname ;
	//QN_local_search();
	
    QN_hangye_search( unname , selHangye) ;
}

//公交线路查询
function search3( busline )
{
	hiddenAll();//隐藏显示区域
	
	QNbus.cityname = "0534";

	QN_busline_search(busline);

}

//定位到指定地区
function moveCity( y , x,zoom )
{
	if(zoom==null)
		zoom=12;
     mapObj.setCenterByLatLng(y, x) ;
	 mapObj.setZoomLevel(zoom);
}

//隐藏搜索结果
function hiddenResult()
{
     $('M_search_list').style.display = "none";
	 $('M_Buschoosediv').style.display = "none";
	 $('M_bus_list').style.display = "none";
	 $('M_busline_list').style.display = "none";
	 $('M_drivechooseDIV').style.display = "none";
	 $('M_drive_list').style.display = "none";
	 $('M_periferal_list').style.display = "none";
}

//隐藏  行业内容table
function hiddenTable()
{
   $('tblhy').style.display = "none";	
   $('tblpage').style.display = "none";	
}

//显示 行内容业table
function showTable( selhy )
{
   selHangye = selhy ;
   
   hiddenResult();
   
   $('hangye').style.width = "40px" ;
   
   $('canyin').style.background = "url(images/canyin.gif) no-repeat" ;
   $('jingdian').style.background = "url(images/jingdian.gif) no-repeat" ;
   $('binguan').style.background = "url(images/binguan.gif) no-repeat" ;
   $('fangchan').style.background = "url(images/fangchan.gif) no-repeat" ;
   $('qiche').style.background = "url(images/qiche.gif) no-repeat" ;
   $('xiuxian').style.background = "url(images/xiuxian.gif) no-repeat" ;
   $('yiliao').style.background = "url(images/yiliao.gif) no-repeat" ;
   $('jiaoyu').style.background = "url(images/jiaoyu.gif) no-repeat" ;
   $('shoupiao').style.background = "url(images/shoupiao.gif) no-repeat" ;
   $('gouwu').style.background = "url(images/gouwu.gif) no-repeat" ;
   $('qiye').style.background = "url(images/qiye.gif) no-repeat" ;
   
   $('tblhy').style.display = "";	
   checkXml();
   DisplayPage();
}

//隐藏  行业
function hiddenHy()
{
   $('hangye').style.width = "12px" ;
   
   $('canyin').style.background = "" ;
   $('jingdian').style.background = "" ;
   $('binguan').style.background = "" ;
   $('fangchan').style.background = "" ;
   $('qiche').style.background = "" ;
   $('xiuxian').style.background = "" ;
   $('yiliao').style.background = "" ;
   $('jiaoyu').style.background = "" ;
   $('shoupiao').style.background = "" ;
   $('gouwu').style.background = "" ;
   $('qiye').style.background = "" ;
}

//隐藏所有 行业、搜索结果
function hiddenAll()
{
	hiddenHy(); ///隐藏行业
	hiddenTable(); //隐藏行业内容table
	hiddenResult();//隐藏搜索结果
}


//选择城市
var staticC = "" ;
var inputNa = "" ;
function showFloatdiv(temp,naid){
	staticC = temp;
	inputNa = naid;
	
	switch(temp){
		case 'as'://周边搜索
			citylistBox();
		break;
		case 's'://周边搜索
		citylistBox();
		break;
		case 'e'://驾车线路
		citylistBox();
		break;
		default :
			buscityBox();
	}
}

function setCurrentCity(o){
	setCookie("mapabccityname",o);
	$(inputNa).value = o;
	closeWindow('citylist');
}

//公交车
function busList()
{
	for( i=1 ; i<31; i++ )
	{
		if( i == 1 )
		   document.write("<div>");
		else if( i%20 == 1 )
		   document.write("</div><div>");
		   
		if( i <= 10 )
		   document.write("&nbsp;&nbsp;");
		   
		document.write("&nbsp;&nbsp;<a href='javascript:void(0)' onclick='search3("+ i +")'>"+ i +"路</a>");
		
		if( i%20 == 0 )
		   document.write("<br>");
	}
	
	document.write("</div>");
	//document.write("<div>");
	//for( i=101 ; i<120; i++ )
	//{
	 //  if( i == 102 )
	 //     continue ;
	//	else  
	 //     document.write("&nbsp;&nbsp;<a href='javascript:void(0)' onclick='search3("+ i +")'>"+ i +"路</a>");
	//}
	//document.write("</div>");
}

//黄金标注
var poiid,poiname,poiaddress,poitel,poitype,poimatch,poicitycode,poicityname,poix,poiy;
poiid = 'B000A81C5B';
poiname = '威海信息港';
poiaddress = '新威路40号';
poitel = '0631-5279001';
poitype = '知名企业';
poicitycode = '0631';
poicityname = '威海';
poix = 'JJKMQMHVLRDHHP';
poiy = 'LOGTPRKWJDLLH';

function drawAlonePoint()
{
	var centerPointStyle = new MStyle();
	centerPointStyle.lineColor = 0xff230b;
	centerPointStyle.lineSize = 2;
	centerPointStyle.fillColor = 0xffffff;
	centerPointStyle.fillOpacity = 100;
	centerPointStyle.labelColor = 0xffffff;
	centerPointStyle.showTip = true ;//false;

	centerPointStyle.labels = poiname;
	centerPointStyle.isShowLabels = true;
	centerPointStyle.isShowTip = false;
	centerPointStyle.textSize = 13;
	centerPointStyle.isLabelsFontBold = true;
	centerPointStyle.backgroundColor = 0xff230b;
	centerPointStyle.isLabelsBackground = true;
	centerPointStyle.textColor = 0xffffff;
	sContent = "<font color='#000000'><b>"+poiname+ "</b>";
	sContent += "<br>地址：<font color='#000000'>"+poiaddress+ "";
	sContent += "<br>电话：<font color='#000000'>"+poitel+ "<br>";
	centerPointStyle.textContent = sContent;
	centerPoint = new MCustomPointOverlay(new MLatLng(poiy,poix), "http://www.mapabc.com/images/center.swf", centerPointStyle, "1000");
	mapObj.addOverlay(centerPoint, true);
}

function drawTempPoint()
{
	var pointStyle = new MStyle();
	pointStyle.showTip = false;
	
	mapObj.addOverlay(new MCustomPointOverlay(new MLatLng('LOGTVRJQQLHLL','JJKMPTIRMTHLDH'), "images/qzh.jpg",pointStyle,"1001"), false);
}