//===========================================================================
//基本設定
//==================== begin ================================================
topMargin = 112;    //內部為112
layerHeight = 23;
leftMargin = 90;
tableWidth = 200;
rowHeight = 22;
showWeekly = true;
showHouse = false;
path = '';    //內部為空字串
//====================  end  ================================================

//===========================================================================
//所有的menu
//==================== begin ================================================
menuNames = new Array('t','fo','p','so','int','c','o','e','life','sp','region','show');
titles = new Array('頭版新聞','焦點新聞','政治新聞','社會新聞','國際新聞','自由評論','自由廣場','財經焦點','生活新聞','體育新聞','地方新聞','影視名人');
pages = new Array('today-t1.htm','today-fo1.htm','today-p1.htm','today-so0.htm','today-int0.htm','today-s1.htm','today-o0.htm','today-e1.htm','today-life1.htm','today-sp0.htm','today-taipei0.htm','today-show1.htm');
if (!showWeekly)
{
	menuNames = menuNames.concat(new Array('supplement'));
	titles = titles.concat(new Array('生活副刊'));
	pages = pages.concat(new Array('today-fashion1.htm'));
}
menuNames2 = new Array('taipei','north','center','south','fashion','work','gender','family','article','travel');

names = menuNames.concat(menuNames2);
menus = Array(names.length);
for (i=0; i<menus.length; i++)
{
	menus[i] = new Object();
	menus[i].name = names[i];
}
//====================  end  ================================================

//===========================================================================
//主選單
//==================== begin ================================================
document.write('<TABLE class=block2L cellSpacing=1 cellPadding=3 width=90 border=0>');
document.write('	<TR>');
document.write('		<TD bgColor=#333399>今日要聞</TD>');
document.write('	</TR>');
for (i=0; i<menuNames.length; i++)
{
	document.write('	<TR>');
	document.write('		<TD class=block2L_tda onMouseOver="showMenu(this,'+menuNames[i]+')" onMouseOut="hideMenu()" style=color:blue;cursor:pointer');
	document.write('				onClick="location.href=\''+path+pages[i]+'\'">'+titles[i]+'</TD>');
	document.write('	</TR>');
}
if (true)
{
	document.write('	<TR>');
	document.write('		<TD class=block2L_tdb><A class=block2La href="#" onClick=open("http://www.libertytimes.com.tw/Service/weekly.htm","","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=810,height=643")>生活週報</A></TD>');
	document.write('	</TR>');
}
if (false)
{
	document.write('	<TR>');
	document.write('		<TD class=block2L_tdb><A class=block2La href="#" onClick=open("http://www.libertytimes.com.tw/Service/house.htm","","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=810,height=707")>住宅生活</A></TD>');
	document.write('	</TR>');
}
document.write('	<TR>');
document.write('		<TD bgColor=#cc6600><A class=block2La href="'+path+'Rnews.htm">專題報導</A></TD>');
document.write('	</TR>');
document.write('	<TR>');
document.write('		<TD bgColor=#666666>服務專區</TD>');
document.write('	</TR>');
document.write('	<TR>');
document.write('		<TD class=block2L_tdb><A class=block2La href="http://www.roclotto.com.tw/" target=_blank>樂透彩券</A></TD>');
document.write('	</TR>');
document.write('	<TR>');
document.write('		<TD class=block2L_tdb><A class=block2La href="'+path+'Nnews.htm">統一發票</A></TD>');
document.write('	</TR>');
document.write('	<TR>');
document.write('		<TD class=block2L_tdb><font color=blue><A onmouseover="this.style.cursor=\'pointer\';this.style.color=\'deepskyblue\'" ');
document.write('			onclick="window.open(\'http://www.libertytimes.com.tw/Service/Order.htm\',\'_new\',\'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=770,height=650\');" ');
document.write('			onmouseout="this.style.color=\'blue\'">訂報服務</A></FONT></TD>');
document.write('	</TR>');
document.write('	<TR>');
document.write('		<TD class=block2L_tdb><A class=block2La href="http://www.libertytimes.com.tw/about/recruit.htm">求才專區</a></TD>');
document.write('	</TR>');
document.write('	<TR>');
document.write('		<TD class=block2L_tdb><A class=block2La href="'+path+'activity.htm">活動訊息</a></TD>');
document.write('	</TR>');
document.write('	<TR>');
document.write('		<TD class=block2L_tdb><A class=block2La href="http://www.lscc.com.tw/" target=_blank>自由廣場<br>國際會議中心</a></TD>');
document.write('	</TR>');
document.write('	<TR>');
document.write('		<TD class=block2L_tdb><A class=block2La href="http://www.ntat.gov.tw/" target=_blank>台北市國稅局</a></TD>');
document.write('	</TR>');
document.write('</TABLE>');
//====================  end  ================================================

