﻿// JScript 文件

//保存导航起始和终止点的坐标信息
var fromx = null;
var fromy = null;
var tox = null;
var toy = null;
//保存导航的起始和终止点的GUID信息
var fromEpNo = null;
var toEpNo = null;
//标记 判断选择的企业编号是'起始的'还是'终止的'
var fromOrtoFlag =null;


//选择城市，将从后台取得该城市的热门关键字!
function  SelectCity()
{

    var cityCode = document.getElementById("selectCity").value;
    var searchType = document.getElementById("selectType").value;
    //与杨靖的接口，调用地图函数将地图也进行跳转 柏玉晶 2006-3-27 
    window.frames.ifMaplite.window.setToCity(cityCode);

    var params = "SELCITY" + "|" + cityCode+"|"+searchType;
    //无刷新调用服务器
    CallTheServer(params,'');
}


//选择类别
function  SelectType()
{

    var cityCode = document.getElementById("selectCity").value;
    var searchType = document.getElementById("selectType").value;
 
    var params = "SELTYPE" + "|" + cityCode+"|"+searchType;
    //无刷新调用服务器
    CallTheServer(params,'');
}


//地图检索(POI检索)
function POISearch()
{
    //把城市代码也要传入！
    var searchKey = document.getElementById("Text_SearchKey").value;
    var cityCode = document.getElementById("selectCity").value;
    var searchType = document.getElementById("selectType").value;
    //检索类别
    //默认为第一页
    var params = "SEARCH" + "|" + searchKey + "|" + cityCode + "|"+searchType+"|" + "1";
   
    //无刷新调用服务器
    CallTheServer(params,'');
}


//地图检索(POI检索)支持道路检索
function POISearchEx()
{
    //把城市代码也要传入！
    var searchKey = document.getElementById("Text_SearchKey").value;
    //var searchRoad = document.getElementById("Text_SearchRoad").value;
    var searchRoad = "";
    var cityCode = document.getElementById("selectCity").value;
    var searchType = document.getElementById("selectType").value;
    //检索类别
    var params = "SEARCHEX" + "|" + searchKey + "|"+searchRoad+"|" + cityCode + "|"+searchType+"|" + "1";
   
    //无刷新调用服务器
    CallTheServer(params,'');
}








