//Variables to override in settings

var useTOC = <%= html.show_toc %>;
var useGLO = <%= html.show_glossary %>;
var useIDX = <%= html.show_index %>;
var useFilter = <%= html.show_filter %>;
var fontFamily = "<%- html.page_font_family %>";

var delayLoadIdx = true;
var delayLoadGlo = true;
var useSocial = true;
var maxResults = 15;
var titleColor = "#ffffff";
var backgroundColor = "#509de6";

(function () {
	var rh = window.rh,
		model = rh.model
	
	model.publish(rh.consts('KEY_SEARCH_HIGHLIGHT_COLOR'), "<%= html.search_highlight_text_color %>")
	model.publish(rh.consts('KEY_SEARCH_BG_COLOR'), "<%= html.search_highlight_bg_color %>")
	model.publish(rh.consts('DATA_TOC_IMG_DATA_SET'),<%- JSON.stringify(html.tocImageDataSet  || []) %>);
	model.publish(rh.consts('SHOW_SKIN_BCRUMBS'), <%= html.showBreadcrumbs %>);
	model.publish(rh.consts('KEY_SHOW_ACCORDIAN'), false);
	model.publish(rh.consts('KEY_TOOLBAR_SEARCH'), false);
	model.publish(rh.consts('KEY_TOP_NAVIGATION'), false);
	model.publish(rh.consts('KEY_SHOW_TOC'), <%= html.show_toc %>);
	model.publish(rh.consts('KEY_SHOW_GLOSSARY'), <%= html.show_glossary %>);
	model.publish(rh.consts('KEY_SHOW_INDEX'), <%= html.show_index %>);
	rh.model.publish(rh.consts('KEY_DEFAULT_TAB'), "<%= html.default_pane || 'toc' %>");

	rh.model.publish(rh.consts('KEY_SHOW_FULL_SCREEN'), <%= html.fullScreen %>);
	rh.model.publish(rh.consts('KEY_SHOW_TO_TOP'), <%= html.toTop %>);
	
	model.publish(rh.consts('KEY_DRILL_DOWN'), <%= html.drillDownTOC %>);
	model.publish(rh.consts('SHOW_CUSTOM_BUTTON_LABELS'), <%= html.showName %>);
	model.publish(rh.consts('KEY_GDPR_COMPLIANT'), <%= html.gdprCompliant %>);
	model.publish(rh.consts('KEY_IS_RESPONSIVE'), <%= html.showOnlyDesktopView %>);
	model.publish(rh.consts('SHOW_PDF_DOWNLOAD'), "<%= pdfPath %>");

	model.publish(rh.consts('MINITOC_FROM_LEVEL'), <%= html.minitoc_levelFrom %>)
	model.publish(rh.consts('MINITOC_TO_LEVEL'), <%= html.minitoc_levelTo %>)
	model.publish(rh.consts('MINITOC_CAPTION'), "<%= html.minitoc_caption %>")


	var phone_max_width = <%= html.max_width_mobile %>;
	var tablet_max_width = <%= html.max_width_tablet %>;
	var screens = {
		ios: {
			user_agent: /(iPad|iPhone|iPod)/g
		}
	};

	screens.phone = {
		media_query: 'screen and (max-width: ' + phone_max_width + 'px)'
	};
	if (phone_max_width === 0) {
		screens.tablet = {
			media_query: 'screen and (max-width: ' + tablet_max_width + 'px)'
		};
	} else {
		screens.tablet = {
			media_query: 'screen and (min-width: ' + (phone_max_width + 1) + 'px) and (max-width: ' +
				tablet_max_width + 'px)'
		};
	}
	if (tablet_max_width === 0) {
		screens.desktop = {
			media_query: 'screen and (min-width: ' + (phone_max_width || 1) + 'px)'
		};
	} else {
		screens.desktop = {
			media_query: 'screen and (min-width: ' + (tablet_max_width + 1) + 'px)'
		};
	}
	model.publish(rh.consts('KEY_SCREEN'), screens);
	model.publish(rh.consts('KEY_DEFAULT_SCREEN'), "<%= html.default_screen || 'phone' %>");
}.call(this));

(function () {
	var mobileMenu, rh, features;

	rh = window.rh;


	//If there are are no panes available
	if (!useTOC && !useGLO && !useIDX) {
		mobileMenu = false;
	} else {
		mobileMenu = true;
	}


	//Number of search results to be loaded at once.

	//Choose whether to use the AND search option in the layout

	/* This layout has single page and so handles search */

	//Social widgets
	}.call(this));