﻿<!--
function init() {
	var q = document.getElementById('q');
	q.focus();
}

function forwardNext(form) {
	var inputs = form.getElementsByTagName('input');
	for (var i = 0; i < inputs.length; i++) {
		if (inputs[i].type == 'submit' || inputs[i].type == 'image') {
			inputs[i].disabled = 'disabled';
		}
	}
}

function search(word, offset) {
	if (typeof offset == 'undefined') {
		offset = 0;
	}
	var form = document.getElementById('searchForm');
	var q    = document.getElementById('q');
	var o    = document.getElementById('o');
	q.value = word;
	o.value = offset;
	form.submit();
}

function forwardDisplay(obj) {
	var forward = document.getElementById('forward');
	forward.value = obj.name;
}

var language = "ja";
var country  = "jp";
var ja_arrMonth= new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
var ja_arrWeek = new Array("日","月","火","水","木","金","土");
var ja_dispDay = "日";
var zh_arrMonth= new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
var zh_arrWeek = new Array("日","一","二","三","四","五","六");
var zh_dispDay = "日";
var en_arrMonth= new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
var en_arrWeek = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
var en_arrCalW = new Array("S","M","T","W","T","F","S");
var en_dispDay = "";
var arrMonth   = new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
var arrWeek    = new Array("日","月","火","水","木","金","土");
var arrCalW    = new Array("日","月","火","水","木","金","土");
var arrEndDay  = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
var dispDay    = "";
var selMonthList  = new Array();
var selEndDayList = new Array();
var selStartWkIdx = new Array();
//現在日
var now      = new Date();
var nowYear  = now.getFullYear();
var nowMon   = now.getMonth();
var nowDay   = now.getDate();
//2ヶ月後
var toDate   = getSameDateAddMonth(now,2);
var toYear   = toDate.getFullYear();
var toMon    = toDate.getMonth();
var toDay    = toDate.getDate();

function getDepMonthOption(selectedLanguage,selectedCountry,form){
//alert("getDepMonthOption(form)-->START");
//alert("getDepMonthOption(form)-->selectedLanguage="+selectedLanguage);
//alert("getDepMonthOption(form)-->selectedCountry="+selectedCountry);
  language = selectedLanguage;
  country  = selectedCountry;
  if(selectedLanguage=="en"){
    arrMonth = en_arrMonth;
    arrWeek  = en_arrWeek;
    arrCalW  = en_arrCalW;
    dispDay  = en_dispDay;
  }else if(selectedLanguage=="zh_CN"||selectedLanguage=="zh_TW"){
    arrMonth = zh_arrMonth;
    arrWeek  = zh_arrWeek;
    arrCalW  = zh_arrWeek;
    dispDay  = zh_dispDay;
  }else{
    arrMonth = ja_arrMonth;
    arrWeek  = ja_arrWeek;
    arrCalW  = ja_arrWeek;
    dispDay  = ja_dispDay;
  }
  document.write('<select name="month" class="selectMonth" onChange="chgDepDateOption(form)">');
  for(i=1;i<=3;i++){
    mm = nowMon + i;
    if (12 < mm) {mm = mm - 12}
    if(i==1){
      document.write('<option value="'+mm+'" selected>'+arrMonth[mm-1]+'</option>');
    }else{
      document.write('<option value="'+mm+'">'+arrMonth[mm-1]+'</option>');
    }
    selMonthList[i-1]  = mm;
    selEndDayList[i-1] = arrEndDay[mm-1];
  }
  document.write('</select>');
  return;
}
function chgDepDateOption(form){
//alert("chgDepDateOption(form)-->START");
  var svSelIndexDay = form.day.selectedIndex;
  //
  var opts = createDepDateOption(form);
  for (i = 0; i < opts.length; i++) {
    form.day.options[i] = new Option(opts[i], i+1);
  }
  for (i = opts.length; i < 31; i++) {
    form.day.options[opts.length] = null;
  }
  //
  if(svSelIndexDay < arrEndDay[form.month.value - 1]){
  	form.day.selectedIndex = svSelIndexDay;
  }else{
    //月末対応
    form.day.selectedIndex = arrEndDay[form.month.value - 1] - 1;
  }
  return;
}

