fsInfoFlight = new Array;

fsInfoSubFlight0 = new Array('AUH|アブダビ (Abu Dhabi)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[0] = fsInfoSubFlight0;


fsInfoSubFlight1 = new Array('BCD|バコロド (Bacolod)'

       ,'セブ (Cebu) |CEB'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[1] = fsInfoSubFlight1;


fsInfoSubFlight2 = new Array('BAH|バーレーン (Bahrain)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[2] = fsInfoSubFlight2;


fsInfoSubFlight3 = new Array('BKK|バンコク （Bangkok）'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[3] = fsInfoSubFlight3;


fsInfoSubFlight4 = new Array('BWN|バンダー　セリ　ベガワン (Begawan)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[4] = fsInfoSubFlight4;


fsInfoSubFlight5 = new Array('PEK|ペキン (Beijing)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[5] = fsInfoSubFlight5;


fsInfoSubFlight6 = new Array('PUS|プサン (Busan)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[6] = fsInfoSubFlight6;


fsInfoSubFlight7 = new Array('USU|ブスワンガ (Busuanga)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[7] = fsInfoSubFlight7;


fsInfoSubFlight8 = new Array('BXU|ブツワン (Butuan)'

       ,' |'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[8] = fsInfoSubFlight8;


fsInfoSubFlight9 = new Array('CGY|カガヤン　デ　オロ (Cagayan de Oro)'

       ,'セブ (Cebu) |CEB'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[9] = fsInfoSubFlight9;


fsInfoSubFlight10 = new Array('CYP|カルバヨグ (Calbayog)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[10] = fsInfoSubFlight10;


fsInfoSubFlight11 = new Array('CRM|カタルマン (Catarman)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[11] = fsInfoSubFlight11;


fsInfoSubFlight12 = new Array('MPH|カティクラン (Caticlan)'

       ,'セブ (Cebu) |CEB'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[12] = fsInfoSubFlight12;


fsInfoSubFlight13 = new Array('CYZ|カウアヤン (Cauayan)'

       ,' |'


); fsInfoFlight[13] = fsInfoSubFlight13;


fsInfoSubFlight14 = new Array('CEB|セブ (Cebu)'

       ,'イロイロ (Iloilo) |ILO'


       ,'イロイロ (Iloilo) |ILO'


       ,'オザミズ (Ozamiz) |OZC'


       ,'オザミズ (Ozamiz) |OZC'


       ,'カガヤンデオロ (Cagayan De Oro) |CGY'


       ,'カティクラン (Caticlan) |MPH'


       ,'ザンブワンガ (Zamboanga) |ZAM'


       ,'スリガオ (Surigao) |SUG'


       ,'ソウル (Seoul) |ICN'


       ,'タクロバン (Tacloban) |TAC'


       ,'ダバオ (Davao) |DVO'


       ,'ダバオ (Davao) |DVO'


       ,'バコロド (Bacolod) |BCD'


       ,'バコロド (Bacolod) |BCD'


       ,'バコロド (Bacolod) |BCD'


       ,'マニラ (Manila) |MNL'


       ,'大阪 (Osaka) |KIX'


       ,'東京 (Tokyo) |NRT'


       ,'香港 (Hong Kong) |HKG'


); fsInfoFlight[14] = fsInfoSubFlight14;


fsInfoSubFlight15 = new Array('CBO|コタバト (Cotabato)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[15] = fsInfoSubFlight15;


fsInfoSubFlight16 = new Array('DVO|ダバオ (Davao)'

       ,'ザンブワンガ (Zamboanga) |ZAM'


       ,'セブ (Cebu) |CEB'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[16] = fsInfoSubFlight16;


fsInfoSubFlight17 = new Array('DPL|ディポログ (Dipolog)'

       ,'マニラ (Manila) |MNL'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[17] = fsInfoSubFlight17;


fsInfoSubFlight18 = new Array('DOH|ドーハ (Doha)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[18] = fsInfoSubFlight18;


fsInfoSubFlight19 = new Array('DXB|ドバイ (Dubai)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[19] = fsInfoSubFlight19;


fsInfoSubFlight20 = new Array('DGT|ドューマゲーテ (Dumaguete)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[20] = fsInfoSubFlight20;


fsInfoSubFlight21 = new Array('FUK|福岡 (Fukuoka)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[21] = fsInfoSubFlight21;


fsInfoSubFlight22 = new Array('GES|ジェネラルサントス (General Santos)'

       ,' |'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[22] = fsInfoSubFlight22;


fsInfoSubFlight23 = new Array('GUM|グアム (Guam)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[23] = fsInfoSubFlight23;


fsInfoSubFlight24 = new Array('SGN|ホーチミン (Ho Chi Minh)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[24] = fsInfoSubFlight24;


fsInfoSubFlight25 = new Array('HKG|ホンコン (Hong Kong)'

       ,'セブ (Cebu) |CEB'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[25] = fsInfoSubFlight25;


fsInfoSubFlight26 = new Array('HNL|ホノルル (Honolulu)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[26] = fsInfoSubFlight26;


fsInfoSubFlight27 = new Array('ILO|イロイロ (Iloilo)'

       ,'セブ (Cebu) |CEB'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[27] = fsInfoSubFlight27;


fsInfoSubFlight28 = new Array('CGK|ジャカルタ (Jakarta)'

       ,'シンガポール (Singapore) |SIN'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[28] = fsInfoSubFlight28;


fsInfoSubFlight29 = new Array('KLO|カリボ (Kalibo)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[29] = fsInfoSubFlight29;


fsInfoSubFlight30 = new Array('BKI|コタキナバル (Kota Kinabalu)'

       ,' |'


); fsInfoFlight[30] = fsInfoSubFlight30;


fsInfoSubFlight31 = new Array('KUL|クアラルンプール (Kuala Lumpur)'

       ,' |'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[31] = fsInfoSubFlight31;


fsInfoSubFlight32 = new Array('LAO|ラワグ (Laoag)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[32] = fsInfoSubFlight32;


fsInfoSubFlight33 = new Array('LAS|ラスベガス (Las Vegas)'

       ,'バンクーバー (Vancouver) |YVR'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[33] = fsInfoSubFlight33;


fsInfoSubFlight34 = new Array('LGP|レガスピ (Legazpi)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[34] = fsInfoSubFlight34;


fsInfoSubFlight35 = new Array('LAX|ロサンジェルス (Los Angeles)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[35] = fsInfoSubFlight35;


fsInfoSubFlight36 = new Array('MFM|マカオ (Macau)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[36] = fsInfoSubFlight36;


fsInfoSubFlight37 = new Array('MNL|マニラ (Manila)'

       ,'アブダビ (Abu Dhabi)  |AUH'


       ,'アモイ (Xiamen) |XMN'


       ,'イロイロ (Iloilo) |ILO'


       ,'オザミズ (Ozamiz) |OZC'


       ,'オルモック (Ormoc) |OMC'


       ,'カガヤンデオロ (Cagayan De Oro) |CGY'


       ,'カタルマン (Catarman) |CRM'


       ,'カティクラン (Caticlan) |MPH'


       ,'カリーボ (Kalibo) |KLO'


       ,'カルバヨグ (Calbayog) |CYP'


       ,'クアラルンプール (Kuala Lumpur) |KUL'


       ,'グアム (Guam) |GUM'


       ,'コタバト (Cotabato) |CBO'


       ,'サンフランシスコ (San Francisco) |SFO'


       ,'ザンブワンガ (Zamboanga) |ZAM'


       ,'シドニー (Sydney) |SYD'


       ,'シンガポール (Singapore) |SIN'


       ,'ジェネラルサントス (General Santos) |GES'


       ,'ジャカルタ (Jakarta) |CGK'


       ,'スリガオ (Surigao) |SUG'


       ,'セブ (Cebu) |CEB'


       ,'ソウル (Seoul) |ICN'


       ,'タクロバン (Tacloban) |TAC'


       ,'タグビラーラン (Tagbilaran) |TAG'


       ,'ダバオ (Davao) |DVO'


       ,'ディポログ (Dipolog) |DPL'


       ,'トゥゲガラオ (Tuguegarao) |TUG'


       ,'ドゥマゲテ (Dumaguete) |DGT'


       ,'ドバイ (Dubai) |DXB'


       ,'ドーハ (Doha) |DOH'


       ,'ドーハ (Doha) |DOH'


       ,'ナガ (Naga) |WNP'


       ,'バコロド (Bacolod) |BCD'


       ,'バンクーバー (Vancouver) |YVR'


       ,'バンコク （Bangkok） |BKK'


       ,'バーレーン (Bahrain) |BAH'


       ,'ブスワンガ (Busuanga) |USU'


       ,'ブトゥアン (Butuan) |BXU'


       ,'プエルトプリセサ (Puerto Princesa) |PPS'


       ,'プサン (Busan) |PUS'


       ,'ベガワン (Begawan) |BWN'


       ,'ホノルル (Honolulu) |HNL'


       ,'ホーチミン (Ho Chi Minh) |SGN'


       ,'マカオ (Macau) |MFM'


       ,'メルボルン (Melbourne) |MEL'


       ,'ラスベガス (Las Vegas) |LAS'


       ,'ラワグ (Laoag) |LAO'


       ,'レガスピ (Legazpi) |LGP'


       ,'ロサンジェルス (Los Angeles) |LAX'


       ,'ローハス (Roxas) |RXS'


       ,'ヴィラク (Virac) |VRC'


       ,'上海 (Shanghai) |PVG'


       ,'北京 (Beijing) |PEK'


       ,'台北 (Taipei) |TPE'


       ,'名古屋 (Nagoya) |NGO'


       ,'大阪 (Osaka) |KIX'


       ,'東京 (Tokyo) |NRT'


       ,'福岡 (Fukuoka) |FUK'


       ,'香港 (Hong Kong) |HKG'


       ,'ｻﾝﾉｾﾞ (San Jose) |SJI'


); fsInfoFlight[37] = fsInfoSubFlight37;


fsInfoSubFlight38 = new Array('MEL|メルボルン (Melbourne)'

       ,'シドニー (Sydney) |SYD'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[38] = fsInfoSubFlight38;


fsInfoSubFlight39 = new Array('WNP|ナガ (Naga)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[39] = fsInfoSubFlight39;


fsInfoSubFlight40 = new Array('NGO|名古屋 (Nagoya)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[40] = fsInfoSubFlight40;


fsInfoSubFlight41 = new Array('OMC|オルミック (Ormoc)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[41] = fsInfoSubFlight41;


fsInfoSubFlight42 = new Array('KIX|大阪 (Osaka)'

       ,'セブ (Cebu) |CEB'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[42] = fsInfoSubFlight42;


fsInfoSubFlight43 = new Array('OZC|オザミズ (Ozamiz)'

       ,'セブ (Cebu) |CEB'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[43] = fsInfoSubFlight43;


fsInfoSubFlight44 = new Array('PPS|プエルト　プリンセサ (Puerto Princesa)'

       ,' |'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[44] = fsInfoSubFlight44;


fsInfoSubFlight45 = new Array('RXS|ロハス (Roxas)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[45] = fsInfoSubFlight45;


fsInfoSubFlight46 = new Array('SFO|サンフランシスコ (San Francisco)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[46] = fsInfoSubFlight46;


fsInfoSubFlight47 = new Array('SJI|サンホセ (San Jose)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[47] = fsInfoSubFlight47;


fsInfoSubFlight48 = new Array('ICN|ソウル (Seoul)'

       ,'セブ (Cebu) |CEB'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[48] = fsInfoSubFlight48;


fsInfoSubFlight49 = new Array('PVG|上海 (Shanghai)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[49] = fsInfoSubFlight49;


fsInfoSubFlight50 = new Array('SIN|シンガポール (Singapore)'

       ,'ジャカルタ (Jakarta) |CGK'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[50] = fsInfoSubFlight50;


fsInfoSubFlight51 = new Array('SUG|スリガオ (Surigao)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[51] = fsInfoSubFlight51;


fsInfoSubFlight52 = new Array('SYD|シドニー (Sydney)'

       ,'マニラ (Manila) |MNL'


       ,'メルボルン (Melbourne) |MEL'


); fsInfoFlight[52] = fsInfoSubFlight52;


fsInfoSubFlight53 = new Array('TAC|タクロバン (Tacloban)'

       ,'セブ (Cebu) |CEB'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[53] = fsInfoSubFlight53;


fsInfoSubFlight54 = new Array('TAG|タグビラーラン (Tagbilaran)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[54] = fsInfoSubFlight54;


fsInfoSubFlight55 = new Array('TPE|台北 (Taipei)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[55] = fsInfoSubFlight55;


fsInfoSubFlight56 = new Array('NRT|東京 (Tokyo)'

       ,'セブ (Cebu) |CEB'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[56] = fsInfoSubFlight56;


fsInfoSubFlight57 = new Array('TUG|トゥゲガラオ (Tuguegarao)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[57] = fsInfoSubFlight57;


fsInfoSubFlight58 = new Array('YVR|バンクーバー (Vancouver)'

       ,'マニラ (Manila) |MNL'


       ,'ラスベガス (Las Vegas) |LAS'


); fsInfoFlight[58] = fsInfoSubFlight58;


fsInfoSubFlight59 = new Array('VRC|ヴィラク (Virac)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[59] = fsInfoSubFlight59;


fsInfoSubFlight60 = new Array('XMN|厦門アモイ (Xiamen)'

       ,'マニラ (Manila) |MNL'


); fsInfoFlight[60] = fsInfoSubFlight60;


fsInfoSubFlight61 = new Array('ZAM|ザンブワンガ (Zamboanga)'

       ,'セブ (Cebu) |CEB'


       ,'ダバオ (Davao) |DVO'


       ,'マニラ (Manila) |MNL'


); fsInfoFlight[61] = fsInfoSubFlight61;



function submitDepFltNum(){
  varboolean = false;
  
  if (document.forms['topForm']['in_depstn'].value == "000") {
	  
	  //Field is empty
	  if (document.forms['topForm']['in_fltno'].value == "")
	  {
	     alert ("フライト番号を選択するか、出発地と目的地を選択して下さい。");
	
	  } else { //Something is entered
	   
	    if (document.topForm.in_fltno.value != "") {
		          document.topForm.querytype.value = "flight";
	                          varboolean = validateChar(document.topForm.in_fltno, '0123456789', true, 'Only numeric characters are allowed.');
		}
		if (varboolean == true) {
			submitDep();
		}
	  }    
  }     
}

function submitDepOD(){
  varboolean = false;
  if (document.topForm.in_fltno.value == "") {
	
	  //Field is empty
	  if ((document.forms['topForm']['in_depstn'].value == "000") && (document.forms['topForm']['in_arrstn'].value == "000"))
	  {
	     alert ("フライト番号を選択するか、出発地と目的地を選択して下さい。");
	
	  } else { //Something is entered
	   
	    if (document.topForm.in_depstn.value != "000"){
			if (document.topForm.in_arrstn.value != "000"){                                                 
				varboolean = true;
			} else {
	            alert ("目的地を選択して下さい。");
			}
		}
		if (varboolean == true) {
			submitDep();
		}
	  } 	
  }       
    
}

function submitDep(){
  varboolean = false;
  document.topForm.querytype.value = "";
    
  //Fields are empty
  if ((document.forms['topForm']['in_fltno'].value == "") && (document.forms['topForm']['in_depstn'].value == "000") && (document.forms['topForm']['in_arrstn'].value == "000"))
  {
     alert ("フライト番号を選択するか、出発地と目的地を選択して下さい。");

  } else { //Something is entered
   
                if (document.topForm.in_fltno.value != "") {
	          document.topForm.querytype.value = "flight";
                          varboolean = validateChar(document.topForm.in_fltno, '0123456789', true, 'Only numeric characters are allowed.');
	}else{
		if (document.topForm.in_depstn.value != "000"){
			if (document.topForm.in_arrstn.value != "000"){
                                                     document.topForm.querytype.value = "station";
                                                     document.topForm.prevFrom.value = document.topForm.in_depstn[document.topForm.in_depstn.options.selectedIndex].value;    
                                                     document.topForm.prevTo.value = document.topForm.in_arrstn[document.topForm.in_arrstn.options.selectedIndex].value;
                                                     varboolean = true;
			} else {
                                                     alert ("目的地を選択して下さい。");
                                                }
		}
	}
  


  }
    
	
	
	
    if (varboolean == true) {
        document.topForm.op_deparr.value = "Departure";
         if (document.topForm.querytype.value != "") {
            document.topForm.action.value = "search";
            document.topForm.submit();
        }
    }
    
}

function submitArr(){
    varboolean = false;
    document.topForm.querytype.value = "";

    //Fields are empty
  if ((document.forms['topForm']['in_fltno'].value == "") && (document.forms['topForm']['in_depstn'].value == "000") && (document.forms['topForm']['in_arrstn'].value == "000"))
  {
     alert ("フライト番号を選択するか、出発地と目的地を選択して下さい。");

  } else { //Something is entered
	
                if (document.topForm.in_fltno.value != "") {
	                document.topForm.querytype.value = "flight";
                                varboolean = validateChar(document.topForm.in_fltno, '0123456789', true, 'Only numeric characters are allowed.');
                }else{
		if (document.topForm.in_depstn.value != "000"){
			if (document.topForm.in_arrstn.value != "000"){
                                                                document.topForm.querytype.value = "station";
                                                                document.topForm.prevFrom.value = document.topForm.in_depstn[document.topForm.in_depstn.options.selectedIndex].value;    
                                                                document.topForm.prevTo.value = document.topForm.in_arrstn[document.topForm.in_arrstn.options.selectedIndex].value;  
                                                                varboolean = true;
			} else {
                                                        alert ("目的地を選択して下さい。");
                                                }
		}
	}
 }

    if (varboolean == true) {
        document.topForm.op_deparr.value = "Arrival";
        if (document.topForm.querytype.value != "") {
            document.topForm.action.value = "search";
            document.topForm.submit();
        }
    }
}
	
//validates the characters within a text
//sample usage
//booloean = validateChar(document.frmSupplyItem.strCode, '0123456789', true, 'Only numeric characters are allowed.');
//booloean = validateChar(document.frmSupplyItem.strCode, '0123456789', false, 'Numeric characters are not allowed.');
function validateChar(field, charList, valid, errMsg) {
	var status;
	var char;
	
	for (var i = 0; i < field.value.length; i++) {
		char = "" + field.value.substring(i, i+1);
		if (charList.indexOf(char) != -1) {
			if (valid == true) {
				status = true;
			} else {
				status = false;
				break;
			}
		} else {
			if (valid == true) {
				status = false;
				break;
			} else {
				status = true;
			}
		}
	}
	if (status == false) {
		alert(errMsg);
		field.focus();
		field.select();
		return false;
	} else {
		return true;
	}   	
}

// Generating arrival dropdown list
function generateListDA() {
	fromObj = document.forms['topForm']['in_depstn'];
	toObj     = document.forms['topForm']['in_arrstn'];
	//Resetting arrival dropdown
                toObj.options.selectedIndex=0;
                toObj.length=1;
	if(fromObj.options.selectedIndex!=0){
                                for(var i=0;i<fsInfoFlight.length;i++){
                                               if(fsInfoFlight[i][0].split("|")[0].indexOf(fromObj[fromObj.options.selectedIndex].value)==0){ 
                                                               //Generating new list
				for(var j=1;j<fsInfoFlight[i].length;j++) {
                                                                                var newOption = document.createElement("option");
                                                                                newOption.value = fsInfoFlight[i][j].split("|")[1];
                                                                                newOption.appendChild(document.createTextNode(fsInfoFlight[i][j].split("|")[0]));
					toObj.appendChild(newOption);
                                                                                if(document.forms['topForm']['prevTo'].value != ""){
                                                                                          if(newOption.value == document.forms['topForm']['prevTo'].value){
                                                                                                         newOption.selected = true;
                                                                                                         document.forms['topForm']['prevTo'].value = "";
                                                                                          }
                                                                                }
                                                                }
                                               }
                                }
                }
}

function generateFromDA(){
                fromObj = document.forms['topForm']['in_depstn'];
                fromObj.options.selectedIndex=0;
                fromObj.length=1;

                //sort
                fromDAArray = new Array();
                fromDAArray[0] = fsInfoFlight[0][0];
                for(var h=1;h<fsInfoFlight.length;h++){
                      fromDAArray[h] = fsInfoFlight[h][0];
                      for(g=fromDAArray.length-1; g>=1; g--){
                                if(fromDAArray[g].split("|")[1] < fromDAArray[g-1].split("|")[1]){
                                              var tempString = fromDAArray[g];
                                              fromDAArray[g] = fromDAArray[g-1];
                                              fromDAArray[g-1] = tempString;
                                }
                      }//end sort
                }

                for(var i=0;i<fsInfoFlight.length;i++){
                                var newOption = document.createElement("option");
                                newOption.value = fromDAArray[i].split("|")[0];
                                newOption.appendChild(document.createTextNode(fromDAArray[i].split("|")[1]));
		fromObj.appendChild(newOption);
                                if(document.forms['topForm']['prevFrom'].value != ""){
                                           if(newOption.value == document.forms['topForm']['prevFrom'].value){
                                                    newOption.selected = true;
                                                    document.forms['topForm']['prevFrom'].value = "";
                                            }
                                 }
                 }
}


function docEnDis(){

  // fields are empty...

  if ((document.forms['topForm']['in_fltno'].value == "") && (document.forms['topForm']['in_depstn'].value == "000") && (document.forms['topForm']['in_arrstn'].value == "000"))
  { 
    document.forms['topForm']['in_fltno'].disabled = false;
    document.forms['topForm']['in_depstn'].disabled = false;
    document.forms['topForm']['in_arrstn'].disabled = true;
    //document.depbutton.src = butDep_out.src;
    //document.arrbutton.src = butArr_out.src;
  } else {
  // something is entered... 
    // a flight number is entered
    if (document.forms['topForm']['in_fltno'].value != "") 
    { document.forms['topForm']['in_depstn'].disabled = true;
      document.forms['topForm']['in_arrstn'].disabled = true;
      //document.depbutton.src = butDep_act.src;
      //document.arrbutton.src = butArr_act.src;
    } else
    // DEP&ARR stations are selected
    { if (document.forms['topForm']['in_depstn'].value != "000")
      { 
        document.forms['topForm']['in_fltno'].disabled = true;
        document.forms['topForm']['in_arrstn'].disabled = false;
        
        if (document.forms['topForm']['in_arrstn'].value != "000")
        { 
          //document.depbutton.src = butDep_act.src;
          //document.arrbutton.src = butArr_act.src;
        } else
        { 
          //document.depbutton.src = butDep_out.src;
          //document.arrbutton.src = butArr_out.src;
        }
      } else
      { document.forms['topForm']['in_fltno'].disabled = false;
        document.forms['topForm']['in_depstn'].disabled = false;
        document.forms['topForm']['in_arrstn'].disabled = true;
	//document.depbutton.src = butDep_out.src;
	//document.arrbutton.src = butArr_out.src;
      }
    }
  }
	setTimeout("docEnDis()", 500);
}

function entsub(e, ind, msg) {
  if(e && e.which){
     e = e
     characterCode = e.which
  }else{
     e = event
     characterCode = e.keyCode
  }	

  
  if (characterCode == 13){
     if (ind=="YES") {
        displayDowntimeMsg(msg); 
        return false;
     } else {
        if ((document.forms['topForm']['in_fltno'].value == "") && (document.forms['topForm']['in_depstn'].value == "000") && (document.forms['topForm']['in_arrstn'].value == "000")){
           alert ("フライト番号を選択するか、出発地と目的地を選択して下さい。"); 
           return false;
        } else {
           //submitDep();           
           if (document.topForm.in_fltno.value != "") {       // 11262010 csg
	document.topForm.querytype.value = "flight";
	varboolean = validateChar(document.topForm.in_fltno, '0123456789', true, 'Only numeric characters are allowed.');		
                if (varboolean == true) {
	    submitDep();
	} else {
                    return false;
                }
           } else {
               submitDepOD();
           }  // 11262010 csg
        }
     }
  }    
  
}

// for switching

function switchTab(tabName) {
	if(tabName == "timetable") {						
		document.getElementById('deparrDiv').style.display = 'none'; 
		document.getElementById('timetableDiv').style.display = 'block'; 						 	
		document.getElementById('timetableDiv').style.height = '100%';
                document.getElementById('tabframe').className = 'daframe2';
	}
	else if (tabName == "deparr") {		
		document.getElementById('deparrDiv').style.display = 'block'; 
		document.getElementById('deparrDiv').style.height = '100%';						
		document.getElementById('timetableDiv').style.display = 'none';
                document.getElementById('tabframe').className = 'daframe';	
	}
	else if(tabName == "midtab1") {
		document.getElementById('middiv1').style.display = 'block'; 				
		document.getElementById('middiv2').style.display = 'none';
		document.getElementById('middiv3').style.display = 'none';
		document.getElementById('middiv4').style.display = 'none';
                document.getElementById('tabDivsMid').className = 'tabdivs1';
	}
	else if(tabName == "midtab2") {
		document.getElementById('middiv1').style.display = 'none'; 				
		document.getElementById('middiv2').style.display = 'block';		
		document.getElementById('middiv3').style.display = 'none';
		document.getElementById('middiv4').style.display = 'none';
                document.getElementById('tabDivsMid').className = 'tabdivs2';		
	}
        else if(tabName == "midtab3") {
		document.getElementById('middiv1').style.display = 'none'; 				
		document.getElementById('middiv2').style.display = 'none';		
		document.getElementById('middiv3').style.display = 'block';
		document.getElementById('middiv4').style.display = 'none';
                document.getElementById('tabDivsMid').className = 'tabdivs3';		
	}
	else if(tabName == "midtab4") {
		document.getElementById('middiv1').style.display = 'none'; 				
		document.getElementById('middiv2').style.display = 'none';		
		document.getElementById('middiv3').style.display = 'none';
		document.getElementById('middiv4').style.display = 'block';
                document.getElementById('tabDivsMid').className = 'tabdivs4';		
	}
}


function setVisibility(id, visibility, id2, id3) {
	document.getElementById(id).style.display = visibility;
	document.getElementById(id2).style.display = 'none';
	document.getElementById(id3).style.display = 'none';	
}

function displayDowntimeMsg(msg) {
	alert (msg); 
}


