
function isBlank(str)
{
    if (str == "")
        return(true);
    else
        return(false);
}

function sjIsDigit(ch)
{
	switch(ch)
	{
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
		return(true);
	default:
		return(false);
	}
}

function sjIsMathSymbols(ch)
{
	switch(ch)
	{
	case '+':
	case '-':
	case '.':
		return(true);
	default:
		return(false);
	}
}

function isRealNumeric(n)
{
	var i;
	var iLen=0;
	var rv=true;
	iLen = n.length;
	if(iLen>0)
	{
		for(i=0;i<iLen;i++)
		{
			ch = n.charAt(i);
			if(sjIsDigit(ch)==true || sjIsMathSymbols(ch)==true)
				rv=true;
			else
				return(false);
		}
	}
	return(rv);
}

function isWholeNumeric(n)
{
	var i;
	var iLen=0;
	var start=0;
	iLen = n.length;
	if(iLen>0)
	{
		switch(n.charAt(0))
		{
		case '+':
		case '-':
			start=1;
		default:
			start=0;
		}

		for(i=start;i<iLen;i++)
		{
			if(sjIsDigit(n.charAt(i)) == false)
				return(false);
		}
	}
	return(true);
}

function bCheckByte(n)
{
	var nByte;
	var bool;
	bool = isWholeNumeric(n);
	if(bool == true)
	{
		nByte = parseInt(n);
		if(nByte>=0 && nByte<256)
			return(true);
		else
			return(false);
	}
	return(false);
}

function bCheckInteger(n)
{
	var nInteger;
	var bool;
	bool = isWholeNumeric(n);
	if(bool == true)
	{
		nInteger = parseInt(n);
		if(nInteger>=-32767 && nInteger<32768)
			return(true);
		else
			return(false);
	}
	return(false);
}

function bCheckLong(n)
{
	var nLong;
	var bool;
	bool = isWholeNumeric(n);
	if(bool == true)
	{
		nLong = parseInt(n);
		if(nLong>=-2147483648 && nLong<2147483647)
			return(true);
		else
			return(false);
	}
	return(false);
}


