var i = 0;
var j = 0;
var index = 0;
for( ; i < MenuCategory.length ; i++){	
	var Category = MenuCategory[i];
	var SubMenu = ""
	var ImgID = "folder";
			
	document.write('<tr valign="top">');
	document.write('<td width="7" height="10">&nbsp;</td>');

	//判斷是有子選項
	if(Category[1].length != 0){
		SubMenu = '&nbsp;&nbsp;&nbsp;<img id="' + ImgID + (i+1) + '" style="z-index:' + NodeExpand + '" src="/images/p00' + (NodeExpand+1)+ '.gif" border="0" width="13" height="13" onclick="TreeChange()">';
	}
	
	//判斷是否有 link
	if(Category[2].length == 0){
		document.write('<td colspan="3" height="10"><img src="' + Category[0] + '" border="0">' + SubMenu + '</td>');
	}else{
		document.write('<td colspan="3" height="10"><a href="' + Category[2] + '"><img src="' + Category[0] + '" border="0"></a>' + SubMenu + '</td>');
	}
	
	
	document.write('</tr>');
	if(NodeExpand == 1){
		document.write('<tr id="folder'+ (i+1) + 'list">');
	}else{
		document.write('<tr id="folder'+ (i+1) + 'list" style="display:none">');
	}
	document.write('<td width="7" height="68">&nbsp;</td>');
	document.write('<td colspan="3" height="68" valign="top">');
	document.write('    <table width="262" border="0" cellspacing="0" cellpadding="0" class="font_12">');
	if(Category[1].length  != 0){
		for(j = 0; j < Category[1].length ; j++){
			index++;
			var Item = Category[1];
			document.write('<tr>')
			document.write('  <td height="10" width="40"></td>')
			document.write('  <td height="10" width="222"></td>')
			document.write('</tr>')
			document.write('<tr>')
			document.write('  <td height="13" valign="top" align="right">&#149;&nbsp;&nbsp;</td>')
			document.write('  <td><a href="' + Item[j][0] + '" class="link_b" id="s' + index + '">' + Item[j][1] + '</a></td>')
			document.write('</tr>')		
		}
	}
	document.write('    </table>')
	document.write('  </td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('  <td colspan="4" height="10" valign="top"></td>');
	document.write('</tr>')	
}
    
