/*显示国内城市 function ACN(obj,城市代码)*/
function ACN(obj){
 var ChkValue,sel,j = 0;
 if(arguments.length == 2)
	ChkValue = arguments[1];
 obj.length = 0;
 if(ChkValue == "")
	obj.options[obj.length] = new Option(" -请选择-","");
 for(var i=0;i<NationPort.length;i++){
	if(NationPort[i][3] != 1){
		obj.options[obj.length] = new Option(NationPort[i][2].substr(0,1)+" - "+NationPort[i][4],NationPort[i][1]+","+NationPort[i][4]);
		if(NationPort[i][1] == ChkValue){
			sel = j;}
		j++;}}
 obj.selectedIndex = sel;
}

/*显示国际城市 function ACI(obj,城市代码)*/
function ACI(obj){
 var ChkValue,sel,j = 0;
 if(arguments.length == 2)
	ChkValue = arguments[1];
 obj.length = 0;
 for(var i=0;i<InterPort.length;i++){
	if(InterPort[i][3] != 1){
		obj.options[obj.length] = new Option(InterPort[i][2].substr(0,1)+" - "+InterPort[i][0],InterPort[i][1]+","+InterPort[i][0]);
		if(InterPort[i][1] == ChkValue)
			sel = j;
		j++;}}
 obj.selectedIndex = sel;
}

/*显示酒店城市 function HCN(obj,城市代码)*/
function HCN(obj){
 var ChkValue,sel,j = 0;
 if(arguments.length == 2)
	ChkValue = arguments[1];
 obj.length = 0;
 for(var i=0;i<Hotel.length;i++){
	if(Hotel[i][5] == 1){
		obj.options[obj.length] = new Option(Hotel[i][2].substr(0,1)+" - "+Hotel[i][0],Hotel[i][0]+","+Hotel[i][1]);
		if(Hotel[i][1] == ChkValue)
			sel = i;}}
 obj.selectedIndex = sel;
}


/*显示国内的国际机场 function AII(obj,航空公司代码)*/
function AII(obj){
 var ChkValue,sel,j = 0;
 if(arguments.length == 2)
	ChkValue = arguments[1];
obj.length = 0;
 for(var i=0;i<InternalPort.length;i++){
	obj.options[obj.length] = new Option(InternalPort[i][0],InternalPort[i][1]+","+InternalPort[i][0]);

if(InternalPort[i][1] == ChkValue){ sel = j;}
	j++;}
 obj.selectedIndex = sel;
}

/*显示国内航空公司 function AWN(obj,航空公司代码)*/
function AWN(obj){
 var ChkValue,sel,j = 0;
 if(arguments.length == 2)
	ChkValue = arguments[1];
 obj.length = 0;
 obj.options[0] = new Option("----全 部----","");
 for(var i=0;i<NationWays.length;i++){
	j++;
	obj.options[obj.length] = new Option(NationWays[i][1],NationWays[i][0]);
	if(NationWays[i][0] == ChkValue)
		sel = j;}
 obj.selectedIndex = sel;
}

function AWNN(obj){
 var ChkValue,sel,j = 0;
 if(arguments.length == 2)
	ChkValue = arguments[1];
 obj.length = 0;
 for(var i=0;i<NationWays.length;i++){
	
	obj.options[i] = new Option(NationWays[i][3],NationWays[i][1]);
	if(NationWays[i][1].indexOf(ChkValue)!=-1)
	  {
		sel = j;
	  }
	j++;}
 obj.selectedIndex = sel;
}

/*显示国际航空公司 function AWI(obj,航空公司代码)*/
function AWI(obj){
 var ChkValue,sel,j = 0;
 if(arguments.length == 2)
	ChkValue = arguments[1];
 obj.length = 0;
 obj.options[0] = new Option("------全 部------","");
 for(var i=0;i<InterWays.length;i++){
	j++;
	obj.options[obj.length] = new Option(InterWays[i][0]+" - "+InterWays[i][1],InterWays[i][0]);
	if(InterWays[i][0] == ChkValue)
		sel = j;}
 obj.selectedIndex = sel;
}

/*根据指定值选取*/
function SV(obj,val){
 var sel;
 for(var i=0;i<obj.length;i++)
	if(obj.options[i].value == val)
		sel = i;
 obj.selectedIndex = sel;
}

function GN(obj,n){
 for(var i=1;i<=n;i++)
	obj.options[obj.length] = new Option(i,i);
}

/*显示时间 function ST(obj,开始时间,结束时间,选择时间)*/
function ST(obj){
 var ChkValue,sel,j;
 var StartHour,EndHour;
 if(arguments.length >= 2)
	StartHour = arguments[1];
 else
	StartHour = 1;
 if(arguments.length >= 3)
	EndHour = arguments[2];
 else
	EndHour = 23;
 if(arguments.length == 4)
	ChkValue = arguments[3];
 obj.options[0] = new Option("-不限-","");
 for(var i=StartHour;i<=EndHour;i++){
	if(i<10)
		j = "0" + i;
	else
		j = i;
	obj.options[obj.length] = new Option(j+":00",i+":00");
	if(ChkValue == i)
		sel = i - StartHour + 1;}
 obj.selectedIndex = sel;
}


/*显示省份 function ST(obj,省份名称)*/
function SP(obj){
 var ChkValue,sel,j = 0;
 if(arguments.length == 2)
	ChkValue = arguments[1];
 obj.length = 0;
 obj.options[0] = new Option("--选择--","");
 for(var i=0;i<City.length;i++)
	if(City[i][3] == 1){
		j++;
		obj.options[obj.length] = new Option(City[i][1].slice(0,1)+"-"+City[i][0],City[i][0]);
		if(City[i][0] == ChkValue)
			sel = j;}
 obj.selectedIndex = sel;
}