	function testPassword(elementname,complexityfieldname)
	{
		//var password = element.text;
		var inputField = jQuery("#"+elementname);
		var password=inputField.val();
		checkPassword(password,complexityfieldname);
	}

	function checkPassword(psswd,complexityfield)
	{
		// get the input field
		//var passwordField = jQuery("#password");

		// get the value, basically the password
		//var password = passwordField.val();

		/*var oldStatus = passwordField.data("prePassword");
		if (oldStatus == password)
		{
			// no change, leave and do nothing
			return;
		}*/
		//passwordField.data("prePassword", psswd);

		var pm = new PasswordMeter();
		pm.checkPassword(psswd);

		// set complexity
		var complexity = pm.Complexity.value;
		var indicator = jQuery("#"+complexityfield);

		// remove class
		indicator.removeClass("veryweak weak good strong verystrong");

		if (complexity == pm.COMPLEXITY.VERYWEAK)
		{
			indicator.html("Password strength: Very Weak. Strongly consider strengthening by adding special characters(!,&, etc), numbers, and capital letters, as well as increasing length.");
			indicator.addClass("veryweak");
		}
		else if (complexity == pm.COMPLEXITY.WEAK)
		{
			indicator.html("Password strength: Weak. Consider strengthening by adding special characters(!,&, etc), numbers, and capital letters, as well as increasing length.");
			indicator.addClass("weak");
		}
		else if (complexity == pm.COMPLEXITY.GOOD)
		{
			indicator.html("Password strength: Good");
			indicator.addClass("good");
		}
		else if (complexity == pm.COMPLEXITY.STRONG)
		{
			indicator.html("Password strength: Strong");
			indicator.addClass("strong");
		}
		else if (complexity == pm.COMPLEXITY.VERYSTRONG)
		{
			indicator.html("Password strength: Very Strong");
			indicator.addClass("verystrong");
		}
	}
