function DUser()
{
	this.uid = 0;
	this.vkid = "";
	this.mail_id = "";
	this.settings = 0;
	this.authSWF = {};
	this.authParams = {}; 	// Параметры авторизации. Используется для настройки обратного
							// вызова при авторизации юзера, например, для обновления голосований
	this.marks = 0;
	this.ableCreateChannel = false;
	this.ableAddToChannel = false;
	// "Константы"
	this.NO_NOTES_WND = 1;
	this.NO_NOTES_ADD = 2;
	this.SHOW_YT_RELATED = 4;
	this.NO_WALL_WND = 8;
	this.NO_FAV_VK_WALL = 16;
	this.NO_FAV_VK_NOTES = 32;
	this.NO_FAV_MAIL_SHARE = 64;
	this.NO_FAV_FB_SHARE = 128;
	this.NO_FAV_FB_NOTES = 256;
	this.NO_WALL_WND_COOKIE = "drakoff_cookie_no_wall_wnd";
	// Размер превью видео по ширине
	this.VIDEO_PREVIEW_WIDTH = 149; // класс preview
	this.MAX_VIDEO_IN_CHANNEL = 6;
	this.MAX_VIDEO_IN_FAVOURITE = 12;
	// Константы ошибок согласно файлу constants
	this.AUTH_OK = 9330;
	this.AUTH_ERR_LOGIN_OR_PW = 10331;
	// Константы ODKL
	this.ODKL_APPID = 350976;
	// События
	this.OPERATOR_LOADED = "dataavailable";
	// Ссылка на информацию о пользователе (друге)
	this.FriendInfo = {};
	this.Site = {"AuthComplete":false, "authorized":false, ID:0};
	this.VK = {"AuthComplete":false, "authorized":false, ID:0, perms:0};
	this.Mail = {"AuthComplete":false, "authorized":false, ID:0, perms:[]};
	this.Odkl = {"AuthComplete":false, "authorized":false, ID:0, perms:[]};
	this.FB = {"AuthComplete":false, "authorized":false, ID:0, perms:[]};
	// ID
	// authorized (залогинен на сайте mail.ru. Присваивается при авторизации на сервере, либо
	// вызове из функции API)
	this.DENY_AUTO_AUTH_COOKIE = "deny_auto_auth";
	this.Init();
}

DUser.prototype.Init = function()
{
	var c = new Cookie();
	var ignore = decodeURIComponent(c.Get(this.DENY_AUTO_AUTH_COOKIE));
	if (!ignore)
		return;
	var p = ignore.split("&");
	for (var i = 0; i < p.length; i++)
		if (this[p[i]])
			this[p[i]].denyautoauth = true;
}

DUser.prototype.SetSettings = function(value/* Integer */)
{
	this.settings |= value;
}

DUser.prototype.GetSettings = function(value/* Integer */)
{
	var testvalue = this.settings | value;
	if (testvalue == this.settings)
		return true;
	return false;
}

DUser.prototype.ClearSettings = function(value/* Integer */)
{
	var testvalue = this.settings | value;
	if (testvalue == this.settings)
		this.settings ^= value;
}
//
// Метод вызывается при успешной авторизации любого из разделов: Site, VK, Mail и т.д.
// Параметр chapter - Object: Site, VK, Mail
DUser.prototype.Authorized = function(chapter, authorized/* Boolean default false */)
{
	chapter.AuthComplete = true;
	if (authorized)
		chapter.authorized = true;
}

DUser.prototype.IsAuthorized = function()
{
	if (this.Site.authorized)
		return true;
	if (this.VK.authorized)
		return true;
	if (this.Mail.authorized)
		return true;
	if (this.FB.authorized)
		return true;
	if (this.Odkl.authorized)
		return true;
	return false;
}
