﻿

function changeTab(n){
    //tab个数
    var len=6;
    for(i=1;i<=len;i++){
	    document.getElementById("tab_"+i).style.display=(i==n)?"block":"none";
	    document.getElementById("tab_head_"+i).className=(i==n)?"isactive":"none";
    }
}
var timeout; 
function delayChangeTab(m,n){
    timeout = setTimeout("changeTab("+m+")",n);
}

function cancelChangeTab(){
    clearTimeout(timeout);
}

function onSearch(){
     var df = document.searchForm;
     var word=df.keyword.value;
     if(word=="" || word=="搜索" || word=="请输入关键字"){
        setSearchText("请输入关键字");
     return false;
     }
     df.searchContent.value=escape(word);
     return true;
 }
 
function setSearchText(word){
    var df = document.searchForm;
    df.keyword.value=word;
}

function setDefaultText(){
    var df = document.searchForm;
    if(df.keyword.value==""){
        setSearchText("搜索");
    }
}

var childCreate=false;
function kingdeeLinkLoad(iDiv,link){
    iDiv.onmouseover=function(){//鼠标移到
     	
	    iDiv.style.background="url('bottom_kingdee_link_select_bg_over.gif')";
    }
    iDiv.onmouseout=function(){//鼠标移走
	    iDiv.style.background="url('bottom_kingdee_link_select_bg_out.gif')";
    }
    iDiv.onclick=function(){//鼠标点击
	    if (childCreate){
		    //判断当前的下拉是不是打开状态，如果是打开的就关闭掉。是关闭的就打开。
		    document.getElementById(link).style.display="none";
		    childCreate=false;
	    }else{
		    document.getElementById(link).style.display="block";
		    childCreate=true;
	    }
    }
    document.onmousedown=function(e){
        var div=document.getElementById(link);
        if(childCreate && isMouseOut(div,e)){
            div.style.display="none";
	        childCreate=false;
	    }
    }
    var div=document.getElementById(link);
    div.onclick=function(){
        div.style.display="none";
        childCreate=false;
    }
}

function expandclose(obj){
	var _parent = obj.parentNode;
	//alert(_parent.childNodes.length);
	
	for(var _i=0;_i<_parent.childNodes.length;_i++)
    {
		 if(_parent.childNodes[_i].className=='expand-off' ||_parent.childNodes[_i].className=='expand-on'){
		  	if(_parent.childNodes[_i].className=='expand-off'){
		  		_parent.childNodes[_i].className= 'expand-on';
		  	} else{
		  		_parent.childNodes[_i].className= 'expand-off'; 
		  	}
		  }
		 if(_parent.childNodes[_i].className=='title' ||_parent.childNodes[_i].className=='title-on'){
		  	if(_parent.childNodes[_i].className=='title'){
		  		_parent.childNodes[_i].className= 'title-on';
		  	} else{
		  		_parent.childNodes[_i].className= 'title'; 
		  	}
		  }
		 if(_parent.childNodes[_i].className=='summary'){
		  	if(_parent.childNodes[_i].style.display!='block'){
					_parent.childNodes[_i].style.display='block';
				}else{
					_parent.childNodes[_i].style.display='none';
				} 
				break;
			}
	 }	
}
var _delayECTimeout ;
function delayExpandClose(obj)
 { 
	 _delayECTimeout=setTimeout(function(){expandclose(obj);},1000);
}
function clearExpandClose(){
	clearTimeout(_delayECTimeout);
}

function selectContentLoad(iDiv,link,type){
    iDiv.onmouseover=function(){//鼠标移到
     	
	    iDiv.style.background="url('"+type+"_bg_over.gif') ";
    }
    iDiv.onmouseout=function(){//鼠标移走
	    iDiv.style.background="url('"+type+"_bg_out.gif' ) ";
    }
    iDiv.onclick=function(){//鼠标点击
	    if (childCreate){
		    //判断当前的下拉是不是打开状态，如果是打开的就关闭掉。是关闭的就打开。
		    document.getElementById(link).style.display="none";
		    childCreate=false;
	    }else{
		    document.getElementById(link).style.display="block";
		    childCreate=true;
	    }
    }
    document.onmousedown=function(e){
        var div=document.getElementById(link);
        if(childCreate && isMouseOut(div,e)){
            div.style.display="none";
	        childCreate=false;
	    }
    }
    var div=document.getElementById(link);
    div.onclick=function(){
        div.style.display="none";
        childCreate=false;
    }
}