var fn = "";

var re = new RegExp("=","i");

strL1 = "認識慈暉,5,服務內容,5,活動佈告欄,2";
strL2 = "成立緣起與宗旨,intro/aboutus.html,組織架構,intro/org.html,年度計劃,intro/plan_2006.html,年度預算,intro/budget_2006.html,榮譽事蹟,intro/honor.html,";
strL2 += "教育課程,services/classes.html,主要活動,services/activity.html,發行刊物,services/publish.html,獎助項目,services/reward.html,捐助項目,services/support.html,";
strL2 += "慈暉大事記,announces/history.html,活動集錦,announces/actrec.html,";

aryL1 = strL1.split(",");
aryL2 = strL2.split(",");

L1_Items = aryL1.length/2;
L2_Items = aryL2.length/2;

j1 = 0;
j2 = 0;


var mainMenu = "";
var submenu = new Array();
var menuobj;

function init() {
	menuobj = document.all.describe;
	for ( i = 0 ; i < L1_Items; i++ ) {	
	
		for ( ii = 0 ; ii < aryL1[j1+1]; ii++ ) {
	
			if ( ii == 0 ) {
				submenu[i] = '<!--<span style="color:#FF0000;">' + aryL1[j1] + '</span><span style="font: 14px Webdings; color: #FF0000;">&#52;</span> -->| <a href="' + aryL2[j2+1] + '" onClick="javascript:setL2Focus(this);" class="a1">' + aryL2[j2] + '</a>';
			} else {
				submenu[i] += '│<a href="' + aryL2[j2+1] + '" onClick="javascript:setL2Focus(this);" class="a1">' + aryL2[j2] + '</a>';
			}
	
			if ( ii == ( aryL1[j1+1] - 1 ) ) {
				submenu[i] += '│';
			}
			j2 += 2;
		}
		j1 += 2;
	}
}

var tmpObj, tmpL2Obj;

function showit(i, obj){
	menuobj.innerHTML = submenu[i];
	setFocusIn(obj);
}

function setFocusIn( obj ){
	if ( tmpObj != undefined ) {
		tmpObj.style.color = "#C1750B";
	}
	tmpObj = obj;
	obj.style.color = "RED";
}

function setL2Focus( obj ) {
	if ( tmpL2Obj != undefined ) {
		tmpL2Obj.style.color = "#C1750B";
	}
	tmpL2Obj = obj;
	obj.style.color = "Blue";
}
