<div class="popups">
	<div class="modal hide b-contacts-content" data-bind="modal: modalVisibility">
		<div class="modal-header b-header-toolbar g-ui-user-select-none">

			<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

			<div class="btn-toolbar">

				<div class="btn-group">
					<a class="btn button-create-contact" data-bind="command: newCommand">
						<i class="icon-plus"></i>
						&nbsp;&nbsp;
						<span class="i18n" data-i18n-text="CONTACTS/BUTTON_ADD_CONTACT"></span>
					</a>
				</div>

				<div class="btn-group">
					<a class="btn btn-success button-new-message" data-bind="command: newMessageCommand">
						<i class="icon-mail icon-white"></i>
					</a>
				</div>

				<div class="btn-group">
					<a class="btn button-delete" data-bind="command: deleteCommand">
						<i class="icon-trash"></i>
						<span data-bind="text: 1 < contactsCheckedOrSelected().length ? ' (' + contactsCheckedOrSelected().length + ')' : ''"></span>
					</a>
				</div>

				<div class="btn-group dropdown colored-toggle" data-bind="registrateBootstrapDropdown: true">
					<a id="contacts-more-dropdown-id" class="btn dropdown-toggle buttonMore" href="#" tabindex="-1" data-toggle="dropdown">
						<i data-bind="css: {'icon-list': !contacts.importing() && !contacts.syncing(),
							'icon-spinner animated': contacts.importing() || contacts.syncing()}"></i>
					</a>
					<ul class="dropdown-menu g-ui-menu" role="menu" aria-labelledby="contacts-more-dropdown-id">
						<li class="e-item" role="presentation">
							<a class="e-link menuitem" href="#" tabindex="-1" data-bind="initDom: importUploaderButton">
								<i data-bind="css: {'icon-import': !contacts.importing(), 'icon-spinner animated': contacts.importing}"></i>
								&nbsp;&nbsp;
								<span class="i18n" data-i18n-text="CONTACTS/BUTTON_IMPORT"></span>
							</a>
						</li>
						<li class="divider" role="presentation" data-bind="visible: allowExport"></li>
						<li class="e-item" role="presentation" data-bind="visible: allowExport">
							<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: exportCsv">
								<i data-bind="css: {'icon-export': !contacts.exportingCsv(), 'icon-spinner animated': contacts.exportingCsv}"></i>
								&nbsp;&nbsp;
								<span class="i18n" data-i18n-text="CONTACTS/BUTTON_EXPORT_CSV"></span>
							</a>
						</li>
						<li class="e-item" role="presentation" data-bind="visible: allowExport" >
							<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: exportVcf">
								<i data-bind="css: {'icon-export': !contacts.exportingVcf(), 'icon-spinner animated': contacts.exportingVcf}"></i>
								&nbsp;&nbsp;
								<span class="i18n" data-i18n-text="CONTACTS/BUTTON_EXPORT_VCARD"></span>
							</a>
						</li>
						<li class="divider" role="presentation" data-bind="visible: enableContactsSync() && allowContactsSync()"></li>
						<li class="e-item" role="presentation" data-bind="visible: enableContactsSync() && allowContactsSync()">
							<a class="e-link menuitem" href="#" tabindex="-1" data-bind="command: syncCommand">
								<i data-bind="css: {'icon-sync': !contacts.syncing(), 'icon-spinner animated': contacts.syncing}"></i>
								&nbsp;&nbsp;
								<span class="i18n" data-i18n-text="CONTACTS/BUTTON_SYNC"></span>
							</a>
						</li>
					</ul>
				</div>

			</div>
		</div>
		<div class="modal-body" style="position: relative;">
			<div class="b-list-toolbar">
				<input type="search" class="i18n span3 e-search" placeholder="Search" autocorrect="off" autocapitalize="off"
					data-i18n-placeholder="CONTACTS/SEARCH_INPUT_PLACEHOLDER" data-bind="value: search" />
			</div>
			<div class="b-list-content g-ui-user-select-none" data-bind="nano: true, css: {'hideContactListCheckbox': !useCheckboxesInList()}">
				<div class="content g-scrollbox">
					<div class="content-wrapper">
						<div class="listClear" data-bind="visible: viewClearSearch() && '' !== search()">
							<span class="g-ui-link i18n" data-i18n-text="CONTACTS/CLEAR_SEARCH" data-bind="command: clearCommand"></span>
						</div>
						<div class="listEmptyList" data-bind="visible: 0 === contacts().length && '' === search() && !contacts.loading()">
							<span class="i18n" data-i18n-text="CONTACTS/EMPTY_LIST"></span>
						</div>
						<div class="listEmptyListLoading" data-bind="visible: 0 === contacts().length && '' === search() && contacts.loading()">
							<span class="i18n" data-i18n-text="CONTACTS/LIST_LOADING"></span><span class="textLoadingAnimationD1">.</span><span class="textLoadingAnimationD2">.</span><span class="textLoadingAnimationD3">.</span>
						</div>
						<div class="listEmptySearchList" data-bind="visible: 0 === contacts().length && '' !== search() && !contacts.loading()">
							<span class="i18n" data-i18n-text="CONTACTS/EMPTY_SEARCH"></span>
						</div>
						<div class="e-contact-foreach g-ui-user-select-none" data-bind="foreach: contacts, visible: 0 < contacts().length">
							<div class="e-contact-item g-ui-user-select-none" data-bind="css: lineAsCcc()">
								<div class="sidebarParent">
									&nbsp;
								</div>
								<div class="delimiter"></div>
								<div class="wrapper">
									<div class="checkedParent">
										<i class="checkboxItem" data-bind="css: checked() ? 'checkboxMessage icon-checkbox-checked' : 'checkboxMessage icon-checkbox-unchecked'"></i>
									</div>
									<div class="shareParent actionHandle">
										<i class="icon-share"></i>
									</div>
									<div class="nameParent actionHandle">
										<span class="listName" data-bind="text: display"></span>
										&nbsp;
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="b-list-footer-toolbar">
				<div class="pull-right footer-pager">
					<!-- ko template: { name: 'Pagenator', data: contactsPagenator } --><!-- /ko -->
				</div>
			</div>
			<div class="b-view-content-toolbar btn-toolbar" data-bind="css: {'read-only': viewReadOnly}">
				<div class="btn-group pull-right dropdown colored-toggle button-add-prop" data-bind="visible: !emptySelection(), registrateBootstrapDropdown: true">
					<a id="button-add-prop-dropdown-id" href="#" tabindex="-1" class="btn dropdown-toggle" data-toggle="dropdown">
						<span class="i18n" data-i18n-text="CONTACTS/ADD_MENU_LABEL"></span>
						&nbsp;&nbsp;
						<span class="caret"></span>
					</a>
					<ul class="dropdown-menu g-ui-menu" style="text-align: left" tabindex="-1" role="menu" aria-labelledby="button-add-prop-dropdown-id">
						<li class="e-item" role="presentation">
							<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: addNewEmail">
								<i class="icon-none"></i>
								&nbsp;&nbsp;
								<span class="i18n" data-i18n-text="CONTACTS/ADD_MENU_EMAIL"></span>
							</a>
						</li>
						<li class="e-item" role="presentation">
							<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: addNewPhone">
								<i class="icon-none"></i>
								&nbsp;&nbsp;
								<span class="i18n" data-i18n-text="CONTACTS/ADD_MENU_PHONE"></span>
							</a>
						</li>
						<li class="e-item" role="presentation">
							<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: addNewWeb">
								<i class="icon-none"></i>
								&nbsp;&nbsp;
								<span class="i18n" data-i18n-text="CONTACTS/ADD_MENU_URL"></span>
							</a>
						</li>
						<li class="divider" role="presentation"></li>
						<li class="e-item" role="presentation">
							<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: addNewNickname">
								<i class="icon-none"></i>
								&nbsp;&nbsp;
								<span class="i18n" data-i18n-text="CONTACTS/ADD_MENU_NICKNAME"></span>
							</a>
						</li>
	<!--									<li class="e-item" role="presentation">
							<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: addNewAddress">
								<span class="i18n" data-i18n-text="CONTACTS/ADD_MENU_ADDRESS"></span>
							</a>
						</li>-->
					</ul>
				</div>
				<div class="btn-group pull-right">&nbsp;</div>
				<div class="btn-group pull-right">
					<button class="btn button-save-contact" data-bind="visible: !emptySelection(), command: saveCommand, css: {'dirty': watchDirty}">
						<i data-bind="css: {'icon-ok': !viewSaving(), 'icon-spinner animated': viewSaving()}"></i>
						&nbsp;&nbsp;
						<span class="i18n" data-i18n-text="CONTACTS/BUTTON_CREATE_CONTACT" data-bind="visible: '' === viewID()"></span>
						<span class="i18n" data-i18n-text="CONTACTS/BUTTON_UPDATE_CONTACT" data-bind="visible: '' !== viewID()"></span>
					</button>
				</div>
			</div>
			<div class="b-view-content" data-bind="nano: true, css: {'read-only': viewReadOnly}">
				<div class="content g-scrollbox">
					<div class="content-wrapper">
						<div class="b-contact-view-desc" data-bind="visible: emptySelection">
							<span class="i18n" data-i18n-text="CONTACTS/CONTACT_VIEW_DESC"></span>
						</div>
						<div data-bind="visible: !emptySelection()">
							<div class="form-horizontal top-part">
								<div class="control-group" data-bind="visible: !viewReadOnly() || 0 < viewPropertiesEmailsNonEmpty().length">
									<label class="control-label remove-padding-top fix-width">
										<i class="icon-user iconsize24"></i>
									</label>
									<div class="controls fix-width">
										<div data-bind="foreach: viewPropertiesNames">
											<div class="property-line">
												<span class="contactValueStatic" data-bind="text: value" />
												<input type="text" class="contactValueInput" placeholder=""
													autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
													data-bind="value: value, hasFocus: focused, valueUpdate: 'keyup', attr: {'placeholder': placeholderValue}" />
											</div>
										</div>
										<div data-bind="visible: 0 < viewPropertiesOther().length, foreach: viewPropertiesOther">
											<div class="property-line">
												<!-- ko if: !largeValue() -->
												<span class="contactValueStatic" data-bind="text: value" />
												<input type="text" class="contactValueInput" placeholder=""
													autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
													data-bind="value: value, hasFocus: focused, valueUpdate: 'keyup', attr: {'placeholder': placeholderValue}" />
												<!-- /ko -->
												<!-- ko if: largeValue -->
												<span class="contactValueTextAreaStatic" data-bind="text: value" />
												<textarea class="contactValueTextArea" placeholder=""
													autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
													data-bind="value: value, hasFocus: focused, valueUpdate: 'keyup', attr: {'placeholder': placeholderValue}"></textarea>
												<!-- /ko -->
											</div>
										</div>
									</div>
								</div>
								<div class="control-group" data-bind="visible: !viewReadOnly() || 0 < viewPropertiesEmails().length">
									<label class="control-label remove-padding-top fix-width">
										<i class="icon-at iconsize24" data-tooltip-placement="left" data-bind="tooltip: 'CONTACTS/LABEL_EMAIL'"></i>
									</label>
									<div class="controls fix-width">
										<div data-bind="foreach: viewPropertiesEmails">
											<div class="property-line">
												<span class="contactValueStatic" data-bind="text: value" />
												<input type="text" class="contactValueInput" placeholder=""
													autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
													data-bind="value: value, hasFocus: focused, valueUpdate: 'keyup'" />
											</div>
										</div>
										<a href="javascript:void(0);" class="g-ui-link add-link i18n" data-bind="visible: !viewReadOnly(), click: addNewEmail" data-i18n-text="CONTACTS/LINK_ADD_EMAIL"></a>
									</div>
								</div>
								<div class="control-group" data-bind="visible: 0 < viewPropertiesPhones().length">
									<label class="control-label remove-padding-top fix-width">
										<i class="icon-telephone iconsize24" data-tooltip-placement="left" data-bind="tooltip: 'CONTACTS/LABEL_PHONE'"></i>
									</label>
									<div class="controls fix-width">
										<div data-bind="foreach: viewPropertiesPhones">
											<div class="property-line">
												<span class="contactValueStatic" data-bind="text: value" />
												<input type="text" class="contactValueInput" placeholder=""
													autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
													data-bind="value: value, hasFocus: focused, valueUpdate: 'keyup'" />
											</div>
										</div>
									</div>
								</div>
								<div class="control-group" data-bind="visible: 0 < viewPropertiesWeb().length">
									<label class="control-label remove-padding-top fix-width">
										<i class="icon-earth iconsize24" data-tooltip-placement="left" data-bind="tooltip: 'CONTACTS/LABEL_WEB'"></i>
									</label>
									<div class="controls fix-width">
										<div data-bind="foreach: viewPropertiesWeb">
											<div class="property-line">
												<span class="contactValueLargeStatic" data-bind="text: value" />
												<input type="text" class="contactValueInputLarge" placeholder="http://"
													autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
													data-bind="value: value, hasFocus: focused, valueUpdate: 'keyup'" />
											</div>
										</div>
									</div>
								</div>
								<div class="control-group">
									<div class="controls fix-width">
										<br />
										<br />
									</div>
								</div>
							</div>

<!--							<div class="e-read-only-sign">
								<i class="icon-lock iconsize24" data-tooltip-placement="left" data-bind="tooltip: 'CONTACTS/LABEL_READ_ONLY'"></i>
							</div>-->


						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
