function GetList(key,ct){
	var xmlhttp = false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e2){
				xmlhttp = false;
			};
		};
	@end @*/if(!xmlhttp && typeof XMLHttpRequest != 'undefined'){xmlhttp = new XMLHttpRequest();};
	if (xmlhttp) {
		xmlhttp.onreadystatechange=function () {
		  if(xmlhttp.readyState==4)  {
			 if(xmlhttp.status==200)  {
				 show(unescape(xmlhttp.responseText),ct);
			 }else {
				 /*alert("error");*/
			 }
		  }
		}  
		xmlhttp.open("get","/train-china/Ajax.aspx?fn=gl&t=" + ct + "&id=" + key);
		xmlhttp.send(null);
	}	
}

function show(text,ct) {
	var obj;
	if(ct == "d"){
		obj = document.getElementById("lst_depart");
	}else if(ct == "a"){
		obj = document.getElementById("lst_arrive");
	}else if(ct == "t"){
		obj = document.getElementById("lst_trainNo");
	};
	obj.innerHTML = text;
	/*var oPopup = window.createPopup();
	var oPopBody = oPopup.document.body;
	oPopBody.innerHTML = text;
	oPopup.show(obj.offsetLeft, obj.offsetTop + 20,100,200,obj);*/
}

function getListDC(key){
	GetList(key,"d");
}

function getListAC(key){
	GetList(key,"a");
}

function getListTN(key){
	GetList(key,"t");
}

function objClear(objName){
	document.getElementById(objName).innerHTML = '';
}

function VF_CityName(departName,arriveName){
	if(departName != ""){ValidCityName(departName,"Please check the from city!")};
	if(arriveName != ""){ValidCityName(arriveName,"Please check the to city!")};
}


function ValidCityName(cityName,errInfo){
	var xmlhttp = false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e2){
				xmlhttp = false;
			};
		};
	@end @*/if(!xmlhttp && typeof XMLHttpRequest != 'undefined'){xmlhttp = new XMLHttpRequest();};
	if (xmlhttp) {
		xmlhttp.open("get","Ajax.aspx?fn=vc&cn=" + cityName);
		xmlhttp.send(null);
		xmlhttp.onreadystatechange = function(){
		  if(xmlhttp.readyState==4) {
			 if(xmlhttp.status==200) {
				 if(xmlhttp.responseText == "true"){}else{alert(errInfo);};
			 }else {
				 /*alert("error");*/
			 }
		  }
		};
	}
}