public static function generatePassword($password, $type = 'md5')
	{
		switch (strtolower($type))
		{
			case 'sha':
				$userpassword = '{SHA}' . base64_encode(pack('H*', sha1($password)));
				break;

			case 'md5':
			default:
				$userpassword = '{MD5}' . base64_encode(pack('H*', md5($password)));
				break;
		}

		return $userpassword;
	}