// function reloadFromServer() {
// 	location.reload(true); //“true” parameter to reload from server, not cache
// }

//on page load
if (typeof(Storage) !== "undefined") { // check browser support for localStorage

	// Code for localStorage/sessionStorage.
	if (localStorage.lfbLastLoadedDate) {

		var lfbLastLoadedDate = new Date(localStorage.lfbLastLoadedDate);
		var currentDate = new Date();

		// if lfbLastLoadedDate is different from currentDate
		if (lfbLastLoadedDate.getFullYear() != currentDate.getFullYear() ||
			lfbLastLoadedDate.getMonth() != currentDate.getMonth() ||
			lfbLastLoadedDate.getDate() != currentDate.getDate()) {

			// replace localStorage.lfbLastLoadedDate with current date
			localStorage.lfbLastLoadedDate = new Date();

			// reload current document (does the same as the reload button in the browser), delayed to give service worker time
			//setTimeout(reloadFromServer, 200);
			location.reload(true); //“true” parameter to reload from server, not cache
			//window.location.href = window.location.href.split( '#' )[0];
		}
	}
	else {
		// initialize localStorage.lfbLastLoadedDate with current date
		localStorage.lfbLastLoadedDate = new Date();
	}
}
