function isNumber(sVal)
{
	var lRe= true;
	var nInt= 0;
	while (lRe && nInt<=sVal.length)
	{
		var cCA= sVal.charCodeAt(nInt);
		lRe= !(cCA<48 || cCA>57);		// not between 0..9
		nInt++;
	}
	return lRe;
}

function isChar(sVal)
{
	sVal= sVal.toUpperCase();
	var lRe= true;
	var nInt= 0;
	while (lRe && nInt<=sVal.length)
	{
		var cCA= sVal.charCodeAt(nInt);
		lRe= !(cCA<65 || cCA>90);		// not between A..Z
		nInt++;
	}
	return lRe;
}

function isSpecial(cChar, sSpecial)
{
	cChar= cChar.toUpperCase();
	sSpecial= sSpecial.toUpperCase();
	var lRe= false;
	var nInt= 0;
	while (!lRe && nInt<=sSpecial.length)
	{
		lRe= cChar.charCodeAt(0)==sSpecial.charCodeAt(nInt);		// not between sSpecial' value
		nInt++;
	}
	return lRe;
}

function inputMask(sMask,autoFocus)
{
	//sMask:
	//	- "L" : character
	//	- "9" : number
	//	- "#" : special characters ". "...

	var cChar= ""+ event.keyCode;
	var objFocus= getObj(autoFocus);
	if (cChar==13 && objFocus) {objFocus.focus();objFocus.select();return};
	if (cChar>=97 && cChar<=122) cChar-=32;

	sMask= sMask.toUpperCase();

	var sPlus= "";
	if (sMask.search("L")>=0) sPlus+= "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	if (sMask.search("9")>=0) sPlus+= "0123456789";
	if (sMask.search("#")>=0) sPlus+= "`~!@#$%^&*()_-=|\'[];:<,.>?";
	sMask+= sPlus;

	var lRe= false;
	var nInt= 0;
	while (!lRe && nInt<=sMask.length)
	{
		lRe= cChar==sMask.charCodeAt(nInt);		// invalid key
		nInt++;
	}
	return lRe;
}