//===========================================================================
//所有的menu的項目，由PHP產生
//==================== begin ================================================

menu = getMenu('fo');
menu.layer = 1;
menu.menuLayer = 0;
menu.rows = new Array(8);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = '蘇揆報佳音：甘比亞堅定挺台';
	rows[0].link = 'today-fo1.htm';
																										
	rows[1].text = '陳隆志讚賈梅 不畏中國打壓';
	rows[1].link = 'today-fo2.htm';
																										
	rows[2].text = '立委選舉／民進黨 二成選區 同志相爭';
	rows[2].link = 'today-fo3.htm';
																										
	rows[3].text = '立委選舉／國民黨 協調不成 就辦初選';
	rows[3].link = 'today-fo4.htm';
																										
	rows[4].text = '無盟想結親 卡在路線問題';
	rows[4].link = 'today-fo5.htm';
																										
	rows[5].text = '辜寬敏：綠贏總統大選仍樂觀';
	rows[5].link = 'today-fo6.htm';
																										
	rows[6].text = '愛上台灣 日女留學生漫畫紀實';
	rows[6].link = 'today-fo7.htm';
																										
	rows[7].text = '拼圖達人 代客拼圖樂趣多';
	rows[7].link = 'today-fo8.htm';
																										
}
menu = null;

menu = getMenu('p');
menu.layer = 2;
menu.menuLayer = 0;
menu.rows = new Array(5);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = '「逛街不會暈倒」連勝文諷珍 綠：禽獸不如';
	rows[0].link = 'today-p1.htm';
																										
	rows[1].text = '台聯：胡志強應說句公道話';
	rows[1].link = 'today-p2.htm';
																										
	rows[2].text = '扁嫂病情不穩 需再住院';
	rows[2].link = 'today-p3.htm';
																										
	rows[3].text = '李鴻禧批審判長：不近人性';
	rows[3].link = 'today-p4.htm';
																										
	rows[4].text = '釋憲案若受理 憲法辯論 民進黨備戰';
	rows[4].link = 'today-p5.htm';
																										
}
menu = null;

menu = getMenu('int');
menu.layer = 4;
menu.menuLayer = 0;
menu.rows = new Array(9);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = "伏法過程殘暴 佛州死刑喊停";
	rows[0].link = 'today-int1.htm';
																										
	rows[1].text = "捐血 奉送按摩、算命";
	rows[1].link = 'today-int2.htm';
																										
	rows[2].text = "俄棋王對抗普廷 下險棋";
	rows[2].link = 'today-int3.htm';
																										
	rows[3].text = "運動員求勝 搞基改";
	rows[3].link = 'today-int4.htm';
																										
	rows[4].text = "英殺妓狂魔 鎖定五疑犯";
	rows[4].link = 'today-int5.htm';
																										
	rows[5].text = "「珍」鈔 價值7500萬元";
	rows[5].link = 'today-int6.htm';
																										
	rows[6].text = "馬來西亞 搶救布氏鯨";
	rows[6].link = 'today-int7.htm';
																										
	rows[7].text = "《中日對照讀新聞》「漁&#12434;&#12377;&#12427;」天才&#12470;&#12523;死&#12396; 「捕魚」天才猴死亡";
	rows[7].link = 'today-int8.htm';
																										
	rows[8].text = "《中英對照讀新聞》Cold campout on roof for NJ principa 新澤西州校長，屋頂露營度寒夜";
	rows[8].link = 'today-int9.htm';
																										
}
menu = null;

