{
	let insertScripts = function(srcList, then) {
		var count = srcList.length
		var onLoaded = function() {
			console.log(count, window.UIkit)

			if (--count == 0 && then) {
				then()
			}
		}
		
		srcList.forEach(function(src){
			var head = document.getElementsByTagName('head')[0];
			var script = document.createElement('script');
			script.type = 'text/javascript';
			script.src = src;
			script.async = false;
			script.defer = true;
			script.onload = onLoaded
			head.appendChild(script);
		})
	}

	let appendStylesheet = function(href) {
		var head = document.getElementsByTagName('head')[0];
		var link = document.createElement('link');
		link.rel = 'stylesheet';
		link.href = href;
		head.appendChild(link);
	}

	let ready = function() {
		window.setTimeout(function(){
			$('body').load('partial/base.htm')
		}, 1000)
	}
	
	//appendStylesheet('lib/bootstrap5/bootstrap.min.css')
	appendStylesheet('lib/uikit/uikit.min.css')

	insertScripts([
		'lib/jquery/jquery.min.js',
		'lib/mustache/mustache.min.js',
		//'lib/bootstrap5/bootstrap.bundle.min.js',
		'lib/uikit/uikit.min.js',
		'lib/uikit/uikit-icons.min.js',
		'js/binapp.js',
		'js/rssentry.js',
		'js/feedparser.js',
		'js/rssdesk.js',
	], ready)
}

