/* **************** NEW FUNCTIONS ********************************* */

function GetTrimInput(str) 
    {
        if(!str || typeof str != 'string')        
            return null;
        return str.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
    }
    
function IsValidYear(strInput) 
{
    var filter = /^\d{4}$/;
    if (!filter.test(strInput)) 
    {
        return false;
    }
    else
    {
        return true;
    }
}

function IsValidPinCode(strInput) 
{
    var filter = /^\d{6}$/;
    if (!filter.test(strInput)) 
    {
        return false;
    }
    else
    {
        return true;
    }
}

function IsValidNumber(strInput) 
{
    var filter = /^([0-9])$/;
    if (!filter.test(strInput)) 
    {
        return false;
    }
    else
    {
        return true;
    }
}

function IsValidEmailAddress(email) 
    {
        var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
        if (!filter.test(email)) 
        {
            return false;
        }
        else
        {
            return true;
        }
    }

