﻿var stopscroll=false;


/*size*/

function doZoom(size)
{document.getElementById('zoom').style.fontSize=size+'px';}


/*login*/


//创建遮罩层
	function AlertMsg(){

	   /**第一步：创建DIV遮罩层。*/
		var sWidth,sHeight;
		sWidth = window.screen.availWidth;
		//屏幕可用工作区高度： window.screen.availHeight;
		//屏幕可用工作区宽度： window.screen.availWidth;
		//网页正文全文宽：     document.body.scrollWidth;
		//网页正文全文高：     document.body.scrollHeight;
		if(window.screen.availHeight > document.body.scrollHeight){  //当高度少于一屏
			sHeight = window.screen.availHeight;  
			
		}else{//当高度大于一屏
			sHeight = document.body.scrollHeight;   
		}
		//创建遮罩背景
		var maskObj = document.createElement("div");
		maskObj.setAttribute('id','BigDiv');
		maskObj.style.position = "absolute";
		maskObj.style.top = "0";
		maskObj.style.left = "0";
		maskObj.style.background = "#777";
		maskObj.style.filter = "Alpha(opacity=30);";
		maskObj.style.opacity = "0.3";
		maskObj.style.width = sWidth + "px";
		maskObj.style.height = sHeight + "px";
		maskObj.style.zIndex = "10000";
		document.body.appendChild(maskObj);

      
        /**第二步：动态设置div的上边距和左边距，使弹出div居中打开。*/
        var MyDiv =document.getElementById("MyDiv");
		var MyDiv_w = getStyle(MyDiv,"width");
		var MyDiv_h = getStyle(MyDiv,"height");
	    
		MyDiv_w = parseInt(MyDiv_w); //去掉 单位 "px"
		MyDiv_h = parseInt(MyDiv_h);

		var width = pageWidth(); 
		var height = pageHeight();
		var left = leftPosition();
		var top = topPosition();

		var Div_topposition = top + (height / 2) - (MyDiv_h / 2); //计算上边距
		var Div_leftposition = left + (width / 2) - (MyDiv_w / 2); //计算左边距

		MyDiv.style.left = Div_leftposition + "px";  //拼接上 单位"px"
		MyDiv.style.top =  Div_topposition + "px";
		MyDiv.style.display = "block";  //设置弹出div显示
	}

		/**第三步：关闭窗口和遮罩层。*/
	function CloseDiv(){
		var Bigdiv = document.getElementById("BigDiv");
		var Mydiv = document.getElementById("MyDiv");
		document.body.removeChild(Bigdiv); 
		Mydiv.style.display="none";
	}


/**
下面都是常用函数，已经收录在我的jsskep.js中。可以在里面找到。
工程地址：http://code.google.com/p/jsskep/
**/
// 计算当前窗口的宽度 //
function pageWidth(){
			 return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
}

// 计算当前窗口的高度 //
function pageHeight(){
			 return window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;
}

// 计算当前窗口的上边滚动条//
function topPosition(){
			  return typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
}

// 计算当前窗口的左边滚动条//
function leftPosition(){
			 return typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;
}

//解决外嵌样式style , 用js获取不到的问题。
function getStyle(elem, name){
			if(elem.style[name])
				return elem.style[name];
			else if(elem.currentStyle)	//ie
				return elem.currentStyle[name];
			else if(document.defaultView && document.defaultView.getComputedStyle){	//w3c
				name = name.replace(/([A-Z])/g,"-$1");
				name = name.toLowerCase();
				
				var s = document.defaultView.getComputedStyle(elem,"");
				return s && s.getPropertyValue(name);
			} else
				return null
}



/*tab*/

function setTabb(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("dnn_con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }
}
function setTabbs(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }
}

/*tab2*/
function cleanallstyle() {
				for (i=0;i<4;i++) {
					document.getElementById("focus_"+i).className = "" ;
				}
			}
			function show_focus_image(index) {
				clearTimeout(refreshHotQueryTimer);
				setHotQueryList(index);
				refreshHotQueryTimer = setTimeout('refreshHotQuery();', 5000);
			}
			function setClick() {
				clearTimeout(refreshHotQueryTimer);
			}
			//如果当前页面是首页的话要先加载下面的这个函数
			function indexload()
			{
		      var refreshHotQueryTimer = null ;
		      var CurrentHotScreen = 0 ;
		      var hot_query_td =document.getElementById('HotSearchList');
		      setHotQueryList(CurrentHotScreen);
		      refreshHotQueryTimer = setTimeout('refreshHotQuery();', 5000);
            }
			function setHotQueryList(screen){
				var Vmotion = "forward" ;
				var MaxScreen = 4 ;
				if (screen >= MaxScreen) {
					screen = 0 ;
					Vmotion = "reverse" ;
				}
				
				cleanallstyle();

				document.getElementById("focus_"+screen).className = "up" ;
			  
			  if(null!=hot_query_td.filters){
				hot_query_td.filters[0].apply();
				hot_query_td.filters[0].motion = Vmotion;
			  }
			  
			  for (i=0;i<MaxScreen;i++) {
				document.getElementById("switch_"+i).style.display = "none" ;
			  }
			  
			  document.getElementById("switch_"+screen).style.display = "block" ;
			  if(null!=hot_query_td.filters){
				hot_query_td.filters[0].play();
			  }
				CurrentHotScreen = screen ;
			}
			function refreshHotQuery(){
				refreshHotQueryTimer = null;
				setHotQueryList(CurrentHotScreen+1);
				refreshHotQueryTimer = setTimeout('refreshHotQuery();', 5000);
			}


/*search*/
function AddConditionBox(tableID,addbuttonID,removebuttonID)
{
    var conditionTable = document.getElementById(tableID);
    if(conditionTable && conditionTable.rows && conditionTable.rows.length>2)
    {
        // 从第二个检索条件开始测试是否为隐藏，如果是就显示出来，但每次只显示一个就break
        // 因为第一和第五个默认已经显示出来
        for(var i=1; i<conditionTable.rows.length; i++)
        {
            var conditionRow = conditionTable.rows[i];
            if(conditionRow.style.display && conditionRow.style.display=="none")
            {
                conditionRow.style.display = "block";
                break;
            }
        }
        
        var addButton = document.getElementById(addbuttonID);
        var removeButton = document.getElementById(removebuttonID);
        
        removeButton.style.display = "block";
        if(i==7)
            addButton.style.display = "none";

    }
    return false;
}

function RemoveConditionBoxNum(tableID,num,addbuttonID,removebuttonID)
{
    var conditionTable = document.getElementById(tableID);
    if(conditionTable && conditionTable.rows && conditionTable.rows.length>1)
    {
        for(var i=conditionTable.rows.length-num; i>0; i--)
        {
            var conditionRow = conditionTable.rows[i];
            if(conditionRow.style.display==null || conditionRow.style.display=="block")
            {
                conditionRow.style.display = "none";
                break;
            }
        }
        var addButton = document.getElementById(addbuttonID);
        var removeButton = document.getElementById(removebuttonID);
        
        addButton.style.display = "block";
        if(i==1)
            removeButton.style.display = "none";
    }
//    clearWords(tableID);
}


