/*
*
* @(#)Func List
* 1. COM_isEmptyStr : check string is empty or not
* 2. COM_isEmailStr : check string is email or not
* 3. COM_isCsvFileName : check string is csv file name or not
* 4. COM_isBetween(value,a,b) : check value is between A with B or not
* 5. COM_allCheckOn(checkbox) : check checkboxon is selected or not
* 6. COM_allCheckOff(checkbox) : check checkboxoff is selected or not
* 7. COM_isDigit(theNum) : check number is digit or not
* 8. COM_isNumStr(numStr) : check string is int or not
* 9. COM_isDateStr(dateStr) : check string is date or not
*10.COM_isScienceCountStr(theStr) :check string display with scienceCount or not
*/
/************** Example @see FRM70301.COMp ***************
************** Example **********************************/
//COM_isEmptyStr
//check string is empty or not
// ver date author description
// 1.0 03/04/21 LLin Write the first version
//function COM_isEmptyStr( rsStr ){
// var iI = 0 ;
// var bSucc = new Boolean( true );
// if( rsStr.length > 0 ) {
// for( iI = 0 ;iI < rsStr.length ; iI ++ ){
// if( (rsStr.charAt(iI) != ' ')&&(rsStr.charAt(iI) != '@')@) {
// bSucc = false;
// }
// }
/// }
// return bSucc;
//}
//zhangyihui
//check Ab)) {return(false);}
else {return(true);}
}
//check string is empty or not
function COM_isEmptyStr(str){
var strChk;
strChk = COM_Trim(str)
if((strChk==null)||(strChk.length==0)) return true;
else return (false);
}
//check oncheckbox is selected or not
function COM_allCheckOn(checkbox){
if (checkbox == null)
{
return;
}
for(i=0;i0) maxDays=28;
else if(y%100==0&&y%400>0) maxDays=28;
else maxDays=29;
}
if(COM_isBetween(d,1,maxDays)==false){
// alert("The day is invalid");
return(false);}
else{return(true);}
}
}
//check string is money or not
function COM_isScienceCountStr(theStr){
if(COM_isEmptyStr(theStr)) {return(false);}
else if(theStr.length<4){
if(!COM_isNumStr(theStr)){return(false)}
else{return(true);}
}
else{
var partNum=theStr.length/4+1;
var firstPartBits=theStr.length%4;
var tempStr=theStr;
for(i=1;i-1; i++) {
len -= escval.charAt(i+1)=='u' ? 4 : 2;
}
if (len > maxsize) {
return false;
} else {
return true;
}
}
function COM_LenChk(val,maxsize) {
var i=0;
var str_len=val.length;
if (str_len > maxsize) {
return false;
} else {
return true;
}
}
function COM_IsFRMSABookInfo(rsCsvPathFiles, rbAbookCls) {
var sFileName = new String();
var sFRMSABookInfo = new String();
var sCSVInfo = new String();
//get file name
iEnd = rsCsvPathFiles.length;
iBegin = rsCsvPathFiles.lastIndexOf("\\") + 1;
sFileName = rsCsvPathFiles.substring(iBegin,iEnd);
iEnd = sFileName.length;
if (iEnd < 8) return false;
sFRMSABookInfo = sFileName.substring(0,4);
//alert(sFRMSABookInfo.toLowerCase() );
//alert(rbAbookCls);
if ( rbAbookCls) {
if (sFRMSABookInfo.toLowerCase() != "1(2)") return false;
} else {
if (sFRMSABookInfo.toLowerCase() != "1(3)") return false;
}
sCSVInfo = sFileName.substring(iEnd-4,iEnd);
if (sCSVInfo.toLowerCase() != ".csv" ) return false;
return true;
}