﻿/* 
 this function dispaly the company title
*/
function title(path) {
	if (path == null || path.length == 0) 
		path = "./";
		
	var newyear1 = "<img src='" + path + "image/happy-new-year3.gif' border='0' width='100'/>";
	var logo = "<a href='" + path + "index.html'><img src='" + path + "image/logo.png' border='0'/></a>";
	var title = "<a href='" + path + "index.html'><img src='" + path + "image/title.png' border='0'/></a>";
	var newyear2 = "<img src='" + path + "image/happy-new-year1.gif' border='0' width='100'/>";
//	var notes = "<br/><img src='" + path + "image/happy_2012.png' border='0'/>";
	
	var month_ch = new Array("一","二","三","四","五","六","七","八","九","十","十一","十二");
	var date_ch = new Array("一","二","三","四","五","六","七","八","九","十",
							"十一","十二","十三","十四","十五","十六","十七","十八","十九","二十",
							"二十一","二十二","二十三","二十四","二十五","二十六","二十七","二十八","二十九","三十",
							"三十一");
	var month_en = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	var day_en = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	
	var currentTime = new Date();
	var month = currentTime.getMonth() + 1;
	var day = currentTime.getDate();
	var year = currentTime.getFullYear();

//	document.write(newyear1);
	document.write(logo);
	document.write(title);
//	document.write(newyear2);

//	document.write(notes);
	/*
	var photo = "<tr><td><a style='text-decoration:none' href='" + path + "photo.php'><font size='4'>相簿 Photo</font></a><img src='image/new.png' width='36' border='0'/></td></tr>";
	var article = "<tr><td><a style='text-decoration:none' href='" + path + "article.php'><font size='4'>韓華文藝</font></a><img src='image/new.png' width='36' border='0'/></td></tr>";
	var information = "<tr><td valign='center'><a style='text-decoration:none' href='" + path + "information.php'><font size='4'>韓華訊息</a></font><img src='image/new.png' width='36' border='0'/></td></tr>";
	
	
	
	document.write("<table width='800'>");
	document.write("<tr><td align='center'><br/><font style='Font: 22px Times New Roman; '>");
	document.write("今天是" + month_ch[currentTime.getMonth()] + "月" + date_ch[currentTime.getDate()-1] + "日");
	document.write("今天是 " + day_en[currentTime.getDay()] + ", " + month_en[currentTime.getMonth()] + " " + day + ", " + year);
	document.write("</td></tr></table>");
	*/
}

/* 
 this function dispaly the main menu
*/
function mainMenuLeft(path) {
	if (path == null || path.length == 0) 
		path = "./";

	var home = "<tr><td><a style='text-decoration:none' href='" + path + "index.html'><font size='4'>韓華首頁</font></a></td></tr>";
	var events = "<tr><td><a style='text-decoration:none' href='" + path + "event.php'><font size='4'>行事日曆</font></a></td></tr>";
	var newsletter = "<tr><td><a style='text-decoration:none' href='" + path + "newsletter.php'><font size='4'>聯誼會通訊</font><img src='image/new.png' width='36' border='0'/></a></td></tr>";
	var team = "<tr><td><a style='text-decoration:none' href='" + path + "team.html'><font size='4'>理監事團隊</font></a></td></tr>";
	var photo = "<tr><td><a style='text-decoration:none' href='" + path + "photo.php'><font size='4'>相簿 Photo</font><img src='image/new.png' width='36' border='0'/></a></td></tr>";
	var article = "<tr><td><a style='text-decoration:none' href='" + path + "article.php'><font size='4'>韓華文藝</font></a></td></tr>";
	var information = "<tr><td valign='center'><a style='text-decoration:none' href='" + path + "information.php'><font size='4'>韓華訊息</a></font></td></tr>";
	var video = "<tr><td><a style='text-decoration:none' href='" + path + "video.html'><font size='4'>視頻 Video</font></a></td></tr>";
	var contact = "<tr><td><a style='text-decoration:none' href='" + path + "contact.html'><font size='4'>聯絡 Contact</font></a></td></tr>";
	var pcclass = "<tr><td><a style='text-decoration:none' href='" + path + "pcclass.html'><font size='4'>電腦教室</font></a></td></tr>";
	var business = "<tr><td><a style='text-decoration:none' href='" + path + "business.html'><font size='4'>韓華工商</font></a></td></tr>";
	var link = "<tr><td><a style='text-decoration:none' href='" + path + "link.html'><font size='4'>相關網站</font></a></td></tr>";
	var health = "<tr><td><a style='text-decoration:none' href='" + path + "health.php'><font size='4'>健康與醫療</font><img src='image/new.png' width='36' border='0'/></a></td></tr>";
	var link14 = "<tr><td><a style='text-decoration:none' href='http://www.hanhwa-la.org/index14.html' target='_blank'><font size='4'>前韓華網站</font></a></td></tr>";
	
	document.write("<table width='138'>");
	document.write(home);
	document.write(events);
	document.write(newsletter);
	document.write(team);
	document.write(photo);
	document.write(article);
	document.write(information);
	document.write(health);
	document.write(video)
	document.write(contact);
	document.write(pcclass);
	document.write(business);
	document.write(link);
	document.write(link14);
	
	document.write("</table>");
}

