var OnewayCityAirList={}
var ReturnCityAirList={}

/** 首页 单程，往返两种情况下不同出发城市对应的到达城市*/
function kindselect(formobj)
{
	//alert(formobj.name);
	var kind = "0";
	var str1 = "";
	for (var i=0;i<formobj.elements.length;i++)
	{
		var e = formobj.elements[i];
		str1 = e.name;
		//alert(e.value);
 		if (str1=="tripType")
 		{
 			if (e.checked==1)
 			{
 				if (e.value=="0"){
 					kind="0"
 				}else if (e.value=="1"){
 					kind="1"
 				}else if (e.value=="1"){	
 					kind = e.value;
 				}else{
 					kind ="0";
 				}
 				break;
 			}
		}
	}
	var ctValue="";
	try{
		ctValue=formobj.orgCity.options[formobj.orgCity.selectedIndex].value;
	}catch(e){
	}
	switch (kind) 
	{
		case "0": 
			
	 		ddchange_fromCity(ctValue,formobj);
			break;
		
		case "1":
			airreturn_ddchange_fromCity(ctValue,formobj);
		 	break;
		
		default: 
		 	break;
					
	}
	  	
}
//单程对应出发到达城市对
function ddchange_fromCity(ctCode,formobj){
	var len = formobj.dstCity.options.length;
	for(var i = (len-1); i >= 0; i--) {
		if (formobj.dstCity.options[i] != null) {
			formobj.dstCity.options[i] = null;
		}
	}
		
	var itemno=[],itemcode=[];
	for(var i=0;i<OnewayCityAirList[ctCode].length;i++){
		itemno[itemno.length]=OnewayCityAirList[ctCode][i][0];
		itemcode[itemcode.length]=OnewayCityAirList[ctCode][i][1];
	}
 	for(var i=0;i<itemno.length;i++){
		//var item = document.createElement("OPTION");
		//item.text = itemno[i];
		//item.value = itemcode[i];
		//formobj.dstCity.add(item);
		
		formobj.dstCity.options[formobj.dstCity.length]=new Option(itemno[i],itemcode[i]); 
    }	
}

//往返对应出发到达城市对

function airreturn_ddchange_fromCity(ctCode,formobj){
    	var len = formobj.dstCity.options.length;
	for(var i = (len-1); i >= 0; i--) {
		if (formobj.dstCity.options[i] != null) {
			formobj.dstCity.options[i] = null;
		}
	}
	var itemno=[],itemcode=[];
	for(var i=0;i<ReturnCityAirList[ctCode].length;i++){
		itemno[itemno.length]=ReturnCityAirList[ctCode][i][0];
		itemcode[itemcode.length]=ReturnCityAirList[ctCode][i][1];
	}
	
    for(var i=0;i<itemno.length;i++){
		//var item = document.createElement("OPTION");
		//item.text = itemno[i];
		//item.value = itemcode[i];
		//formobj.dstCity.add(item);
		formobj.dstCity.options[formobj.dstCity.length]=new Option(itemno[i],itemcode[i]); 
    }	
}

//城市对设置
document.write('<script type="text/javascript" src="js/AirlineFlightInfo.asp"><\/script>');

/** 预定行程中网上查询订票 单程，往返两种情况下不同出发城市对应的到达城市*/
function kindselect1(formobj)
{
	//alert(formobj.name);
	var kind = "0";
	var str1 = "";
	for (var i=0;i<formobj.elements.length;i++)
	{
		var e = formobj.elements[i];
		str1 = e.name;
		//alert(e.value);
 		if (str1=="tripType")
 		{
 			if (e.checked==1)
 			{
 				if (e.value=="0"){
 					kind="0"
 				}else if (e.value=="1"){
 					kind="1"
 				}else if (e.value=="1"){	
 					kind = e.value;
 				}else{
 					kind ="0";
 				}
 				break;
 			}
		}
	}
	var ctValue="";
	try{
		ctValue=formobj.orgCity.options[formobj.orgCity.selectedIndex].value;
	}catch(e){
	}
	switch (kind) 
	{
		case "0": 
			
	 		ddchange_fromCity(ctValue,formobj);
			break;
		
		case "1":
			airreturn_ddchange_fromCity(ctValue,formobj);
		 	break;
		
		default: 
		 	break;
					
	}
	  	
}
//单程对应出发到达城市对
function ddchange_fromCity(ctCode,formobj){
	var len = formobj.dstCity.options.length;
	for(var i = (len-1); i >= 0; i--) {
		if (formobj.dstCity.options[i] != null) {
			formobj.dstCity.options[i] = null;
		}
	}
		
	var itemno=[],itemcode=[];
	for(var i=0;i<OnewayCityAirList[ctCode].length;i++){
		itemno[itemno.length]=OnewayCityAirList[ctCode][i][0];
		itemcode[itemcode.length]=OnewayCityAirList[ctCode][i][1];
	}
 	for(var i=0;i<itemno.length;i++){
		//var item = document.createElement("OPTION");
		//item.text = itemno[i];
		//item.value = itemcode[i];
		//formobj.dstCity.add(item);
		
		formobj.dstCity.options[formobj.dstCity.length]=new Option(itemno[i],itemcode[i]); 
    }	
}

//往返对应出发到达城市对

function airreturn_ddchange_fromCity(ctCode,formobj){
    	var len = formobj.dstCity.options.length;
	for(var i = (len-1); i >= 0; i--) {
		if (formobj.dstCity.options[i] != null) {
			formobj.dstCity.options[i] = null;
		}
	}
	var itemno=[],itemcode=[];
	for(var i=0;i<ReturnCityAirList[ctCode].length;i++){
		itemno[itemno.length]=ReturnCityAirList[ctCode][i][0];
		itemcode[itemcode.length]=ReturnCityAirList[ctCode][i][1];
	}
	
    for(var i=0;i<itemno.length;i++){
		//var item = document.createElement("OPTION");
		//item.text = itemno[i];
		//item.value = itemcode[i];
		//formobj.dstCity.add(item);
		formobj.dstCity.options[formobj.dstCity.length]=new Option(itemno[i],itemcode[i]); 
    }	
}

//城市对设置
//document.write('<script type="text/javascript" src="../js/AirlineFlightInfo.asp"><\/script>');