menu = getMenu('so');
menu.layer = 3;
menu.menuLayer = 0;
menu.rows = new Array(13);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = '超HOT奇人 赤膊47載   「衣」無所求';
	rows[0].link = 'today-so1.htm';
																										
	rows[1].text = '上班族「兼差」抽獎 年賺10萬';
	rows[1].link = 'today-so2.htm';
																										
	rows[2].text = '臧家宜連夜南下 搶救「證據」';
	rows[2].link = 'today-so3.htm';
																										
	rows[3].text = '「卑鄙」男 「明」哲保身 有人摃龜 他卻樂透';
	rows[3].link = 'today-so4.htm';
																										
	rows[4].text = '景氣冷 酒店促銷火辣辣';
	rows[4].link = 'today-so5.htm';
																										
	rows[5].text = '養不起 婦人想送男嬰';
	rows[5].link = 'today-so6.htm';
																										
	rows[6].text = '彰化改裝車甩尾大賽 上百警力場外開單';
	rows[6].link = 'today-so7.htm';
																										
	rows[7].text = '腦傷老男行竊 檢不起訴';
	rows[7].link = 'today-so8.htm';
																										
	rows[8].text = '裝冷氣留指紋 3年後被當竊嫌';
	rows[8].link = 'today-so9.htm';
																										
	rows[9].text = '信佛芽菜 誦經聲中成長';
	rows[9].link = 'today-so10.htm';
																										
	rows[10].text = '心靈畫師 阿嬤生活特笑藥';
	rows[10].link = 'today-so11.htm';
																										
	rows[11].text = '行動牙醫座 義診趴趴走';
	rows[11].link = 'today-so12.htm';
																										
	rows[12].text = '照顧腦麻兄 「食」在新楷模';
	rows[12].link = 'today-so13.htm';
																										
}
menu = null;

menu = getMenu('life');
menu.layer = 8;
menu.menuLayer = 0;
menu.rows = new Array(5);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = 'JHMC數學競賽 中市居仁國中林杰稱霸';
	rows[0].link = 'today-life1.htm';
																										
	rows[1].text = '《星期人物》捨電影夢 陳勝福打造東方歌劇';
	rows[1].link = 'today-life2.htm';
																										
	rows[2].text = '台灣文學獎頒獎 唱遊添詩意';
	rows[2].link = 'today-life3.htm';
																										
	rows[3].text = '冷氣團發威 今明更冷';
	rows[3].link = 'today-life4.htm';
																										
	rows[4].text = '黑猩猩基因 可探究人類愛滋';
	rows[4].link = 'today-life5.htm';
																										
}
menu = null;

menu = getMenu('sp');
menu.layer = 9;
menu.menuLayer = 0;
menu.rows = new Array(6);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = '金棒 捐助基層';
	rows[0].link = 'today-sp1.htm';
																										
	rows[1].text = '建仔簽名會 老少通吃';
	rows[1].link = 'today-sp2.htm';
																										
	rows[2].text = '中職選秀 納入高畢生';
	rows[2].link = 'today-sp3.htm';
																										
	rows[3].text = '小布 狂砍53分';
	rows[3].link = 'today-sp4.htm';
																										
	rows[4].text = '龔怡萍穩住 亞洲隊領先';
	rows[4].link = 'today-sp5.htm';
																										
	rows[5].text = '杜哈亞運10憾';
	rows[5].link = 'today-sp6.htm';
																										
}
menu = null;

menu = getMenu('e');
menu.layer = 7;
menu.menuLayer = 0;
menu.rows = new Array(6);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = '台日韓LCD業面臨10億美元罰款';
	rows[0].link = 'today-e1.htm';
																										
	rows[1].text = '學者：廢止遺產稅 勢所必然';
	rows[1].link = 'today-e2.htm';
																										
	rows[2].text = '樺福建設 挑戰八掛山魔咒';
	rows[2].link = 'today-e3.htm';
																										
	rows[3].text = '《品牌故事》上銀科技 高科技贏家';
	rows[3].link = 'today-e4.htm';
																										
	rows[4].text = '吳家錄拿太太私房錢 從事公益';
	rows[4].link = 'today-e5.htm';
																										
	rows[5].text = '中鋼35年 鋼鐵學院培育人才';
	rows[5].link = 'today-e6.htm';
																										
}
menu = null;

menu = getMenu('t');
menu.layer = 0;
menu.menuLayer = 0;
menu.rows = new Array(1);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = '越娘不棄病夫 推車賣魚持家';
	rows[0].link = 'today-t1.htm';
}
menu = null;