function horizontalMenu(path) {
	if (path == null || path.length == 0) 
		path = "./";

	var style = "<style type='text/css'> a:link	{text-decoration : none;color : #FFFFFF;font-size: 18px; bold: 1;} " +
		"a:active	{text-decoration : none;color : #FFFFFF;font-size: 18px;} " +
		"a:active	{text-decoration : none;color : #FFFFFF;font-size: 18px;} " +
		"a:visited	{text-decoration : none;color : #FFFFFF;font-size: 18px; } " +
		"a:hover 	{text-decoration : underline;color : #000000;font-size: 18px;bold: 1;} " +
		"</style> ";
		
	var home = "<a href='" + path + "index.html'>韓華首頁</a> | ";
	var events = "<a href='" + path + "event.php'>行事日曆</a> | ";
	var newsletter = "<a href='" + path + "newsletter.php'>聯誼會通訊</a> | ";
	var team = "<a href='" + path + "team.html'>理監事團隊</a> | ";
	var photo = "<a href='" + path + "photo.php'>相簿 Photo</a> | ";
	var article = "<a href='" + path + "article.php'>韓華文藝</a> | ";
	var information = "<a href='" + path + "information.php'>韓華訊息</a> | ";
	var video = "<a href='" + path + "video.html'>視頻 Video</a> | ";
	var contact = "<a href='" + path + "contact.html'>聯絡 Contact</a> | ";
	var pcclass = "<a href='" + path + "pcclass.html'>電腦教室</a> | ";
	var business = "<a href='" + path + "business.html'>韓華工商</a> | ";
	var link = "<a href='" + path + "link.html'>相關網站</a>";
	
	document.write("<tr bgcolor='#6D7B8D'><td>");
	document.write(style);
	document.write(home);
	document.write(events);
	document.write(newsletter);
	document.write(team);
	document.write(photo);
	document.write(article);
	document.write(information);
	document.write(video)
	document.write(contact);
	document.write(pcclass);
	document.write(business);
	document.write(link);
	
	document.write("</td></tr>");
}


function headers(path) {
	title(path)
	document.write("<br/><br/>");
	mainMenu(path);
}

/* public
|  (1) width1 - table width
|  (2) header  - text on the right side
|  (3) color1 - color scheme
|  (4) borde1 - border width
*/
function drawFolder(width1, header, color1, border1) {
	if (header == null || header.length == 0) 
		header = "&nbsp;";
	
	if (border1 == null || header.length == 0) 
		border1 = "0"; 
	else 
		border1 = "1";
		
	var v_tabHeadBgColor = "";
	var v_tabHeadFgColor = "white";
	var v_tabBodyBgColor = "";
	
	if (color1 == "red") {
		v_tabHeadBgColor = "CC0099";
		v_tabBodyBgColor = "bgcolor=#fff0f5";
	} else if (color1 == "orange") {
		v_tabHeadBgColor = "FF9933";
		v_tabBodyBgColor = "bgcolor=seashell"; //retired #FFCC99 the color used in the logo
	} else if (color1 == "yellow") {
		v_tabHeadBgColor = "CCCC00";
		v_tabBodyBgColor = "bgcolor=#FFFFEA"; //retired #FFFFCC
		v_tabHeadFgColor = "midnightblue";
	} else if (color1 == "green") {
		v_tabHeadBgColor = "006600";
		v_tabBodyBgColor = "bgcolor=#EAFFEA"; //retired #CCFFCC
	} else if (color1 == "blue") {
		v_tabHeadBgColor = "6F99CC";
		v_tabBodyBgColor = "bgcolor=#E1F1FF";
	} else {
		v_tabHeadBgColor = "6F99CC";
		v_tabBodyBgColor = "bgcolor=" + color1;
	}
	var v_style = "'Color:" + v_tabHeadFgColor + "; background-Color:#" + v_tabHeadBgColor + "; Font:bold 14px Verdana; letter-spacing:.12 mm; height:24px; border-bottom:1px solid #000066; padding-left: 14px; padding-right: 14px'";
	var str = '<table align=left border=0 cellspacing=0 cellpadding=0 width=' + width1 + '>';
	str += '</tr><td align=left style=' + v_style + '>' + header + '</td></tr></table>';
	document.write(str);
}