//无刷新回调
function ReceiveServerData(rValue)
{
  var rValueArray = null;
    rValueArray = rValue.split("|");
   
  if(rValueArray[0]=="SELCITY")
   {    //选择城市，将从后台取得该城市的热门关键字!
        Label_HotKeys.innerHTML = rValueArray[1];
   }
   else if(rValueArray[0]=="INITPAGE")
   {
   
   var time1 =  TimeDemo();
       //选择城市，将从后台取得该城市的热门关键字!
        Label_HotKeys.innerHTML = rValueArray[1];
      
        //显示光谷软件园、建筑物等...
        
        window.frames.ifMaplite.window.SetAllPOIList(rValueArray[2]);
        
        var arrayGarden = rValueArray[4].split(',');
        //显示光谷软件园POI
        
        window.frames.ifMaplite.window.setGGRJYPOILon(arrayGarden[0],arrayGarden[1],arrayGarden[2],arrayGarden[3]);
       
       var array1 = rValueArray[3].split('%');
		var k = 0;
		for(var i = 0; i < array1.length; i++)
		{
			if(array1[i] != null && array1[i].length > 0)
			{
			var array2 = array1[i].split('^');
			
			window.frames.ifMaplite.window.setBuildPOILon(array2[0],array2[1],array2[2],array2[3]);
			
			}
		} 
		
		var alist = rValueArray[5];
		
		window.frames.ifMaplite.window.setArecz(alist);
		window.frames.ifMaplite.window.reShowMap();
		
		var time2 =  TimeDemo();
		
		
		
   }
    else if(rValueArray[0]=="LOADBYCHART")
   {    //选择城市，将从后台取得该城市的热门关键字!
        Label_HotKeys.innerHTML = rValueArray[1];
       
        //显示光谷软件园、建筑物等...
        
        window.frames.ifMaplite.window.SetAllPOIList(rValueArray[2]);
        
        var arrayGarden = rValueArray[4].split(',');
        //显示光谷软件园POI
        
        window.frames.ifMaplite.window.setGGRJYPOILon(arrayGarden[0],arrayGarden[1],arrayGarden[2],arrayGarden[3]);
       
       var array1 = rValueArray[3].split('%');
		var k = 0;
		for(var i = 0; i < array1.length; i++)
		{
			if(array1[i] != null && array1[i].length > 0)
			{
			var array2 = array1[i].split('^');
			
			window.frames.ifMaplite.window.setBuildPOILon(array2[0],array2[1],array2[2],array2[3]);
			
			}
		} 
		
		window.frames.ifMaplite.window.reShowMap();
		
   }
   else if(rValueArray[0]=="SELTYPE")
   {    //选择城市，将从后台取得该城市的热门关键字!
        window.frames.ifMaplite.window.SetAllPOIList(rValueArray[1]);
        window.frames.ifMaplite.window.reShowMap();
   }
   
   
   
   
   else if(rValueArray[0]=="SEARCH")
   {
   //检索
   AroundPanoPicList.innerHTML = rValueArray[1];
   //window.frames.ifMaplite.window.setPraList(rValueArray[2]);
   
   window.frames.ifMaplite.window.setPOIList(rValueArray[2]);
   }
    else if(rValueArray[0]=="SEARCHEX")
   {
   //检索
   AroundPanoPicList.innerHTML = rValueArray[1];
   //window.frames.ifMaplite.window.setPraList(rValueArray[2]);
   
   window.frames.ifMaplite.window.setPOIList(rValueArray[2]);
   }
   
    else if(rValueArray[0]=="RECTRangeSearch")
   {
   //拉框检索
   AroundPanoPicList.innerHTML = rValueArray[1];
   //window.frames.ifMaplite.window.setPraList(rValueArray[2]);
   
   //拉框结束后，图形不跳转
   window.frames.ifMaplite.window.BackSetPOIList(rValueArray[2]);
   }
     else if(rValueArray[0]=="CircleRangeSearch")
   {
       //画圆检索
       AroundPanoPicList.innerHTML = rValueArray[1];
       //window.frames.ifMaplite.window.setPraList(rValueArray[2]);
       
       //画圆结束后，图形不跳转
       window.frames.ifMaplite.window.BackSetPOIList(rValueArray[2]);
   }
   
     else if(rValueArray[0]=="AroundSearch")
   {
       //周边检索 2006-4-19 
  
       AroundPanoPicList.innerHTML = rValueArray[1];
       //window.frames.ifMaplite.window.setPraList(rValueArray[2]);
       
       //画圆结束后，图形不跳转
       //window.frames.ifMaplite.window.BackSetPOIList(rValueArray[2]);
       //周边检索，图形跳转
       window.frames.ifMaplite.window.setPOIList(rValueArray[2]);
   }
   
   
   
     else if(rValueArray[0]=="CircleSearchTurnPage")
   {
    //检索翻页
    //只对一个具体的操作

   window.frames.ifMaplite.window.BackSetPOIList(rValueArray[2]);
   
   var temp = document.getElementById( "labelType_"+ rValueArray[3]);
    if(temp==null)
    {

    
    }
    else
    {
        temp.innerHTML = rValueArray[1];
    }
   
   }
   
   
    else if(rValueArray[0]=="RectSearchTurnPage")
   {
    //检索翻页
    //只对一个具体的操作

   window.frames.ifMaplite.window.BackSetPOIList(rValueArray[2]);
   
   var temp = document.getElementById( "labelType_"+ rValueArray[3]);
    if(temp==null)
    {
    
    }
    else
    {
        temp.innerHTML = rValueArray[1];
    }
   
   }
   
   else if(rValueArray[0]=="SEARCHTURNPAGE")
   {
    //检索翻页
    //只对一个具体的操作

   window.frames.ifMaplite.window.setPOIList(rValueArray[2]);
   
   var temp = document.getElementById( "labelType_"+ rValueArray[3]);
    if(temp==null)
    {
    
    }
    else
    {
        temp.innerHTML = rValueArray[1];
    }
   
   }
   
   else if(rValueArray[0]=="SEARCHEXTURNPAGE")
   {
    //检索翻页
    //只对一个具体的操作
  
   window.frames.ifMaplite.window.setPOIList(rValueArray[2]);
   var temp = document.getElementById( "labelType_"+ rValueArray[3]);
    if(temp==null)
    {
    
    
    }
    else
    {
        temp.innerHTML = rValueArray[1];
    }
   }
   
   else if(rValueArray[0]=="SEARCHEX_SB")
   {
   //检索    
   AroundPanoPicList.innerHTML = rValueArray[1];
   //window.frames.ifMaplite.window.setPraList(rValueArray[2]);
  
   window.frames.ifMaplite.window.setPOIList(rValueArray[2]);
   
   label_SingleInfo.innerHTML ="";
   label_Navigator.innerHTML = "";
   label_NavDesc.innerHTML = "";
   }
   else if(rValueArray[0]=="RECTRangeSearch_SB")
   {
   //拉框检索
   AroundPanoPicList.innerHTML = rValueArray[1];
   //window.frames.ifMaplite.window.setPraList(rValueArray[2]);
   
   //拉框结束后，图形不跳转
   window.frames.ifMaplite.window.BackSetPOIList(rValueArray[2]);
   
   label_SingleInfo.innerHTML = "";
   label_Navigator.innerHTML = "";
   label_NavDesc.innerHTML = "";
   }
   else if(rValueArray[0]=="CircleRangeSearch_SB")
   {
       //画圆检索
       AroundPanoPicList.innerHTML = rValueArray[1];
       //window.frames.ifMaplite.window.setPraList(rValueArray[2]);
       
       //画圆结束后，图形不跳转
       window.frames.ifMaplite.window.BackSetPOIList(rValueArray[2]);
       
       label_SingleInfo.innerHTML = "";
       label_Navigator.innerHTML = "";
       label_NavDesc.innerHTML = "";
   }
   
    else if(rValueArray[0]=="ShowSingleInfo_SB")
   {
     
       label_SingleInfo.innerHTML = rValueArray[1];
       label_Navigator.innerHTML = "";
       label_NavDesc.innerHTML = "";
       
     
   }
       else if(rValueArray[0]=="EditPoi")
   {
      
       document.all.lblShowMsg.innerHTML = rValueArray[1];   
   }
       else if(rValueArray[0]=="EMAP_SHOWREGIONCORDS")
   {
//   alert(rValueArray[1]);
//   alert(rValueArray[2]);
     window.frames.ifMaplite.window.Arealig(rValueArray[1],rValueArray[2]);   
   }
   
    else if(rValueArray[0]=="NavigatorTest")
   {
        //导航测试
        alert(rValueArray[1]);
        window.frames.ifMaplite.window.RemoveAll();
        window.frames.ifMaplite.window.PenNavpath(rValueArray[1],3);
   }
   else if(rValueArray[0]=="DrawToPath")
   {//画一条LINK测试信息
        if(rValueArray[1]!="")
        {
            window.frames.ifMaplite.window.RemoveAll();
            window.frames.ifMaplite.window.PenNavpath(rValueArray[1],3);
        }
   }
   else if(rValueArray[0]=="TwoPointsNavigator" || rValueArray[0]=="POI2PntNavigator" ||
           rValueArray[0]=="Pnt2POINavigator" || rValueArray[0]=="POI2POINavigator")
   {//两点导航、POI到POINT、POINT到POI、POI到POI的导航
        if(rValueArray[1]!="")
        {
            //绘画导航路径
            window.frames.ifMaplite.window.RemoveAll();
            window.frames.ifMaplite.window.PenNavpath(rValueArray[1],3);
        }
        if(rValueArray[2]!="")
        {
            //详细导航线路面板
            label_NavDesc.innerHTML = rValueArray[2];
        }
        if(rValueArray[3]!="")
        {
            //未能找到LINK的警告提示
            alert(rValueArray[3]);
            //清空图上的标记和路径
            window.frames.ifMaplite.window.RemoveAll();
        }
        if(rValueArray[4]!="")
        {
            //Link集合中Link上的Poi模型信息的标注
            //boyking
            
            window.frames.ifMaplite.window.BackSetOnWayPOIList(rValueArray[4]);
            
        }
   }    
   else if(rValueArray[0]=="FromHerePanel")
   {
        //构造“从这里出发”的面板
        //alert("进行中...");
        label_Navigator.innerHTML = rValueArray[1];
        label_NavDesc.innerHTML = "";
        fromOrtoFlag = "From";
   }
   else if(rValueArray[0]=="ToHerePanel")
   {
        //构造“到这里去”的面板
        //alert("进行中...");
        label_Navigator.innerHTML = rValueArray[1];
        label_NavDesc.innerHTML = "";
        fromOrtoFlag = "To";
   }
   else if(rValueArray[0]=="POIDropDownListSearch_SB")
   {
        var label_NavigatorObj = document.getElementById("label_Navigator");
        //alert(label_NavigatorObj.innerHTML);
        var lblPoiListobj = document.getElementById("lblPoiList");
        lblPoiListobj.innerHTML  = rValueArray[1];
        //lblPoiListobj.innerHTML = "<select style='width: 240px;' name='selectPoiList' id='selectPoiList'><option value='0018'  selected>武汉开目信息技术有限责任公司</option><option value='0028'>武汉立得空间信息技术发展有限公司</option></select><input id='Button_POIDropDownListNavigator' type='button' value='导航' onclick='POIDropDownList_Navigator();' />";
        //obj1.innerHTML = "<select style='width: 147px;' name='selectPoiList' id='selectPoiList'><option value='0018'  selected>武汉开目信息技术有限责任公司</option><option value='0028'>武汉立得空间信息技术发展有限公司</option></select>";
   }
  
}


