/* http://keith-wood.name/realPerson.html Real Person Form Submission for jQuery v1.1.1. Written by Keith Wood (kwood{at}iinet.com.au) June 2009. Available under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license. Please attribute the author if you use it. */ (function($){function RealPerson(){this._defaults={length:6,includeNumbers:false,regenerate:'Click to change',hashName:'{n}Hash'}}var f='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';var g=[[' * ',' * * ',' * * ',' * * ',' ***** ','* *','* *'],['****** ','* *','* *','****** ','* *','* *','****** '],[' ***** ','* *','* ','* ','* ','* *',' ***** '],['****** ','* *','* *','* *','* *','* *','****** '],['*******','* ','* ','**** ','* ','* ','*******'],['*******','* ','* ','**** ','* ','* ','* '],[' ***** ','* *','* ','* ','* ***','* *',' ***** '],['* *','* *','* *','*******','* *','* *','* *'],['*******',' * ',' * ',' * ',' * ',' * ','*******'],[' *',' *',' *',' *',' *','* *',' ***** '],['* *','* ** ','* ** ','** ','* ** ','* ** ','* *'],['* ','* ','* ','* ','* ','* ','*******'],['* *','** **','* * * *','* * *','* *','* *','* *'],['* *','** *','* * *','* * *','* * *','* **','* *'],[' ***** ','* *','* *','* *','* *','* *',' ***** '],['****** ','* *','* *','****** ','* ','* ','* '],[' ***** ','* *','* *','* *','* * *','* * ',' **** *'],['****** ','* *','* *','****** ','* * ','* * ','* *'],[' ***** ','* *','* ',' ***** ',' *','* *',' ***** '],['*******',' * ',' * ',' * ',' * ',' * ',' * '],['* *','* *','* *','* *','* *','* *',' ***** '],['* *','* *',' * * ',' * * ',' * * ',' * * ',' * '],['* *','* *','* *','* * *','* * * *','** **','* *'],['* *',' * * ',' * * ',' * ',' * * ',' * * ','* *'],['* *',' * * ',' * * ',' * ',' * ',' * ',' * '],['*******',' * ',' * ',' * ',' * ',' * ','*******'],[' *** ',' * * ','* * *','* * *','* * *',' * * ',' *** '],[' * ',' ** ',' * * ',' * ',' * ',' * ','*******'],[' ***** ','* *',' *',' * ',' ** ',' ** ','*******'],[' ***** ','* *',' *',' ** ',' *','* *',' ***** '],[' * ',' ** ',' * * ',' * * ','*******',' * ',' * '],['*******','* ','****** ',' *',' *','* *',' ***** '],[' **** ',' * ','* ','****** ','* *','* *',' ***** '],['*******',' * ',' * ',' * ',' * ',' * ','* '],[' ***** ','* *','* *',' ***** ','* *','* *',' ***** '],[' ***** ','* *','* *',' ******',' *',' * ',' **** ']];$.extend(RealPerson.prototype,{markerClassName:'hasRealPerson',propertyName:'realperson',setDefaults:function(a){$.extend(this._defaults,a||{});return this},_attachPlugin:function(a,b){a=$(a);if(a.hasClass(this.markerClassName)){return}var c={options:$.extend({},this._defaults)};a.addClass(this.markerClassName).data(this.propertyName,c);this._optionPlugin(a,b)},_optionPlugin:function(a,b,c){a=$(a);var d=a.data(this.propertyName);if(!b||(typeof b=='string'&&c==null)){var e=b;b=(d||{}).options;return(b&&e?b[e]:b)}if(!a.hasClass(this.markerClassName)){return}b=b||{};if(typeof b=='string'){var e=b;b={};b[e]=c}$.extend(d.options,b);a.prevAll('.'+this.propertyName+'-challenge,.'+this.propertyName+'-hash').remove().end().before(this._generateHTML(a,d))},_generateHTML:function(a,b){var c='';for(var i=0;i'+'
';for(var i=0;i'+b.options.regenerate+'
';return d},_enablePlugin:function(a){a=$(a);if(!a.hasClass(this.markerClassName)){return}a.removeClass(this.propertyName+'-disabled').prop('disabled',false).prevAll('.'+this.propertyName+'-challenge').removeClass(this.propertyName+'-disabled')},_disablePlugin:function(a){a=$(a);if(!a.hasClass(this.markerClassName)){return}a.addClass(this.propertyName+'-disabled').prop('disabled',true).prevAll('.'+this.propertyName+'-challenge').addClass(this.propertyName+'-disabled')},_destroyPlugin:function(a){a=$(a);if(!a.hasClass(this.markerClassName)){return}a.removeClass(this.markerClassName).removeData(this.propertyName).prevAll('.'+this.propertyName+'-challenge,.'+this.propertyName+'-hash').remove()},_hash:function(a){var b=5381;for(var i=0;i-1}$.fn.realperson=function(a){var b=Array.prototype.slice.call(arguments,1);if(isNotChained(a,b)){return k['_'+a+'Plugin'].apply(k,[this[0]].concat(b))}return this.each(function(){if(typeof a=='string'){if(!k['_'+a+'Plugin']){throw'Unknown command: '+a;}k['_'+a+'Plugin'].apply(k,[this].concat(b))}else{k._attachPlugin(this,a||{})}})};var k=$.realperson=new RealPerson();$(document).on('click','div.'+k.propertyName+'-challenge',function(){if(!$(this).hasClass(k.propertyName+'-disabled')){$(this).nextAll('.'+k.markerClassName).realperson('option',{})}})})(jQuery);