//js document
function ajax(url,par,result,objid,bt,nowhref){
try{this.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){try{this.xmlHttp=new XMLHttpRequest()}catch(e){}}}
var obj=this.xmlHttp;
obj.onreadystatechange=function(){onchange(obj,result,objid,bt,nowhref)};
url=url+"?timeStamp=" + new Date().getTime() + "&" + par;
//alert(url);
obj.open("GET",url,true);obj.send();
}
ajax.prototype.abort=function(){this.xmlHttp.abort();}
function onchange(xmlHttp1,result,objid,bt,nowhref){
	if(xmlHttp1.readyState==3){//数据加载中
		document.getElementById("tb"+objid).innerHTML="<IMG SRC=\"pics/nolines_minus.gif\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\" ALT=\"\" onclick=\"hiddentree("+objid+")\">";
		document.getElementById("tbl"+objid).innerHTML="<IMG SRC=\"pics/folderopen.gif\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\" ALT=\"\">";
		document.getElementById("tradingtree_tr"+objid).style.display="";
		document.getElementById("tradingtree_td"+objid).innerText="数据加载中......";
		
	};
	if(xmlHttp1.readyState==4){if(xmlHttp1.status==200){result(xmlHttp1,objid,bt,nowhref);}}
}
function hiddentree(objid){
	document.getElementById("tb"+objid).innerHTML="<IMG SRC=\"pics/nolines_plus.gif\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\" ALT=\"\" onclick=\"showtree("+objid+")\">";
	document.getElementById("tbl"+objid).innerHTML="<IMG SRC=\"pics/folder.gif\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\" ALT=\"\">";
	document.getElementById("tradingtree_tr"+objid).style.display="none";
}
function showtree(objid){
	document.getElementById("tb"+objid).innerHTML="<IMG SRC=\"pics/nolines_minus.gif\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\" ALT=\"\" onclick=\"hiddentree("+objid+")\">";
	document.getElementById("tbl"+objid).innerHTML="<IMG SRC=\"pics/folderopen.gif\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\" ALT=\"\">";
	document.getElementById("tradingtree_tr"+objid).style.display="";
}
function gettree(xml,objid,bt,nowhref){
	var cstr="<table cellspacing=0 cellpadding=0 width='100%'  align='left'>";
	for(var i=0;i<xml.responseXML.getElementsByTagName("trading1txt").length;i++){
		cstr+="<tr><td width=18 align='left'>";
		if (bt==0)
		{
			cstr+="<IMG SRC=\"pics/line.gif\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\" ALT=\"\">";
		}
		cstr+="</td><td  width=18>";
		if (i==(xml.responseXML.getElementsByTagName("trading1txt").length-1))
		{
			cstr+="<IMG SRC=\"pics/joinbottom.gif\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\" ALT=\"\">";
		}else{
			cstr+="<IMG SRC=\"pics/join.gif\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\" ALT=\"\">";
		}
		cstr+="</td><td><IMG SRC=\"pics/page.gif\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\" ALT=\"\"></td><td width='180' align='left'><a href=\""+nowhref+"?trading1="+xml.responseXML.getElementsByTagName("trading1txt")[i].getAttribute("id")+"\">"+xml.responseXML.getElementsByTagName("trading1txt")[i].text+"</a></td></tr>";
	}
	cstr+="</table>";
	document.getElementById("tradingtree_td"+objid).innerHTML=cstr;
}
function showhiddentree(){
	if (document.getElementById("tradingtree").style.display=="")
	{
		document.getElementById("tradingtree").style.display="none";
	}else{
		document.getElementById("tradingtree").style.display="";
	}
}