/*矩形拉框检索的函数调用*/
//供杨靖调用-拉框结束时调用
//新加一个缩放级别！
function GetRect(Minlon,Minlat,Maxlon,Maxlat,level)
{
   //POI矩形框范围检索
   //POIRectRangeSearch(Minlon,Minlat,Maxlon,Maxlat,level);
   
   //拉框检索供软件基地电子地图使用
   POIRectRangeSearch_SB(Minlon,Minlat,Maxlon,Maxlat,level);
}


//POI矩形框范围检索
function POIRectRangeSearch(lonMin,latMin,lonMax,latMax,level)
{
    //先不用传入类别，全部都检索把！
    //默认为第一页
 
    var searchType = document.getElementById("selectType").value;
    
    
    var params = "RECTRangeSearch" + "|" + lonMin + "|" + latMin + "|" + lonMax + "|" + latMax + "|"+level+"|" +searchType+"|"+ "1";
    //无刷新调用服务器
    CallTheServer(params,'');
}



/*画圆检索的函数调用*/
//供杨靖调用-画圆结束时调用
function GetRou(centlon,cetlat,lenlon,level)
{
   //画圆检索供软件基地电子地图使用
   POICircleRangeSearch_SB(centlon,cetlat,lenlon,level);
}


//显示单个POI信息
function ShowSinglePoiInfo(parm)
{
     var rValueArray = null;
    rValueArray = parm.split(",");
 
    try
    {   
        GetValue(parm);
        
//        alert(parm);
//        
//        alert(rValueArray[17]);
    }
    catch(e)
    {

    }
 
//    if(rValueArray[16]=="光谷软件园")
//        rValueArray[9] = "../Maplite/fullscreenmap.swf?ep_code="+rValueArray[2];
        
    
 
    window.frames.ifMaplite.window.setPOILon(rValueArray[0],rValueArray[1],rValueArray[2],rValueArray[3],rValueArray[4],rValueArray[5],rValueArray[6],rValueArray[7],rValueArray[8],rValueArray[9]);
  
    //显示单个POI信息Ex(供杨靖调用)
    ShowSinglePoiInfoEx(rValueArray[10]);
    
    
//     var cityCode = document.getElementById("selectCity").value;
//    var params = "ShowSingleInfo_SB" + "|" +cityCode+"|"+ rValueArray[10];
//    alert(params);
//    //无刷新调用服务器
//    CallTheServer(params,'');
}


