<div class="panel_top">
	<label class="custom_checkbox" data-bind="css: {'checked': checkAll, 'incomplete': checkAllIncomplite}">
		<span class="icon"></span>
		<input type="checkbox" data-bind="checked: checkAll" />
	</label>
	<!--<span class="field" contenteditable="true" style="background: #fff; width: 300px; height: 20px; position: absolute; top: -50px; z-index: 2000; display: block" ></span>-->
	<!--<div class="field" contenteditable="true" style="background: #fff; width: 300px; height: 20px; position: absolute; top: -20px; z-index: 2000; display: inline-block" ></div>-->
	<span class="search_block custom_select" data-bind="dropdown: {passClick: false, callback: fillAdvancedSearch, close: bAdvancedSearch}">
		<span class="input" data-bind="css: {'focus': isFocused}">
			<span class="button" data-i18n="MAILBOX/BUTTON_SEARCH" data-bind="i18n: 'text', click: onSearchClick"></span>
			<input class="field hide" type="text" data-bind="value: searchInput" />
			<div class="field" contenteditable="true" data-bind="highlighter: {valueObserver: searchInput, highlighterValueObserver: searchSpan, highlightTrigger: highlightTrigger}, onEnter: onSearchClick, hasfocus: isFocused" ></div>
		</span>
		<span class="control">
			<span class="icon"></span>
		</span>
		<span class="dropdown">
			<span class="dropdown_helper">
				<span class="dropdown_arrow"><span></span></span>
				<span class="dropdown_content">
					<span class="fields">
						<span class="row">
							<span class="label" data-i18n="MAILBOX/SEARCH_FIELD_FROM" data-bind="i18n: 'text'"></span>
							<input class="value input" type="text" data-bind="value: searchInputFrom, valueUpdate: 'afterkeydown', onEnter: onSearchClick" />
						</span>
						<span class="row">
							<span class="label" data-i18n="MAILBOX/SEARCH_FIELD_TO" data-bind="i18n: 'text'"></span>
							<input class="value input" type="text" data-bind="value: searchInputTo, valueUpdate: 'afterkeydown', onEnter: onSearchClick" />
						</span>
						<span class="row">
							<span class="label" data-i18n="MAILBOX/SEARCH_FIELD_SUBJECT" data-bind="i18n: 'text'"></span>
							<input class="value input" type="text" data-bind="value: searchInputSubject, valueUpdate: 'afterkeydown', onEnter: onSearchClick" />
						</span>
						<span class="row">
							<span class="label" data-i18n="MAILBOX/SEARCH_FIELD_TEXT" data-bind="i18n: 'text'"></span>
							<input class="value input" type="text" data-bind="value: searchInputText, valueUpdate: 'afterkeydown', onEnter: onSearchClick" />
						</span>
						<span class="buttons">
							<span class="button" data-bind="click: onSearchClick">
								<span data-i18n="MAILBOX/BUTTON_SEARCH" data-bind="i18n: 'text'"></span>
							</span>
						</span>
					</span>
				</span>
			</span>
		</span>
	</span>
</div>
<div class="panel_center unselectable">
	<div class="items_list message_list" data-bind="initDom: messagesContainer, customScrollbar: {'reset': listChangedThrottle(), x: false}">
		<div class="scroll-inner">
			<span class="list_notification" data-bind="visible: visibleInfoSearchLoading">
				<span class="link" data-i18n="MAILBOX/LINK_STOP_SEARCH" data-bind="i18n: 'text', click: onStopSearchClick"></span>
				<span class="description" data-bind="text: searchText"></span>
			</span>

			<span class="list_notification search_results" data-bind="visible: visibleInfoSearchList">
				<span class="link" data-i18n="MAILBOX/LINK_CLEAR_SEARCH" data-bind="i18n: 'text', click: onClearSearchClick"></span>
				<span class="description" data-bind="text: searchText"></span>
			</span>

			<span class="list_notification" data-bind="visible: visibleInfoSearchEmpty">
				<span class="link" data-i18n="MAILBOX/LINK_CLEAR_SEARCH" data-bind="i18n: 'text', click: onClearSearchClick"></span>
				<span class="description" data-i18n="MAILBOX/INFO_SEARCH_EMPTY" data-bind="i18n: 'text'"></span>
			</span>
			
			<span class="list_notification" data-bind="visible: visibleInfoSearchError">
				<span class="link" data-i18n="MAILBOX/LINK_RETRY" data-bind="i18n: 'text', click: onRetryClick"></span>
				<span class="link" data-i18n="MAILBOX/LINK_SWITCH_TO_MESSAGE_LIST" data-bind="i18n: 'text', click: onClearSearchClick"></span>
				<span class="description" data-i18n="MAILBOX/INFO_SEARCH_ERROR" data-bind="i18n: 'text'"></span>
			</span>
			
			<span class="list_notification" data-bind="visible: visibleInfoMessageListEmpty">
				<span class="description" data-i18n="MAILBOX/INFO_MESSAGE_LIST_EMPTY" data-bind="i18n: 'text'"></span>
			</span>

			<span class="list_notification" data-bind="visible: visibleInfoStarredFolderEmpty">
				<span class="description" data-i18n="MAILBOX/INFO_STARRED_FOLDER_EMPTY" data-bind="i18n: 'text'"></span>
			</span>

			<span class="list_notification" data-bind="visible: visibleInfoMessageListError">
				<span class="link" data-i18n="MAILBOX/LINK_RETRY" data-bind="i18n: 'text', click: onRetryClick"></span>
				<span class="description" data-i18n="MAILBOX/INFO_MESSAGE_LIST_ERROR" data-bind="i18n: 'text'"></span>
			</span>

			<div class="items_sub_list message_sub_list" data-bind="foreach: collection, 
				 draggablePlace: function (oMessage) {return $root.dragAndDropHelper(oMessage);},
				 css: {'not_use_threads': !useThreads(), 'use_threads': useThreads}">
				<!-- ko template: {name: 'Mail_MessageListItemViewModel'} --><!-- /ko -->
			</div>
			
			<span class="list_notification" data-bind="visible: visibleInfoLoading()">
				<span class="description" data-i18n="MAILBOX/INFO_LOADING_MESSAGE_LIST" data-bind="i18n: 'text'"></span>
			</span>
			<span class="list_notification" data-bind="visible: visibleInfoSearchLoading()">
				<span class="description" data-i18n="MAILBOX/INFO_SEARCHING_FOR_MESSAGES" data-bind="i18n: 'text'"></span>
			</span>
		</div>
	</div>
</div>

<div class="panel_bottom" data-bind="template: {name: 'Common_PageSwitcherViewModel', data: oPageSwitcher}"></div>