/*  
 * @author: uzzal
 * @class: validator
 * @web: http://uzzal.wordpress.com
 */
var validator={show_alert:!1,setAlert:function(a){this.show_alert=a},showAlert:function(a){this.show_alert&&(alert(a),this.setAlert(!1))},isNull:function(a){var b=/^[ ]*$/;return a=="null"||a.length==0||a=="undefined"||b.test(a)?(this.showAlert("A Required Field is Null"),!0):!1},isNumber:function(a){return isNaN(a)?!1:(this.showAlert("A Required Field is Not a Number"),!0)},isEmail:function(a){return/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/.test(a)?!0:(this.showAlert("Email Field is Not a Valid Email"), !1)},isUrl:function(a){return/^https?:\/\/[^ ]+\.[^ ]+$/.test(a)?!0:(this.showAlert("Url Field is Not a Valid Url"),!1)},isPasswordMatch:function(a,b){if(this.isNull(a))return!1;if(this.isNull(b))return!1;return a==b?!0:(this.showAlert("Password and Confirm Password Field mismatched"),!1)},isInMax:function(a,b){return a.length<=b?!0:(this.showAlert("A Field Exceeds The Maximum Character Limit"),!1)},isInMin:function(a,b){return a.length>=b?!0:(this.showAlert("A Field Below The Minimum Character Limit"), !1)}};
