//*******************************************************
// Affichage heure
//*******************************************************
function tS(){ 
    x=new Date(); 
    x.setTime(x.getTime()); 
    return x; 
} 
function lZ(x){ 
    return (x>9)?x:'0'+x; 
} 
function dT(){ 
    if(fr==0){ 
        fr=1; 
        document.write(" " + '<span id="tP">'+eval(oT)+'</span>'); 
    } 
    document.getElementById("tP").innerHTML =  eval(oT); 
    setTimeout('dT()',1000); 
} 
var fr=0; 
oT="tS().getHours()+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())"; 
//-->   
//*******************************************************
// Verification mot de passe
//*******************************************************
var updateStrength = function(pw) {
	var strength = getStrength(pw);
	var width = (100/32)*strength;
	new Effect.Morph('psStrength', {style:'width:'+width+'px', duration:'0.4'}); 
}

var getStrength = function(passwd) {
	intScore = 0;
	if (passwd.match(/[a-z]/)) // [verified] at least one lower case letter
			{
			intScore = (intScore+5)
			} if (passwd.match(/[A-Z]/)) // [verified] at least one upper case letter
			{
			intScore = (intScore+3)
			} // 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+5)
			} // [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+5)
			}
			return intScore;
}