//显示单个POI信息Ex(供杨靖调用)
function ShowSinglePoiInfoEx(epCode)
{
    
    var cityCode = document.getElementById("selectCity").value;
    var params = "ShowSingleInfo_SB" + "|" +cityCode+"|"+ epCode;
    
    //无刷新调用服务器
    CallTheServer(params,'');
}


//POI检索翻页
function POISearchTurnPage(searchKey, cityCode, poitype,pageId)
{
    var params = "SEARCHTURNPAGE" + "|" + searchKey + "|" + cityCode + "|"+poitype + "|"+ pageId ;
    //无刷新调用服务器
   
    CallTheServer(params,'');
}


//POI检索翻页（带路径检索功能）
function POISearchExTurnPage(searchKey,RoadKey, cityCode, poitype,pageId)
{
    var params = "SEARCHEXTURNPAGE" + "|" + searchKey + "|" +RoadKey+"|"+ cityCode + "|"+poitype + "|"+ pageId ;
    //无刷新调用服务器
   
   
    CallTheServer(params,'');
}
 

//矩形拉框翻页！
function POIRectSearchTurnPage(lonMin,latMin,lonMax,latMax, cityCode, poitype,pageId)
{
    
 var params = "RectSearchTurnPage" + "|" + lonMin + "|" +latMin + "|"+lonMax + "|"+latMax + "|"+ cityCode + "|"+poitype + "|"+ pageId ;
    //无刷新调用服务器
   
   
    CallTheServer(params,'');
}





