	function get_obj(id_str) {
		try {
			if(document.getElementById){
				return document.getElementById(id_str);
			}
			else{
				return eval('document.all.' + id_str);
			}
		}
		catch(_e) {
			return false;
		}
	}
	function get_href(id_str) {
		var href_domain = "http://php.tech.sina.com.cn/download/d_list.php?f_categoryid=";
		return href_domain+id_str;
	}
	function get_js_data(url_str) {
		var t_obj;
		var n_node = document.createElement("script");
		n_node.setAttribute("type", "text/javascript");
		n_node.setAttribute("language", "javascript");
		n_node.setAttribute("src", url_str);
		t_obj = document.getElementsByTagName("HEAD")[0];
		t_obj.appendChild(n_node);
	}

	function get_js_data_finish(id_str, times_i) {
		try {
			var _str = eval('js_'+id_str);
			if (_str == 'finished') {
				var _obj = get_obj(id_str);
				var t_obj = get_obj(id_str+'_t');
				if (_obj) {
					var _arr = eval(id_str);
					var _arr_len = _arr.length;
					var r_str = '';
					for (var i=0;i<_arr_len;i++) {
						if (_arr[i][2] == 1) {
							r_str += '<div id="type_'+_arr[i][0]+'_t" class="collect tree" onclick="div_modify(\'type_'+_arr[i][0]+'\');"><a href="'+get_href(_arr[i][0])+'" target="_blank">'+_arr[i][1]+'</a></div>';
							r_str += '<div id="type_'+_arr[i][0]+'" class="hide tree"></div>';
						}
						else {
							r_str += '<div class="iefile tree"><a href="'+get_href(_arr[i][0])+'" target="_blank">'+_arr[i][1]+'</a></div>';
						}
					}
					_obj.innerHTML = r_str;
					if (id_str == 'type_0') {
						_obj.className = 'shown tree';
					}
					else {
						_obj.className = 'block_shown tree';
					}
					if (t_obj) {
						t_obj.className = 'expand tree';
					}
					return true;
				}
				else {
					return false;
				}
			}
		}
		catch(_e) {
			if (times_i > 3) return false;
			times_i = parseInt(times_i)+1;
			window.setTimeout(function(){get_js_data_finish(id_str, times_i);},500);
		}
		return false;
	}

	function div_expand(id_str) {
		var js_domain = 'http://down1.tech.sina.com.cn/download/type_js/';
		var js_url = js_domain+id_str+'.js';
		get_js_data(js_url);
		get_js_data_finish(id_str,0);
	}

	function div_modify(id_str) {
		var _obj = get_obj(id_str);
		var t_obj = get_obj(id_str+'_t');
		if (_obj.className == 'block_shown tree') {
			t_obj.className = 'collect tree';
			_obj.className = 'hide tree';
		}
		else {
			var _nodes = _obj.parentNode.childNodes;
			var _len = _nodes.length;
			for (var i=0;i<_len;i++) {
				if (_nodes[i].className == 'block_shown tree') {
					_nodes[i].className = 'hide tree';
				}
				if (_nodes[i].className == 'expand tree') {
					_nodes[i].className = 'collect tree';
				}
			}
			div_expand(id_str);
		}
	}

	function tree_init(id_str) {
		div_modify(id_str);
	}


