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

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

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

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