
function validateSBCS(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    var formName = form.getAttributeNode("name");

    osbcs = eval('new ' + formName.value + '_SbcsValidations()');
    for (x in osbcs) { //--2003.01.20
        if ((form[osbcs[x][0]].type == 'text' ||
             form[osbcs[x][0]].type == 'textarea') &&
            !(isSBCS(form[osbcs[x][0]].value))) {
            if (i == 0) {
                focusField = form[osbcs[x][0]];
            }
            fields[i++] = osbcs[x][1];
            bValid = false;
        }
    }
    if (fields.length > 0) {
       focusField.focus();
       alert(fields.join('\n'));
    }
    return bValid;
}

function isSBCS(value) {
	for (i = 0; i < value.length; i++) {
		if (!isSingleByteCharacter(value.charCodeAt(i)))
			return false;
	}
	return true;
}

function isSingleByteCharacter(val) {
	var ival = val;
	if ((ival >= 0x0020 && ival <= 0x007f)) {
		return true;
	}
	if ((ival >= 0xff61 && ival <= 0xff9f)) {
		return true;
	}
	return false;
}