//POI画圆范围检索
function POICircleRangeSearch(centlon,cetlat,lenlon,level)
{
    //先不用传入类别，全部都检索把！
    var searchType = document.getElementById("selectType").value;
    
       var params = "CircleRangeSearch" + "|" + centlon + "|" + cetlat + "|" + lenlon + "|" +level+"|" +searchType+"|"+ "1";
       
    //无刷新调用服务器
    CallTheServer(params,'');
}


//画圆翻页！
function POICircleSearchTurnPage(centlon,cetlat,lenlon, cityCode, poitype,pageId)
{
    
 var params = "CircleSearchTurnPage" + "|" + centlon + "|" + cetlat + "|" + lenlon + "|"+ cityCode + "|"+poitype + "|"+ pageId ;
    //无刷新调用服务器
  
    CallTheServer(params,'');
}



//与杨靖的接口函数
function FindCirc(poiid,pioname,lon,lat)
{


POIAroundSearch(lon,lat);
}


//POI周边检索
//不关多少级别，都进行检索！
function POIAroundSearch(centlon,cetlat)
{
    //先不用传入类别，全部都检索把！
    var searchType = document.getElementById("selectType").value;
    var selectSearchRadius =document.getElementById("selectSearchRadius").value;
      //周边检索半径,米->度(1秒等于30米)
    var  dRadius = selectSearchRadius * 1.0 / 3600 / 30;
    
    //级别不进行判断
       var params = "AroundSearch" + "|" + centlon + "|" + cetlat + "|" + dRadius + "|" +"13"+"|" +searchType+"|"+ "1";
       
    //无刷新调用服务器
    CallTheServer(params,'');
}





function POIFrom(poiid,pioname)
{

}

function POITo(poiid,pioname)
{

}






//地图检索(POI检索)支持道路检索(武汉软件基地电子地图使用)
function POISearchEx_SB()
{
    //把城市代码也要传入！
    var searchKey = document.getElementById("Text_SearchKey").value;
    var searchRoad = document.getElementById("Text_SearchRoad").value;
    var cityCode = document.getElementById("selectCity").value;
    var searchType = document.getElementById("selectType").value;
    //软件企业类别
    var softwareType  = document.getElementById("selectSoftwareType").value;
    //软件企业所在区域
    var softwareRegion  = document.getElementById("selectSoftwareRegion").value;
    
    
    //检索类别    var params = "SEARCHEX_SB" + "|" + searchKey + "|"+searchRoad+"|" + cityCode + "|"+searchType+"|"+softwareType+"|" +softwareRegion+"|"+ "1";
   
   
   //检索用户提示
   AroundPanoPicList.innerHTML = "<font color=red>正在检索...</font>";
   
    
    //无刷新调用服务器
    CallTheServer(params,'');
}



//关键字检索出POI的DROPDOWNLIST，供路径导航使用(从这里出发、到这里去)(武汉软件基地电子地图使用)
function POIDropDownListSearch_SB()
{
    //把城市代码也要传入！
    var searchKey = document.getElementById("Text_POIDropDownList").value;
    var searchRoad = "";
    var cityCode = document.getElementById("selectCity").value;
    var searchType = document.getElementById("selectType").value;
    //软件企业类别
    var softwareType  = document.getElementById("selectSoftwareType").value;
    //软件企业所在区域    var softwareRegion  = document.getElementById("selectSoftwareRegion").value;
    
    
    //检索类别    var params = "POIDropDownListSearch_SB" + "|" + searchKey + "|"+searchRoad+"|" + cityCode + "|"+searchType+"|"+softwareType+"|" +softwareRegion+"|"+ "1";
  
   
    
    //无刷新调用服务器
    CallTheServer(params,'');
}




//地图检索(POI检索)支持道路检索(武汉软件基地电子地图使用)-翻页
function POISearchEx_SB_TurnPage(searchKey,RoadKey, cityCode, poitype,softwareType,softwareRegion,pageId)
{
    var params = "SEARCHEX_SB_TURNPAGE" + "|" + searchKey + "|" +RoadKey+"|"+ cityCode + "|"+poitype + "|"+ +softwareType+"|" +softwareRegion+"|"+ pageId;
    
    //无刷新调用服务器
    CallTheServer(params,'');
}