menu = getMenu('show');
menu.layer = 11;
menu.menuLayer = 0;
menu.rows = new Array(15);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = '黃志瑋露肌尬球  愛的刺青滿場飛';
	rows[0].link = 'today-show1.htm';
																										
	rows[1].text = 'S.H.E熱舞  李玟吳尊獻聲';
	rows[1].link = 'today-show2.htm';
																										
	rows[2].text = '蕭亞軒不畏風雨 拄柺杖上陣';
	rows[2].link = 'today-show3.htm';
																										
	rows[3].text = '陳昇跨年開唱 粉絲遊說包場';
	rows[3].link = 'today-show4.htm';
																										
	rows[4].text = '權相佑健身 攬鏡秀美肌';
	rows[4].link = 'today-show5.htm';
																										
	rows[5].text = '權相佑拱豬鼻子 粉碎整形說';
	rows[5].link = 'today-show6.htm';
																										
	rows[6].text = '立威廉偕女友 連體嬰看電影';
	rows[6].link = 'today-show7.htm';
																										
	rows[7].text = '楊丞琳下週告別我猜';
	rows[7].link = 'today-show8.htm';
																										
	rows[8].text = '復興最風光 警廣情侶檔雙喜';
	rows[8].link = 'today-show9.htm';
																										
	rows[9].text = '平胸妹尬波 惠梨香小贏宮崎葵';
	rows[9].link = 'today-show10.htm';
																										
	rows[10].text = '絢香 澤尻繪理香 活躍1級棒';
	rows[10].link = 'today-show11.htm';
																										
	rows[11].text = 'AI首登武道館 粉絲狂High';
	rows[11].link = 'today-show12.htm';
																										
	rows[12].text = '布蘭妮友情愛情兩失 買房子守兒子';
	rows[12].link = 'today-show13.htm';
																										
	rows[13].text = '裘莉爆料避孕 領養傷腦筋';
	rows[13].link = 'today-show14.htm';
																										
	rows[14].text = '哈德森迷上鋼管舞 跳出性感';
	rows[14].link = 'today-show15.htm';
																										
}
menu = null;

menu = getMenu('c');
menu.layer = 5;
menu.menuLayer = 0;
menu.rows = new Array(3);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
		rows[0].text = '《星期專論》 新聞媒體也是這次選舉的輸家';
		rows[0].link = 'today-s1.htm';
																	
	rows[1].text = '《自由談》不沾鍋變厚黑鍋！';
	rows[1].link = 'today-f1.htm';
																
		rows[2].text = '《鏗鏘集》總統「同意」不等於檢方可以「違憲」';
		rows[2].link = 'today-f2.htm';
																	
}
menu = null;

menu = getMenu('region');
menu.layer = 10;
menu.menuLayer = 0;
menu.rows = new Array(4);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();

	rows[0].text = '大台北新聞　→';
	rows[0].submenu = 'taipei';
	rows[0].link = 'today-taipei0.htm';

	rows[1].text = '北部新聞　　→';
	rows[1].submenu = 'north';
	rows[1].link = 'today-north0.htm';

	rows[2].text = '中部新聞　　→';
	rows[2].submenu = 'center';
	rows[2].link = 'today-center0.htm';

	rows[3].text = '南部新聞　　→';
	rows[3].submenu = 'south';
	rows[3].link = 'today-south0.htm';
}
menu = null;

menu = getMenu('taipei');
menu.layer = 10;
menu.parentMenu = 'region';
menu.menuLayer = 1;
menu.rows = new Array(6);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = '喔「耶」! 孔廟、內科 Merry Christmas變裝';
	rows[0].link = 'today-taipei1.htm';
																										
	rows[1].text = '士林官邸 「菊」祥如意';
	rows[1].link = 'today-taipei2.htm';
																										
	rows[2].text = '眷戀 公民會館 重現眷村';
	rows[2].link = 'today-taipei3.htm';
																										
	rows[3].text = '美鈔贓物留伏筆 慣竊認栽';
	rows[3].link = 'today-taipei4.htm';
																										
	rows[4].text = '與夫談判被毆 燒屋洩恨';
	rows[4].link = 'today-taipei5.htm';
																										
	rows[5].text = '用餐被打怪罪麥當勞 求償敗訴';
	rows[5].link = 'today-taipei6.htm';
																										
}
menu = null;

