I have a jQuery script that checks for the strenght of a password. The code looks like this (with more more of those "blocks").
if(passwordLC && lessThan12Password)
{
$('.passwordStrenght').animate({width:'75px',height:'5px'},200).show();
$('.passwordStrenght').css('background-color',red);
$('#password').css('border-color',green);
$('.passwordStrenghtInfo').text(weak).show();
passwordErrors = true;
}else
if(passwordUC && lessThan12Password)
{
$('.passwordStrenght').animate({width:'75px',height:'5px'},200).show();
$('.passwordStrenght').css('background-color',red);
$('#password').css('border-color',green);
$('.passwordStrenghtInfo').text(weak).show();
passwordErrors = true;
}else
if(passwordN && lessThan12Password)
{
$('.passwordStrenght').animate({width:'75px',height:'5px'},200).show();
$('.passwordStrenght').css('background-color',red);
$('#password').css('border-color',green);
$('.passwordStrenghtInfo').text(weak).show();
passwordErrors = true;
}else
And it's go on and on ...
Is there a way to reduce all that code to something more simple and efficient or am I stuck with those horrible "blocks" of repeted code?