﻿function setTab(n){
    for(i=1;i<=3;i++){
    
        var menu=document.getElementById("b"+i);
        var tabmenu = document.getElementById("tab"+i);
        menu.style.display = "none";
        tabmenu.className = "noselect";
    }
    document.getElementById("b"+n).style.display = "block";
    document.getElementById("tab"+n).className = "selected";
    if( n == 1 )
    {
        if(document.getElementById("divx")!=null)
        {
            document.getElementById("divx").style.display = "block";
            document.getElementById("divz").style.display = "none";
        }
    }
    else
    {
        if(document.getElementById("divx")!=null)
        {
            document.getElementById("divx").style.display = "none";
            document.getElementById("divz").style.display = "block";
        }
    }
    }

    function changetext(obj)
    {
	    obj.value = "";
	    obj.style.color = "#000";
    }
    
    
function cha1(cityp,keyword){

    keyword = keyword.replace(/\s+/g,"");
    if( keyword == "" || keyword =="请输入公交站点名称" || keyword =="请输入公交线路名称" )
    {
        return false;
    }
	var link = "http://";
	cityp = cityp.replace(/\s+/g,"");
	if(cityp!="")
	  jumpgo = cityp +".bus.58.com";
	 else
	  jumpgo = "bj.bus.58.com"; 

	link += jumpgo +"/z_"+keyword +"/";

	window.location.href = link;
	return false;
}

function cha2(cityp,keyword){

    keyword = keyword.replace(/\s+/g,"");
    if( keyword == "" || keyword =="请输入公交站点名称" || keyword =="请输入公交线路名称" )
    {
        return false;
    }
    
	var link = "http://";
    cityp = cityp.replace(/\s+/g,"");
	if(cityp!="")
	  jumpgo = cityp +".bus.58.com";
	 else
	  jumpgo = "bj.bus.58.com"; 

	link += jumpgo + "/x_"+keyword +"/";

	window.location.href = link;
	return false;
}

function cha3(cityp,start,end){
    start = start.replace(/\s+/g,"");
    end = end.replace(/\s+/g,"");
    if( start == "" || end == "")
    {
        return false;
    }
    var link = "http://";
    	cityp = cityp.replace(/\s+/g,"");
	if(cityp!="")
	  jumpgo = cityp +".bus.58.com";
	 else
	  jumpgo = "bj.bus.58.com"; 

	link += jumpgo + "/h_"+start+'_'+end+"/";
	window.location.href = link;
	return false;
}

function setstart(s){
    document.getElementById("ctl00_ContentPlaceHolder1_ZhanInfo_ctl00_hcbar_ctl00_q2").value = s;
}
function setend(e){
    document.getElementById("ctl00_ContentPlaceHolder1_ZhanInfo_ctl00_hcbar_ctl00_q3").value = e;
}
function setstart1(s){
    document.getElementById("ctl00_ContentPlaceHolder1_ZhanInfo_ctl00_ZhanInfo_ctl00_q2").value = s;
}
function setend1(e){
    document.getElementById("ctl00_ContentPlaceHolder1_ZhanInfo_ctl00_ZhanInfo_ctl00_q3").value = e;
}