﻿// JScript 文件


var MapUrl=sProjectName+"MapIndex.aspx";
var sQType=1;
function window_onload() {
   document.documentElement.scrollTop=100;
    document.getElementById("MapObj").src=MapUrl+"?sType="+sType+"&sValue="+escape(sValue);
}
function OpenMap(type)
{

    switch(type)
    {
        case 1:
            
            var sDwmc=document.all["txtDwmc"].value+","+document.getElementById(CurMapDq).value;
        
            if(sDwmc!="")
            {
                window.open("Map.aspx?sType=1&sValue="+escape(sDwmc))
            }
        break;
        case 2:
            var sValue1=document.all["txtGjStar"].value;
            var sValue2=document.all["txtGjEnd"].value;
            if(sValue1=="")
            {
                alert("请输入起点位置!");
                return;
            }
            if(sValue2=="")
            {
                alert("请输入终点位置!");
                return;
            }
            var sValue=escape(sValue1)+"|"+escape(sValue2);
            window.open("Map.aspx?sType=3&sValue="+sValue);          
        break;
        case 3:
            var sValue1=document.all["txtStart"].value;
            var sValue2=document.all["txtEnd"].value;
            if(sValue1=="")
            {
                alert("请输入起点位置!");
                return;
            }
            if(sValue2=="")
            {
                alert("请输入终点位置!");
                return;
            }
            var sValue=escape(sValue1)+"|"+escape(sValue2);
            window.open("Map.aspx?sType=4&sValue="+sValue,"MapPage");           
        break;
        case 4:
            var sValue=document.all["txtJdmc"].value;
            window.open("Map/MapIndex.aspx?MapType=4&jdcx=" + sValue);
        break;
        case 5:
            var sValue=document.all["txtGjzd"].value;
            if(sValue=="")
            {
                alert("请输入站点名称!");
                return;
            }
            window.open("Map.aspx?sType=32&sValue="+escape(sValue));
        break;
        case 6:
            var sValue=document.all["txtGjxl"].value;
            if(sValue=="")
            {
                alert("请输入线路名称!");
                return ;
            }
            window.open("Map.aspx?sType=33&sValue="+escape(sValue));
        break;

        
    }
}

//
//左边搜索
//
function TabBoard(type)
{
    document.all["gjcx"].style.display="none";
    document.all["gjzd"].style.display="none";
    document.all["gjxl"].style.display="none";
    document.all["jclx"].style.display="none";
    document.all["jdcx"].style.display="none";
    sQType=type;
    switch(type)
    {
        case 1:
            document.all["gjcx"].style.display="";
        break;
        case 2:
            document.all["gjzd"].style.display="";
        break;
        case 3:
            document.all["gjxl"].style.display="";  
        break;
        case 4:
            document.all["jclx"].style.display="";
        break;
        case 5:
            document.all["jdcx"].style.display="";
        break;
    }
}
//
//右边搜索
//
function MapTabBorard(type)
{
    document.all["znss"].style.display="none";
    document.all["jlzd"].style.display="none";
    document.all["syqzd"].style.display="none";

    sQType=type;
    switch(type)
    {
        case 1:
            document.all["znss"].style.display="";
        break;
        case 2:
            document.all["jlzd"].style.display="";
        break;
        case 3:
            document.all["syqzd"].style.display="";
            break;
    }
}
////地图搜索
//function MapSS()
//{
//    
//}
////驾车线路
//function Jcxl()
//{
//    
//}
function EnterSubmit()
{
//    if(event.keyCode==13)
//    {
//       
//       if(sQType==1)
//       {
//            document.all["btndtss"].click();
//            
//       } 
//       else if(sQType==3)
//       {
//            document.all["btnjclx"].click();
//       }
//    }
}
document.onkeydown=EnterSubmit;
function JdSS()
{
    document.frames[1].location=MapUrl+"?sType="+sType+"&sValue="+escape(document.all["txtName"].value); 
}
function DtSS()
{
    document.frames[1].location=MapUrl+"?sType="+sType+"&sValue="+escape(document.all["txtName"].value)+","+escape(document.all["ctl00$ContentPlaceHolder1$Drop1"].value); 
    //alert(document.frames[0].location);
}
function ShowTv()
{
    document.frames[1].location=MapUrl+"?sType=100";
}
function ShowPolice()
{
    document.frames[1].location=MapUrl+"?sType=101";
}
function ShowGjhc()
{
    document.frames[1].location=MapUrl+"?sType=25";
}
function ShowGjxl()
{
  document.frames[1].location=MapUrl+"?sType=24";   
}
