(function(e){var d="realperson";var g="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var c=g+"0123456789";var b=[["   *   ","  * *  ","  * *  "," *   * "," ***** ","*     *","*     *"],["****** ","*     *","*     *","****** ","*     *","*     *","****** "],[" ***** ","*     *","*      ","*      ","*      ","*     *"," ***** "],["****** ","*     *","*     *","*     *","*     *","*     *","****** "],["*******","*      ","*      ","****   ","*      ","*      ","*******"],["*******","*      ","*      ","****   ","*      ","*      ","*      "],[" ***** ","*     *","*      ","*      ","*   ***","*     *"," ***** "],["*     *","*     *","*     *","*******","*     *","*     *","*     *"],["*******","   *   ","   *   ","   *   ","   *   ","   *   ","*******"],["      *","      *","      *","      *","      *","*     *"," ***** "],["*     *","*   ** ","* **   ","**     ","* **   ","*   ** ","*     *"],["*      ","*      ","*      ","*      ","*      ","*      ","*******"],["*     *","**   **","* * * *","*  *  *","*     *","*     *","*     *"],["*     *","**    *","* *   *","*  *  *","*   * *","*    **","*     *"],[" ***** ","*     *","*     *","*     *","*     *","*     *"," ***** "],["****** ","*     *","*     *","****** ","*      ","*      ","*      "],[" ***** ","*     *","*     *","*     *","*   * *","*    * "," **** *"],["****** ","*     *","*     *","****** ","*   *  ","*    * ","*     *"],[" ***** ","*     *","*      "," ***** ","      *","*     *"," ***** "],["*******","   *   ","   *   ","   *   ","   *   ","   *   ","   *   "],["*     *","*     *","*     *","*     *","*     *","*     *"," ***** "],["*     *","*     *"," *   * "," *   * ","  * *  ","  * *  ","   *   "],["*     *","*     *","*     *","*  *  *","* * * *","**   **","*     *"],["*     *"," *   * ","  * *  ","   *   ","  * *  "," *   * ","*     *"],["*     *"," *   * ","  * *  ","   *   ","   *   ","   *   ","   *   "],["*******","     * ","    *  ","   *   ","  *    "," *     ","*******"],["  ***  "," *   * ","*   * *","*  *  *","* *   *"," *   * ","  ***  "],["   *   ","  **   "," * *   ","   *   ","   *   ","   *   ","*******"],[" ***** ","*     *","      *","     * ","   **  "," **    ","*******"],[" ***** ","*     *","      *","    ** ","      *","*     *"," ***** "],["    *  ","   **  ","  * *  "," *  *  ","*******","    *  ","    *  "],["*******","*      ","****** ","      *","      *","*     *"," ***** "],["  **** "," *     ","*      ","****** ","*     *","*     *"," ***** "],["*******","     * ","    *  ","   *   ","  *    "," *     ","*      "],[" ***** ","*     *","*     *"," ***** ","*     *","*     *"," ***** "],[" ***** ","*     *","*     *"," ******","      *","     * "," ****  "]];e.JQPlugin.createPlugin({name:d,alphabetic:g,alphanumeric:c,defaultDots:b,defaultOptions:{length:6,regenerate:"Click to change",hashName:"{n}Hash",dot:"*",dots:b,chars:g},_getters:["getHash"],_challengeClass:d+"-challenge",_disabledClass:d+"-disabled",_hashClass:d+"-hash",_regenerateClass:d+"-regen",_textClass:d+"-text",_optionsChanged:function(l,m,j){e.extend(m.options,j);var n="";for(var k=0;k<m.options.length;k++){n+=m.options.chars.charAt(Math.floor(Math.random()*m.options.chars.length))}m.hash=f(n+a);var h=this;l.closest("form").off("."+m.name).on("submit."+m.name,function(){var i=m.options.hashName.replace(/\{n\}/,l.attr("name"));var o=e(this);o.find('input[name="'+i+'"]').remove();o.append('<input type="hidden" class="'+h._hashClass+'" name="'+i+'" value="'+f(n+a)+'">');setTimeout(function(){o.find('input[name="'+i+'"]').remove()},0)});l.prevAll("."+this._challengeClass+",."+this._hashClass).remove().end().before(this._generateHTML(m,n)).after(function(){var p=document.getElementById("canvas_captcha");var A=p.getContext("2d");var o=Math.floor(Math.random()*(255));var y=Math.floor(Math.random()*(255));var z=Math.floor(Math.random()*(255));A.beginPath();A.lineColor="gray";var x=Math.random()*-1;var w=p.height;var u=Math.random()+0.5;var s=p.height;for(var v=0;v<25;v++){A.strokeStyle="rgb("+o+","+y+","+z+")";A.beginPath();A.moveTo(x*(v*20),w);A.quadraticCurveTo(0,w-(v*20),u*(v*20),s);A.stroke()}o=Math.floor(Math.random()*(255));y=Math.floor(Math.random()*(255));z=Math.floor(Math.random()*(255));var x=Math.random()*0.5;var w=p.height;var u=Math.random()+1;var s=p.height;for(var v=0;v<25;v++){A.strokeStyle="rgb("+o+","+y+","+z+")";A.beginPath();A.moveTo(p.width-(v*10),w);A.quadraticCurveTo(p.width,w-(v*20),p.width+u*(v*20),s);A.stroke()}A.lineWidth=0.5;var t=Math.floor(Math.random()*(p.width*1/3-10)+10);A.font="20px Verdana";o=Math.floor(Math.random()*(255));y=Math.floor(Math.random()*(255));z=Math.floor(Math.random()*(255));A.fillStyle="rgb("+o+","+y+","+z+")";for(var v=0;v<n.length;v++){A.fillText(n.charAt(v),t+v*20,Math.floor(Math.random()*(p.height*4/7-p.height*3/7)+p.height*3/7))}var q=p.toDataURL();e("#canvas_captcha").hide();e("#img_captcha").attr("src",q)}).prevAll("div."+this._challengeClass).click(function(){if(!e(this).hasClass(h._disabledClass)){l.realperson("option",{})}})},enable:function(h){h=e(h);if(!h.hasClass(this._getMarker())){return}h.removeClass(this._disabledClass).prop("disabled",false).prevAll("."+this._challengeClass).removeClass(this._disabledClass)},disable:function(h){h=e(h);if(!h.hasClass(this._getMarker())){return}h.addClass(this._disabledClass).prop("disabled",true).prevAll("."+this._challengeClass).addClass(this._disabledClass)},getHash:function(h){var i=this._getInst(h);return i?i.hash:0},_generateHTML:function(i,j){var h='<div class="'+this._challengeClass+'"><div class="'+this._textClass+'">';h+='<canvas id="canvas_captcha" width="240" height="50"></canvas>';h+='<br><img id="img_captcha" width="240" height="50">';h+='</div><div class="'+this._regenerateClass+'">'+i.options.regenerate+"</div></div>";return h},_preDestroy:function(h,i){h.closest("form").off("."+i.name);h.prevAll("."+this._challengeClass+",."+this._hashClass).remove()}});var a=e.salt||"#salt";delete e.salt;e(function(){var h=e(a);if(h.length){a=h.text();h.remove()}if(a==="#salt"){a=""}});function f(j){var k=5381;for(var h=0;h<j.length;h++){k=((k<<5)+k)+j.charCodeAt(h)}return k}})(jQuery);