//POI矩形框范围检索(软件基地电子地图使用)
function POIRectRangeSearch_SB(lonMin,latMin,lonMax,latMax,level)
{
    //先不用传入类别，全部都检索把！
    //默认为第一页
 
    var searchType = document.getElementById("selectType").value;
    
    
      //软件企业类别
    var softwareType  = document.getElementById("selectSoftwareType").value;
    //软件企业所在区域
    var softwareRegion  = document.getElementById("selectSoftwareRegion").value;
    
    
    
    var params = "RECTRangeSearch_SB" + "|" + lonMin + "|" + latMin + "|" + lonMax + "|" + latMax + "|"+level+"|" +searchType+"|" +softwareType+"|"+ softwareRegion+"|"+ "1";
    //无刷新调用服务器
    CallTheServer(params,'');
}


//矩形拉框翻页(软件基地电子地图使用)
function POIRectRangeSearch_SB_TurnPage(lonMin,latMin,lonMax,latMax, level,cityCode, poitype,softwareType,softwareRegion,pageId)
{
    
 var params = "RECTRangeSearch_SB" + "|" + lonMin + "|" +latMin + "|"+lonMax + "|"+latMax + "|"+ level + "|"+poitype + "|"+ softwareType+  "|"+   softwareRegion+ "|"+ pageId ;
    //无刷新调用服务器
  
   
    CallTheServer(params,'');
}



//POI画圆范围检索(软件基地电子地图使用)
function POICircleRangeSearch_SB(centlon,cetlat,lenlon,level)
{
    //先不用传入类别，全部都检索把！
    var searchType = document.getElementById("selectType").value;
    
        //软件企业类别
    var softwareType  = document.getElementById("selectSoftwareType").value;
    //软件企业所在区域
    var softwareRegion  = document.getElementById("selectSoftwareRegion").value;
    
    
    var params = "CircleRangeSearch_SB" + "|" + centlon + "|" + cetlat + "|" + lenlon + "|" +level+"|" +searchType+"|" +softwareType+"|"+ softwareRegion+"|"+ "1";
   
       
    //无刷新调用服务器
    CallTheServer(params,'');
}



//画圆翻页！
function POICircleSearch_SB_TurnPage(centlon,cetlat,lenlon, level,cityCode, poitype,softwareType,softwareRegion,pageId)
{
 var params = "CircleRangeSearch_SB" + "|" + centlon + "|" + cetlat + "|" + lenlon +  "|"+ level + "|"+poitype + "|"+ softwareType+  "|"+   softwareRegion+ "|"+ pageId ;
    //无刷新调用服务器
    CallTheServer(params,'');
}




//地图检索(POI检索)(点击热门关键字，直接检索)(软件基地电子地图使用)
function POIHotKeysSearch(searchKey)
{
//    //关键字检索框改为当前的热门关键字
//    document.getElementById("Text_SearchKey").value =searchKey;
//        
//     //把城市代码也要传入！
//    var searchKey = document.getElementById("Text_SearchKey").value;
//    var cityCode = document.getElementById("selectCity").value;
//    var searchType = document.getElementById("selectType").value;
//    //检索类别
//    //默认为第一页
//    var params = "SEARCH" + "|" + searchKey + "|" + cityCode + "|"+searchType+"|" + "1";
//   
//    //无刷新调用服务器
//    CallTheServer(params,'');
    
    
    
       //关键字检索框改为当前的热门关键字
    document.getElementById("Text_SearchKey").value =searchKey;
 
   
     //把城市代码也要传入！
    var searchKey = document.getElementById("Text_SearchKey").value;
    var searchRoad = "";
    var cityCode = document.getElementById("selectCity").value;
    var searchType = document.getElementById("selectType").value;
    //默认热门关键字检索时，软件企业类别和软件企业所在区都是使用'全部'
    //软件企业类别
    //var softwareType  = document.getElementById("selectSoftwareType").value;
    var softwareType = "-1";
    //软件企业所在区域
    //var softwareRegion  = document.getElementById("selectSoftwareRegion").value;
    var softwareRegion= "-1";
    
    
    //检索类别
    var params = "SEARCHEX_SB" + "|" + searchKey + "|"+searchRoad+"|" + cityCode + "|"+searchType+"|"+softwareType+"|" +softwareRegion+"|"+ "1";
   
  
    //无刷新调用服务器
    CallTheServer(params,'');
   
}


//添加Poi
//function Poi_Add(centlon,cetlat,lenlon, level,cityCode, poitype,softwareType,softwareRegion,pageId)
//{
// var params = "CircleRangeSearch_SB" + "|" + centlon + "|" + cetlat + "|" + lenlon +  "|"+ level + "|"+poitype + "|"+ softwareType+  "|"+   softwareRegion+ "|"+ pageId ;
//    //无刷新调用服务器
//    CallTheServer(params,'');
//}




