(function(t){t.fn.captcha=function(a){if(e[a]){return e[a].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof a==="object"||!a){return e.init.apply(this,arguments)}else{t.error("Method "+a+" does not exist on jQuery.niiCaptcha");return false}};var a={refreshUrl:undefined,hashKey:undefined};var i=true;var e={init:function(n){return this.each(function(){var r=t(this);var s=t.extend({},a,n||{});r.data("niiCaptcha",{settings:s});r.on("click.niiCaptcha",function(){if(i){e.refresh.apply(r)}return false})})},refresh:function(){i=false;var a=this;var e=this.data("niiCaptcha").settings;t.ajax({url:a.data("niiCaptcha").settings.refreshUrl,dataType:"json",cache:false,success:function(n){a.attr("src",n.url);t("body").data(e.hashKey,[n.hash1,n.hash2]);i=true}})},destroy:function(){return this.each(function(){t(window).unbind(".niiCaptcha");t(this).removeData("niiCaptcha")})},data:function(){return this.data("niiCaptcha")}}})(window.jQuery);$().ready(function(){$("body").on("click",".captcha-image",function(){if($(this).data("init")==true){return}var t=$(this).attr("id");var a=[];if($("[data-captcha-id='"+t+"']").size>0){a=$("[data-captcha-id='"+t+"']").html()}else if($(this).siblings("script").size()>0){a=$("[data-captcha-id='"+t+"']").html()}if(a&&a.length>0){a=$.parseJSON(a)}$(this).captcha(a);$(this).data("init",true);$(this).click()})});