String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g,"");
}
function IsNumeric(sText){
    var lText = sText;
    var isNumeric = true;
    for(var j=0; j<lText.length; j++)
    {
        var lChar = lText.charAt(j);
        var lUnicode = lChar.charCodeAt(0);
        if((lUnicode > 47 && lUnicode<58)){
        }
        else{
            isNumeric = false;
        }
    }
    return isNumeric;
}
function isAlphaNumeric(sText)
{
    var lText = sText;
    var isAlphaNumeric = true;
    for(var j=0; j<lText.length; j++)
    {
        var lChar = lText.charAt(j);
        var lUnicode = lChar.charCodeAt(0);
        if((lUnicode > 47 && lUnicode<58) ||
            (lUnicode > 64 && lUnicode<91) ||
            (lUnicode > 96 && lUnicode<123) ||
            lUnicode == 32){
        }
        else{
            isAlphaNumeric = false;
        }
    }
    return isAlphaNumeric;
}
function isAlphaNumericNoSpace(sText)
{
    var lText = sText;
    var isAlphaNumeric = true;
    for(var j=0; j<lText.length; j++)
    {
        var lChar = lText.charAt(j);
        var lUnicode = lChar.charCodeAt(0);
        if((lUnicode > 47 && lUnicode<58) ||
            (lUnicode > 64 && lUnicode<91) ||
            (lUnicode > 96 && lUnicode<123)){
        }
        else{
            isAlphaNumeric = false;
        }
    }
    return isAlphaNumeric;
}
function isAlpha(sText)
{
    var lText = sText;
    var isAlpha = true;
    for(var j=0; j<lText.length; j++)
    {
        var lChar = lText.charAt(j);
        var lUnicode = lChar.charCodeAt(0);
        if((lUnicode > 64 && lUnicode<91) || (lUnicode > 96 && lUnicode<123)
            || lUnicode == 32){
        }
        else{
            isAlpha = false;
        }
    }
    return isAlpha;
}
function echeck(str) {

    var at="@"
    var dot="."
    var lat=str.indexOf(at)
    var lstr=str.length
    if (str.indexOf(at)==-1){
        return false
    }

    if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
        return false
    }

    if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
        return false
    }

    if (str.indexOf(at,(lat+1))!=-1){
        return false
    }

    if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
        return false
    }

    if (str.indexOf(dot,(lat+2))==-1){
        return false
    }

    if (str.indexOf(" ")!=-1){
        return false
    }

    return true
}