menu = getMenu('north');
menu.layer = 11;
menu.parentMenu = 'region';
menu.menuLayer = 1;
menu.rows = new Array(5);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = '換發身分證 趣事一籮筐';
	rows[0].link = 'today-north1.htm';
																										
	rows[1].text = '助貧圓夢 企業募款助學';
	rows[1].link = 'today-north2.htm';
																										
	rows[2].text = '中壢龍岡1之1號道路南段 通車';
	rows[2].link = 'today-north3.htm';
																										
	rows[3].text = '宜蘭三星銀柳節 蔥破五百米';
	rows[3].link = 'today-north4.htm';
																										
	rows[4].text = '救人專家 當志工效率奇高';
	rows[4].link = 'today-north5.htm';
																										
}
menu = null;

menu = getMenu('center');
menu.layer = 12;
menu.parentMenu = 'region';
menu.menuLayer = 1;
menu.rows = new Array(8);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = '詔安客平安祭 開嘴獅大會獅';
	rows[0].link = 'today-center1.htm';
																										
	rows[1].text = '身心障礙兒 協力闖９關';
	rows[1].link = 'today-center2.htm';
																										
	rows[2].text = '讓愛傳出去 幼兒寒天送暖';
	rows[2].link = 'today-center3.htm';
																										
	rows[3].text = '張連桂創作 瓶中見乾坤';
	rows[3].link = 'today-center4.htm';
																										
	rows[4].text = '調教流浪狗 歡迎來領養';
	rows[4].link = 'today-center5.htm';
																										
	rows[5].text = '家扶兒上飯店 開心做餅屋';
	rows[5].link = 'today-center6.htm';
																										
	rows[6].text = '秋雨炒股案 副董100萬元交保';
	rows[6].link = 'today-center7.htm';
																										
	rows[7].text = '兩週投保3600萬 截肢理賠敗訴';
	rows[7].link = 'today-center8.htm';
																										
}
menu = null;

menu = getMenu('south');
menu.layer = 13;
menu.parentMenu = 'region';
menu.menuLayer = 1;
menu.rows = new Array(8);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = '全國青少年八家將 屏東較勁';
	rows[0].link = 'today-south1.htm';
																										
	rows[1].text = '黑琵保育季開鑼 單車勇士長征';
	rows[1].link = 'today-south2.htm';
																										
	rows[2].text = '世展會賣場設攤 鼓吹認養';
	rows[2].link = 'today-south3.htm';
																										
	rows[3].text = '歡喜慶耶誕 外籍配偶一起來';
	rows[3].link = 'today-south4.htm';
																										
	rows[4].text = '英語嘉年華會 全英語情境有趣';
	rows[4].link = 'today-south5.htm';
																										
	rows[5].text = '一句比豬吃的還不如 差點吃官司';
	rows[5].link = 'today-south6.htm';
																										
	rows[6].text = '高市女裸屍案 逮一嫌抄一刀';
	rows[6].link = 'today-south7.htm';
																										
	rows[7].text = '女代書貪心 詐騙建商退稅款';
	rows[7].link = 'today-south8.htm';
																										
}
menu = null;

menu = getMenu('o');
menu.layer = 6;
menu.menuLayer = 0;
menu.rows = new Array(11);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
	rows[0].text = '審判長的四通電話';
	rows[0].link = 'today-o1.htm';
																										
	rows[1].text = '人性寒流';
	rows[1].link = 'today-o2.htm';
																										
	rows[2].text = '佛與屎';
	rows[2].link = 'today-o3.htm';
																										
	rows[3].text = '李筱峰專欄／我心目中的總統人選';
	rows[3].link = 'today-o4.htm';
																										
	rows[4].text = '蔡部長 想想國光號';
	rows[4].link = 'today-o5.htm';
																										
	rows[5].text = '連勝文的家教';
	rows[5].link = 'today-o6.htm';
																										
	rows[6].text = '誰記得她抱病拚外交';
	rows[6].link = 'today-o7.htm';
																										
	rows[7].text = '1220看馬利兄弟';
	rows[7].link = 'today-o8.htm';
																										
	rows[8].text = '激情過後的身體自主權';
	rows[8].link = 'today-o9.htm';
																										
	rows[9].text = '別再罵亞運選手';
	rows[9].link = 'today-o10.htm';
																										
	rows[10].text = '白痴粉絲';
	rows[10].link = 'today-o11.htm';
																										
}
menu = null;

