// JavaScript Document
$(document).ready(function() {
      $("#signup_30").hide();
	  $("#signup_40").hide();
	  $("#signup_50").hide();
	  $("#signup_60").hide();
	  $("#signup_70").hide();
});
		
		function hideTest(obj){
		var aryTest = [2,3,4,5,6,7];
		for (i=0;i<aryTest.length;i++)
		if (obj != aryTest[i]){	  
		$("#signup_"+aryTest[i]+"0").hide();
		$("#signup_"+aryTest[i]+"0").css("z-index",10);
		}}
		
		
		function sign20(obj) {
			hideTest(obj);
			$("#signup_20").slideDown("slow", hideTest());
			$("#signup_20").css("z-index",100);
		}
		
		function sign30(obj) {
			hideTest(obj);
			$("#signup_30").slideDown("slow", hideTest());
			$("#signup_30").css("z-index",100);
		}
		
		function sign40(obj) {
			hideTest(obj);
			$("#signup_40").slideDown("slow", hideTest());
			$("#signup_40").css("z-index",100);
		}
		
		function sign50(obj) {
			hideTest(obj);
			$("#signup_50").slideDown("slow", hideTest());
			$("#signup_50").css("z-index",100);
		}
		
		function sign60(obj) {
			hideTest(obj);
			$("#signup_60").slideDown("slow", hideTest());
			$("#signup_60").css("z-index",100);
		}
		function sign70(obj) {
			hideTest(obj);
			$("#signup_70").slideDown("slow", hideTest());
			$("#signup_70").css("z-index",100);
		}
		
			function passwordStrength(password)
{
	var desc = new Array();
	desc[0] = "Very Weak";
	desc[1] = "<span style=\"color:#ff0000;\">Weak</span>";
	desc[2] = "<span style=\"color:#ff5f5f;\">Better</span>";
	desc[3] = "<span style=\"color:#56e500;\">Medium</span>";
	desc[4] = "<span style=\"color:#4dcd00;\">Strong</span>";
	desc[5] = "<span style=\"color:#399800;\">Strongest</span>";

	var score   = 0;

	//if password bigger than 6 give 1 point
	if (password.length > 6) score++;

	//if password has both lower and uppercase characters give 1 point	
	if ( ( password.match(/[a-z]/) ) && ( password.match(/[A-Z]/) ) ) score++;

	//if password has at least one number give 1 point
	if (password.match(/\d+/)) score++;

	//if password has at least one special caracther give 1 point
	if ( password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) )	score++;

	//if password bigger than 12 give another 1 point
	if (password.length > 12) score++;

	 document.getElementById("passwordDescription").innerHTML = desc[score];
	 document.getElementById("passwordStrength").className = "strength" + score;
}

		