function ShowTestHeader(search_key)
{
	var		url_str;
	
	url_str = window.location;
	url_str = url_str.toString();
	document.write('<TABLE><tr><td><a href="http://www.ksou.com.cn/index.htm"><img src="/img/logo.gif" border=0></a>');
	document.write('</td><td>&nbsp;&nbsp;&nbsp;</td><td valign="middle" nowrap>');
	document.write('<FORM action=/s.php name=ksou>');
	if(search_key == "")
	{
		document.write('<INPUT name=kw size=28 style=font-size:16px>');
	}
	else
	{
		document.write('<INPUT name=kw size=28 style=font-size:16px value="' + search_key + '">');
	}
	document.write('&nbsp;<input type=submit value=产品搜索>&nbsp;&nbsp;&nbsp;');
	document.write('<font style=font-size:14px><a href=/advsearch.htm class=h>高级搜索</a>&nbsp;|&nbsp;<a href=/help.htm class=h>搜索帮助</a>：例如输入"nokia n90"、"索尼笔记本"</font>');
	document.write('</form><div id="pic"><font style=font-size:16px>请输入你想找的数码产品↑</font></div></td></tr></table>');
	document.write('<table width=100% bgcolor=#e5ecf9><tr align="left"><td class="nvbar" nowrap>');
	if(url_str.indexOf("/index.htm") > 0)
	{
		document.write('<b>首页</b>&nbsp;|&nbsp;');
	}
	else
	{
		document.write('<a href="/index.htm" class=h>首页</a>&nbsp;|&nbsp;');
	}
	if(url_str.indexOf("/review/nb") > 0)
	{
		document.write('<b>笔记本</b>&nbsp;|&nbsp;');
	}
	else
	{
		document.write('<a href="/review/nb.htm" class=h>笔记本</a>&nbsp;|&nbsp;');
	}
	if(url_str.indexOf("/review/pc") > 0)
	{
		document.write('<b>台式机</b>&nbsp;|&nbsp;');
	}
	else
	{
		document.write('<a href="/review/pc.htm" class=h>台式机</a>&nbsp;|&nbsp;');
	}
	if(url_str.indexOf("/review/hard") > 0)
	{
		document.write('<b>电脑配件</b>&nbsp;|&nbsp;');
	}
	else
	{
		document.write('<a href="/review/hard.htm" class=h>电脑配件</a>&nbsp;|&nbsp;');
	}
	if(url_str.indexOf("/review/mobile") > 0)
	{
		document.write('<b>手机</b>&nbsp;|&nbsp;');
	}
	else
	{
		document.write('<a href="/review/mobile.htm" class=h>手机</a>&nbsp;|&nbsp;');
	}	
	if(url_str.indexOf("/review/dc") > 0)
	{
		document.write('<b>数码相机</b>&nbsp;|&nbsp;');
	}
	else
	{
		document.write('<a href="/review/dc.htm" class=h>数码相机</a>&nbsp;|&nbsp;');
	}
	if(url_str.indexOf("/review/dv") > 0)
	{
		document.write('<b>数码摄像机</b>&nbsp;|&nbsp;');
	}
	else
	{
		document.write('<a href="/review/dv.htm" class=h>数码摄像机</a>&nbsp;|&nbsp;');
	}
	if(url_str.indexOf("/review/mp3") > 0)
	{
		document.write('<b>随身听</b>&nbsp;|&nbsp;');
	}
	else
	{
		document.write('<a href="/review/mp3.htm" class=h>随身听</a>&nbsp;|&nbsp;');
	}
	if(url_str.indexOf("/review/tv") > 0)
	{
		document.write('<b>电视</b>&nbsp;|&nbsp;');
	}
	else
	{
		document.write('<a href="/review/tv.htm" class=h>电视</a>&nbsp;|&nbsp;');
	}
	if(url_str.indexOf("/review/game") > 0)
	{
		document.write('<b>游戏</b>&nbsp;');
	}
	else
	{
		document.write('<a href="/review/game.htm" class=h>游戏</a>&nbsp;');
	}	
	document.write('|&nbsp;<a href="http://www.ksou.mobi" class=h>移动搜索</font></a>&nbsp;');
	document.write('|&nbsp;<a href="/news/index.php" class=h target=_blank>最新要闻</a>&nbsp;');
	if(url_str.indexOf("/about.htm") > 0)
	{
		document.write('&nbsp;&nbsp;&nbsp;&nbsp;<b>关于快搜</b>&nbsp;|&nbsp;');
	}
	else
	{
		document.write('&nbsp;&nbsp;&nbsp;&nbsp;<a href="/about.htm" class=h>关于快搜</a>&nbsp;|&nbsp;');
	}
	document.write('<a href=# onClick="AddFav()" class=h>收藏本站</a>');	
	document.write('</td></tr></table>');
}
function GetCookie(sName)
{
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0]) 
      return unescape(aCrumb[1]);
  }
  return "";
}
function AddFav()
{
	window.external.addfavorite('http://www.ksou.com.cn','快搜测评网-IT产品资讯搜索');
}
function SetLog(mode)
{
	myuid=GetCookie("uid");
	if(myuid != "")
	{
		p = "act=0&uid=" + myuid;
	}
	else
	{
		if(mode == 1)
			return;
		p = "act=1&uid=";
	}
	url = window.location;
	url = url.toString();
	if(url.length > 250)
	{
		url = url.substring(0, 250);
	}
	p += "&url=" + url.replace(/\&/g, "AND");
	
	url = window.top.document.referrer;
	url = url.toString();
	if(url.length > 250)
	{
		url = url.substring(0, 250);
	}
	if(url.indexOf("www.google.") > 0 || url.indexOf("UTF-8") > 0 || url.indexOf("utf-8") > 0)
	{
		url = URLEncoding(decodeURI(url));
	}
	p += "&from=" + url.replace(/\&/g, "AND");
	document.write("<div style='position:absolute; left:0px; top:0px; width:0px; height:0px; z-index:0; visibility: hidden;'>");
	document.write("<img src='/p.php?" + p + "' height='0' width='0'></div>");	
}
function show_tail()
{
	document.write('<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="line" style="margin-top:15px"><tr><td></td></tr></table>');
	document.write('<div style=text-align:center;padding-top:10px><font size=-1>产品资讯搜索源于互联网新闻网站和论坛，系统自动分类排列，不刊登或转载任何完整的资讯内容</font>');
	document.write('<br><font size=-1>&copy; 2008</font> <a href=http://www.ksou.com.cn/about.htm><font size=-1>快搜工作室</font></a>');
	document.write('&nbsp;&nbsp;<a href=http://www.miibeian.gov.cn target=_blank><font size=-1>粤ICP备05137792</font></a></div>');
	document.write('<div id="bottom"></div>');
	//SetLog(0);
}
function show_index_tail()
{
	document.write('<table border=0 border="0" cellspacing="1" cellpadding="0" align=center valign=center>');
  document.write('<tr>');
  document.write('<td  height=12><div align=center><a href="http://www.ksou.mobi" target=_blank>K搜手机搜索</a>&nbsp;</div></td>');
document.write('<td  height=12><div align=center><a href="http://www.hardspell.com" target=_blank>硬派网</a>&nbsp;</div></td>');
  document.write('<td  height=12><div align=center><a target=_blank href=http://www.it.com.cn>IT世界</a>&nbsp;</div></td>');
  document.write('<td  height=12> <div align=center><a target=_blank href=http://www.imp3.net>iMP3</a>&nbsp;</div></td>');
  document.write('<td  height=12><div align=center><a target=_blank href=http://www.xiangshu.com>橡树摄影网</a>&nbsp;</div></td>');
  document.write('<td  height=12><div align=center><a target=_blank href=http://www.sxfans.net>三星摄影</a>&nbsp;</div></td>');
  document.write('<td  height=12><div align=center><a target=_blank href=http://bbs.cmd365.com/>成名数码</a>&nbsp;</div></td>');
  document.write('<td  height=12><div align=center><a target=_blank href=http://www.pjtime.com>投影时代</a>&nbsp;</div></td>');
    document.write('<td  height=12><div align=center><a target=_blank href=http://tech.driverchina.com>驱动中国</a>&nbsp;</div></td>');
    document.write('<td  height=12><div align=center><a target=_blank href=http://www.itdoor.net>倚天硬件门户</a>&nbsp;</div></td>');
    document.write('</tr>');
    document.write('<td><div align=center  height=12><a target=_blank href=http://www.52hardware.com>52硬件</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.itime.cn>随身数码网</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.dc86.com>数码俱乐部</a>&nbsp;</div></td>');
		document.write('<td><div align=center height=12><a target=_blank href=http://bbs.blueshow.net>蓝色手机论坛</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.ChinaDIYer.com>中国硬件玩家网</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.pcicp.com>蔫老虎在线</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.easiu.com>笔记本维修网</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.ynzol.com>云南ZOL</a>&nbsp;</div></td>');
document.write('<td><div align=center height=12><a target=_blank href=http://www.inpai.com.cn>硬派下载</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://bbs.tech.ccidnet.com>赛迪网技术社区</a>&nbsp;</div></td>');
  document.write('</tr>');
  document.write('<tr>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.bokee.net>企业博客网</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.pcolive.com>橄榄树电脑网</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.uusee.com>悠视网</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.pomoho.com>爆米花免费视频</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.Bolaa.com>博啦!互动平台</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.u-vv.com>中国互动媒体</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.czn.com.cn>中关村商情网</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.hunt007.com>广州人才网</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.domolo.com>多么乐阅读器</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a href=/link.htm target=_blank>&gt;&gt;更多链接</a>&nbsp;</div></td>');
  document.write('</tr>');
  document.write('<tr>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.itzh.cn>珠海IT网</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.45it.com>电脑软硬件应用网</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.itren.cn>IT人</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.hardspell.com>硬派网</a>&nbsp;</div></td>');
    document.write('<td><div align=center height=12><a target=_blank href=htttp://www.cbismb.com>中小企业IT网</a>&nbsp;</td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.cskoo.com>超市中国</a>&nbsp;</td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://182.bbs.kooxoo.com/>酷讯IT论坛</a>&nbsp;</td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.sooyuu.com/>搜娱网</a>&nbsp;</td>');
    document.write('<td><div align=center height=12><a target=_blank href=http://www.fixhome.com.cn/>数据恢复专家</a>&nbsp;</td>');
    document.write('<td><div align=center height=12><a href=http://www.ksou.com.cn/about.htm target=_blank>&gt;&gt;申请友情链接</a>&nbsp;</div></td>');
  document.write('</tr>');
  document.write('<tr>');
  document.write('<td><div align=center height=12><a target=_blank href=http://www.cn-tc.com.cn/>网站运营专家网</a>&nbsp;</td>');
  document.write('<td><div align=center height=12><a target=_blank href=http://www.fixhdd.cn/>数据恢复</a>&nbsp;</td>');
  document.write('</tr>');
      document.write('</table><br>');
	
	document.write('<div style=text-align:center;padding-top:10px><font size=-1>产品资讯搜索源于互联网新闻网站和论坛，系统自动分类排列，不刊登或转载任何完整的资讯内容</font>');
	document.write('<br><font size=-1>&copy; 2008</font> <a href=http://www.ksou.com.cn/about.htm><font size=-1>快搜工作室</font></a>');
	document.write('&nbsp;&nbsp;<a href=http://www.miibeian.gov.cn target=_blank><font size=-1>粤ICP备05137792</font></a></div>');
	document.write('<div id="bottom"></div>');
	//SetLog(0);
}
function set_search()
{
	var domain = new Array();
	var key = new Array();
	var conv = new Array();
	
	url = window.top.document.referrer;
	url = url.toString();
	w = "";
	domain[0] = ".baidu.com/s?";
	key[0] = "wd=";
	conv[0] = 0;
	domain[1] = "p.zhongsou.com/p?";
	key[1] = "w=";
	conv[1] = 0;
	domain[2] = "page.zhongsou.com/p?";
	key[2] = "w=";
	conv[2] = 0;
	domain[3] = "www.google.cn/search?";
	key[3] = "q=";
	conv[3] = 1;
	domain[4] = "www.google.com/search?";
	key[4] = "q=";
	conv[4] = 1;
	domain[5] = "search.yahoo.com/search?";
	key[5] = "p=";
	conv[5] = 1;
	domain[6] = ".cn.yahoo.com/search?";
	key[6] = "p=";
	conv[6] = 1;
	domain[7] = ".sogou.com/web?";
	key[7] = "query=";
	conv[7] = 0;
	domain[8] = ".soso.com/q?";
	key[8] = "w=";
	conv[8] = 0;
	domain[9] = ".baidu.com/baidu?";
	key[9] = "word=";
	conv[9] = 0;
	for(n=0; n<10; ++n)
	{
		if(url.indexOf(domain[n]) > 0)
		{ 
			pos = url.indexOf(key[n]);
			if(pos > 0)
			{
				w = url.substring(pos+key[n].length);
				pos = w.indexOf("&");
				if(pos > 0)
				{
					w = w.substring(0, pos);
				}
			}
			break;
		}
	}
	if(w != "")
	{
		if(conv[n] == 0)
		{
			w = URLDecoding(w);
		}
		else if(conv[n] == 1)
		{
			w = decodeURI(w);
		}
		if(w.indexOf("ksou") <= 0 && w.indexOf("快搜") <= 0)
		{
			w = w.replace(/\+/g, " ");
			window.document.all.ksou.kw.value = w;
			document.getElementById("pic").innerHTML = '<font style=font-size:16px color=red>请点击"产品搜索"按钮搜索你想找的产品↑</font>';
		}
	}
}
function show_friend_link()
{
}
function click_url(url)
{
	uid=GetCookie("uid");
	if(uid != "")
	{
		p = "act=0&uid=" + uid;
	}
	else
	{
		p = "act=1&uid=";
	}
	if(url.length > 250)
	{
		url = url.string(0, 250);
	}
	p += "&url=" + url.replace(/\&/g, "AND");
	
	url = window.location;
	url = url.toString();
	if(url.length > 250)
	{
		url = url.string(0, 250);
	}
	p += "&from=" + url.replace(/\&/g, "AND");
	document.getElementById("bottom").innerHTML = "<div style='position:absolute; left:0px; top:0px; width:0px; height:0px; z-index:0; visibility: hidden;'><img src='/p.php?" + p + "' height='0' width='0'></div>";
}