function createDepDateOption(form){
//alert("createDepDateOption(form)-->nowYear="+nowYear+"/+nowMon="+nowMon+"/form.month.value="+form.month.value);
  var cal = new Date();
  cal.setFullYear(nowYear);
  if(form.month.value < (nowMon + 1)){
    cal.setFullYear(nowYear + 1);
  }
  cal.setDate(1);
  cal.setMonth(form.month.value - 1);
//alert("createDepDateOption(form)-->cal.getFullYear="+cal.getFullYear()+"/+cal.getMonth()="+cal.getMonth()+"/+cal.getDate="+cal.getDate());
  setLeapYearMonth(cal.getFullYear());
//alert("createDepDateOption(form)-->getDay="+cal.getDay());
  var week = cal.getDay();
  var strDay = new Array(arrEndDay[cal.getMonth()]);
  for(i=0;i<arrEndDay[cal.getMonth()];i++){
    dd = i + 1;
    strDay[i] = dd + dispDay + "("+arrWeek[week]+")";
    (week==6)? week=0 : week++ ;
  }
  return strDay;
}
function setLeapYearMonth(year){
//alert("setLeapYearMonth(year)-->year="+year);
  if(((year%4)==0 && (year%100)!=0) || (year%400)==0){
    arrEndDay[1] = 29;
  }else{
    arrEndDay[1] = 28;
  }
  return;
}