//从WS1更新企业表(武汉软件基地电子地图使用)
function UpdateFromWS1()
{
    var cityCode = document.getElementById("selectCity").value;
    var params = "UpdateFromWS1" + "|" +cityCode;
    //无刷新调用服务器
    CallTheServer(params,'');
}

//从WS2更新企业表(武汉软件基地电子地图使用)
function UpdateFromWS2()
{
     var cityCode = document.getElementById("selectCity").value;
    var params = "UpdateFromWS2" + "|" +cityCode;
    //无刷新调用服务器
    CallTheServer(params,'');
}


function CheckValue(Operate)
{
   var flag = true;
   
   var Msg = "";
   
   if(document.all.txtPOINTX.value == "" || document.all.txtPOINTX.value == "")
   {
       flag = false;
       
       Msg += "请选择企业坐标!\n"
   }
   
   if(document.all.txtName.value == "")
   {
       flag = false;
       
       Msg += "请输入单位名称!\n"
   }
   
   if(document.all.txtCorpNo.value == "")
   {
       flag = false;
       
       Msg += "请输入企业编号!\n"
   }
   
   if(!flag)
   {
       alert(Msg);
   }
   else
   {
       EditPoi(Operate);
   }
   
   return flag;
}

function EditPoi(Operate)
{  
    document.all.lblShowMsg.innerHTML = "数据操作中...";
    
    //alert("x:"+document.all.txtPOINTX.value+" y:"+ document.all.txtPOINTY.value);
    
    var strcityCode = "027";//1
    
    var Type = "Insert";//2
    
    if(Operate == "Insert")
        Type = "Insert";
    
    if(Operate == "Update")
        Type = "Update";
    
    if(Operate == "Delete")
        Type = "Delete";
                 
    var strPoiID = document.all.txtGuid.value;//3
    
    var strNameValue = document.all.txtName.value;//4
    
    var strCorpNo =  document.all.txtCorpNo.value;//5
    
    var strCorpProductValue = document.all.txtCorpProductValue.value;//6
    
    var strCorpRoadName = document.all.txtCorpRoadName.value;//7
    
    var strAddressValue = document.all.txtHAO.value;//8
    
    var strWebSite = document.all.txtWEBSITE.value;//9
    
    var strMemo = document.all.txtMEMO.value;//10
     
    var strLongitudeValue = document.all.txtPOINTX.value;//11
      
    var strLatitudeValue = document.all.txtPOINTY.value;//12
    
    var strCorpType = document.getElementById("drpCorpType").value;//13
    
    var strCorpRegion = document.getElementById("drpCorpRegion").value;//14
    
    var strTableName = "geopoi_softbase";//15
    
    var strOrgCorpNo = document.all.txtOrgCorpNo.value; //16 原始企业编号
    
    var strCorpBuilding = document.all.txtCorpBuilding.value;//17
    
    var strTelNumber = document.all.txtTel.value;//18
    
//    for(i=0;i<document.all.drpCorpType.length;i++)
//    {
//       if(document.all.drpCorpType[i].selected)
//       {
//           strCorpType = document.all.drpCorpType[i].value;
//       }
//    }
//    
//    for(j=0;j<document.all.drpCorpRegion.length;j++)
//    {
//       if(document.all.drpCorpRegion[j].selected)
//       {
//           strCorpRegion = document.all.drpCorpRegion[j].value;
//       }
//    }
    
    //检索类别
    var params = "EditPoi" + "|" + strcityCode+ "|" + Type + "|"+strPoiID+"|" + strNameValue + "|"+strCorpNo+"|"+strCorpProductValue+"|" +strCorpRoadName+"|"+strAddressValue+"|"+strWebSite+"|"+strMemo+"|"+strLongitudeValue+"|"+strLatitudeValue+"|"+strCorpType+"|"+strCorpRegion+"|"+strTableName+"|"+strOrgCorpNo+"|"+strCorpBuilding+"|"+strTelNumber;
   
    //alert(params);
    
    //无刷新调用服务器
    //alert(params);
    
    CallTheServer(params,'');
}



//初始化页面-onload时调用(加载全部武汉的软件企业信息)
function  InitPage()
{
    //输入关键字编辑框获得焦点

   document.all("Text_SearchKey").focus();
    
    var cityCode = document.getElementById("selectCity").value;
    var searchType = document.getElementById("selectType").value;
    //与杨靖的接口，调用地图函数将地图也进行跳转 柏玉晶 2006-3-27 
    window.frames.ifMaplite.window.setToCity(cityCode);

    var params = "INITPAGE" + "|" + cityCode+"|"+searchType;
//    alert(params);
    //无刷新调用服务器
    CallTheServer(params,'');
}


