/* 関数名:function gNotPressKeys(e) 概要 :キープレスが禁止されているか判定する。禁止されていたらfalseを返す。 作成者:Ramat 作成日:2001/05/16 ================================== 修正履歴: yyyy/mm/dd 修正者 修正内容 2001/08/11 Ramat 公開のためインデントなどを修正 */ function gNotPressKeys(e) { var BolErrFlg = 1; var flg; switch(window.event.srcElement.tagName){ case "INPUT": flg = 0;break; case "TEXTAREA": flg = 0;break; } bolErrFlg = false; if( flg != 0 ) { //禁止キーをチェック switch(event.keyCode){ case 8 : bolErrFlg = true;break; //BackSpace case 27 : bolErrFlg = true;break; //ESC case 116 : bolErrFlg = true;break; //F5 } } if ( bolErrFlg == true ) { event.keyCode = 0; //キーコードを消去してリターン return false; }else{ return true; } } //キーダウンイベントハンドラに設定する。 document.onkeydown = gNotPressKeys; //--------------------------------------------------------------------- //関 数:cjSetCookie //機 能:Cookieの値を書き込む //引 数:(i) sName (Cookie文字列) //引 数:(i) sValue (Cookie値) //引 数:(i) lFlg (Cookie保存期間)0:一時保存、1:半永久保存 //復帰値:1 (正常終了) // 0 (引数異常) //作成日:1998/12/9 //更新日: //--------------------------------------------------------------------- function cjSetCookie(sName,sValue,lFlg){ var sDate=""; if(sName==null || sName=="") return 0; if(sValue==null || sValue=="") return 0; var sFlg=""+lFlg; //IE4.0で空白と0を区別するため文字列にしてチェックする。 if (sFlg != "0" && sFlg !="1") return 0; if (lFlg == "1") sDate=";expires=Mon,01-Jan-9999 12:00:00 GMT"; document.cookie = sName + "=" + escape(sValue) + sDate; return 1; } //------------------------------------------- //関 数:gSetComma //機 能:該当の文字列を3桁おきにカンマ編集 //引 数:(i) intCount (数値) //復帰値:なし //作成日:2003/06/13 //更新日: //------------------------------------------- function gSetComma(intCount){ var destStr = intCount.toString(); destStr = destStr.replace(/,/g, ""); var tmpStr = ""; while (destStr != (tmpStr = destStr.replace(/^([+-]?\d+)(\d\d\d)/,"$1,$2"))) { destStr = tmpStr; } return destStr; } //------------------------------------------- //関 数:over //機 能:該当オブジェクトの背景色を変更 //引 数:(i) objBTN (オブジェクト) //復帰値:なし //作成日:2003/06/13 //更新日: //------------------------------------------- function over(objBTN){ // objBTN.backgroundColor = "#00ff99"; objBTN.backgroundColor = "#00ff99"; } //------------------------------------------- //関 数:out //機 能:該当オブジェクトの背景色を変更 //引 数:(i) objBTN (オブジェクト) //復帰値:なし //作成日:2003/06/13 //更新日: //------------------------------------------- function out(objBTN){ // objBTN.backgroundColor = "#006600"; objBTN.backgroundColor = "#006600"; } //------------------------------------------- //関 数:JudgeZenkaku //機 能:全角文字のみかチェックします //引 数:String (文字列) //復帰値:true:全角文字のみ、false:半角文字を含む //作成日:2003/06/23 //更新日: //------------------------------------------- function JudgeZenkaku( String ){ var Count ; var Letter ; for( Count=0; Count < String.length; Count++ ){ Letter = String.charAt( Count ) ; if( Letter < " " && Letter != '\n' && Letter != '\r' ) return false ; } return true ; } //------------------------------------------- //関 数:trim //機 能:半角スペース削除 //引 数:(i) obj (オブジェクト) //復帰値:なし //作成日:2003/06/23 //更新日: //------------------------------------------- function trim(obj) { var strVal = RTrim(LTrim(obj.value)); obj.value = strVal; } //------------------------------------------- //関 数:RTrim //機 能:半角右スペース削除 //引 数:(i) strTemp (文字列) //復帰値:半角右スペース削除文字列 //作成日:2003/06/23 //更新日: //------------------------------------------- function RTrim(strTemp){ var nLoop = 0; var strReturn = strTemp; while (nLoop < strTemp.length){ if (strReturn.substring(strReturn.length - 1, strReturn.length) == " "){ strReturn = strTemp.substring(0, strTemp.length - (nLoop + 1)); }else{ break; } nLoop++; } return strReturn; } //------------------------------------------- //関 数:LTrim //機 能:半角左スペース削除 //引 数:(i) strTemp (文字列) //復帰値:半角左スペース削除文字列 //作成日:2003/06/23 //更新日: //------------------------------------------- function LTrim(strTemp){ var nLoop = 0; var strReturn = strTemp; while (nLoop < strTemp.length) { if (strReturn.substring(0, 1) == " "){ strReturn = strTemp.substring(nLoop + 1, strTemp.length); }else{ break; } nLoop++; } return strReturn; } //------------------------------------------- //関 数:gChkDate //機 能:日付チェック(注意:内容の数字チェックは事前に行うこと) //引 数:引数2つの場合 月,日(この場合、年は当年をセット) // 引数3つの場合 年,月,日 //復帰値:true : 日付 // false : 日付でない //作成日:2003/06/24 //更新日: //------------------------------------------- function gChkDate(){ switch( gChkDate.arguments.length ){ case 2:{ var objDate = new Date(); var intYear = objDate.getFullYear(); intMonth = parseInt(gChkDate.arguments[0],10); intDay = parseInt(gChkDate.arguments[1],10); break; } case 3:{ intYear = parseInt(gChkDate.arguments[0],10); intMonth = parseInt(gChkDate.arguments[1],10); intDay = parseInt(gChkDate.arguments[2],10); break; } } // 2004/12/24 0000年をエラーにする処理追加 if(intYear == 0){ return false; } maxDayOfMonth = Array( 31,29,31,30,31,30,31,31,30,31,30,31 ); if( intMonth < 1 || intMonth > 12 ){ return false; } if( intDay < 1 || intDay > maxDayOfMonth[intMonth-1] ){ return false; } if( intMonth != 2 ){ return true; } if( intDay < 29 ){ return true; } if( ( intYear % 4 ) == 0 && ( intYear % 100 ) != 0 ){ return true; } if( ( intYear % 400 ) == 0 ){ return true;} return false; } //------------------------------------------- //関 数:gChkHankaku //機 能:指定文字列の半角チェック //引 数:(i) strCheckString (チェック対象文字列) //復帰値:true : 全て半角 // false : 半角以外の文字あり //作成日:2003/06/24 //更新日: //------------------------------------------- function gChkHankaku(strCheckString){ if( strCheckString.match(/[^ -~。-゚]/) == null){ return true; }else{ return false; } } //------------------------------------------- //関 数:gChkZenkaku //機 能:指定文字列の全角チェック //引 数:(i) strCheckString (チェック対象文字列) //復帰値:true : 全て全角 // false : 全角以外の文字あり //作成日:2003/06/24 //更新日: //------------------------------------------- function gChkZenkaku(strCheckString){ if( strCheckString.match(/[ -~^。-゚]/) == null){ return true; }else{ return false; } } //------------------------------------------- //関 数:gChkNumeral //機 能:指定文字列の数字チェック //引 数:(i) strCheckString (チェック対象文字列) //復帰値:true : 全て数字 // false : 数字以外の文字あり //作成日:2003/06/24 //更新日: //------------------------------------------- function gChkNumeral(strCheckString){ if( strCheckString.match(/[^0-9\-]/) == null ){ return true; }else{ return false; } } //------------------------------------------- //関 数:gChkNumeral2 //機 能:指定文字列の数字チェック("--1"や"1-1"などの不正な数字文字列にも対応) //引 数:(i) strCheckString (チェック対象文字列) //復帰値:true : 正しい整数 // false : 不正な数字文字列 //作成者:tdi.坂上 //作成日:2017/01/20 //更新日: //------------------------------------------- function gChkNumeral2(strCheckString) { if(strCheckString.match(/^-?[0-9]+$/) == null) { return false; } else { return true; } } //------------------------------------------- //関 数:gChkForbidden //機 能:指定文字列の禁止文字使用チェック //引 数:(i) strCheckString (チェック対象文字列) //復帰値:true : 禁止文字の使用無し // false : 禁止文字の使用有り(エラー) //作成日:2003/06/24 //更新日: //------------------------------------------- function gChkForbidden(strCheckString){ //注意:禁止文字を追加した後はメッセージファイル //DPW_COMMN_MES.inc を修正せよ! if( strCheckString.match(/["',|]/) == null ){ return true; }else{ return false; } } //------------------------------------------- //関 数:demicalFloat //機 能:xxxxxxx //引 数:(i) numberA xxxxxx //引 数:(i) numberB xxxxxx //引 数:(i) type xxxxxx //復帰値:xx : xxxxxx // xx : xxxxxx //作成日:xxxxxx //更新日: //------------------------------------------- function demicalFloat(numberA,numberB,type) { var h=(type=="*")? "+":"-"; var c=[get(numberA),get(numberB)]; var A=c[0][1]; var B=c[1][1]; var pointA=c[0][0]; var pointB=c[1][0]; if (type=="*" || type=="/") { var k1=eval("numberA"+type+"numberB"); var k2=eval("(A"+type+"B)"); if (get(k1)[1]==k2) return k1; else return (pointA+pointB==0? k1:eval(k2+"/Math.pow(10,pointA"+h+"pointB)")); } else if (type=="+" || type=="-") { var pointL=pointA; if (pointA