function encrypt_password(e,f,b,a){if($(f)){$(f).disabled=false;$(f).removeClass("ig-buttonv3-disabled")}var d=$(e);if(d){var c=function(){var h=Cookie.read("igloojs").substring(1,37).replace(/-/g,"").toUpperCase();var k,i,g,j;if($("pass_unencrypted")){k=$("pass_unencrypted").value;if(k!=""){i=convertCP2UTF8(convertChar2CP(k));g=new Crypt.Aes({output:"hex",hexcase:1});j=g.encrypt(h,i);$("pass_encrypted").value=j}}if($("confirmpass_unencrypted")){k=$("confirmpass_unencrypted").value;if(k!=""){i=convertCP2UTF8(convertChar2CP(k));g=new Crypt.Aes({output:"hex",hexcase:1});j=g.encrypt(h,i);$("confirmpass_encrypted").value=j}}};if(a){d.addEvent("onvalidformsubmit",function(g){c();this.submit()})}else{d.addEvent("submit",function(g){g.stop();c();this.submit()})}if(b){$(f).addEvent("click",function(){d.fireEvent("submit")})}}if($("ig-form-noscripterror")){$("ig-form-noscripterror").dispose()}if($("default")){$("default").focus();$("default").select()}}window.addEvent("domready",function(){if(Igloo&&Igloo.asset_encrypt_password){$each(Igloo.asset_encrypt_password,function(a,d){var c=false;if(a.submit_bypass){c=true}var b=false;if(a.with_validation){b=true}encrypt_password(a.form_id,a.button_id,c,b)})}});window.addEvent("bootstrap4finished",function(){if(window.dependents.encrypt_password){window.dependents.encrypt_password.each(function(d){var c=JSON.decode(d.dataobj);var b=false;if(c.encrypt_password.submit_bypass){b=true}var a=false;if(c.encrypt_password.with_validation){a=true}encrypt_password(c.encrypt_password.form_id,c.encrypt_password.button_id,b,a)})}});function dec2hex(a){return(a+0).toString(16).toUpperCase()}function dec2hex2(a){var b=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");return b[(a>>4)&15]+b[a&15]}function convertCP2UTF8(a){var d="";a=a.replace(/^\s+/,"");if(a.length==0){return""}a=a.replace(/\s+/g," ");var c=a.split(" ");for(var b=0;b<c.length;b++){var e=parseInt(c[b],16);if(b>0){d+=""}if(e<=127){d+=dec2hex2(e)}else{if(e<=2047){d+=dec2hex2(192|((e>>6)&31))+""+dec2hex2(128|(e&63))}else{if(e<=65535){d+=dec2hex2(224|((e>>12)&15))+""+dec2hex2(128|((e>>6)&63))+""+dec2hex2(128|(e&63))}else{if(e<=1114111){d+=dec2hex2(240|((e>>18)&7))+""+dec2hex2(128|((e>>12)&63))+""+dec2hex2(128|((e>>6)&63))+""+dec2hex2(128|(e&63))}else{d+="!erreur "+dec2hex(e)+"!"}}}}}return(d)}function convertChar2CP(d){var c=0;var g=0;var f="";for(var e=0;e<d.length;e++){var a=d.charCodeAt(e);if(a<0||a>65535){f+="Error "+dec2hex(a)+"!"}if(c!=0){if(56320<=a&&a<=57343){f+=dec2hex(65536+((c-55296)<<10)+(a-56320))+" ";c=0;continue}else{f+="!erreur "+dec2hex(c)+"!";c=0}}if(55296<=a&&a<=56319){c=a}else{f+=dec2hex(a)+" "}}f=f.substring(0,f.length-1);return f};
