﻿//-------------------------------------------------------------------------------
// General validation methods.
//-------------------------------------------------------------------------------
// This method check the given value is numeric or not.
function isNumeric( value ) 
{
    for (var i = 0; i < value.length; i++)
    {
        var ch = value.substring(i, i + 1)
        if ((ch < "0" || "9" < ch) && ch != '.')
            return false;
    }
    return true;
}

// This method prefix 0 with the given value.
function fixDigit( pValue, pDigits )
{
	if( (pValue+'').length >= parseInt( pDigits ) )
		return pValue;
	
	var prefix = '';
	for( i = 1; i < pDigits; i++ )
		prefix += '0';
		
	return prefix + pValue;
}