function testPassword(passwd)
{
var description = new Array();
description[0] = "<table style='display:inline;'><tr><td class='bold' width='50'>Strength:</td><td><table cellspacing='2'><tr><td height='15' width='30' bgcolor='#ff0000'></td><td height='15' width='120' bgcolor='#dddddd'></td></tr></table></td><td class='bold'>Weakest</td></tr></table>";
description[1] = "<table style='display:inline;'><tr><td class='bold' width='50'>Strength:</td><td><table cellspacing='2'><tr><td height='15' width='60' bgcolor='#bb0000'></td><td height='15' width='90' bgcolor='#dddddd'></td></tr></table></td><td class='bold'>Weak</td></tr></table>";
description[2] = "<table style='display:inline;'><tr><td class='bold' width='50'>Strength:</td><td><table cellspacing='2'><tr><td height='15' width='90' bgcolor='#ff9900'></td><td height='15' width='60' bgcolor='#dddddd'></td></tr></table></td><td class='bold'>Medium</td></tr></table>";
description[3] = "<table style='display:inline;'><tr><td class='bold' width='50'>Strength:</td><td><table cellspacing='2'><tr><td height='15' width='120' bgcolor='#00bb00'></td><td height='15' width='30' bgcolor='#dddddd'></td></tr></table></td><td class='bold'>Strong</td></tr></table>";
description[4] = "<table style='display:inline;'><tr><td class='bold' width='50'>Strength:</td><td><table cellspacing='2'><tr><td height='15' width='150' bgcolor='#00ee00'></td></tr></table></td><td class='bold'>Strongest</td></tr></table>";
description[5] = "<table style='display:inline;'><tr><td class='bold' width='50'>Strength:</td><td><table cellspacing='2'><tr><td height='15' width='150' bgcolor='#dddddd'></td></tr></table></td><td class='bold'>Begin Typing</td></tr></table>";

		var intScore   = 0
		var strVerdict = 0
		
		// PASSWORD LENGTH
		if (passwd.length==0 || !passwd.length)                         // length 0
		{
			intScore = -1
		}
		else if (passwd.length>0 && passwd.length<5) // length between 1 and 4
		{
			intScore = (intScore+3)
		}
		else if (passwd.length>4 && passwd.length<9) // length between 5 and 8
		{
			intScore = (intScore+6)
		}
		else if (passwd.length>7)// length between 6 ++
		{
			intScore = (intScore+18)
		}

		
		
		// LETTERS (Not exactly implemented as dictacted above because of my limited understanding of Regex)
		if (passwd.match(/[a-z]/))                              // at least one lower case letter
		{
			intScore = (intScore+2)
		}
		
		if (passwd.match(/[A-Z]/))                              // at least one upper case letter
		{
			intScore = (intScore+5)
		}
		
		// NUMBERS
		if (passwd.match(/\d+/))                                 // at least one number
		{
			intScore = (intScore+5)
		}
		
	
		// SPECIAL CHAR
		if (passwd.match(/.[!,@,#,$,%,^,&,*,?,_,~]/))            // at least one special character
		{
			intScore = (intScore+7)
		}
		
																 // at least two special characters
		if (passwd.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/))
		{
			intScore = (intScore+10)
		}
	
		
		// COMBOS
		if (passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/))        // both upper and lower case
		{
			intScore = (intScore+8)
		}
 
																  //  letters, numbers, and special characters
		if (passwd.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/))
		{
			intScore = (intScore+15)
		}
	
	
		if(intScore == -1)
		{
		   strVerdict = description[5];
		}
		else if(intScore > -1 && intScore < 12)
		{
		   strVerdict = description[0];
		}
		else if (intScore > 11 && intScore < 20)
		{
		   strVerdict = description[1];
		}
		else if (intScore > 19 && intScore < 29)
		{
		   strVerdict = description[2];
		}
		else if (intScore > 29 && intScore < 39)
		{
		   strVerdict = description[3];
		}
		else
		{
		   strVerdict = description[4];
		}
	
	document.getElementById("words").innerHTML= (strVerdict);
	
}

function populate(id){
window.location = "/admin/users/new/"+id;
}