
function setFirefox(){
	var browser=navigator.appName;
	if(browser=="Microsoft Internet Explorer"){	//ie
		document.getElementById("top").className="top center";
	}else{	//非ie
		document.getElementById("top").className="top centerFire"
	}
	}
function makevisible(cur,which){
	if (which==0)
	cur.filters.alpha.opacity=50
	else
	cur.filters.alpha.opacity=120
}
function IsChild(cNode,pNode){
	while(cNode!=null){
		cNode=cNode.parentNode;
		if(cNode==pNode) return true; 
	}
	return false;
}


var ajccache=new Object();
var waitInterval;
var tempref;
var MouseDelayTime=150;//鼠标感应延迟300毫秒
function getTBprefixName(str,sta){
	if(str.indexOf("active")!=-1 || str.indexOf("normal")!=-1) str=str.substr(6);
		else if(str.indexOf("over")!=-1) str=str.substr(4);
			else str="";
	return sta+str;
}
function startajaxtabs(){
	for(var i=0;i<arguments.length;i++)
	{
		var ulobj=document.getElementById(arguments[i]);
			ulist=ulobj.getElementsByTagName("li");

			for(var j=0;j<ulist.length;j++)
			{
				var thelist=ulist[j];
				if(thelist.parentNode.parentNode!=ulobj) continue;//只有第一层li有效 fixed 2006.9.29
				var ulistlink=thelist.getElementsByTagName("a")[0];
				var ulistlinkurl=ulistlink.getAttribute("urn");
				var ulistlinktarget=ulistlink.getAttribute("rel");


				thelist.setActive=function(bactive){
					if(bactive){
						this.status="active";
						this.className=getTBprefixName(this.className,"active");
					}else{
						this.status="normal";
						this.className=getTBprefixName(this.className,"normal");
					}
				}
				thelist.LoadTab=function(){
					this.setActive(true);
					this.parentNode.parentNode.activetab.setActive(false);
					this.parentNode.parentNode.activetab=this;					
					var ulistlink=this.getElementsByTagName("a")[0];
					loadAJAXTab(ulistlink.getAttribute("urn"),ulistlink.getAttribute("rel"));
				}
				thelist.onmouseover=function(aEvent){
					var myEvent = window.event ? window.event : aEvent;
					var fm=myEvent.fromElement;
					if(IsChild(fm,this) || fm==this) return;//过滤子元素event
					if(this.status=="active") return;
					tempref=this;
					clearTimeout(waitInterval);
					waitInterval=window.setTimeout("tempref.LoadTab();",MouseDelayTime);
				}

				thelist.onmouseout=function(aEvent){
					var myEvent = window.event ? window.event : aEvent;
					var em=myEvent.toElement;
					if(IsChild(em,this) || em==this) return; //过滤子元素event
					if(this.status=="active") return;
					clearTimeout(waitInterval);
				}

				if(j==0){
					thelist.setActive(true);
					ulobj.activetab=thelist;
					var ulistlink=thelist.getElementsByTagName("a")[0];
					loadAJAXTab(ulistlink.getAttribute("urn"),ulistlink.getAttribute("rel"));
				}else{
					thelist.setActive(false);
				}

			}
		if(ulobj.activetab==null) ulobj.activetab=ulist[0];
	}
}

function getXmlhttp()
{
	var http_request;
	
	if(window.XMLHttpRequest) { 
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType("text/xml");
		}
	}
	else if (window.ActiveXObject) { 
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) { 
		window.alert("can't create XMLHttpRequest object.");
		return null;
	}	
	return http_request;
}

function loadAJAXTab(url,contentid){
	var ocontent=getElement(contentid);
	if(ajccache[url]==null) {
		var xhttp=getXmlhttp();		
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{					
					ocontent.innerHTML=unescape(xhttp.responseText);
					ajccache[url]=ocontent.innerHTML;
				}
			}
		xhttp.open("GET",url,true);
		xhttp.send(null);
	}else{
		ocontent.innerHTML=ajccache[url];
	}
}
window.onerror=function(){return true}


function getElement(aID)
{
  return (document.getElementById) ? document.getElementById(aID): document.all[aID];
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function getcaseinfo1(){
	var obj=getElement("caseinfo_1");
	if(obj.style.display=="none"){
		obj.style.display="";
		loadAJAXTab("caseinfo.html","caseinfo_1");
		return false;
	}
	else obj.style.display="none";
}
function getcaseinfo(file){
	window.open(file,null,"width=670,scrollbars=1,status=no,toolbar=no,menubar=no,location=no,top=300,left=400");
}
function changecasebg(e, color){
	var el=window.event? event.srcElement: e.target;
	if (el.tagName=="UL"&&el.className=="casebox"){
		el.style.backgroundColor=color;
	}
	if (el.tagName=="LI"&&el.parentNode.className=="casebox")
		el.parentNode.style.backgroundColor=color;
	if (el.tagName=="A"&&el.parentNode.parentNode.className=="casebox")
		el.parentNode.parentNode.style.backgroundColor=color;
}
function changefeaturebg(e,cname){
	var el=window.event? event.srcElement: e.target;
	if (el.tagName=="LI"){
		el.className=cname;
	}
	if (el.tagName=="IMG")
		el.parentNode.className=cname;
}
function CloseWin() //这个不会提示是否关闭浏览器    
{    
	window.opener=null;    
	//window.opener=top;    
	window.open("","_self");    
	window.close();    
} 


/**
* 定义ForceWindow类构造函数
* 无参数
* 无返回值
*/
function ForceWindow ()
{
this.r = document.documentElement;
this.f = document.createElement("FORM");
this.f.target = "_blank";
this.f.method = "post";
this.r.insertBefore(this.f, this.r.childNodes[0]);
}

/**
* 定义open方法
* 参数sUrl：字符串，要打开窗口的URL。
* 无返回值
*/
ForceWindow.prototype.open = function (sUrl)
{
this.f.action = sUrl;
this.f.submit();
}

/**
* 实例化一个ForceWindow对象并做为window对象的一个子对象以方便调用
* 定义后可以这样来使用：window.force.open("URL");
*/
window.force = new ForceWindow();