function onloadProcTop(){
//alert("onloadProcTop():document.cookie:"+document.cookie);
  var depMonthV  = 0;
  var depDayV    = nowDay - 1;
  var departureV   = "";
  var arrivalV   = "";
  var seatV      = 1;
  var depMonthI  = 0;
  var depDayI    = nowDay - 1;
  var flightNo   = "";
  var reserveNo  = "";
  var secondname = "";
  var firstname  = "";
  var depMonthS  = 0;
  var depDayS    = nowDay - 1;
  var depMonthF  = 0;
  var depDayF    = nowDay - 1;
  var tab1       = tabsArr_1[0];
  var tab2       = tabsArr_2[0];
  //発着案内
  var airlineOI  = 0;
  var departureOI  = 0;
  var select_dayOI = 1;
  //運賃照会
  var depMonthF  = 0;
  var depDayF    = nowDay - 1;
  var airlineF   = 0;
  var departureF   = "";
  var arrivalF     = "";
  //スケジュール
  var depMonthS  = 0;
  var depDayS    = nowDay - 1;
  var airlineS   = 0;
  var departureS   = "";
  var arrivalS     = "";

  //クッキー取得
  var values = document.cookie;
  var value  = values.split(";")
  for(i=0;i<value.length;i++){
    var getval = value[i].replace(" ","");
    var vals = getval.split("=");
    var val  = "";
    if(vals.length==2){
      val = unescape( vals[1] );
    }
    if(vals[0]=="depMonthV"){
      depMonthV = val;
      continue;
    }
    if(vals[0]=="depDayV"){
      depDayV = val;
      continue;
    }
    if(vals[0]=="departureV"){
      departureV = val;
      continue;
    }
    if(vals[0]=="arrivalV"){
      arrivalV = val;
      continue;
     }
    if(vals[0]=="seatV"){
      seatV = val;
      continue;
    }
    if(vals[0]=="depMonthI"){
      depMonthI = val;
      continue;
    }
    if(vals[0]=="depDayI"){
      depDayI = val;
      continue;
    }
    if(vals[0]=="flightNo"){
      flightNo = val;
      continue;
    }
    if(vals[0]=="reserveNo"){
      reserveNo = val;
      continue;
    }
    if(vals[0]=="secondname"){
      secondname = val;
      continue;
    }
    if(vals[0]=="firstname"){
      firstname = val;
      continue;
    }
    //発着案内
    if(vals[0]=="airlineOI"){
      airlineOI = val;
      continue;
    }
    if(vals[0]=="departureOI"){
      departureOI = val;
      continue;
    }
    if(vals[0]=="select_dayOI"){
      select_dayOI = val;
      continue;
    }
    //運賃照会
    if(vals[0]=="depMonthF"){
      depMonthF = val;
      continue;
    }
    if(vals[0]=="depDayF"){
      depDayF = val;
      continue;
    }
    if(vals[0]=="airlineF"){
      airlineF = val;
      continue;
    }
    if(vals[0]=="departureF"){
      departureF = val;
      continue;
    }
    if(vals[0]=="arrivalF"){
      arrivalF = val;
      continue;
    }
    //スケジュール
    if(vals[0]=="depMonthS"){
      depMonthS = val;
      continue;
    }
    if(vals[0]=="depDayS"){
      depDayS = val;
      continue;
    }
    if(vals[0]=="airlineS"){
      airlineS = val;
      continue;
    }
    if(vals[0]=="departureS"){
      departureS = val;
      continue;
    }
    if(vals[0]=="arrivalS"){
      arrivalS = val;
      continue;
    }
	//Tab
    if(vals[0]=="tab1"){
      tab1 = val;
      continue;
    }
    if(vals[0]=="tab2"){
      tab2 = val;
      continue;
    }
  }
  //空席照会・予約
  document.sky1.month.selectedIndex   = depMonthV;
    //ADD 2007-10-31
	chgDepDateOption(document.sky1);
	document.sky1.day.selectedIndex     = depDayV;
    
  ix = parseInt(seatV - 1);
  document.sky1.seat[ix].checked      = true;
  //予約確認・追加・変更・取消
  document.sky2.month.selectedIndex   = depMonthI;
    //ADD 2007-10-31
    chgDepDateOption(document.sky2);
  document.sky2.day.selectedIndex     = depDayI;
  document.sky2.flightNo.value        = flightNo;
  document.sky2.reserveNo.value       = reserveNo;
  document.sky2.secondname.value      = secondname;
  document.sky2.firstname.value       = firstname;
  if (typeof(csm) == 'object' && departureV != "" && arrivalV != "") {
    csm.selectByValues([departureV, arrivalV]);
  }
  //発着案内
//  document.operate.airline.selectedIndex    = airlineOI;
  if (typeof(csm4) == 'object') {
    csm4.selectByValue(airlineOI);
  }
  document.operate.select_day.selectedIndex = select_dayOI;
  //運賃検索
  document.fare.month.selectedIndex   = depMonthF;
    //ADD 2007-11-27
    chgDepDateOption(document.fare);
  document.fare.day.selectedIndex     = depDayF;
//  document.fare.airline.selectedIndex = airlineF;
  if (typeof(csm2) == 'object' && departureF != "" && arrivalF != "") {
    csm2.selectByValues([departureF, arrivalF]);
  }
  //スケジュール
  document.schedule.month.selectedIndex = depMonthS;
    //ADD 2007-11-27
    chgDepDateOption(document.schedule);
  document.schedule.day.selectedIndex = depDayS;
//  document.schedule.airline.selectedIndex = airlineS;
  if (typeof(csm3) == 'object' && departureS != "" && arrivalS != "") {
    csm3.selectByValues([departureS, arrivalS]);
  }
  //Tab復元
  try{
    for(i=0;i<tabsArr_1.length;i++){
  	  window.document.getElementById(tabsArr_1[i]).style.display = "none";
    }
    window.document.getElementById(tab1).style.display = "block";
  }catch( e ){
    window.document.getElementById(tabsArr_1[0]).style.display = "block";
    document.cookie = ("tab1=" + escape( tabsArr_1[0] ) + ";");
  }
  try{
    for(i=0;i<tabsArr_2.length;i++){
      window.document.getElementById(tabsArr_2[i]).style.display = "none";
    }
    window.document.getElementById(tab2).style.display = "block";
  }catch( e ){
    window.document.getElementById(tabsArr_2[0]).style.display = "block";
    document.cookie = ("tab2=" + escape( tabsArr_2[0] ) + ";");
  }
return true;
}

//タブ復元用
var formsArr1 = new Array("sky1", "sky2");
var tabsArr_1 = new Array("topRightZoneT1", "topRightZoneT2");
var formsArr2 = new Array("operate", "fare", "schedule");
var tabsArr_2 = new Array("topRightZoneB1", "topRightZoneB2", "topRightZoneB3");

