﻿window.onload=function(){
	if(document.getElementById("homeFndJsFix")){
		homeFndJsFix();
	}
}

 function homeFndJsFix(){
	var obj=document.getElementById("homeFndJsFix").getElementsByTagName("ul")[0].childNodes;
	var t2=1;
	for(var i=0;i<obj.length;i++){
		if(obj[i].tagName=="LI"){			
			obj[i].id="tabObj" + t2;
			t2+=1;
		}
	}
	for(var i=0;i<obj.length;i++){
		obj[i].onclick=function(){
			this.getElementsByTagName("a")[0].blur();
			setInfoShow(this.id.substring(6,7),this);			
		}
		obj[i].onmouseover=function(){
			tempTabFlag=this;			
			wait2=window.setTimeout("setInfoShow(tempTabFlag.id.substring(6,7));",700);
		}
		obj[i].onmouseout=function(){
			clearTimeout(wait2);
		}
	}
}
//设置显示
function setInfoShow(Id){
		//重新获得一遍数量，以便循环内容样式
	var objx=document.getElementById("homeFndJsFix").getElementsByTagName("ul")[0].childNodes;
	var t2x=1;
	for(var i=0;i<objx.length;i++){
		if(objx[i].tagName=="LI"){			
			objx[i].id="tabObj" + t2x;
			t2x+=1;
		}
	}
	//循环变更
	var obj=document.getElementById("tab" + Id);
	var pObj=document.getElementById("tabObj" + Id);
	if(obj.className=="tabInfo"){
		for(var i=1;i<t2x;i++){
			document.getElementById("tab"+i).className="tabInfo";
			document.getElementById("tabObj" + i).className=""
		}
		obj.className="tabInfo show";
		pObj.className="c";
	}
}



//

function showHomeNT(id){
	var allNums=2;
	var getTabs="homeNoticeTab";
	var getCons="homeNoticeTabCon";
	var setValueOn="";
	var setValueOff="hidden";
	
	
	
	for(i=1;i<=allNums;i++){
		document.getElementById(getTabs+i).className="";
		document.getElementById(getCons+i).className=setValueOff;
		}
		document.getElementById(getTabs+id).className="c";
		document.getElementById(getCons+id).className=setValueOn;

}
function Search()
{
	var host="http://"+GetHost();
    var word=encodeURIComponent(document.getElementById("keyword").value);
    var keyword=document.getElementById("keyword").value;
    if(word=='' || keyword=='请输入关键字')
    {
      alert("请输入搜索关键字");
    }else
    {
	
	var url=encodeURIComponent (host+document.getElementById("ctl00_SearchBox1_drpListSite").value)
	window.open("/SearchCenter/Pages/results.aspx?k="+word+"&u="+url);
    }
	
}
function SearchInFrame()
{
	var host="http://"+GetHost();
    var word=encodeURIComponent(document.getElementById("keyword").value);
	var url=encodeURIComponent (host+document.getElementById("ctl00_SearchBox1_drpListSite").value)
	if (window.location.href.indexOf("results")==-1)
	{
    window.location.href="/SearchCenter/Pages/results.aspx?k="+word+"&u="+url;
	}
	else
	{
	window.document.getElementById('searchResult').src="/SearchCenter/Pages/result.aspx?k="+word+"&u="+url;
	}
}

  function QueryParameterFromUrl()
	{
	var re=new RegExp(".*[?]", "g");
	var stURL=window.location.href;
	stURL='result.aspx?'+stURL.replace(re, "");
	window.document.getElementById('searchResult').src=stURL;
	}
	function GetHost()
	{
		var re=new RegExp("[?].*", "g");
	var stURL=window.location.href;
	stURL=stURL.replace(re, "");	
	return stURL.split("/")[2]
	}

