<!--

function Trim(str)
{
    return str.replace(/^[\s]*(.*?)[\s]*$/g, '$1');
}

function Left(strIn, iLength)
{
    if (strIn.length > iLength)
    {
        strIn = strIn.substr(0, iLength);
    }
    return strIn;
}

function Right(strIn, iLength)
{
    if (strIn.length > iLength)
    {
        var iIndex = strIn.length - iLength;
        strIn = strIn.substr(iIndex, iLength);
    }
    return strIn;
}

function GetWordsLenth(strIn)
{
    return strIn.replace(/[^\x00-\xff]/g, "00").length;
}

function CharRepeat(strIn, iCount)
{
    var strValue = "";
    if (IsEmptyStr(strIn) == false)
    {
        for (var iCharRepeatCount = 1; iCharRepeatCount <= iCount; iCharRepeatCount++)
        {
            strValue += strIn;
        }
    }
    return strValue;
}

function IsEmptyStr(strIn)
{
    var bValue = false;
    if (strIn == null)
        bValue = true;
    else if (strIn.length == 0)
        bValue = true;
    return bValue;
}

function FillZeroBeforeNum(iNumIn, iNumMax)
{
    var strValue = "";
    var iLen = iNumMax.toString().length;
    strValue = CharRepeat("0", iLen - 1) + iNumIn.toString();
    strValue = Right(strValue, iLen);
    return strValue;
}
-->