var myArray = new Array(); function freeIndex(o) { var i; for (i=0; i0) i++; o[i] = null; return i; } /** * Jelszó erõsségének ellenõrzése */ function checkpwd(o) { setTimeout(function() { var strength = getPwdStrength(o.value); if (strength > 0) { if (strength < 3) $('#pwdtext').html('Gyenge jelszó'); else if (strength >= 3 && strength < 5) $('#pwdtext').html('Közepes jelszó'); else $('#pwdtext').html('Erõs jelszó'); var w = 39; if (strength > 1) w += 14; if (strength > 2) w += 20; if (strength > 3) w += 6; if (strength > 4) w += 11; if (strength > 5) w += 10; $('#pwdcontainer').css('width', w + '%'); } else { $('#pwdtext').html(''); $('#pwdcontainer').css('width', 0); } }, 10); } function getPwdStrength(pwd) { if (pwd.length < 5) return 0; var check1 = new RegExp('[0-9]'); var check2 = new RegExp('[a-záéíóöõúüû]'); var check3 = new RegExp('[A-ZÁÉÍÓÖÕÚÜÛ]'); var check4 = new RegExp('[^0-9a-záéíóöõúüûA-ZÁÉÍÓÖÕÚÜÛ]'); var num = false; var string = false; var stringbig = false; var other = false; var strong = 0; for (i=0; i < pwd.length; i++) { if (!num && pwd.charAt(i).match(check1)) { num = true; strong++; } if (!string && pwd.charAt(i).match(check2)) { string = true; strong++; } if (!stringbig && pwd.charAt(i).match(check3)) { stringbig = true; strong++; } if (!other && pwd.charAt(i).match(check4)) { other = true; strong++; } } if (pwd.length > 7) strong++; if (pwd.length > 9) strong++; return strong; } function select(field) { field.focus(); field.select(); } $(function() { $(".number").each(function() { $(this).bind("keypress", function() { var obj = this; setTimeout(function() { obj.value = obj.value.replace(/([^\d])/, ''); }, 10); }); }); $('.tooltip').tooltip(); });