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 == "minus_last")
		{	document.getElementById(ClassID).className = "plus_last"} 
		else
		{	document.getElementById(ClassID).className = "plus"}
	} 
	else
	{	document.getElementById(LevelID).style.visibility = "visible";
		document.getElementById(LevelID).style.display = "block";
		if (document.getElementById(ClassID).className == "plus_last")
		{	document.getElementById(ClassID).className = "minus_last"}
		else
		{	document.getElementById(ClassID).className = "minus"}
	}
}

function creat_child(Child)
{
	var ID;
	var ClassID;
	strChild+='<table 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];
					}
//					alert(ID);

					if (i2<(Child.length-3)) 
						{	
							strChild+='<td class="plus" id="point_'+ClassID+'">';
						}
						else
						{	
							strChild+='<td class="plus_last" id="point_'+ClassID+'">';
						}
					strChild+='<a href="javascript:Item('+ID+') "><img class=tree_node border="0" src="'+imgPath+'1.gif" width="15" height="12" /></a></td><td class="sitemap"><a href="'+Child[i2]+'">'+Child[i2+1]+'</a><br><div id="item_'+ClassID+'" style = "visibility : hidden; display : none"><img src="'+imgPath+'1.gif" width="1" height="3"><br>';
					LevelLength=LevelLength+1;
					item[LevelLength] = i2;
					creat_child(Child[i2+2]);
					LevelLength=LevelLength-1;
					strChild+='</div></td>';
				}	
				else 
				{
					if (i2<(Child.length-3)) 
						{	strChild+='<td class="normal">'}
						else
						{	strChild+='<td class="normal_last">'}
					strChild+='<img class=tree_node border="0" src="'+imgPath+'1.gif" width="15" height="12" /></td><td class="sitemap"><a href="'+Child[i2]+'">'+Child[i2+1]+'</a><br><img src="'+imgPath+'1.gif" width="1" height="2"></td>';
				}
			strChild+='<tr>';
			str2+=')';
			if (i2<(Child.length-3)) {str2+=','};
		}

	strChild+='</table>'
}

function creat_tree()
{
	var arg = creat_tree.arguments;
	var ID=0;
	str+='<table border="0" cellpadding="0" cellspacing="0">';
	for(var i=0; i<arg.length; i=i+3)
	{
		item[0] = i;
		str+='<tr>';
		ID = i;
		if (arg[i+2]!='') 
			{
				str2='';
				strChild='';
				LevelLength=1;
				creat_child(arg[i+2]);
				if (i<(arg.length-3)) 
					{	str+='<td class="minus" id="point_'+ID+'">'}
					else
					{	str+='<td class="minus_last" id="point_'+ID+'">'}
				str+='<a href="javascript:Item('+ID+') "><img class=tree_node border="0" src="'+imgPath+'1.gif" width="15" height="15" /></a></td><td><a href="'+arg[i]+'" class="menu_item">'+arg[i+1]+'</a><br><img src="'+imgPath+'1.gif" width="1" height="2"><br><div id="item_'+ID+'" style = "visibility : visible; display : block">';
				str+=strChild;
				str+='</div></td>';
			}	else 
			{
				str2='';
				strChild='';
				if (i<(arg.length-3)) 
					{	str+='<td class="normal">'; }
					else
					{	str+='<td class="normal_last">'; }
				str+='<img class=tree_node border="0" src="'+imgPath+'1.gif" width="15" height="15" /></td><td><a href="'+arg[i]+'" class="menu_item">'+arg[i+1]+'</a><br><img src="'+imgPath+'1.gif" width="1" height="2"><br></td>';
			}
			str+='</tr>';
	}
	str+='</table>';
	document.write(str);
}

