/**
 * Returns the strength of the given password string
 *
 * @param string password
 * @return int
 */
function get_password_strength(password)
{
   var strength = 0;
   if (password.length > 7)
   {
      strength += 1;
   }
   var pattern = /[a-z]/;
   if (pattern.test(password))
   {
      strength += 1;
   }
   var pattern = /[A-Z]/;
   if (pattern.test(password))
   {
      strength += 1;
   }
   var pattern = /[0-9]/;
   if (pattern.test(password))
   {
      strength += 1;
   }
   return strength;
}

/**
 * Checks if the input is a valid e-mailaddress
 *
 * @param string email_address
 * @return bool
 */
function is_emailaddress(emailaddress)
{
   var pattern = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
   return pattern.test(emailaddress);
}

/**
 * Checks if the input is empty
 *
 * @param string value
 * @return bool
 */
function is_empty(value)
{
	var is_empty = false;
	if (value == "")
	{
		is_empty = true;
	}
   return is_empty;
}

/**
 * Checks if the input is not empty
 *
 * @param string value
 * @return bool
 */
function is_not_empty(value)
{
	var is_not_empty = true;
	if (value == "")
	{
		is_not_empty = false;
	}
   return is_not_empty;
}

/**
 * Checks if the input is numeric
 *
 * @param string number
 * @return bool
 */
function is_number(number)
{
   var is_number = true;
   if (isNaN(number))
   {
   	is_number = false;
   }
   return is_number;
}