(function(a){function b(){}global.nwt.extend=function(a,b){var c=function(){};c.prototype=b.prototype,a.prototype=new c,a._super=b},global.nwt.random=function(a,b){return Math.floor(Math.random()*(b-a+1))+a},b.prototype._validate_VALID_EMAIL=function(a,b){var c=/^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i;if(!c.test(a))throw"OMG WRON EMAIL."},b.prototype._validate_UNIQUE=function(a,b){},b.prototype._validate_MIN_LENGTH=function(a,b){if(a.length<b.value)throw"Not enough characters ("+b.value+" min)."},b.prototype._validate_MAX_LENGTH=function(a,b){if(a.length>b.value)throw"Too many characters ("+b.value+" max)."},b.prototype._validate_ALPHA=function(a,b){var c=/^[A-Za-z]+$/;if(!c.test(a))throw"Must be letters only."},b.prototype._validate_ALPHA_NUMERIC=function(a,b){var c=/^[A-Za-z0-9]+$/;if(!c.test(a))throw"Must be alphanumeric."},b.prototype._validate_NUMERIC=function(a,b){var c=/^[0-9]+$/;if(!c.test(a))throw"Must be numeric."},b.prototype._validate_URL=function(a,b){var c=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;if(!c.test(a))throw"Valid URL not found."},b.prototype.validate=function(a,b,c){var d="_validate_"+a;c instanceof Object||(c={value:c});try{this[d](b,c)}catch(e){return!1}return!0},b.prototype.validateProvidedValue=function(a,b){var c={status:!0};for(var d in b){var e="_validate_"+d,f=b[d];f instanceof Object||(f={value:f});try{this[e](a,f)}catch(g){c.status=!1,c[b[d]]=g}}return c},global.nwt.validation=new b})(this)