function onSubmit(form){
 //NAME=値; expires=値; domain=値; path=値
 //var domain = document.domain;
 //var path = "/";
    var value;
    //form
    for(i=0;i<formsArr1.length;i++){
        if(formsArr1[i] == form.name){
            value = ("tab1=" + escape( tabsArr_1[i] ) + ";");
            document.cookie = value;
        }
    }
    for(i=0;i<formsArr2.length;i++){
        if(formsArr2[i] == form.name){
            value = ("tab2=" + escape( tabsArr_2[i] ) + ";");
            document.cookie = value;
        }
    }
    //搭乗月(空席照会)
    value = "depMonthV=" + escape( document.sky1.month.selectedIndex ) + ";";
    document.cookie = value;
    //搭乗日(空席照会)
    value = "depDayV=" + escape( document.sky1.day.selectedIndex ) + ";";
    document.cookie = value;
    //航路(空席照会)
    value = "departureV=" + escape( document.sky1.departure.value ) + ";";
    document.cookie = value;
    value = "arrivalV=" + escape( document.sky1.arrival.value  ) + ";";
    document.cookie = value;
    //航路(シートクラス)
    if(document.sky1.seat[0].checked){
      value = "seatV=" + escape( document.sky1.seat[0].value ) + ";";
    }else{
      value = "seatV=" + escape( document.sky1.seat[1].value ) + ";";
    }
    document.cookie = value;
    //搭乗月(予約照会)
    var value = "depMonthI=" + escape( document.sky2.month.selectedIndex ) + ";";
    document.cookie = value;
    //搭乗日(予約照会)
    value = "depDayI=" + escape( document.sky2.day.selectedIndex ) + ";";
    document.cookie = value;
    //便名(予約照会)
    value = "flightNo=" + escape( document.sky2.flightNo.value ) + ";";
    document.cookie = value;
    //予約番号(予約照会)
    value = "reserveNo=" + escape( document.sky2.reserveNo.value ) + ";";
    document.cookie = value;
    //名前・姓(予約照会)
    value = "secondname=" + escape( document.sky2.secondname.value ) + ";";
    document.cookie = value;
    //名前・名(予約照会)
    value = "firstname=" + escape( document.sky2.firstname.value ) + ";";
    document.cookie = value;

    //航路(発着案内)
//    value = "airlineOI=" + escape( document.operate.airline.selectedIndex ) + ";";
    value = "departureOI=" + escape( document.operate.departure.selectedIndex ) + ";";
    document.cookie = value;
    value = "airlineOI=" + escape( document.getElementById('mcr2').value ) + ";";
    document.cookie = value;
    //照会日(発着案内)
    value = "select_dayOI=" + escape( document.operate.select_day.selectedIndex ) + ";";
    document.cookie = value;

    //搭乗月(運賃照会)
    var value = "depMonthF=" + escape( document.fare.month.selectedIndex ) + ";";
    document.cookie = value;
    //搭乗日(運賃照会)
    value = "depDayF=" + escape( document.fare.day.selectedIndex ) + ";";
    document.cookie = value;
    //航路(運賃照会)
//    value = "airlineF=" + escape( document.fare.airline.selectedIndex ) + ";";
    value = "departureF=" + escape( document.fare.departure.value ) + ";";
    document.cookie = value;
    value = "arrivalF=" + escape( document.fare.arrival.value ) + ";";
    document.cookie = value;
    value = "airlineF=" + escape( document.getElementById('fare2').value ) + ";";
    document.cookie = value;

    //搭乗月(スケジュール)
    var value = "depMonthS=" + escape( document.schedule.month.selectedIndex ) + ";";
    document.cookie = value;
    //搭乗日(スケジュール)
    value = "depDayS=" + escape( document.schedule.day.selectedIndex ) + ";";
    document.cookie = value;
    //航路(スケジュール)
//    value = "airlineS=" + escape( document.schedule.airline.selectedIndex ) + ";";
    value = "departureS=" + escape( document.schedule.departure.value ) + ";";
    document.cookie = value;
    value = "arrivalS=" + escape( document.schedule.arrival.value ) + ";";
    document.cookie = value;
    value = "airlineS=" + escape( document.getElementById('schedule2').value ) + ";";
    document.cookie = value;
//alert("onSubmit(form):document.cookie:"+document.cookie);
return true;
}

/**
 * 指定された日付のnヶ月後の同一日を取得する。
 * 指定された日付が月末の場合、nヶ月後の月末を返す。
 * 指定された日付が月末以外の場合、nヶ月後の月末より大きい場合はnヶ月後の月末を返す。
 * @param date
 * @return Date
 */
function getSameDateAddMonth(date,n){
	//指定された日付
	var year   = date.getFullYear();
	var month  = date.getMonth();
	var day    = date.getDate();
	//指定された日付のうるう年調整
	setLeapYearMonth(year);
	var MaxDay = arrEndDay[month];
	//nヶ月後算出
	month = month + n;
	if(month>=12){
		year = year +1;
		month = month - 12;
	}
	//nヶ月後のうるう年調整
	setLeapYearMonth(year);
	var toMaxDay = arrEndDay[month];
	//月末判定
	if(day==MaxDay){
		//指定された日付が月末
		day = toMaxDay;
	}
	if(day>toMaxDay){
		//nヶ月後の月末より大きい
		day = toMaxDay;
	}
	//nヶ月後生成
	return new Date(year,month,day);
}

