﻿

function Check()
{
	if (document.Form1.TBSearch.value.length<=0)
	{
		alert("关键字不能为空！");
		document.getElementById("TBSearch").focus();
		return false;
	}
	return true;
}

function AddHits(ProID)
{
	var xxhh = new ActiveXObject("Microsoft.XMLHTTP");
	xxhh.open("POST","../../JSCPU.aspx?YID="+ProID,false);
	xxhh.send();
}

function ShowDiv(obj) {
	var liobj = new Array('Iabout', 'Icraft', 'Isuccess');
	for(var i=0; i<liobj.length; i++) 
	{
		document.getElementById(liobj[i]).className = "menuOn";
		var j = i+1;
		document.getElementById("M_" + j.toString()).style.display = "none";
	}
	document.getElementById(liobj[obj-1]).className = "menuOver";
	document.getElementById("M_" + obj.toString()).style.display = "";
	document.body.focus();
}

function Mes()
{
	document.writeln("Google_page_url = \"document.locATIon\";");
}


function SearchNews(Mes,Path)
{
	if (Mes=="")
	{
		alert("关键字不能为空！");
		document.getElementById("TSearch").focus();
		return false;
	}
	Mes = URLEncode(Mes);
	if (Path=="PList")
		location.href="../SearchNews.aspx?KW="+Mes
	else
		location.href="SearchNews.aspx?KW="+Mes
}

function Search(Mes,Path)
{
	if (Mes=="")
	{
		alert("关键字不能为空！");
		document.getElementById("TSearch").focus();
		return false;
	}
	Mes = URLEncode(Mes);
	if (Path=="PList")
		location.href="../../SearchList.aspx?KW="+Mes
	else
		location.href="SearchList.aspx?KW="+Mes
}

function URLEncode(strInput)
{
	strTmp = encodeURI(strInput);
	strTmp = strTmp.replace(/\ /g, '+');
	strTmp = strTmp.replace(/\@/g, '%40');
	strTmp = strTmp.replace(/\#/g, '%23');
	strTmp = strTmp.replace(/\$/g, '%24');
	strTmp = strTmp.replace(/\&/g, '%26');
	strTmp = strTmp.replace(/\+/g, '%2B');
	strTmp = strTmp.replace(/\=/g, '%3D');
	strTmp = strTmp.replace(/\;/g, '%3B');
	strTmp = strTmp.replace(/\:/g, '%3A');
	strTmp = strTmp.replace(/\//g, '%2F');
	strTmp = strTmp.replace(/\?/g, '%3F');
	strTmp = strTmp.replace(/\,/g, '%2C');
	return strTmp;
}

function ButUP()
{
	if (NowCount>0)
	{
		var tempCou = NowCount + 2;
		document.getElementById("dd"+tempCou).style.display = "none";
		tempCou = NowCount - 1;
		document.getElementById("dd"+tempCou).style.display = "block";
		tempCou = NowCount;
		document.getElementById("dd"+tempCou).style.display = "block";
		tempCou = NowCount + 1;
		document.getElementById("dd"+tempCou).style.display = "block";
		NowCount = NowCount - 1;
	}
}
		
function ButDown()
{
	if (NowCount+3<=MaxCount)
	{	
		var tempCou = NowCount;
		document.getElementById("dd"+tempCou).style.display = "none";
		tempCou = NowCount + 1 ;
		document.getElementById("dd"+tempCou).style.display = "block";
		tempCou = NowCount + 2;
		document.getElementById("dd"+tempCou).style.display = "block";
		tempCou = NowCount + 3;
		document.getElementById("dd"+tempCou).style.display = "block";
		NowCount = NowCount + 1;
	}
}