if (showWeekly == false)
{
	menu = getMenu('supplement');
	menu.layer = 13;
	menu.menuLayer = 0;
	menu.rows = new Array(6);
	with (menu)
	{
		for (i=0; i<rows.length; i++)
			rows[i] = new Object();
	
		rows[0].text = '流行消費　　→';
		rows[0].submenu = 'fashion';
		rows[0].link = 'today-fashion1.htm';
	
		rows[1].text = '上班一族　　→';
		rows[1].submenu = 'work';
		rows[1].link = 'today-work1.htm';
	
		rows[2].text = '兩性異言堂　→';
		rows[2].submenu = 'gender';
		rows[2].link = 'today-gender1.htm';
	
		rows[3].text = '家庭親子　　→';
		rows[3].submenu = 'family';
		rows[3].link = 'today-family1.htm';
	
		rows[4].text = '自由副刊　　→';
		rows[4].submenu = 'article';
		rows[4].link = 'today-article1.htm';
	
		rows[5].text = '休閒旅遊　　→';
		rows[5].submenu = 'travel';
		rows[5].link = 'today-travel1.htm';
	}
	menu = null;
}

menu = getMenu('fashion');
menu.layer = 13;
menu.parentMenu = 'supplement';
menu.menuLayer = 1;
menu.rows = new Array(0);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
}
menu = null;

menu = getMenu('family');
menu.layer = 16;
menu.parentMenu = 'supplement';
menu.menuLayer = 1;
menu.rows = new Array(0);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
}
menu = null;

menu = getMenu('work');
menu.layer = 14;
menu.parentMenu = 'supplement';
menu.menuLayer = 1;
menu.rows = new Array(0);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
}
menu = null;

menu = getMenu('article');
menu.layer = 17;
menu.parentMenu = 'supplement';
menu.menuLayer = 1;
menu.rows = new Array(0);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
}
menu = null;

menu = getMenu('gender');
menu.layer = 15;
menu.parentMenu = 'supplement';
menu.menuLayer = 1;
menu.rows = new Array(0);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
}
menu = null;

menu = getMenu('travel');
menu.layer = 18;
menu.parentMenu = 'supplement';
menu.menuLayer = 1;
menu.rows = new Array(0);
with (menu)
{
	for (i=0; i<rows.length; i++)
		rows[i] = new Object();
																
}
menu = null;

//====================  end  ================================================

//===========================================================================
//產生tables
//==================== begin ================================================
for (j=0; j<menus.length; j++)
{
	var previousRowType = '';
	if (menus[j].parentMenu == null)
		document.write('<table id='+menus[j].name+' style="position:absolute;left:'+(leftMargin+tableWidth*menus[j].menuLayer)+';visibility:hidden;font-size:13px;width:200;cursor:pointer;border:1 solid #00CCFF" border=0 bgcolor=#FFFFFF cellspacing=1 cellpadding=2 onMouseOver=showMenu(null,null) onMouseOut=hideMenu()>');
	else
		document.write('<table id='+menus[j].name+' style="position:absolute;left:'+(leftMargin+tableWidth*menus[j].menuLayer)+';visibility:hidden;font-size:13px;width:200;cursor:pointer;border:1 solid #00CCFF" border=0 bgcolor=#FFFFFF cellspacing=1 cellpadding=2 onMouseOver=showMenu2(null,null) onMouseOut=hideMenu2()>');

	for (i=0; i<menus[j].rows.length; i++)
	{
		if (previousRowType!='' && menus[j].rows[i].type==null)
		{
			document.write('<tr bgcolor=#00CCFF height=2 style=cursor:default>');
			document.write('	<td></td>');
			document.write('</tr>');
		}

		if (menus[j].rows[i].type && menus[j].rows[i].type!=previousRowType)
		{
			document.write('<tr bgcolor=#00CCFF height='+rowHeight+' style="cursor:default">');
			document.write('	<td>《'+menus[j].rows[i].type+'》</td>');
			document.write('</tr>');
		}

		if (menus[j].rows[i].submenu)
		{
			document.write('<tr onMouseOver="incell(this);showMenu2(this,'+menus[j].rows[i].submenu+')" onMouseOut="outcell(this);hideMenu2()" bgcolor=#C2E5FF height='+rowHeight+'>');
			if (menus[j].rows[i].link)
				document.write('	<td onClick="location.href=\''+path+menus[j].rows[i].link+'\'">'+menus[j].rows[i].text+'</td>');
			else
				document.write('	<td>'+menus[j].rows[i].text+'</td>');
			document.write('</tr>');
		}
		else 
		{
			if (menus[j].rows[i].type == null)
			{
				document.write('<tr onMouseOver=incell(this) onMouseOut=outcell(this) bgcolor=#C2E5FF height='+rowHeight+'>');
				document.write('	<td onClick="location.href=\''+path+menus[j].rows[i].link+'\'">◎'+menus[j].rows[i].text+'</td>');
				document.write('</tr>');
			}
			else
			{
				document.write('<tr onMouseOver=incell(this) onMouseOut=outcell2(this) bgcolor=#41DAAA height='+rowHeight+'>');
				document.write('	<td onClick="location.href=\''+path+menus[j].rows[i].link+'\'">．'+menus[j].rows[i].text+'</td>');
				document.write('</tr>');
			}
		}

		previousRowType = menus[j].rows[i].type==null? '': menus[j].rows[i].type;
	}

	document.write('</table>');
}
//====================  end  ================================================