//获得研究快报,报告的检索框内容
function SearchAll(webid)
{
    var _Content="";
    var TextControl=document.getElementsByName('q');
    var _Logic="";
    var LogicControl=document.getElementsByName('Logic');
    var _Field="";
    var FieldControl=document.getElementsByName('FldName');
    
    
    
    if(document.getElementById('ckresult').checked==true)
    {
        var currenturl=location.href;
        var c,l,f;
        c=currenturl.indexOf('C=');
        l=currenturl.indexOf('L=');
        f=currenturl.indexOf('F=');
        if(c=="-1"&&l=="-1"&&f=="-1")
        {
            alert("请先查询后才可以使用在结果中检索！");
            document.getElementById('ckresult').checked=false;
            return;
        }
    }
    for(var i=0;i<TextControl.length;i++)
    {
        if(_Content=="")
        {
            if(TextControl[i].value!="")
            {
                _Content=TextControl[i].value;
                _Field=FieldControl[i].value;
            }
        }
        else
        {
            if(TextControl[i].value!="")
            {
                _Content+=","+TextControl[i].value;
                _Field+=","+FieldControl[i].value;
                if(_Logic=="")
                {
                    _Logic+=LogicControl[i-1].value;
                }
                else
                {
                    _Logic+=","+LogicControl[i-1].value;
                }
                
                
               
            }
        }
    }
    
    if(webid==3)
    {
        var ckProject=document.getElementsByName('ck');
        var _Ck="";
        for(var i=0;i<ckProject.length;i++)
        {
            if(ckProject[i].checked==true)
            {
                if(_Ck=="")
                {
                    _Ck=ckProject[i].value;
                }
                else
                {
                    _Ck+=","+ckProject[i].value;
                }
            }
        }
        if(_Content==""&&_Ck=="")
        {
            alert("请输入检索词!");
            return;
        }
    }
    
    if(webid==5)
    {
        var ckTeam=document.getElementsByName('ck');
        var _Ck5="";
        for(var i=0;i<ckTeam.length;i++)
        {
            if(ckTeam[i].checked==true)
            {
                if(_Ck5=="")
                {
                    _Ck5=ckTeam[i].value;
                }
                else
                {
                    _Ck5+=","+ckTeam[i].value;
                }
            }
        }
        if(_Content==""&&_Ck5=="")
        {
            alert("请输入检索词!");
            return;
        }
    }
    
    if(webid==10)
    {
        var ControlsCK=document.getElementsByName('ck_db');
        var _DB="";
        for(var i=0;i<ControlsCK.length;i++)
        {
            if(ControlsCK[i].checked==true)
            {
                if(_DB=="")
                    _DB=ControlsCK[i].value;
                else
                    _DB+=","+ControlsCK[i].value;
            }
        }
        if(_Content==""||_DB=="")
        {
            alert("请选择查询的数据库并且添入查询的内容！");
            return;
        }
    }
    
    if(webid==7)
    {
        
    }
    
    
    if(webid==1||webid==2||webid==4||webid==6)
    {
        if(_Content=="")
        {
            alert("请输入检索词!");
            return;
        }
    }
    
    
    var DateRank="";
    if(document.getElementById('yearchk').checked==true)
    {
        if(document.getElementById('ylStart').value>=document.getElementById('ylEnd').value)
        {
            alert("起始年度不能大于或等于结束年度!");
            return;
        }
        DateRank=document.getElementById('ylStart').value+","+document.getElementById('ylEnd').value;
    }
    _Content=_Content.replace(/\s/g,"");
    
    
    var CurrentUrl=decodeURIComponent(location.href);

    var result=document.getElementById('ckresult');
    
    if(result!=null&&result!=undefined)
    {
        if(result.checked==true)
        {   
            var c,l,f;
            var ctemp,ltemp,ftemp;
            var ctrue,ltrue,ftrue;

            if(CurrentUrl.indexOf("C=")!=-1&&CurrentUrl.indexOf("L=")!=-1&&CurrentUrl.indexOf("F=")!=-1)
            {
//                l=CurrentUrl.substring(CurrentUrl.indexOf("L="));
//                if(l.indexOf('&')!="-1")
//                    ltemp=l.split('&');

//                if(ltemp[1].indexOf('=')!="-1")
//                    ltrue=ltemp[1].split('=');
//                if(_Logic==""&&ltrue[1]=="")
//                {
//                    _Logic="0";
//                }
//                else if(_Logic==""&&ltrue[1]!="")
//                {
//                    _Logic=ltrue[1]+",0";
//                }
//                else if(_Logic!=""&&ltrue[1]=="")
//                {
//                    _Logic="0,"+_Logic;
//                }
//                else
//                {
//                    _Logic=ltrue[1]+",0,"+_Logic;
//                }

//                c=CurrentUrl.substring(CurrentUrl.indexOf("C="));
//                if(c.indexOf('&')!="-1")
//                    ctemp=c.split('&');
//                if(ctemp[0].indexOf('=')!="-1")
//                    ctrue=ctemp[0].split('=');
//                if(ctrue[1]!="")
//                {
//                    _Content=ctrue[1]+","+_Content;
//                }

//                f=CurrentUrl.substring(CurrentUrl.indexOf("F="));
//                if(f.indexOf('&')!="-1")
//                    ftemp=f.split('&');
//                if(ftemp[0].indexOf('=')!="-1")
//                    ftrue=ftemp[0].split('=');
//                if(ftrue[1]!="")
//                    _Field=ftrue[1]+","+_Field;
//            }
                l=CurrentUrl.substring(CurrentUrl.indexOf("L="));
                if(l.indexOf('&')!="-1")
                    ltemp=l.split('&');

                if(ltemp[1].indexOf('=')!="-1")
                    ltrue=ltemp[1].split('=');
                _Logic=ltrue[1]+";"+_Logic;

                c=CurrentUrl.substring(CurrentUrl.indexOf("C="));
                if(c.indexOf('&')!="-1")
                    ctemp=c.split('&');
                if(ctemp[0].indexOf('=')!="-1")
                    ctrue=ctemp[0].split('=');
                if(ctrue[1]!="")
                {
                    _Content=ctrue[1]+";"+_Content;
                }

                f=CurrentUrl.substring(CurrentUrl.indexOf("F="));
                if(f.indexOf('&')!="-1")
                    ftemp=f.split('&');
                if(ftemp[0].indexOf('=')!="-1")
                    ftrue=ftemp[0].split('=');
                if(ftrue[1]!="")
                    _Field=ftrue[1]+";"+_Field;
            }
           
        }
        
    }
    
    
    
    
    
    var Tempid="";
    
    if(CurrentUrl.indexOf("tabid")!="-1")
        Tempid=CurrentUrl.substring(CurrentUrl.indexOf("tabid")+6);
    else
        Tempid=CurrentUrl.substring(CurrentUrl.indexOf("TabId")+6);
    Tempid=Tempid.substring(0,3);
    if(ContentJudge(_Content)==false)
		return;
    //Tempid=
    switch(webid)
    {
        case 1:
            //研究报告为748
            location.href("/tabid/748/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+encodeURIComponent(DateRank));
            break;
        case 11:
            //研究报告为748
            location.href("/tabid/930/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+encodeURIComponent(DateRank));
            break;
        case 2:
            //快报为747
            location.href("/tabid/747/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+encodeURIComponent(DateRank));
            break;
        case 3:
            //项目是749
            location.href("/tabid/749/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+encodeURIComponent(DateRank)+"&S="+encodeURIComponent(_Ck)+"&ID="+Tempid);
            break;
        case 4:
            //人员是750
            location.href("/tabid/750/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+"&ID="+Tempid);
            break;
        case 5:
            //协作是751
            location.href("/tabid/751/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+encodeURIComponent(DateRank)+";"+encodeURIComponent(_Ck5));
            break;
        case 6:
            //专著是799
            location.href("/tabid/799/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+encodeURIComponent(DateRank));
            break;
        case 7:
            //期刊是858
            location.href("/tabid/858/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+encodeURIComponent(DateRank)+"&ID="+Tempid);
            break;
        case 8:
            //期刊专著是752
            //location.href("/tabid/752/Default.aspx?"+encodeURIComponent("C="+_Content+"&L="+_Logic+"&F="+_Field+"&D="+DateRank));
            break;
        case 10:
            var tid="";
            tid=_DB.substring(0,1);
            switch(tid)
            {   
                //831快报0 com1
                //832报告1 com2
                //838专著5 com3
                //835协作4 com4
                //833项目2 com6
                //834人员3 com5
                case "0":
                    location.href("/tabid/831/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+encodeURIComponent(DateRank)+"&db="+encodeURIComponent(_DB));
                    break;
                case "1":
                    location.href("/tabid/832/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+encodeURIComponent(DateRank)+"&db="+encodeURIComponent(_DB));
                    break;
                case "2":
                    location.href("/tabid/833/Default.aspx?C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+encodeURIComponent(DateRank)+"&db="+encodeURIComponent(_DB)+"&S=&ID=833")
                    break;
                case "3":
                    location.href("/tabid/834/Default.aspx?C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+encodeURIComponent(DateRank)+"&db="+encodeURIComponent(_DB)+"&ID=834");
                    break;
                case "4":
                    location.href("/tabid/835/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+encodeURIComponent(DateRank)+"&db="+encodeURIComponent(_DB));
                    break;
                case "5":
                    location.href("/tabid/838/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+encodeURIComponent(_Logic)+"&F="+encodeURIComponent(_Field)+"&D="+encodeURIComponent(DateRank)+"&db="+encodeURIComponent(_DB));
                    break;
            }
            
            break;
    }
}

function Index_SelectAll()
{
    var ckProject=document.getElementsByName('ck');
    if(document.getElementById('ckall').checked==true)
    {
        for(var i=0;i<ckProject.length;i++)
        {
            ckProject[i].checked=true;
        }
    }
    else
    {
        for(var i=0;i<ckProject.length;i++)
        {
            ckProject[i].checked=false;
        }
    }
}
function Index_SelectOne()
{
		var ckProject=document.getElementsByName('ck');
		var str="";
		for(var i=0;i<ckProject.length;i++)
    {
    	if(ckProject[i].checked!=true)
      {
      		document.getElementById('ckall').checked=false;
      		str="1";
      }
    }
    if(str!="1")
    {
    		document.getElementById('ckall').checked=true;
    }
}
function SelectAll()
{
    var ckProject=document.getElementsByName('ck');
    if(document.getElementById('ckall').checked==true)
    {
        for(var i=0;i<ckProject.length;i++)
        {
            ckProject[i].checked=true;
        }
    }
    else
    {
        for(var i=0;i<ckProject.length;i++)
        {
            ckProject[i].checked=false;
        }
    }
}

//初始化研究快报,报告的检索框内容
function init_input()
{
    var TextControl=document.getElementsByName('q');
    var LogicControl=document.getElementsByName('Logic');
    var FieldControl=document.getElementsByName('FldName');
    for(var i=0;i<TextControl.length;i++)
    {
        TextControl[i].value="";
        FieldControl[i].options[i].selected=true;
        if(i<TextControl.length-1)
            LogicControl[i].options[1].selected=true;
    }
}
//研究快报,报告的年度显示
function yearlimitchk(o)
{
	var yo=document.getElementsByName("yl");
	var chkbool=false;
	if (o.checked==true)
	{
		chkbool=true;
	}
  for (var i=0;i<yo.length;i++)
  {
  	if (chkbool)
  	{
	  	yo[i].disabled="";
	  }
	  else
	  {
	  	yo[i].disabled="disabled";
	  }
  }	
}
//初始化研究快报,报告的年度
function selectdate()
{//生成年代下拉选择的项

    var date=new Date();
    var nYear=parseInt(date.getYear());
    var sLst="";
    for(var i=nYear+1;i>=1998;i--)
    {
        if (i==nYear)
        {
            sLst+="<option value='"+i+"' selected='selected'>"+i+"</option>";
        }
        else
        {
            sLst+="<option value='"+i+"'>"+i+"</option>";
        }
    }
    document.write("<select name='yl' id='ylStart' disabled='disabled'>"+sLst+"</select>&nbsp;<span>到</span>&nbsp;");
    document.write("<select name='yl' id='ylEnd' disabled='disabled'>"+sLst+"</select>");
}

function btnSearchClick(webid)
{
//webid为哪个页面,因为每个页面的检索按钮的ID可能不同.所以增加webid用于判断
    if(event.keyCode==13)
    {
        if(webid==1)
        document.getElementById('btnSearch').click();
    }   
}


function selectsort(webid)
{
    var CurrentUrl=decodeURIComponent(location.href);
    CurrentUrl=CurrentUrl.replace(/\+/g," ")
    if(CurrentUrl.indexOf("tabid")!="-1")
        Tempid=CurrentUrl.substring(CurrentUrl.indexOf("tabid")+6);
    else
        Tempid=CurrentUrl.substring(CurrentUrl.indexOf("TabId")+6);
    Tempid=Tempid.substring(0,3);
    
    //左侧导航begin
    var sid="";
    var sidstr="";
    var tempposition="";
    sid=CurrentUrl.indexOf("sid");
    
    //项目试用的变量----------------------------
    var rsid,MoreString;
    rsid=CurrentUrl.indexOf("rsid=");
    MoreString=CurrentUrl.indexOf("MoreString=");
    //------------------------------------------
    
    //期刊论文的变量----------------------------
    var isid,Field,Vol;
    isid=CurrentUrl.indexOf("isid=");
    Field=CurrentUrl.indexOf("Field=");
    Vol=CurrentUrl.indexOf("Vol=");
    //------------------------------------------
    
    //左侧导航end
    //检索begin
    var c="",l="",f="",d="";
    c=CurrentUrl.indexOf("C=");
    l=CurrentUrl.indexOf("L=");
    f=CurrentUrl.indexOf("F=");
    d=CurrentUrl.indexOf("D=");
    s=CurrentUrl.indexOf("S=");
    //alert(CurrentUrl.indexOf(c,l-c));
    var tempclfd="";
    //检索end

    
    if(sid!="-1"&&MoreString=="-1"&&Vol=="-1")
    {
        sidstr=CurrentUrl.substring(sid+4);
        tempposition=sidstr.indexOf("/");
        sidstr=sidstr.substring(sidstr,tempposition);
        location.href(webid+"/sid/"+sidstr+"/cid/26/Default.aspx?O="+document.getElementById('sortlist').value);
    }
    //左侧导航end
    //检索begin
    else if(c!="-1"&&l!="-1"&&f!="-1"&&d!="-1"&&s=="-1")
    {
        tempclfd=CurrentUrl.substring(CurrentUrl.indexOf("?")+1);
        tempclfd=decodeURIComponent(tempclfd);
        if(CurrentUrl.indexOf("TabId=858&")!="-1")
            tempclfd=tempclfd.replace(/TabId=858&/g,"");
        var clfdchild=tempclfd.split('&');
        tempclfd="";
        
        for(var i=0;i<clfdchild.length;i++)
        {
            tempclfd=clfdchild[i].split('=');
            if(i==0)
            {
                c=encodeURIComponent(tempclfd[1]);

            }   
            if(i==1)
            {
                l=encodeURIComponent(tempclfd[1]);

            } 
            if(i==2)
            {
                f=encodeURIComponent(tempclfd[1]);

            } 
            if(i==3)
            {
                d=encodeURIComponent(tempclfd[1]);
            } 
        }

        if(Tempid=="858")
        {
            location.href(webid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&O="+document.getElementById('sortlist').value+"&ID="+Tempid);
        }
        else
            location.href(webid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&O="+document.getElementById('sortlist').value);
    }
    
    else if(c!="-1"&&l!="-1"&&f!="-1"&&d!="-1"&&s!="-1")
    {
        tempclfd=CurrentUrl.substring(CurrentUrl.indexOf("?")+1);
        if(CurrentUrl.indexOf("TabId=749&")!="-1")
            tempclfd=tempclfd.replace(/TabId=749&/g,"");
        tempclfd=decodeURIComponent(tempclfd);
        var clfdchild=tempclfd.split('&');
        tempclfd="";
        for(var i=0;i<clfdchild.length;i++)
        {
            tempclfd=clfdchild[i].split('=');
            if(i==0)
            {
                c=encodeURIComponent(tempclfd[1]);

            }   
            if(i==1)
            {
                l=encodeURIComponent(tempclfd[1]);

            } 
            if(i==2)
            {
                f=encodeURIComponent(tempclfd[1]);

            } 
            if(i==3)
            {
                d=encodeURIComponent(tempclfd[1]);
            } 
            if(i==4)
            {
                s=encodeURIComponent(tempclfd[1]);
            }
        }
        location.href(webid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&S="+s+"&O="+document.getElementById('sortlist').value+"&ID="+Tempid);
    }
    //检索end
    //项目--------------------------
    else if(rsid!=-1&&MoreString!=-1)
    {
        var TempUrl=location.href;
        if(TempUrl.indexOf("O=")=="-1")
            location.href(TempUrl+"&O="+document.getElementById('sortlist').value);
        else
        {
            location.href(TempUrl.substring(0,TempUrl.indexOf("O="))+"&O="+document.getElementById('sortlist').value);
        }
        //location.href(webid+"/Default.aspx?"+;
    }
    //--------------------------------
    //期刊论文--------------------------
    else if(isid!=-1&&Field!=-1&&Vol!=-1)
    {
        var TempUrl=location.href;
        if(TempUrl.indexOf("O=")=="-1")
            location.href(TempUrl+"&O="+document.getElementById('sortlist').value);
        else
        {
            location.href(TempUrl.substring(0,TempUrl.indexOf("O="))+"&O="+document.getElementById('sortlist').value);
        }
        //location.href(webid+"/Default.aspx?"+;
    }
    //----------------------------------
    else
    {
        //正常打开无参数
        location.href(webid+"/Default.aspx?"+"O="+document.getElementById('sortlist').value);
    }    
}


function PersonIsShow()
{
    var CurrentUrl="";
    CurrentUrl=location.href;
    if(CurrentUrl.indexOf("isid")!="-1"||CurrentUrl.indexOf("ID=")!="-1")
    {
        document.getElementById('dnn_ContentPane').style.display="block";
        document.getElementById('dnn_MiddleBottom').style.display="none";
    }
    else
    {
    	document.getElementById('dnn_MiddleBottom').style.display="block";
        document.getElementById('dnn_ContentPane').style.display="none";
        
    }
}
function printPgae()
{
    print();
}
function ContentJudge(str)
{
	if(str.replace(" ","").length>0)
	{
	var reg=/\=|\+|\!|\'|\"|\?|\.|\@|\{|\}/g;
	if(reg.test(str)==true)
	{
	  alert('请不要输入符号或空格!');
	  return false;
	}
	}
	else
	{
	  alert('请不要输入符号或空格!');
	  return false;
	}
	
}
function Index_Select()
{
    var _Content="";
    var Controls=document.getElementsByName('ck');
    var db="";
    if(document.getElementById('txtCondition').value!=""&&document.getElementById('txtCondition').value!="请在这里键入您要检索的内容")
    _Content=document.getElementById('txtCondition').value;
    for(var i=0;i<Controls.length;i++)
    {
        if(Controls[i].checked==true)
        {
            if(db=="")
                db=Controls[i].value;
            else
                db+=","+Controls[i].value;
        }
    }
    if(db==""||_Content.replace(/\s/g,"")=="")
    alert("请选择查询的库和内容!");
    else
    {
	if(ContentJudge(_Content)==false)
	return;
        var tid="";
        tid=db.substring(0,1);
        var webid="";
        switch(tid)
        {   
            //831快报0 com1
            //832报告1 com2
            //838专著5 com3
            //835协作4 com4
            //833项目2 com6
            //834人员3 com5
            case "0":
                location.href("/tabid/831/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+"&F=0"+"&D="+"&db="+encodeURIComponent(db));
                break;
            case "1":
                location.href("/tabid/832/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+"&F=0"+"&D="+"&db="+encodeURIComponent(db));
                break;
            case "2":
                location.href("/tabid/833/Default.aspx?C="+encodeURIComponent(_Content)+"&L=&F=0&D=&db="+encodeURIComponent(db)+"&S=&ID=833")
                break;
            case "3":
                location.href("/tabid/834/Default.aspx?C="+encodeURIComponent(_Content)+"&L=&F=0&D=&db="+encodeURIComponent(db)+"&ID=834");
                break;
            case "4":
                location.href("/tabid/835/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+"&F=0"+"&D="+"&db="+encodeURIComponent(db));
                break;
            case "5":
                location.href("/tabid/838/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+"&F=0"+"&D="+"&db="+encodeURIComponent(db));
                break;
            case "7":
                location.href("/tabid/930/Default.aspx?"+"C="+encodeURIComponent(_Content)+"&L="+"&F=0"+"&D="+"&db="+encodeURIComponent(db));
                break;
        }
        
    }
    
}
function DynamicCreateUrl(content,tabid)
{
    var CurrentUrl=location.href;
    if(CurrentUrl.indexOf("tabid")!="-1")
        Tempid=CurrentUrl.substring(CurrentUrl.indexOf("tabid")+6);
    else
        Tempid=CurrentUrl.substring(CurrentUrl.indexOf("TabId")+6);
    Tempid=Tempid.substring(0,3);
    //左侧导航begin
    var sid="";
    var sidstr="";
    var tempposition="";
    sid=CurrentUrl.indexOf("sid");
    
    
    //左侧导航end
    //检索begin
    var c="",l="",f="",d="",db="";
    c=CurrentUrl.indexOf("C=");
    l=CurrentUrl.indexOf("L=");
    f=CurrentUrl.indexOf("F=");
    d=CurrentUrl.indexOf("D=");
    db=CurrentUrl.indexOf("db=");
    //alert(CurrentUrl.indexOf(c,l-c));
    var tempclfd="";
    //检索end
    if(c!="-1"&&l!="-1"&&f!="-1"&&d!="-1"&&db==-1)
    {
        tempclfd=CurrentUrl.substring(CurrentUrl.indexOf("?")+1);
        tempclfd=decodeURIComponent(tempclfd);
        var clfdchild=tempclfd.split('&');
        tempclfd="";
        for(var i=0;i<clfdchild.length;i++)
        {
            tempclfd=clfdchild[i].split('=');
            if(i==0)
            {
                c=encodeURIComponent(tempclfd[1]);
            }   
            if(i==1)
            {
                l=encodeURIComponent(tempclfd[1]);
            } 
            if(i==2)
            {
                f=encodeURIComponent(tempclfd[1]);
            } 
            if(i==3)
            {
                d=encodeURIComponent(tempclfd[1]);
            } 
        }
        if(tabid=="833")
        {
            if(tabid!=Tempid)
                document.write("<a href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&S=&ID=833"+">"+content+"</a>");
            else
                document.write("<a style='color:red;font-weight:bold' href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&S=&ID=833"+">"+content+"</a>");
        }
        else if(tabid=="834")
        {
            if(tabid!=Tempid)
                document.write("<a href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&ID=834"+">"+content+"</a>");
            else
                document.write("<a style='color:red;font-weight:bold' href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&ID=834"+">"+content+"</a>");
        }
        else if(tabid=="837")
        {
            if(tabid!=Tempid)
                document.write("<a href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&ID=837"+">"+content+"</a>");
            else
                document.write("<a style='color:red;font-weight:bold' href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&ID=837"+">"+content+"</a>");
        }
        else
        {
            if(tabid!=Tempid)
                document.write("<a href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+">"+content+"</a>");
            else
                document.write("<a style='color:red;font-weight:bold' href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+">"+content+"</a>");
        }
//        alert("/tabid/831/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d);
    }
    else if(c!="-1"&&l!="-1"&&f!="-1"&&d!="-1"&&db!=-1)
    {

        tempclfd=CurrentUrl.substring(CurrentUrl.indexOf("?")+1);
        tempclfd=decodeURIComponent(tempclfd);
        var clfdchild=tempclfd.split('&');
        tempclfd="";
        for(var i=0;i<clfdchild.length;i++)
        {
            tempclfd=clfdchild[i].split('=');
            if(i==0)
            {
                c=encodeURIComponent(tempclfd[1]);
            }   
            if(i==1)
            {
                l=encodeURIComponent(tempclfd[1]);

            } 
            if(i==2)
            {
                f=encodeURIComponent(tempclfd[1]);

            } 
            if(i==3)
            {
                d=encodeURIComponent(tempclfd[1]);
            } 
            if(i==4)
            {
                db=encodeURIComponent(tempclfd[1]);
            }
        }
        if(tabid=="833")
        {
            if(tabid!=Tempid)
                document.write("<a href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&db="+db+"&S=&ID=833"+">"+content+"</a>");
            else
                document.write("<a style='color:red;font-weight:bold' href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&db="+db+"&S=&ID=833"+">"+content+"</a>");
        }
        else if(tabid=="834")
        {
            if(tabid!=Tempid)
                document.write("<a href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&db="+db+"&ID=834"+">"+content+"</a>");
            else    
                document.write("<a style='color:red;font-weight:bold' href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&db="+db+"&ID=834"+">"+content+"</a>");
        }
        else if(tabid=="837")
        {
            if(tabid!=Tempid)
                document.write("<a href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&db="+db+"&ID=837"+">"+content+"</a>");
            else    
                document.write("<a style='color:red;font-weight:bold' href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&db="+db+"&ID=837"+">"+content+"</a>");
        }
        else
        {
            if(tabid!=Tempid)
                document.write("<a href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&db="+db+">"+content+"</a>");
            else
                document.write("<a style='color:red;font-weight:bold' href="+"/tabid/"+tabid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&db="+db+">"+content+"</a>");
        }
        
    }
//    //检索end
    else
    {
        //正常打开无参数
//        location.href(webid+"/Default.aspx");
        document.write("<a href="+"/tabid/"+tabid+"/Default.aspx"+">"+content+"</a>");
    }    

}
function deductcharge()
{
    //获取模板控件
    var chargeButton = $get("btncharge");
    if(chargeButton!=null)
    {
        chargeButton.attachEvent("onclick",deductcharge);
    }
    
    
    ////-----------------------------------------------------
    
    chargeButton.click();
}
function spandb_isshow()
{
    var CurrentURL=location.href;
    var tempURL="";
    var tempURL1="";
    if(CurrentURL.indexOf("db=")!="-1")
    {
        tempURL1=CurrentURL.substring(CurrentURL.indexOf("db=")+3);
        if(tempURL1.indexOf("&")!="-1")
        {
            tempURL1=tempURL1.split('&');
            tempURL=tempURL1[0];
        }
        else
        {
            tempURL=CurrentURL.substring(CurrentURL.indexOf("db=")+3);
        }
        if(tempURL!="")
        {
            tempURL=decodeURIComponent(tempURL).split(',');
            for(var i=0;i<tempURL.length;i++)
            {
                switch(tempURL[i])
                {
                    case "0":
                        document.getElementById('kuaku_kuaibao').style.display="block";
                        break;
                    case "1":
                        document.getElementById('kuaku_baogao').style.display="block";
                        break;
                    case "2":
                        document.getElementById('kuaku_xiangmu').style.display="block";
                        break;
                    case "3":
                        document.getElementById('kuaku_renyuan').style.display="block";
                        break;
                    case "4":
                        document.getElementById('kuaku_xiezuo').style.display="block";
                        break;
                    case "5":
                        document.getElementById('kuaku_qikanzhuanzhu').style.display="block";
                        break;
                    case "6":
                        document.getElementById('kuaku_qikan').style.display="block";
                        break;
                    case "7":
                        document.getElementById('kuaku_keji').style.display="block";
                        break;
                }
            }
        }
        else
        {
            document.getElementById('kuaku_kuaibao').style.display="block";
            document.getElementById('kuaku_baogao').style.display="block";
            document.getElementById('kuaku_xiangmu').style.display="block";
            document.getElementById('kuaku_renyuan').style.display="block";
            document.getElementById('kuaku_xiezuo').style.display="block";
            document.getElementById('kuaku_qikanzhuanzhu').style.display="block";
            document.getElementById('kuaku_qikan').style.display="block";
        }
    }
    else
    {
        document.getElementById('kuaku_kuaibao').style.display="block";
        document.getElementById('kuaku_baogao').style.display="block";
        document.getElementById('kuaku_xiangmu').style.display="block";
        document.getElementById('kuaku_renyuan').style.display="block";
        document.getElementById('kuaku_xiezuo').style.display="block";
        document.getElementById('kuaku_qikanzhuanzhu').style.display="block";
        document.getElementById('kuaku_qikan').style.display="block";
    }
    
}
//研究人员滚屏

	
function Dron_ScrollBox(uid)
{

	var icefable1=document.getElementById("MiddleBottom");
 		marqueesHeight=160; 
		with(icefable1) 
		{ 
			style.height=marqueesHeight; 
			style.overflowX="visible"; 
			style.overflowY="hidden"; 
			noWrap=true; 
			onmouseover=new Function("stopscroll=true"); 
			onmouseout=new Function("stopscroll=false"); 
		} 
		preTop=0; 
		currentTop=160; 
		stoptime=0; 
		icefable1.innerHTML += icefable1.innerHTML; 
		if (stopscroll)
		{
			stopscroll=false;
		}
		else
		{
			init_srolltext();
		}
}
function init_srolltext() 
{ 
	icefable1.scrollTop=0; 
	setInterval("scrollUp()",20); 
} 
function scrollUp()  
{ 
	var ifo=document.getElementById("MiddleBottom");
	if ((ifo!=null)&&(ifo!="undefined"))
	{
	    if(stopscroll==true) return; 
	    currentTop+=1; 
	    if(currentTop>160) 
	    { 
		    stoptime+=1; 
		    currentTop-=1; 
		    if(stoptime==40) 
		    { 
			    currentTop=0; 
			    stoptime=0; 
		    } 
	    } 
	    else 
	    { 
		    preTop=icefable1.scrollTop; 
		    icefable1.scrollTop+=1; 
		    if(preTop==icefable1.scrollTop) 
		    { 
			    icefable1.scrollTop=160; 
			    icefable1.scrollTop+=1; 
		    } 
	    } 
	}
} 


function getparames(webid,urlcontent,content)
{

 var CurrentURL=location.href;
 var params="";
 var str="";
 if(CurrentURL.indexOf("docid=")!=-1)
 {
  params="&"+CurrentURL.substring(CurrentURL.indexOf("docid="));
 }
 switch(webid)
 {
 		case 1:
 		str=urlcontent+"/Default.aspx?RsId=0fad7ca0-ff35-4418-a459-ba610d5f3136";
	  str="<a href="+str+params+">"+content+"</a>"
	  document.write(str);
	  break;
	  case 2:
	   str=urlcontent+"/Default.aspx";
	   str="<a href="+str+">"+content+"</a>";
	   document.write(str);
	   break;
 } 
}

function selectspansort(webid)
{
    var CurrentUrl=decodeURIComponent(location.href);
    if(CurrentUrl.indexOf("tabid")!="-1")
        Tempid=CurrentUrl.substring(CurrentUrl.indexOf("tabid")+6);
    else
        Tempid=CurrentUrl.substring(CurrentUrl.indexOf("TabId")+6);
    Tempid=Tempid.substring(0,3);
    //左侧导航begin
    var sid="";
    var sidstr="";
    var tempposition="";
    sid=CurrentUrl.indexOf("sid");
    
    //左侧导航end
    //检索begin
    var c="",l="",f="",d="",db="";
    c=CurrentUrl.indexOf("C=");
    l=CurrentUrl.indexOf("L=");
    f=CurrentUrl.indexOf("F=");
    d=CurrentUrl.indexOf("D=");
    db=CurrentUrl.indexOf("db=");
    s=CurrentUrl.indexOf("S=");
    //alert(CurrentUrl.indexOf(c,l-c));
    var tempclfd="";
    //检索end
    if(sid!="-1")
    {
        sidstr=CurrentUrl.substring(sid+4);
        tempposition=sidstr.indexOf("/");
        sidstr=sidstr.substring(sidstr,tempposition);
        location.href(webid+"/sid/"+sidstr+"/cid/26/Default.aspx?O="+document.getElementById('sortlist').value);
    }
    //左侧导航end
    //检索begin
    else if(c!="-1"&&l!="-1"&&f!="-1"&&d!="-1"&&s=="-1"&&db!="-1")
    {
        tempclfd=CurrentUrl.substring(CurrentUrl.indexOf("?")+1);
        tempclfd=decodeURIComponent(tempclfd);
        if(tempclfd.indexOf("TabId=837&")!="-1")
            tempclfd=tempclfd.replace(/TabId=837&/g,"");
        var clfdchild=tempclfd.split('&');
        tempclfd="";
        for(var i=0;i<clfdchild.length;i++)
        {
            tempclfd=clfdchild[i].split('=');
            if(i==0)
            {
                c=encodeURIComponent(tempclfd[1]);

            }   
            if(i==1)
            {
                l=encodeURIComponent(tempclfd[1]);

            } 
            if(i==2)
            {
                f=encodeURIComponent(tempclfd[1]);

            } 
            if(i==3)
            {
                d=encodeURIComponent(tempclfd[1]);
            } 
            if(i==4)
            {   
                db=encodeURIComponent(tempclfd[1]);
            }
        }
        if(Tempid=="837")
        {
            location.href(webid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&db="+db+"&O="+document.getElementById('sortlist').value+"&ID="+Tempid);
        }
        else
        {
            location.href(webid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&db="+db+"&O="+document.getElementById('sortlist').value);
        }
    }
    
    else if(c!="-1"&&l!="-1"&&f!="-1"&&d!="-1"&&s!="-1"&db!="-1")
    {
        tempclfd=CurrentUrl.substring(CurrentUrl.indexOf("?")+1);
        tempclfd=decodeURIComponent(tempclfd);
        if(tempclfd.indexOf("TabId=833&")!="-1")
            tempclfd=tempclfd.replace(/TabId=833&/g,"");
        
        var clfdchild=tempclfd.split('&');
        tempclfd="";

        for(var i=0;i<clfdchild.length;i++)
        {
            tempclfd=clfdchild[i].split('=');
            if(i==0)
            {
                c=encodeURIComponent(tempclfd[1]);

            }   
            if(i==1)
            {
                l=encodeURIComponent(tempclfd[1]);

            } 
            if(i==2)
            {
                f=encodeURIComponent(tempclfd[1]);

            } 
            if(i==3)
            {
                d=encodeURIComponent(tempclfd[1]);
            } 
            if(i==4)
            {
                db=encodeURIComponent(tempclfd[1]);
            }
            if(i==5)
            {
                s=encodeURIComponent(tempclfd[1]);
            }
        }
				
        location.href(webid+"/Default.aspx?"+"C="+c+"&L="+l+"&F="+f+"&D="+d+"&db="+db+"&S="+s+"&O="+document.getElementById('sortlist').value+"&ID="+Tempid);
    }
    
    //检索end
    else
    {
        //正常打开无参数
        location.href(webid+"/Default.aspx?"+"O="+document.getElementById('sortlist').value);
    }    
}



function fHl(o, flag, rndColor, url){ 
        /// <summary>
        ///     使用 javascript HTML DOM 高亮显示页面特定字词.
        ///     实例:
        ///         fHl(document.body, '纸伞|她'); 
        ///         这里的body是指高亮body里面的内容。
        ///         fHl(document.body, '希望|愁怨', false, '/'); 
        ///         fHl(document.getElementById('at_main'), '独自|飘过|悠长', true, 'search.asp?keyword='); 
        ///         这里的'at_main'是指高亮id='at_main'的div里面的内容。search.asp?keyword=指给关键字加的链接地址，
        ///         我这里加了一个参数，在后面要用到。可以是任意的地址。        
        /// </summary>
        /// <param name="o" type="Object">
        ///     对象, 要进行高亮显示的对象. 
        /// </param>
        /// <param name="flag" type="String">
        ///     字符串, 要进行高亮的词或多个词, 使用 竖杠(|) 分隔多个词 . 
        /// </param>
        /// <param name="rndColor" type="Boolean">
        ///     布尔值, 是否随机显示文字背景色与文字颜色, true 表示随机显示. 
        /// </param>
        /// <param name="url" type="String">
        ///     URI, 是否对高亮的词添加链接.
        /// </param>                        
        /// <return></return>
        
        var CurrentUrl=decodeURIComponent(location.href);
        var c,ctemp,ctrue;
        if(CurrentUrl.indexOf("C=")!=-1)
        {
        c=CurrentUrl.substring(CurrentUrl.indexOf("C="));
        if(c.indexOf('&')!="-1")
        ctemp=c.split('&');
        if(ctemp[0].indexOf('=')!="-1")
        ctrue=ctemp[0].split('=');
        flag=ctrue[1].replace(/,|;/g,"|");
        var bgCor=fgCor=''; 
        if(rndColor){ 
            bgCor=fRndCor(10, 20); 
            fgCor=fRndCor(230, 255); 
        } else { 
            bgCor='#ff0000'; 
            fgCor='black'; 
        } 
        var re=new RegExp(flag, 'i'); 
        
				var splitflag=flag.split("|");

        for(var i=0; i<o.childNodes.length; i++){     
            var o_=o.childNodes[i]; 
            var o_p=o_.parentNode; 
            if(o_.nodeType==1) 
             { 
                fHl(o_, flag, rndColor, url);   
             } else if (o_.nodeType==3) 
             { 
                if(!(o_p.nodeName=='A'))
                { 
                    if(o_.data.search(re)==-1)continue; 
                    	var temp=fEleA(o_.data, flag); 
                    	o_p.replaceChild(temp, o_); 
                  	
                    
                } 
             }
        }
        } 
        //------------------------------------------------ 
        function fEleA(text, flag){ 
        	
        		var flagtemp=flag.split("|");
        		for(var i=0;i<flagtemp.length;i++)
        		{
	            var style=' style="color:'+bgCor+'" ' 
	            var o=document.createElement('span'); 
	            var str=''; 
	            var re=new RegExp('('+flag+')', 'gi'); 
	            if(url){ 
	                str=text.replace(re, '<a href="'+url+ 
	                '$1"'+style+'>$1</a>'); //这里是给关键字加链接，红色的$1是指上面链接地址后的具体参数。
	            } else { 
	                str=text.replace(re, '<span '+style+'>$1</span>'); //不加链接时显示
	            } 
	            o.innerHTML=str; 

          	}
            return o; 
        } 
        //------------------------------------------------ 
        function fRndCor(under, over){ 
            if(arguments.length==1){ 
                var over=under; 
                    under=0; 
            }else if(arguments.length==0){ 
                var under=0; 
                var over=255; 
            } 
            var r=fRandomBy(under, over).toString(16); 
                r=padNum(r, r, 2); 
            var g=fRandomBy(under, over).toString(16); 
                g=padNum(g, g, 2); 
            var b=fRandomBy(under, over).toString(16); 
                b=padNum(b, b, 2); 
                //defaultStatus=r+' '+g+' '+b 
            return '#'+r+g+b; 
            function fRandomBy(under, over){ 
                switch(arguments.length){ 
                    case 1: return parseInt(Math.random()*under+1); 
                    case 2: return parseInt(Math.random()*(over-under+1) + under); 
                    default: return 0; 
                } 
            }
            function padNum(str, num, len){ 
                var temp='' 
                for(var i=0; i<len;temp+=num, i++); 
                return temp=(temp+=str).substr(temp.length-len); 
            } 
        } 
    }
    //--------end function fHl(o, flag, rndColor, url)--------------------// 

function check()
{
    
    var controls=document.getElementsByName('cbk');
    var str="";
    
    for(var i=0;i<document.getElementById('hid2').value;i++)
    {
        if(controls[i].checked==true)
        {
            if(str=="")
            {
                
                str=controls[i].id;
            }
            else
            {
                str+=","+controls[i].id;
            }
        }
    }
    document.getElementById('dnn_ctr3990_Manage_UserFavorite_hid').value=str;
}
function selectall(name)
{
    var controls=document.getElementsByName('cbk');
    for(var i=0;i<document.getElementById('hid2').value;i++)
    {
        controls[i].checked=true
    }
    //1为项目，2为收藏
    if(name==1)
    checkproject();
    else if(name==3)
    	supercheckproject();
    else if(name==4)
    	Orgcheckqk();
    else
    check();
}
function clearall()
{
    var controls=document.getElementsByName('cbk');
    for(var i=0;i<document.getElementById('hid2').value;i++)
    {
        controls[i].checked=false
    }

}
function del()
{
    var controls=document.getElementsByName('cbk');
    var strvalue="";
    for(var i=0;i<document.getElementById('hid2').value;i++)
    {
        if(controls[i].checked==true)
        {
            strvalue+=controls[i].value
        }
    }
    if(strvalue!="")
    {
        return confirm("是否确定删除?")
    }
    else
    {
        alert("请选择删除内容!")
        return false;
    }
}










//公告滚动

function Marquee()
{
	this.ID = document.getElementById(arguments[0]);
	if(!this.ID)
	{
		alert("您要设置的\"" + arguments[0] + "\"初始化错误\r\n请检查标签ID设置是否正确!");
		this.ID = -1;
		return;
	}
	this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.Correct = this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
	this.Step = 1;
	this.Timer = 30;
	this.DirectionArray = {"top":0 , "bottom":1 , "left":2 , "right":3};
	if(typeof arguments[1] == "number" || typeof arguments[1] == "string")this.Direction = arguments[1];
	if(typeof arguments[2] == "number")this.Step = arguments[2];
	if(typeof arguments[3] == "number")this.Width = arguments[3];
	if(typeof arguments[4] == "number")this.Height = arguments[4];
	if(typeof arguments[5] == "number")this.Timer = arguments[5];
	if(typeof arguments[6] == "number")this.DelayTime = arguments[6];
	if(typeof arguments[7] == "number")this.WaitTime = arguments[7];
	if(typeof arguments[8] == "number")this.ScrollStep = arguments[8]
	this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
	this.ID.noWrap = true;
	this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1);
	if(arguments.length >= 7)this.Start();
}


Marquee.prototype.Start = function()
{
	if(this.ID == -1)return;
	if(this.WaitTime < 800)this.WaitTime = 800;
	if(this.Timer < 20)this.Timer = 20;
	if(this.Width == 0)this.Width = parseInt(this.ID.style.width);
	if(this.Height == 0)this.Height = parseInt(this.ID.style.height);
	if(typeof this.Direction == "string")this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()];
	this.HalfWidth = Math.round(this.Width / 2);
	this.HalfHeight = Math.round(this.Height / 2);
	this.BakStep = this.Step;
	this.ID.style.width = this.Width + "px";
	this.ID.style.height = this.Height + "px";
	if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height;
	var msobj = this;
	var timer = this.Timer;
	var delaytime = this.DelayTime;
	var waittime = this.WaitTime;
	msobj.StartID = function(){msobj.Scroll()}
	msobj.Continue = function()
				{
					if(msobj.MouseOver == 1)
					{
						setTimeout(msobj.Continue,delaytime);
					}
					else
					{	clearInterval(msobj.TimerID);
						msobj.CTL = msobj.Stop = 0;
						msobj.TimerID = setInterval(msobj.StartID,timer);
					}
				}

	msobj.Pause = function()
			{
				msobj.Stop = 1;
				clearInterval(msobj.TimerID);
				setTimeout(msobj.Continue,delaytime);
			}

	msobj.Begin = function()
		{
			msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth : msobj.ID.scrollHeight;
			if((msobj.Direction <= 1 && msobj.ClientScroll <= msobj.Height + msobj.Step) || (msobj.Direction > 1 && msobj.ClientScroll <= msobj.Width + msobj.Step))return;
			msobj.ID.innerHTML += msobj.ID.innerHTML;
			msobj.TimerID = setInterval(msobj.StartID,timer);
			if(msobj.ScrollStep < 0)return;
			msobj.ID.onmousemove = function(event)
						{
							if(msobj.ScrollStep == 0 && msobj.Direction > 1)
							{
								var event = event || window.event;
								if(window.event)
								{
									if(msobj.IsNotOpera)
									{
										msobj.EventLeft = event.srcElement.id == msobj.ID.id ? event.offsetX - msobj.ID.scrollLeft : event.srcElement.offsetLeft - msobj.ID.scrollLeft + event.offsetX;
									}
									else
									{
										msobj.ScrollStep = null;
										return;
									}
								}
								else
								{
									msobj.EventLeft = event.layerX - msobj.ID.scrollLeft;
								}
								msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2;
								msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft);
								msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) / msobj.HalfWidth);
							}
						}
			msobj.ID.onmouseover = function()
						{
							if(msobj.ScrollStep == 0)return;
							msobj.MouseOver = 1;
							clearInterval(msobj.TimerID);
						}
			msobj.ID.onmouseout = function()
						{
							if(msobj.ScrollStep == 0)
							{
								if(msobj.Step == 0)msobj.Step = 1;
								return;
							}
							msobj.MouseOver = 0;
							if(msobj.Stop == 0)
							{
								clearInterval(msobj.TimerID);
								msobj.TimerID = setInterval(msobj.StartID,timer);
							}
						}
		}
	setTimeout(msobj.Begin,waittime);
}

Marquee.prototype.Scroll = function()
{
	switch(this.Direction)
	{
		case 0:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop >= this.ClientScroll)
				{
					this.ID.scrollTop -= this.ClientScroll;
				}
				this.ID.scrollTop += this.Step;
			}
		break;

		case 1:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop <= 0)
				{
					this.ID.scrollTop += this.ClientScroll;
				}
				this.ID.scrollTop -= this.Step;
			}
		break;

		case 2:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft >= this.ClientScroll)
				{
					this.ID.scrollLeft -= this.ClientScroll;
				}
				this.ID.scrollLeft += this.Step;
			}
		break;

		case 3:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft <= 0)
				{
					this.ID.scrollLeft += this.ClientScroll;
				}
				this.ID.scrollLeft -= this.Step;
			}
		break;
	}
}

function Orgcheckqk()
{
		var controls=document.getElementsByName('cbk');
    var str="";
    for(var i=0;i<document.getElementById('hid2').value;i++)
    {
        if(controls[i].checked==true)
        {
            if(str=="")
            {
                
                str=controls[i].id;
            }
            else
            {
                str+=","+controls[i].id;
            }
        }
    }
    document.getElementById('dnn_ctr4115_QikanList_hid').value=str;
}
function supercheckproject()
{
    
    var controls=document.getElementsByName('cbk');
    var str="";
    for(var i=0;i<document.getElementById('hid2').value;i++)
    {
        if(controls[i].checked==true)
        {
            if(str=="")
            {
                
                str=controls[i].id;
            }
            else
            {
                str+=","+controls[i].id;
            }
        }
    }
    document.getElementById('dnn_ctr4110_ProjectManage_hid').value=str;
}



function checkproject()
{
    
    var controls=document.getElementsByName('cbk');
    var str="";
    for(var i=0;i<document.getElementById('hid2').value;i++)
    {
        if(controls[i].checked==true)
        {
            if(str=="")
            {
                
                str=controls[i].id;
            }
            else
            {
                str+=","+controls[i].id;
            }
        }
    }
    document.getElementById('dnn_ctr4084_ProjectManage_hid').value=str;
}




//热门排行_研究报告
function pucker_show(name,no,hiddenclassname,showclassname) {
//name:命名前缀
//no:当前鼠标所处对象的序号
//showclassname:展开状态样式名
//hiddenclassname:折叠状态样式名
for (var i=1 ;i<6 ;i++ )
{
       document.getElementById(name+i).className=hiddenclassname;
}
document.getElementById(name+no).className=showclassname;
}



function PurviewTransfer()
{

	var idtype=document.getElementById('d_idtype').innerHTML;
	var userid=document.getElementById('d_userid').innerHTML;
	if(idtype==1)
		location.href("/tabid/850/Default.aspx?RsId=0fad7ca0-ff35-4418-a459-ba610d5f3136&docid="+userid)
	else if(idtype==2)
		location.href("/tabid/885/Default.aspx")
	else
		location.href("/tabid/842/Default.aspx")
}


function text_grade()
{
	var currenturl=location.href;
	if(CurrentUrl.indexOf("tabid")!="-1")
        Tempid=CurrentUrl.substring(CurrentUrl.indexOf("tabid")+6);
    else
        Tempid=CurrentUrl.substring(CurrentUrl.indexOf("TabId")+6);
    Tempid=Tempid.substring(0,3);
    
    
	var controls=document.getElementsByName('radio_grade');
	for(var i=0;i<controls.length;i++)
	{
		if(controls[i].checked==true)
		{
			if(Tempid==754)
				document.getElementById('dnn_ctr4085_Articles_Grade_txt_grade').value=controls[i].value;
			if(Tempid==755)
				document.getElementById('dnn_ctr4086_Articles_Grade_txt_grade').value=controls[i].value;
		}	
	}
	
}

//重新定位选中的排序字段
function BackupSortByField(id)
{
    var url=decodeURIComponent(location.href);
    if(url.indexOf("&O=")!=-1)
    {
        var para=url.substring(url.indexOf("&O=")+1).split('=');
        for(var i=0;i<$$(id).options.length;i++)
        {
            if(para[1]==$$(id).options[i].value)
            {
                $$(id).options[i].selected=true;
            }
        }
    }
}
function $$(id)
{
	return document.getElementById(id);
}
//字段排序
function BackupSortByField(id)
{
    var url=decodeURIComponent(location.href);
    var parastr=url.substring(url.indexOf("?")+1,url.length);
    var paraal=parastr.split('&');
    for(var i=0;i<paraal.length;i++)
    {
        var tempstr;
        tempstr=paraal[i].split('=');
        if(tempstr[0]=="O")
        {
        	var para=tempstr[1];
	        for(var i=0;i<$$(id).options.length;i++)
	        {
	            if(para==$$(id).options[i].value)
	            {
	                $$(id).options[i].selected=true;
	            }
	        }
        }
    }
}