
function ChangeSearchType(where, index){
/*	var arr='';
	if(where=='home'){
		arr = $('searchTab').getElementsByTagName('LI');
		$('tabFootPic').className = 'tabFootPic' + index;	//首页下面的红箭头
		for(var i=0;i<arr.length;i++)
		{
			arr[i].className = 'TabNormal';
		}
		if(index!=1) arr[0].className = 'TabNormal2';
	}else{
		arr = $('searchTab').getElementsByTagName('UL')[0].getElementsByTagName('a');
		for(var i=0;i<arr.length;i++)
		{
			Element.removeClassName(arr[i],'TabFocus');
		}		
	}	
	arr[index-1].className = 'TabFocus';	
*/	for(var j=1;j<=5;j++){
		if(j == index){
			setElement('searchCond'+j, 'show');
		}else{
			setElement('searchCond'+j, 'hide');
		}
	}
//	$("AText").innerHTML = "";
}




function SearchTrainNumber(){
	tn = $F("trainNumber");
	if(tn != "" && tn.length >= 2){
		location.href = webRootURL+"/trains/searchTN.asp?trainNumber="+escape(tn);
	}else{
		$("AText").innerHTML = "请输入正确的车次。";
	}
}


function SearchStationBuy(){
	cF = $F("cityFromBuy");
	cT = $F("cityToBuy");
	dt = $F("dtLeftBuy");
	tn = $F("trainNumberBuy");
	sc = $F("seatClassBuy")
	
	
	if(cF == "" || cT == ""){
			return $("AText").innerHTML = "请输入出发站名称与到达站名称";
	}else{
		if(tn != ""){
			if(!IsTrainNumber(tn)){
				return $("AText").innerHTML = "请输入正确的车次";
			}
		}
	}
	
	var strUrl;
	strUrl = webRootURL+"/buy/search.asp?cityFrom="+escape(cF)+"&cityTo="+escape(cT)+"&dtLeft="+dt+"&trainNumber="+tn+"&seatClass="+escape(sc);
	//alert(strUrl);
	location.href = strUrl;
}

function SearchStationSell(){
	cF = $F("cityFromSell");
	cT = $F("cityToSell");
	dt = $F("dtLeftSell");
	tn = $F("trainNumberSell");
	sc = $F("seatClassSell")
	
	
	if(cF == "" || cT == ""){
			return $("AText").innerHTML = "请输入出发站名称与到达站名称";
	}else{
		if(tn != ""){
			if(!IsTrainNumber(tn)){
				return $("AText").innerHTML = "请输入正确的车次";
			}
		}
	}
	
	var strUrl;
	strUrl = webRootURL+"/sell/search.asp?cityFrom="+escape(cF)+"&cityTo="+escape(cT)+"&dtLeft="+dt+"&trainNumber="+tn+"&seatClass="+escape(sc);
	//alert(strUrl);
	location.href = strUrl;
	
	
}