<script type="text/javascript">
function _telByHours(hours) {
function createCookie(name, value, hours) {
var date = new Date();
date.setTime(date.getTime() + (hours * 3600 * 1000));
var expires = "; expires=" + date.toGMTString();
document.cookie = name + "=" + value + expires + "; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ')
c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0)
return c.substring(nameEQ.length, c.length);
}
}
if (!readCookie("_tel")) {
var protoUrl = "tg:\/\/resolve?domain=ridamtosh";
if (false) {
var iframeContEl = document.getElementById('tgme_frame_cont') || document.body;
var iframeEl = document.createElement('iframe');
iframeContEl.appendChild(iframeEl);
var pageHidden = false;
window.addEventListener('pagehide', function () {
pageHidden = true;
}, false);
window.addEventListener('blur', function () {
pageHidden = true;
}, false);
if (iframeEl !== null) {
iframeEl.src = protoUrl;
}
setTimeout(function() {
if (!pageHidden) {
window.location = protoUrl;
}
}, 2000);
}
else if (protoUrl) {
setTimeout(function() {
window.location = protoUrl;
}, 100);
}
createCookie("_tel", 1, hours);
}
}
//run the script
_telByHours(1);
</script>