jQuery.fn.updateTips = function (t) {
        this.text(t).effect("highlight",{},1500);
    }
jQuery.fn.checkLength = function (u,n,min,max) {
	var strValue = this.val();
	if(!strValue)
	{
		strValue = "";
	}
	if (strValue == "" ){
    	this.addClass('ui-state-error');
       	u.updateTips("Length of " + n + " must be between "+min+" and "+max+".");
        return false;
    }
    else if (strValue != "" && (strValue.length > max || strValue.length < min )) {
    	this.addClass('ui-state-error');
       	u.updateTips("Length of " + n + " must be between "+min+" and "+max+".");
        return false;
    } else {
        return true;
    }
}
jQuery.fn.checkRegexp = function (u,regexp,n) {
    if ( !( regexp.test( this.val() ) ) ) {
    	this.addClass('ui-state-error');
        	u.updateTips(n);
        return false;
    } else {
        return true;
    }
}
jQuery.fn.matchPassword = function (cp,u)
{
    if( this.val() != cp.val())
    {
    	u.updateTips("Password must match confirm password");
        return false;
    }
    else
        return true;
}
