function quicksave( formId ) { var asDiv = $(formId + '_qsave'); asDiv.update(''); originalTarget = $(formId).getAttribute('target'); $(formId).setAttribute('target', formId + '_qsave_iframe'); submitForm( formId, 0); $($(formId + '_qsave_iframe')).observe('load', function(event){ asDiv.update(); }); Effect.Appear(formId + '_msg', {duration:0.5}); window.setTimeout('Effect.Fade(\'' + formId + '_msg\')',2500); if( originalTarget == null ) originalTarget = '_self'; $(formId).setAttribute('target', originalTarget); } function calculateProgressbar( id ){ buildProgressbar( $(id) ); } function buildProgressbar( element ) { maxLength = element.readAttribute('maxlength'); if( maxLength > 0 && maxLength < 10000 ) { totalWidth = element.getWidth(); if( !element.getValue() )// ie fix for textareas value = element.value; else value = element.getValue(); valueLength = value.length; if( valueLength > maxLength ) element.value = value.truncate(maxLength, ''); if( valueLength == 0 ) newLength = 0; else newLength = totalWidth / maxLength * valueLength; if( newLength > totalWidth ) newLength = totalWidth; if( $(element.id + '_progressbar') ) { $(element.id + '_progressbar').style.backgroundColor = (element.readAttribute('required') ? "#55929F" : "#C1CED8"); $(element.id + '_progressbar').style.width = newLength + 'px'; } } } function checkProgressbars( formElement ) { setTimeout("$A($('" + formElement + "').getInputs('text')).each( function(e){if( e.readAttribute('maxlength') > 0 && e.readAttribute('maxlength') < 10000 ) buildProgressbar(e);} );", 400); } var getStrength = function(passwd) { intScore = 0; if (passwd.match(/[a-z]/)) // [verified] at least one lower case letter { intScore = (intScore+1) } if (passwd.match(/[A-Z]/)) // [verified] at least one upper case letter { intScore = (intScore+5) } // NUMBERS if (passwd.match(/\d+/)) // [verified] at least one number { intScore = (intScore+5) } if (passwd.match(/(\d.*\d.*\d)/)) // [verified] at least three numbers { intScore = (intScore+5) } // SPECIAL CHAR if (passwd.match(/[!,@#$%^&*?_~]/)) // [verified] at least one special character { intScore = (intScore+5) } if (passwd.match(/([!,@#$%^&*?_~].*[!,@#$%^&*?_~])/)) // [verified] at least two special characters { intScore = (intScore+5) } // COMBOS if (passwd.match(/[a-z]/) && passwd.match(/[A-Z]/)) // [verified] both upper and lower case { intScore = (intScore+2) } if (passwd.match(/\d/) && passwd.match(/\D/)) // [verified] both letters and numbers { intScore = (intScore+2) } // [Verified] Upper Letters, Lower Letters, numbers and special characters if (passwd.match(/[a-z]/) && passwd.match(/[A-Z]/) && passwd.match(/\d/) && passwd.match(/[!,@#$%^&*?_~]/)) { intScore = (intScore+2) } return intScore; } function calculatePasswordStrength( element ) { var strength = getStrength($(element).getValue()); var width = (100/32)*strength; new Effect.Morph(element + '_passwordstrength', {style:'width:'+width+'px', duration:'0.4'}); }