﻿
function changeTab(n){
    //tab个数
    var len=7;
    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("搜索");
//    }
//}

//function hideSearchFacade(){
//	var sf = document.getElementById("searchFacade");
//	var sw = document.getElementById("searchWraper");
//	if(sf != null && sw != null){
//		sf.style.display="none";
//		sw.style.display="block";
//	}
//}

//function hideSearchWraper(){
//	var sf = document.getElementById("searchFacade");
//	var sw = document.getElementById("searchWraper");
//	if(sf != null && sw != null && document.searchForm.keyword.value == "搜索"){
//		sf.style.display="block";
//		sw.style.display="none";
//	}
//}


//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('/images/v2008.2/sys/"+type+"_bg_over.gif') ";
//    }
//    iDiv.onmouseout=function(){//鼠标移走
//	    iDiv.style.background="url('/images/v2008.2/sys/"+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;
//    }
//}
