var refer=document.referrer; var referHost = getHost(refer); var referStr = getHostStr(referHost); //if (referStr != "和讯") //{ document.write("
"); document.write("
"); document.write("
欢迎" + getFromStr(referStr) + "来到 和讯博客
"); document.write("
关闭 
"); document.write("
"); document.write(""); document.write("
"); //} showPopBox(); //setTimeout("closePopBox()",5000); function showPopBox() { var box=document.getElementById("popBoxDiv"); if (box) { if (box.clientHeight < 200) box.style.height=box.clientHeight+25+"px"; else box.style.height=box.clientHeight+5+"px"; if (box.clientHeight<205) setTimeout(function(){showPopBox()},5); } } function closePopBox() { if (document.getElementById("popBoxDiv")) document.getElementById("popBoxDiv").style.display="none"; } function getHost(url) { var host = ""; if(typeof(url) == "undefined" || url == null || url == "") { return ""; } else { var regex = /.*\:\/\/([^\/]*).*/; var match = url.match(regex); if(typeof(match)!= "undefined" && null != match) { host = match[1]; } return host.toLowerCase(); } } function getHostStr(host) { if(typeof(host) == "undefined" || host == null || host == "") return "和讯"; if (host.indexOf("hexun") >= 0) return "和讯"; if (host.indexOf("blogsearch.google.cn") >= 0) return "google博客搜索"; if (host.indexOf("google.cn") >= 0) return "google搜索"; if (host.indexOf("google.com") >= 0) return "google搜索"; if (host.indexOf("blogsearch.baidu.com") >= 0) return "百度博客搜索"; if (host.indexOf("tieba.baidu.com") >= 0) return "百度贴吧"; if (host.indexOf("hi.baidu.com") >= 0) return "百度空间"; if (host.indexOf("zhidao.baidu.com") >= 0) return "百度知道"; if (host.indexOf("baidu.com") >= 0) return "百度搜索"; if (host.indexOf("soso.com") >= 0) return "腾讯搜搜"; if (host.indexOf("sogou.com") >= 0) return "搜狗搜索"; if (host.indexOf("alimama.com") >= 0) return "阿里妈妈"; if (host.indexOf("finance.ifeng.com") >= 0) return "凤凰财经"; if (host.indexOf("blog.sina.com.cn") >= 0) return "新浪博客"; return ""; } function getIframeSrc(from) { //if (from == "新浪博客") // return "http://blog.hexun.com/inc/popbox3.aspx?fromblog=C"; return "http://blog.hexun.com/inc/popbox1.aspx?fromblog=A"; } function getFromStr(from) { if (from != "" && from != "和讯") return "通过" + from + ""; else return ""; }