function getTotalBytes(varField) {
if(varField == null)
return -1;
var totalCount = 0;
for (i = 0; i< varField.value.length; i++) {
if (varField.value.charCodeAt(i) > 127)
totalCount += 2;
else
totalCount++ ; }
return totalCount; }
function getFirstSelectedValue( checkboxID ){
var value = null;
var i=0;
if( document.all(checkboxID).length > 0 ){
for( i=0; i if( document.all(checkboxID).item( i ).checked ){ value = document.all(checkboxID).item(i).value; break; } } } else { if( document.all(checkboxID).checked ) value = document.all(checkboxID).value; } return value; } function getFirstSelectedIndex( checkboxID ){ var value = -2; var i=0; if( document.all(checkboxID).length > 0 ){ for( i=0; i if( document.all(checkboxID).item( i ).checked ) { value = i; break; } } } else { if( document.all(checkboxID).checked ) value = -1; } return value; } function selectAll( checkboxID,status ){ if( document.all(checkboxID) == null) return; if( document.all(checkboxID).length > 0 ){ for( i=0; i document.all(checkboxID).item( i ).checked = status; } } else { document.all(checkboxID).checked = status; } } function selectInverse( checkboxID ) { if( document.all(checkboxID) == null) return; if( document.all(checkboxID).length > 0 ) { for( i=0; i document.all(checkboxID).item( i = !document.all(checkboxID).item( i ).checked; } } else { document.all(checkboxID).checked = !document.all(checkboxID).checked; } ).checked } function checkDate( value ) { if(value=='') return true; if(value.length!=8 || !isNumber(value)) return false; var year = value.substring(0,4); if(year>\ return false; var month = value.substring(4,6); if(month>\ var day = value.substring(6,8); if(day>getMaxDay(year,month) || day< \ return true; } /* 用途:检查输入的起止日期是否正确,规则为两个日期的格式正确或都为空 且结束日期>=起始日期 输入: startDate:起始日期,字符串 endDate: 结束日期,字符串 返回: 如果通过验证返回true,否则返回false */ function checkPeriod( startDate,endDate ) { if( !checkDate(startDate) ) { alert(\起始日期不正确!\ return false; } else if( !checkDate(endDate) ) { alert(\终止日期不正确!\ return false; } else if( startDate > endDate ) { alert(\起始日期不能大于终止日期!\ return false; } return true; } /* 用途:检查证券代码是否正确 输入: secCode:证券代码 返回: 如果通过验证返回true,否则返回false */ function checkSecCode( secCode ) { if( secCode.length !=6 ){