!function(e){function o(o){e.extend(l,o)}function n(o,n){var t=e(i.codeval).get(0);return n?void e.data(t,o,n):e.data(t,o)}function t(o,t,d){var c=r(l.codeType.name,l.codeType.len),u=Math.floor(6*Math.random()),p="";l.inputID||(p='<span><input id="ehong-code-input" type="text" maxlength="4" /></span>'),p+='<div id="ehong-code" class="ehong-idcode-val ehong-idcode-val',p+=String(u),p+='" href="#" onblur="return false" onfocus="return false" oncontextmenu="return false" onclick="$.idcode.setCode()">'+a(c)+'</div><span id="ehong-code-tip-ck" class="ehong-code-val-tip" onclick="$.idcode.setCode()">'+l.codeTip+"</span>",e(o).html(p),n(i.storeLable,c)}function a(e){for(var o,n=new Array,t=new Array("#BF0C43","#E69A2A","#707F02","#18975F","#BC3087","#73C841","#780320","#90719B","#1F72D8","#D6A03C","#6B486E","#243F5F","#16BDB5"),a=0;a<e.length;a++)o=Math.floor(Math.random()*t.length),n.push('<font color="'+t[o]+'">'+e.charAt(a)+"</font>");return n.join("")}function r(e,o){var n;return n="follow"==e?c(o):"calc"==e?d(o):""}function d(e){for(var o,n,t,a=new Array("0","1","2","3","4","5","6","7","8","9"),r=0;r<e;r++)t=Math.floor(Math.random()*a.length),o+=a[t],t=Math.floor(Math.random()*a.length),n+=a[t];return[parseInt(o),parseInt(n),parseInt(o)+parseInt(n)]}function c(e){for(var o="",n=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"),t=0;t<e;t++){var a=Math.floor(Math.random()*n.length);o+=a%2==0?n[a].toLowerCase():n[a]}return o}var l={e:"idcode",codeType:{name:"follow",len:5},codeTip:"",inputID:"Txtidcode"},i={storeLable:"codeval",store:"#ehong-code-input",codeval:"#ehong-code"};e.idcode={getCode:function(e){return o(e),n(i.storeLable,null)},setCode:function(e){o(e),t("#"+l.e,l.codeType.name,l.codeType.len)},validateCode:function(a){o(a);var r;return r=l.inputID?e("#"+l.inputID).val():e(i.store).val(),r.toUpperCase()==n(i.storeLable,null).toUpperCase()||(t("#"+l.e,l.codeType.name,l.codeType.len),!1)}}}(jQuery);