// 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.lcLastLoadedDate) {

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

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

			// replace localStorage.lcLastLoadedDate with current date
			localStorage.lcLastLoadedDate = 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.lcLastLoadedDate with current date
		localStorage.lcLastLoadedDate = new Date();
	}
}
