var LevelLength = 0;
var item=new Array();
item[LevelLength] = 0;
ID = '0';
ClassID = '0';

var str='';
var str2='';
var strChild='';

function Item()
{
	var arg = Item.arguments;
	var LevelID = 'item';
	var ClassID = 'point';

	for(var i=0; i<arg.length; i=i+1)
	{
		LevelID+='_'+arg[i];
		ClassID+='_'+arg[i];
	}

	if (document.getElementById(LevelID).style.visibility != "hidden")
	{
	      document.getElementById(LevelID).style.visibility = "hidden";
	      document.getElementById(LevelID).style.display = "none";
		if (document.getElementById(ClassID).className == "minusLast")
		{	document.getElementById(ClassID).className = "plusLast"} 
		else
		{	document.getElementById(ClassID).className = "plus"}
	} 
	else
	{	document.getElementById(LevelID).style.visibility = "visible";
		document.getElementById(LevelID).style.display = "block";
		if (document.getElementById(ClassID).className == "plusLast")
		{	document.getElementById(ClassID).className = "minusLast"}
		else
		{	document.getElementById(ClassID).className = "minus"}
	}
}

function creat_child(Child)
{
	var ID;
	var ClassID;
	strChild+='<table width="100%" border="0" cellpadding="0" cellspacing="0">';
	for (var i2=0 ; i2<Child.length; i2=i2+3) 
		{
			strChild+='<tr>';
			str2+='"'+Child[i2]+'","'+Child[i2+1]+'", new Array(';
			if (Child[i2+2]!='') 
				{	
					item[LevelLength] = i2;
					ID=item[0];
					ClassID=item[0];
					for(var l=1; l<=LevelLength; l=l+1)
					{
						ID=ID+','+item[l];
						ClassID=ClassID+'_'+item[l];
					}


					strChild+='<td class="child hand" onclick="location=\''+baseURL+Child[i2]+'\'">'+Child[i2+1]+'</td></tr><tr><td>&nbsp;';
					LevelLength=LevelLength+1;
					item[LevelLength] = i2;
					creat_child(Child[i2+2]);
					LevelLength=LevelLength-1;
					strChild+='</div></td>';
				}	
				else 
				{
					strChild+='<td class="child hand" onclick="location=\''+baseURL+Child[i2]+'\'"><a>'+Child[i2+1]+'</a></td>';
				}
			strChild+='</tr>';
			str2+=')';
			if (i2<(Child.length-3)) {str2+=','};
		}

	strChild+='</table>'
}

function creat_tree()
{
	var arg = creat_tree.arguments;
	var ID=0;
	var actualUrl=window.location+'';
	var reg=baseHREF+'';
	actualUrl=actualUrl.replace(reg, "/");
	reg=baseURL+'';
	actualUrl=actualUrl.replace(reg, "");
	str+='<table width="100%" cellpadding="0" cellspacing="0">';
	for(var i=0; i<arg.length-1; i=i+3)
	{
		item[0] = i;
		str+='';
		ID = i;
		if (arg[i+2]!='') 
			{
				str2='';
				strChild='';
				LevelLength=1;
				creat_child(arg[i+2]);
				if (arg[i]!='') str+='<tr><td class="root hand" onclick="location=\''+baseURL+arg[i]+'\'">'+arg[i+1]+'</td></tr>';
				else str+='<tr><td class="root">'+arg[i+1]+'</td></tr>';
				url=arg[i+2]+'';
				url2=arg[i]+'';
				if (((url.indexOf(actualUrl)!=-1) || (url2.indexOf(actualUrl)!=-1)) && ((actualUrl!="/") && (actualUrl!=""))) str+='<tr><td>'+strChild+'</td></tr>';
			}	else 
			{
				str2='';
				if (arg[i]!='') str+='<tr><td class="root hand" onclick="location=\''+baseURL+arg[i]+'\'">'+arg[i+1]+'</td></tr>';
				else str+='<tr><td class="root">'+arg[i+1]+'</td></tr>';
			}
	}
	str+='<tr><td><img src="/data/img/menu_r.gif" /></td></tr>';
	str+='</table>';
	document.write(str);
}