//通过杨靖的图表来加载区域或行业的企业信息
function  LoadCorpInfoByRegionType(corpType,corpRegion)
{
    var cityCode = document.getElementById("selectCity").value;
    var searchType = document.getElementById("selectType").value;


    var params = "LOADBYCHART" + "|" + cityCode+"|"+searchType+"|"+corpType+"|"+corpRegion;
    //无刷新调用服务器
    CallTheServer(params,'');
}

//查看某个区域的企业信息(供杨靖的图表调用)
//传入中文名:武昌区
function GetListByArea(area)
{
    LoadCorpInfoByRegionType("全部",area);
}

//查看某个行业的企业信息(供杨靖的图表调用)
//传入中文名:3S
function GetListByCall(Call)
{
    LoadCorpInfoByRegionType(Call,"全部");
}


//测试更新"企业名称的汉语拼音首字母"
function  UPDATE_NameEngCaptain()
{
    var cityCode = document.getElementById("selectCity").value;
    var searchType = document.getElementById("selectType").value;


    var params = "UPDATE_NameEngCaptain" + "|" + cityCode+"|"+searchType;
    //无刷新调用服务器
    CallTheServer(params,'');
}


//测试更新"GUID和企业名称的汉语拼音首字母"
function  UPDATE_GUIDNameEngCaptain()
{
    var cityCode = document.getElementById("selectCity").value;
    var searchType = document.getElementById("selectType").value;


    var params = "UPDATE_GUIDNameEngCaptain" + "|" + cityCode+"|"+searchType;
    //无刷新调用服务器
    CallTheServer(params,'');
}

   function TimeDemo(){
   var d, s = "当前本地时间为: ";
   var c = ":";
   d = new Date();
   s += d.getHours() + c;
   s += d.getMinutes() + c;
   s += d.getSeconds() + c;
   s += d.getMilliseconds();
   return(s);
}



//给杨靖的接口（通过区域名称取得坐标集合）
function GetCorListByArea(area)
{    
    //检索类别    var params = "EMAP_SHOWREGIONCORDS" + "|" + area ;
//    alert(params);
    //无刷新调用服务器
    CallTheServer(params,'');
}


function GetFromNavPnt(lon,lat)
{

//    alert("看LINK信息");
//    var params = "DrawToPath" + "|" + lon+"|"+lat ;
//    //无刷新调用服务器
//    CallTheServer(params,'');

   var params = "Pnt2POINavigator" + "|" + lon+"|"+lat+"|"+toEpNo ;
    //无刷新调用服务器
    CallTheServer(params,'');
    
}

function GetToNavPnt(lon,lat)
{
    //alert("to  x:"+lon+";y:"+lat);
    //alert("从POI->POINT导航");
    var params = "POI2PntNavigator" + "|" + lon+"|"+lat+"|"+fromEpNo ;
    //无刷新调用服务器
    CallTheServer(params,'');
    
    
}



//两点导航（获取第一点）
function GetNavPnt1(lon,lat)
{
    fromx = lon;
    fromy = lat;
}

//两点导航(获取第二点)
function GetNavPnt2(lon,lat)
{
    tox = lon;
    toy = lat;
    //两点导航
    var params = "TwoPointsNavigator"+"|"+fromx  +"|"+fromy+"|"+tox+"|"+toy;
    //alert(params);
    CallTheServer(params,'');
}


//从这里出发
function FromHere(epNo)
{
    fromEpNo = epNo;
    var params = "FromHerePanel"+"|";
    CallTheServer(params,''); 
}

//到这里去
function ToHere(epNo)
{
    toEpNo = epNo;
    
    var params = "ToHerePanel"+"|";
    CallTheServer(params,''); 
    
}



function POIDropDownList_Navigator()
{
    if(fromOrtoFlag == "From")
    {
       
        toEpNo = document.getElementById("selectPoiList").value;
    }
    else
    {
     
       fromEpNo = document.getElementById("selectPoiList").value;
    }
    
    var params = "POI2POINavigator" + "|" +fromEpNo+"|"+ toEpNo;
    //无刷新调用服务器
    CallTheServer(params,'');
}




//设置经纬度
function SetLonLat(lon,lat)
{
    window.frames.ifMaplite.window.maplet.setCenter(lat,lon);
    //window.frames.ifMaplite.window.maplet.setZoomLevel('12');
}