/*
var ConnectedSels = null;

//航路選択分割1月30日
function ConnectedSelect(selIdList){
	ConnectedSels = new Array();
	for(var i=0;selIdList[i];i++) {
		var CS = new Object();
		var obj = document.getElementById(selIdList[i]);
		if (obj == null) {
			break;
		}
		ConnectedSels.push(obj);
		if(i){
			CS.node=document.createElement('select');
			var GR = obj.getElementsByTagName('optgroup');
			while(GR[0]) {
				CS.node.appendChild(GR[0].cloneNode(true));
				obj.removeChild(GR[0]);
			}
			obj.disabled = true;
		}
		if(selIdList[i+1]) {
			CS.nextSelect = document.getElementById(selIdList[i+1]);
			obj.onchange = function(){ConnectedSelectEnabledSelect(this)};
		} else {
			CS.nextSelect = false;
		}
		obj.ConnectedSelect = CS;
	}
}

function ConnectedSelectEnabledSelect(oSel){
    console.log(oSel);
	var oVal = oSel.options[oSel.selectedIndex].value;
	if(oVal) {
		while(oSel.ConnectedSelect.nextSelect.options[1])oSel.ConnectedSelect.nextSelect.remove(1);
		var eF = false;
		for(var OG=oSel.ConnectedSelect.nextSelect.ConnectedSelect.node.firstChild;OG;OG=OG.nextSibling) {
			if(OG.label == oVal) {
				eF = true;
				for(var OP=OG.firstChild;OP;OP=OP.nextSibling)
					oSel.ConnectedSelect.nextSelect.appendChild(OP.cloneNode(true));
				break;
			}
		}
		oSel.ConnectedSelect.nextSelect.disabled = !eF;
	} else {
		oSel.ConnectedSelect.nextSelect.selectedIndex = 0;
		oSel.ConnectedSelect.nextSelect.disabled = true;
	}
	if(oSel.ConnectedSelect.nextSelect.onchange)oSel.ConnectedSelect.nextSelect.onchange();
}
*/



/**
 * コンボボックスを協調動作させる
 * 親の持つvalueが直下の子のoptgroupのlabelと一致するものだけを選択可能とする。
 * 協調動作させたコンボボックスのうち、一番下の子のvalueを全体の値として利用する。
 * ※一番下の子のvalueはそれぞれユニークでなければならない。
 * ConnectedSelectorManager :  ConnectedSelectorを生成・管理する。外部からの処理インターフェイス
 * ConnectedSelector        :  強調動作するコンボボックス1つを管理する。
 * 
 * [ Usage ]
 *   // 管理オブジェクト生成
 *   // 強調動作させるコンボボックスのIDを親から子の順序で並べた配列を渡す
 *   var csm = new ConnectedSelectorManager(['コンボボックスID1', 'コンボボックスID2', ...]);
 *   // 一番下の子のvalueを指定して適切な選択状態を作り出す
 *   csm.selectByValue('一番下の子のvalue');
 *   // それぞれのコンボボックスのvalueを指定して、適切な選択状態を作り出す
 *   csm.selectByValues(['value1', 'value2', ...]);
 */
/**
 * 協調コンボボックスグループ管理クラス
 */
var ConnectedSelectorManager = function() {
    this.initialize.apply(this, arguments);
};
ConnectedSelectorManager.prototype = {
    _selectors: null,
    //
    // 初期化処理
    //
    initialize: function(selIdList) {
        this._selectors = new Array();
        var next = null;
        var len = selIdList.length;
        for (var i = len - 1; i >= 0; i--) {
            var selector = new ConnectedSelector(selIdList[i]);
            if (selector.Elm == null) break;
            if (next != null) {
                selector.setNext(next);
            }
            next = selector;
            this._selectors.unshift(selector);
        }
        
        this._selectors[0].selectByIndex(0);
    },
    //
    // 一番下の子のvalueを指定して適切な選択状態を作り出す
    //
    selectByValue: function(value) {
        var len = this._selectors.length;
        var group_stack = new Array();
        var group = value;
        for (var i = len - 1; i >= 0; i--) {
            group_stack.push(group);
            group = this._selectors[i].getGroupByValue(group);
        }
        for (var i = 0; i < len; i++) {
            group = group_stack.pop();
            this._selectors[i].selectByValue(group);
        }
    },
    //
    // 値を配列で指定して、親から順に該当したものを選択状態とする
    //
    selectByValues: function(values) {
        var len = this._selectors.length;
        for (var i = 0; i < len && values.length > 0; ++i) {
            var value = values.shift();
            if (!this._selectors[i].selectByValue(value)) {
                break;
            }
        }
    }
};

