


/*
Title: 		
Author: 	
Update: 	
*/

/*******************************************
validator class
*******************************************/
function validator(s)
{
 this._s = s; 
}

//*********Methods**********

 
validator.prototype._s;
validator.prototype.IsNull = function()
{
    return (this._s == null);
}

validator.prototype.IsEmpty = function()
{    
    return (this._s == '');
}

validator.prototype.IsAlpha = function()
{
    //regular expression to test for only alphabets value
    var filter = /^([a-zA-Z]+)$/i;    
    return filter.test(this._s);
}

validator.prototype.IsValidEmail = function()
{
    //regular expression to test for valid email format
    //var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    var filter = /^(\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)$/i    
    return filter.test(this._s);
}
