<!--
// by K.T.
 
  //コンボボックスのvalue取得
  function GetComboBoxValue(theComboBox) {
  
    return theComboBox.options[theComboBox.selectedIndex].value;
    
  }
  
  // コンボボックスのvalueのURLに飛ぶ
  function MoveSelected(theComboBox) {
  
    var wComboBox = GetComboBoxValue(theComboBox);
    
    if (wComboBox != '') {
      window.location = wComboBox;
    }
    
  }
  
  // 年月日のコンボボックスのチェック
  function CheckComboYMD(yearComboBox, monthComboBox, dayComboBox) {
  
    var wYear;
    var wMonth;
    var wDay;
    
    // 月で判断
    wMonth = GetComboBoxValue(monthComboBox);
    
    // 1月,3月,5月,7月,8月,10月,12月は無条件でOK
    if (wMonth == '1'
     || wMonth == '3'
     || wMonth == '5'
     || wMonth == '7'
     || wMonth == '8'
     || wMonth == '10'
     || wMonth == '12') {
      return true;
    }
    
    // 日でも判断
    wDay = GetComboBoxValue(dayComboBox);
    
    // 2月は特殊
    if (wMonth == '2') {
    
      // 30日と31日はNG
      if (wDay == '30' || wDay == '31') {
        alert('正しい年月を選択してください。(-1)');
        return false;
      }
      
      // 29日のときは年も必要
      if (wDay == '29') {
      
        wYear = GetComboBoxValue(yearComboBox);
        
        // 閏年以外はNG
        if (wYear % 4 != 0 || (wYear % 100 == 0 && wYear % 400 != 0)) {
          alert('正しい年月を選択してください。(-2)');
          return false;
        }
        
      }
      
      // 他の日はOK
      return true;
      
    }
    
    // 他の月は31日がNGで他はOK
    if (wDay == '31') {
      alert('正しい年月を選択してください。(-3)');
      return false;
    } else {
      return true;
    }
    
  }
  
  // 数値入力欄のチェック
  function CheckNum(theTextBox) {
  
    var wText;
    
    // 数字のチェック
    wText = theTextBox.value;
    
    if (wText.match(/[^0-9]/) != null) {
      alert('半角数字で入力してください。(-1)');
      theTextBox.focus();
      theTextBox.select();
      return false;
    }
    
    return true;
    
  }
  
  // 年月入力欄のチェック
  function CheckYM(theTextBox) {
  
    var wArray = new Array();
    
    // 「/」で分ける
    wArray = theTextBox.value.split('/');
    
    if (wArray.length != 2) {
      alert('正しい年月を入力してください。(-1)');
      theTextBox.focus();
      theTextBox.select();
      return false;
    }
    
    // 年のチェック
    if (wArray[0].match(/^19[0-9][0-9]$/) == null
     && wArray[0].match(/^20[0-9][0-9]$/) == null) {
      alert('正しい年月を入力してください。(-2)');
      theTextBox.focus();
      theTextBox.select();
      return false;
    }
    
    // 月のチェック
    if (wArray[1].match(/^0?[1-9]$/) == null
     && wArray[1].match(/^1[0-2]$/)  == null) {
      alert('正しい年月を入力してください。(-3)');
      theTextBox.focus();
      theTextBox.select();
      return false;
    }
    
    return true;
    
  }
  
  // 年月日入力欄のチェック
  function CheckYMD(theTextBox) {
  
    var wArray = new Array();
    var wDays  = new Array();
    var wYear;
    var wMonth;
    
    // 「/」で分ける
    wArray = theTextBox.value.split('/');
    
    if (wArray.length != 3) {
      alert('正しい年月日を入力してください。(-1)');
      theTextBox.focus();
      theTextBox.select();
      return false;
    }
    
    // 年のチェック
    if (wArray[0].match(/^19[0-9][0-9]$/) == null
     && wArray[0].match(/^20[0-9][0-9]$/) == null) {
      alert('正しい年月日を入力してください。(-2)');
      theTextBox.focus();
      theTextBox.select();
      return false;
    }
    
    // 月のチェック
    if (wArray[1].match(/^0?[1-9]$/) == null
     && wArray[1].match(/^1[0-2]$/)  == null) {
      alert('正しい年月日を入力してください。(-3)');
      theTextBox.focus();
      theTextBox.select();
      return false;
    }
    
    // 月ごとの日数
    wDays.length = 12;
    wDays[0]  = 29; //  2月(閏年)
    wDays[1]  = 31; //  1月
    wDays[2]  = 28; //  2月
    wDays[3]  = 31; //  3月
    wDays[4]  = 30; //  4月
    wDays[5]  = 31; //  5月
    wDays[6]  = 30; //  6月
    wDays[7]  = 31; //  7月
    wDays[8]  = 31; //  8月
    wDays[9]  = 30; //  9月
    wDays[10] = 31; // 10月
    wDays[11] = 30; // 11月
    wDays[12] = 31; // 12月
    
    // 年月によって日数が違う
    wYear  = Number(wArray[0]);
    wMonth = Number(wArray[1]);
    
    // 閏年の2月チェック
    if (wMonth == 2 && ((wYear % 4 == 0 && wYear % 100 != 0) || wYear % 400 == 0)) {
      wMonth = 0;
    }
    
    // 日のチェック
    switch (wDays[wMonth]) {
    case 31: // 31日
      if (wArray[2].match(/^0?[1-9]$/)   == null
       && wArray[2].match(/^[12][0-9]$/) == null
       && wArray[2].match(/^3[01]$/)     == null) {
        alert('正しい年月日を入力してください。(-4)');
        theTextBox.focus();
        theTextBox.select();
        return false;
      }
      break;
    case 30: // 30日
      if (wArray[2].match(/^0?[1-9]$/)   == null
       && wArray[2].match(/^[12][0-9]$/) == null
       && wArray[2].match(/^30$/)        == null) {
        alert('正しい年月日を入力してください。(-5)');
        theTextBox.focus();
        theTextBox.select();
        return false;
      }
      break;
    case 29: // 29日
      if (wArray[2].match(/^0?[1-9]$/)   == null
       && wArray[2].match(/^[12][0-9]$/) == null) {
        alert('正しい年月日を入力してください。(-6)');
        theTextBox.focus();
        theTextBox.select();
        return false;
      }
      break;
    case 28: // 28日
      if (wArray[2].match(/^0?[1-9]$/) == null
       && wArray[2].match(/^1[0-9]$/)  == null
       && wArray[2].match(/^2[0-8]$/)  == null) {
        alert('正しい年月日を入力してください。(-7)');
        theTextBox.focus();
        theTextBox.select();
        return false;
      }
      break;
    }
    
    return true;
    
  }
  
  // MaxLengthを超えていないかチェック
  function CheckByte(theTextBox) {
  
    if (LenBAscii(theTextBox.value) > theTextBox.maxLength) {
      alert('入力された文字列が長すぎます。(-1)');
      theTextBox.focus();
      theTextBox.select();
      return false;
    }
    
    return true;
    
  }
  
  // 1バイト文字のチェック
  function CheckOneByteChar(theString) {
  
    var cnt;
    
    for (cnt = 0; cnt < theString.length; cnt++) {
      if (LenBAscii(theString.substr(cnt, 1)) != 1) {
        alert('半角文字で入力してください。(-1)');
        return false;
      }
    }
    
    return true;
    
  }
  
  // Asciiコードのバイト数を返す
  function LenBAscii(theString) {
  
    var cnt;
    var wlen;
    var wcode;
    
    wlen = 0;
    
    for (cnt = 0; cnt < theString.length; cnt++) {
    
      wcode = theString.charCodeAt(cnt);
      wlen++;
      
      // 文字コードの範囲で1バイト文字か2バイト文字化判定
      if (((0 <= wcode && wcode <= 255) || (65383 <= wcode && wcode <= 65439)) == false) {
        wlen++;
      }
      
    }
    
    return wlen;
    
  }
  
  // メールアドレスチェック
  function CheckMailAddress(theTextBox) {
  
    var len;
    var ret;
    var i;
    var cnt;
    var addr = new Array(2);
    var UsrNam;
    var DmnNam;
    var word = new Array;
    var RE1;
    var RE2;
    var RE3;
    var RE4;
    var RE5;
    var j;
    var chr;
    var ChrCod;
    
    // 未入力チェック
    if (theTextBox.value == '') {
      theTextBox.focus();
      theTextBox.select();
      return false;
    }
    
    // @チェック
    len = theTextBox.value.length;
    i = 0;
    cnt = 0;
    
    while (i < len) {
    
      ret = theTextBox.value.indexOf('@',i);
      
      if (ret != -1) {
        cnt += 1;
        i = ret + 1;
      } else if (cnt == 1) {
        break;
      }
      
      if (cnt == 0 || cnt > 1 ){
        theTextBox.focus();
        theTextBox.select();
        return false;
      }
      
    }
    
    addr = theTextBox.value.split('@')
    UsrNam = addr[0];
    DmnNam = addr[1];
    
    // ドメイン名チェック
    if (DmnNam == '' || DmnNam.length >= 255) {
      theTextBox.focus();
      theTextBox.select();
      return false;
      
    } else if (DmnNam.indexOf('.') == -1) {
      theTextBox.focus();
      theTextBox.select();
      return false;
      
    } else {
      word = DmnNam.split('.');
      
      // ワードチェック
      for (i = 0; i < word.length; i++) {
      
        if (word[i] == '' || word[i].length >= 64) {
          theTextBox.focus();
          theTextBox.select();
          return false;
          
        } else {
          RE1 = new RegExp('[^A-Z]')
          RE2 = new RegExp('[^a-z]')
          RE3 = new RegExp('[^-]')
          RE4 = new RegExp('[^0-9]')
          RE5 = new RegExp('[-]')
          
          len = word[i].length
          j = 0
          
          while (j < len) {
          
            chr = word[i].substring(j,j + 1);
            
            // 'A～Z','a～z','-','0～9'以外の文字が使用されていないかチェック
            if (RE1.test(chr)) {
              if (RE2.test(chr)) {
                if (RE3.test(chr)) {
                  if (RE4.test(chr)) {
                    theTextBox.focus();
                    theTextBox.select();
                    return false;
                  }
                }
              }
            }
            
            // '-'が先頭または末尾に使用されていないかチェック
            if ((j == 0 || j == len - 1) && RE5.test(chr)) {
              theTextBox.focus();
              theTextBox.select();
              return false;
            }
            
            j += 1;
            
          }
          
        }
        
      }
      
    }
    
    // ユーザー名チェック
    if (UsrNam == ''){
      theTextBox.focus();
      theTextBox.select();
      return false;
      
    } else {
      len = UsrNam.length;
      
      for (i = 0; i < len; i++) {
      
        ChrCod = UsrNam.charCodeAt(i)
      
        if (ChrCod < 0 || 127 < ChrCod) {
          theTextBox.focus();
          theTextBox.select();
          return false;
        }
        
      }
      
    }
    
    return true;
    
  }
  
	//--------------------------------------------------------------------------------------------

	//未入力チェック
	function CheckEmpty(Obj, MsgStr){
	
		if(Obj.value == ''){
		
			alert(MsgStr + 'が未入力です。');
			Obj.focus();

			return false;

		}

		return true;
	
	}
	
	//--------------------------------------------------------------------------------------------  
  
//-->