/**
 * 協調コンボボックス単体クラス
 */
var ConnectedSelector = function() {
    this.initialize.apply(this, arguments);
};
ConnectedSelector.prototype = {
    _elm:      null,
    _groups:   null,
    _values:   null,
    _next:     null,
    _EMPTY:    '__',
    Elm: function() { return this._elm; },
    //
    // 初期化処理
    //
    initialize: function(id) {
        this._elm = document.getElementById(id);
        this.initOptions();
        this.initEvents();
    },
    //
    // 対象コンボボックスのoptgroup/optionを管理データとして保存する
    //
    initOptions: function() {
        this._groups = {};
        this._values = {};
        var options = this._elm.getElementsByTagName('option');
        for (var i = 0, len = options.length; i < len; i++) {
            var group_name = this._EMPTY;
            if (options[i].parentNode.tagName.toLowerCase() == 'optgroup') {
                group_name = options[i].parentNode.label;
            }
            if (!this._groups[group_name]) {
                this._groups[group_name] = {};
            }
            var value = options[i].value;
            this._groups[group_name][value] = options[i].cloneNode(true);
            this._values[value] = group_name;
        }
    },
    //
    // イベントの初期化
    //
    initEvents: function() {
        var _self = this;
        this.bindEvent('change', (function() { return function() { _self.onChangeEvent();} })());
    },
    //
    // イベント登録用簡易ラッパ
    //
    bindEvent: function(type, listener) {
        if (this._elm.addEventListener) {
            this._elm.addEventListener(type, listener, false);
        } else if (this._elm.attachEvent) {
            this._elm.attachEvent('on' + type, listener);
        }
    },
    //
    // 子のコンボボックスを設定する
    //
    setNext: function(nextSelector) {
        this._next = nextSelector;
    },
    //
    // 対象コンボボックスをアクティブにする
    // 指定されたoptgroupの項目を利用可能にする
    //
    activate: function(group_name) {
        for (var i = this._elm.childNodes.length - 1; i >= 0; i--) {
            this._elm.removeChild(this._elm.childNodes[i]);
        }
        this._elm.disabled = (group_name == this._EMPTY)? 'disabled': '';
        if (!this._groups[group_name]) {
            return;
        }
        for (var p in this._groups[group_name]) {
            this._elm.appendChild(this._groups[group_name][p]);
        }
        this.activateNext(this._elm.value);
    },
    //
    // 子のコンボボックスをアクティブにする
    //
    activateNext: function(group_name) {
        if (this._next == null) return;
        if (group_name == null || group_name == '') group_name = this._EMPTY;
        this._next.activate(group_name);
    },
    //
    // コンボボックスの選択状態が変化した際に呼ばれる処理
    //
    onChangeEvent: function() {
        this.activateNext(this._elm.value);
    },
    //
    // 指定されたvalueによって適切な選択状態を作り出す
    //
    selectByValue: function(value) {
        var ret = false;
        if (value == null) value = '';
        if (!this._values.hasOwnProperty(value) || value.length == 0) {
            value = this._EMPTY;
            this._elm.selectedIndex = 0;
            ret = false;
        } else {
            this._elm.value = value;
            ret = true;
        }
        this.activateNext(value);
        return ret;
    },
    //
    // 指定されたindexによって適切な選択状態を作り出す
    //
    selectByIndex: function(index) {
        this._elm.selectedIndex = 0;
        this.activateNext(this._elm.value);
    },
    //
    // 指定されたvalueが属しているoptgroupのlabelを返す
    //
    getGroupByValue: function(value) {
        if (this._values[value]) {
            return this._values[value];
        }
        for (var p in this._values) {
            return this._values[p];
        }
        
        return this._EMPTY;
    }
};

//-->