function selectTag(showContent,selfObj){
	var tag = document.getElementById("tags").getElementsByTagName("a");
	var taglength = tag.length;
	for(i=0; i<taglength; i++){
		tag[i].className = "";
	}
	selfObj.className = "focu";
	for(i=0; j=document.getElementById("baidu"+i); i++){
		j.style.display = "none";
	}
	document.getElementById(showContent).style.display = "block";
}
function addBookmark(title,url) {
    if (window.sidebar) {
        window.sidebar.addPanel(title, url,"");
    } else if( document.all ) {
        window.external.AddFavorite( url, title);
    } else if( window.opera && window.print ) {
        return true;
    }
}

function $(o){
 var o=document.getElementById(o)?document.getElementById(o):'';
 return o;
}
function runCode(code){
var _c=window.open("","","");
_c.opener=null;
_c.document.write(code);
_c.document.close();
}
function createXMLHttpRequest(){
  if(window.ActiveXObject){
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  }else if(window.XMLHttpRequest) {
      xmlHttp = new XMLHttpRequest();
  }
} 
function startRequest(url,returnfun) {
   createXMLHttpRequest(); 
   xmlHttp.onreadystatechange =returnfun;
   xmlHttp.open("GET",url,true);
   xmlHttp.send(null);    
}
function weatherStateChange(){
  if(xmlHttp.readyState == 4){
	  $("ipweather").innerHTML=xmlHttp.responseText;
  }
}

function glog(evt)
{	
  evt=evt?evt:window.event;var srcElem=(evt.target)?evt.target:evt.srcElement;
try
{
while(srcElem.tagName.toUpperCase()=="A" || srcElem.parentNode.tagName.toUpperCase()=="A") 
{
address=srcElem.href; 
urlReg = /^http:\/\/(.*)\/catalog/; 
if (urlReg.test(address)){
   return ;
}
if(srcElem.parentNode.parentNode.id=="pagelist"||srcElem.parentNode.parentNode.id=="pagelist2"||srcElem.parentNode.parentNode.id=="indextool" ||srcElem.parentNode.parentNode.parentNode.id=="pagelist"||srcElem.parentNode.parentNode.parentNode.id=="pagelist2"||srcElem.parentNode.parentNode.parentNode.id=="indextool" )
{
 linkname=DelHtml(srcElem.innerHTML); 
 islog=true;
 wlink=linkname+"+"+address+"_114la_"; 
 wlink+=GetCookie("history");
 wlink=escape(wlink);
 SetCookie("history",wlink); 
 history_show();
 if ( islog==true)
 {
	  savehits(linkname,address,srcElem.parentNode.parentNode.id);
 }
}
srcElem = srcElem.parentNode;
}
}
catch(e){}
return true;
}

function showindexhtml(){
 if(tmptxt!=''){
   $("indexhtml").innerHTML=tmptxt;
 }
}
function JHshStrLen(sString)
{
var sStr,iCount,i,strTemp ; 
iCount = 0 ;
sStr = sString.split("");
for (i = 0 ; i < sStr.length ; i ++)
{
strTemp = escape(sStr[i]); 
if (strTemp.indexOf("%u",0) == -1) // 表示是汉字
{ 
iCount = iCount + 1 ;
} 
else 
{
iCount = iCount + 2 ;
}
}
return iCount ;
}
var oldkeyword='';
function KeyDown()
{
    if (event.keyCode == 13)
    {
        event.returnValue=false;
        event.cancel = true;
        if($('sitekeyword').value=='' ||JHshStrLen($('sitekeyword').value)<2){
			alert('请输入要搜索的关键字或关键字不能少于2个字节!!');
		}else{
			if ($('sitekeyword').value!=oldkeyword)
			{
				gositesearch($('sitekeyword').value);
			}
		}
    }
}
function input(){
      if($('sitekeyword').value=='' ||JHshStrLen($('sitekeyword').value)<2 ){//||JHshStrLen($('sitekeyword').value)<3
		 // showindexhtml();
      }else{
		  // $("indexhtml").innerHTML=JHshStrLen($('sitekeyword').value);
		  // 请求判断
		  // if (xmlHttp.readyState!=4)
		   //{
			 //  xmlHttp.abort();
		   //}
	       if ($('sitekeyword').value!=oldkeyword)
		  {
			gositesearch($('sitekeyword').value);
		  }
	  }
}

