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