var activeRow,activeMenu1,activeRow1,activeMenu2;
var protrude1;
var timer,timer2;
var hide,hide2

function getMenu(name)
{
	index = -1;
	for (i=0; i<menus.length; i++)
		if (menus[i].name == name)
		{
			index = i;
			break;
		}
	if (index != -1) return menus[index];
	else return null;
}

function showMenu(row,menu)
{
	if (activeRow)
	{
		hide = true;
		hideAllMenu();
	}
	hide = false;
	if (row)	activeRow = row;
	activeRow.style.backgroundColor = '#FFCCFF';
	if (menu) activeMenu1 = menu;
	
	defaultTop = topMargin+layerHeight*getMenu(activeMenu1.id).layer;
	protrude1 = defaultTop-document.body.scrollTop+activeMenu1.offsetHeight-document.body.clientHeight;
	if (protrude1 > 0)	
		activeMenu1.style.top = defaultTop-protrude1;
	else
		activeMenu1.style.top = defaultTop;
		
	activeMenu1.style.visibility = 'visible';
}

function hideMenu()
{
	clearTimeout(timer);
	hide = true;
	timer = setTimeout(hideAllMenu,600);
}

function hideAllMenu()
{
	if (hide)
	{
		activeRow.style.backgroundColor = '#FAF9F5';
		activeMenu1.style.visibility = 'hidden';
	}
}

function showMenu2(row,menu)
{
	if (activeRow1)
	{
		hide2 = true;
		hideAllMenu2();
	}
	hide = false;
	hide2 = false;
	if (row)	activeRow1 = row;
	activeRow.style.backgroundColor = '#FFCCFF';
	activeRow1.style.backgroundColor = '#FFCCFF';
	if (menu) activeMenu2 = menu;
	
	defaultTop = topMargin+layerHeight*getMenu(activeMenu2.id).layer;
	protrude2 = defaultTop-document.body.scrollTop+activeMenu2.offsetHeight-document.body.clientHeight;
	if (protrude2 > 0)	
	{
		if (protrude1 > protrude2)
			activeMenu2.style.top = defaultTop-protrude1;
		else
			activeMenu2.style.top = defaultTop-protrude2;
	}
	else
	{
		if (protrude1 > 0)
			activeMenu2.style.top = defaultTop-protrude1;
		else
			activeMenu2.style.top = defaultTop;
	}
	
	activeMenu1.style.visibility = 'visible';
	activeMenu2.style.visibility = 'visible';
}

function hideMenu2()
{
	hideMenu();
	clearTimeout(timer2);
	hide2 = true;
	timer2 = setTimeout(hideAllMenu2,600);
}

function hideAllMenu2()
{
	if (hide2) {
		activeRow1.style.backgroundColor = '#C2E5FF';
		activeMenu2.style.visibility = 'hidden';
	}
}

function outcell(cell)
{
	cell.style.backgroundColor = '#C2E5FF';
	cell.style.color = 'black';
}

function outcell2(cell)
{
	cell.style.backgroundColor = '#41DAAA';
	cell.style.color = 'black';
}

function incell(cell)
{
	cell.style.backgroundColor = '#FFCCFF';
	cell.style.color = 'blue';
}