﻿var defaultRelativePath = "../"; // To define the relative path for the root folder from the current page
var enableEng = true; // To define whether we show the English button or not
var enableChi = true; // To define whether we show the Chinese button or not
var enableChs = false; // To define whether we show the Simplified Chinese button or not

//var tempStr = "";

var sectionCodes = Array();
var sections = Array();

// add a section (Level 1) to the array
function addSection(showOnMenu, showBanner, sectionCode, sectionName, sectionNameChi, sectionNameChs, sectionPath, sectionPathChi, sectionPathChs, newWindow) {
	sectionCodes[sectionCodes.length] = sectionCode;
	
	sections[sectionCode] = Array();
	sections[sectionCode]['showOnMenu'] = showOnMenu;
	sections[sectionCode]['showBanner'] = showBanner;
	sections[sectionCode]['code'] = sectionCode;
	sections[sectionCode]['name'] = sectionName;
	sections[sectionCode]['nameChi'] = sectionNameChi;
	sections[sectionCode]['nameChs'] = sectionNameChs;
	sections[sectionCode]['path'] = sectionPath;
	sections[sectionCode]['pathChi'] = sectionPathChi;
	sections[sectionCode]['pathChs'] = sectionPathChs;
	sections[sectionCode]['newWindow'] = newWindow;
	sections[sectionCode]['subSectionCodes'] = Array();
	sections[sectionCode]['subSections'] = Array();
	
//	tempStr += "addSection(" + showOnMenu + ", " + showBanner + ", \"" + sectionCode + "\", \"" + sectionName + "\", \"" + sectionNameChi + "\", \"" + sectionPath + "\", \"" + sectionPathChi + "\", " + newWindow + ");\n";
}

// add a sub section (Level 2) to the array
function addSubSection(showOnMenu, showBanner, sectionCode, subSectionCode, subSectionName, subSectionNameChi, subSectionNameChs, subSectionPath, subSectionPathChi, subSectionPathChs, newWindow) {
	currentIndex = sections[sectionCode]['subSectionCodes'].length;
	sections[sectionCode]['subSectionCodes'][currentIndex] = subSectionCode;
	
	sections[sectionCode]['subSections'][subSectionCode] = Array();
	sections[sectionCode]['subSections'][subSectionCode]['showOnMenu'] = showOnMenu;
	sections[sectionCode]['subSections'][subSectionCode]['showBanner'] = showBanner;
	sections[sectionCode]['subSections'][subSectionCode]['code'] = subSectionCode;
	sections[sectionCode]['subSections'][subSectionCode]['name'] = subSectionName;
	sections[sectionCode]['subSections'][subSectionCode]['nameChi'] = subSectionNameChi;
	sections[sectionCode]['subSections'][subSectionCode]['nameChs'] = subSectionNameChs;
	sections[sectionCode]['subSections'][subSectionCode]['path'] = subSectionPath;
	sections[sectionCode]['subSections'][subSectionCode]['pathChi'] = subSectionPathChi;
	sections[sectionCode]['subSections'][subSectionCode]['pathChs'] = subSectionPathChs;
	sections[sectionCode]['subSections'][subSectionCode]['newWindow'] = newWindow;

//	tempStr += "addSubSection(" + showOnMenu + ", " + showBanner + ", \"" + sectionCode + "\", \"" + subSectionCode + "\", \"" + subSectionName + "\", \"" + subSectionNameChi + "\", \"" + subSectionPath + "\", \"" +subSectionPathChi + "\", " + newWindow + ");\n";

}

// add all the sections and sub section to the array, so that we can have the mapping for the section / sub section name
// and also we can construct the left menu
addSection(true, true, "about_hkied", "About HKIEd", "本校簡介", "本校简介", "about_hkied/index.html", "about_hkied/index_c.html", "about_hkied/index_s.html", false);
addSubSection(true, true, "about_hkied", "presidents-welcome", "President's Welcome", "校長的話", "校长的话", "about_hkied/presidents-welcome.html", "about_hkied/presidents-welcome_c.html", "about_hkied/presidents-welcome_s", false);
addSubSection(true, true, "about_hkied", "vision-mission", "Vision &amp; Mission", "願景及使命", "愿景及使命", "about_hkied/vision-mission.html", "about_hkied/vision-mission_c.html", "about_hkied/vision-mission_s", false);
addSubSection(true, true, "about_hkied", "history", "History", "歷史", "历史", "about_hkied/history.html", "about_hkied/history_c.html", "about_hkied/history_s", false);
addSubSection(true, true, "about_hkied", "governance", " Governance", "校政", "校政", "about_hkied/governance.html", "about_hkied/governance_c.html", "about_hkied/governance_s", false);
addSubSection(true, true, "about_hkied", "management", "Management", "管理", "管理", "about_hkied/management.html", "about_hkied/management_c.html", "about_hkied/management_s", false);
addSubSection(true, true, "about_hkied", "organisation-structure", "Organisation Structure", "組織架構", "组织架构", "about_hkied/eng/", "about_hkied/trad/", "about_hkied/trad/", true);
addSubSection(true, true, "about_hkied", "institutional-publications", "Institutional Publications", "本校刊物", "本校刊物", "ciao/eng/publications.php", "ciao/trad/publications.php", "publications/index_s.html", true);
addSubSection(true, true, "about_hkied", "facts-figures", "Facts &amp; Figures", "資料及數字", "数据及数字", "facts/index.html", "facts/index_c.html", "facts/index_s.html", false);
addSubSection(true, true, "about_hkied", "campus", "Campus", "校園設施", "校园设施", "campus/index.html", "campus/index_c.html", "campus/index_s.html", false);
addSection(true, true, "programmes-faculties", "Programmes &amp; Faculties", "課程及學院", "課程及學院", "programmes-faculties/index.html", "programmes-faculties/index_c.html", "programmes-faculties/index_c.html", false);
addSubSection(true, true, "programmes-faculties", "summary-of-programs", "Summary of Programmes", "課程摘要", "課程摘要", "https://www2.ied.edu.hk/plreg/display_ied.asp", "https://www2.ied.edu.hk/plreg/display_ied.asp", "https://www2.ied.edu.hk/plreg/display_ied.asp", true);
addSubSection(true, true, "programmes-faculties", "programmes-programmes", "Admissions", "入學申請", "入學申請", "http://www.ied.edu.hk/acadprog/main.htm", "http://www.ied.edu.hk/acadprog/main.htm", "http://www.ied.edu.hk/acadprog/main.htm", true);
addSubSection(true, true, "programmes-faculties", "faculties-departments", "Faculties &amp; Departments", "學院／學系", "學院／學系", "programmes-faculties/faculties-departments.html", "programmes-faculties/faculties-departments_c.html", "programmes-faculties/faculties-departments_c.html", false);
addSubSection(true, true, "programmes-faculties", "academic-support-units", "Academic Support Units", "教學支援部門", "教學支援部門", "programmes-faculties/academic-support-units.html", "programmes-faculties/academic-support-units_c.html", "programmes-faculties/academic-support-units_c.html", false);
addSubSection(true, true, "programmes-faculties", "centres", "Centres", "中心", "中心", "research/centres.html", "research/centres_c.html", "research/centres_c.html", false);
addSection(true, true, "learn_res", "Learning Resources", "學習資源", "學習資源", "learn_res/index.html", "learn_res/index_c.html", "learn_res/index_c.html", false);
addSubSection(true, true, "learn_res", "library", "Library", "圖書館", "圖書館", "http://www.lib.ied.edu.hk/", "http://www.lib.ied.edu.hk/index_c.html", "http://www.lib.ied.edu.hk/index_c.html", true);
addSubSection(true, true, "learn_res", "information-technology", "Information Technology", "資訊科技", "資訊科技", "http://www.ied.edu.hk/its/", "http://www.ied.edu.hk/its/", "http://www.ied.edu.hk/its/", true);
addSubSection(true, true, "learn_res", "education-technology", "Education Technology", "教育科技", "教育科技", "http://www.ied.edu.hk/lttc/", "http://www.ied.edu.hk/lttc/", "http://www.ied.edu.hk/lttc/", true);
addSubSection(true, true, "learn_res", "learning-centres", "Learning Centres", "研習中心", "研習中心", "learn_res/learning-centres.html", "learn_res/learning-centres_c.html", "learn_res/learning-centres_c.html", false);
addSection(true, true, "colla_partner", "Collaboration", "協作", "協作", "colla_partner/index.html", "colla_partner/index_c.html", "colla_partner/index_c.html", false);
addSubSection(true, true, "colla_partner", "international-and-local-collaboration", "International, Mainland &amp; Local Collaboration", "國際、國內及本地協作", "國際、國內及本地協作", "colla_partner/international-and-local-collaboration.html", "colla_partner/international-and-local-collaboration_c.html", "colla_partner/international-and-local-collaboration_c.html", false);
addSubSection(true, true, "colla_partner", "school-partnership", "School Partnership", "學校協作", "學校協作", "colla_partner/school-partnership.html", "colla_partner/school-partnership_c.html", "colla_partner/school-partnership_c.html", false);
addSubSection(true, true, "colla_partner", "student-exchange", "Student Exchange", "學生交流", "學生交流", "colla_partner/student-exchange.html", "colla_partner/student-exchange_c.html", "colla_partner/student-exchange_c.html", false);
addSubSection(true, true, "colla_partner", "community-service", "Community Service", "社群服務", "社群服務", "colla_partner/community-service.html", "colla_partner/community-service_c.html", "colla_partner/community-service_c.html", false);
addSection(true, true, "research", "Research &amp; Development", "研究與發展", "研究與發展", "research/index.html", "research/index_c.html", "research/index_c.html", false);
addSubSection(true, true, "research", "centres", "Research and Development Centres", "研究與發展中心", "研究與發展中心", "research/centres.html", "research/centres_c.html", "research/centres_c.html", false);
addSubSection(true, true, "research", "repository", "Research Repository", "學術典藏", "學術典藏", "http://repository.ied.edu.hk/dspace/", "http://repository.ied.edu.hk/dspace/", "http://repository.ied.edu.hk/dspace/", true);
addSubSection(true, true, "research", "projects", "Research Projects", "研究項目", "研究項目", "http://www.ied.edu.hk/research/projects.html", "http://www.ied.edu.hk/research/projects.html", "http://www.ied.edu.hk/research/projects.html", true);
addSubSection(true, true, "research", "profile", "Senior Academic Staff Profile", "資深教授概覽", "資深教授概覽", "http://www.ied.edu.hk/academic/eng/profile.php", "http://www.ied.edu.hk/academic/trad/profile.php", "http://www.ied.edu.hk/academic/trad/profile.php", true);
addSubSection(true, true, "research", "fprofile", "Faculty Academic Staff Profile", "教學人員概覽", "教學人員概覽", "https://oraas0.ied.edu.hk/rich/web/search_acad_staff.jsp", "https://oraas0.ied.edu.hk/rich/web/search_acad_staff.jsp", "https://oraas0.ied.edu.hk/rich/web/search_acad_staff.jsp", true);
addSection(true, true, "donation", "Donation", "捐贈", "捐贈", "donation/index.html", "donation/index_c.html", "donation/index_c.html", false);
addSubSection(true, true, "donation", "donation-sponsorship", "Donation &amp; Sponsorship", "捐贈及資助", "捐贈及資助", "http://www.ied.edu.hk/ciao/eng/donation_home.php", "http://www.ied.edu.hk/ciao/trad/donation_home.php", "http://www.ied.edu.hk/ciao/trad/donation_home.php", true);
addSection(false, false, "general", "", "", "", "", "", "", false);
addSubSection(false, false, "general", "privacy-policy", "Privacy Policy", "私隱政策聲明", "私隱政策聲明", "p_policy/index.html", "p_policy/index_c.html", "p_policy/index_c.html", false);
addSubSection(false, false, "general", "site-map", "Site Map", "網頁指南", "網頁指南", "general/site-map.html", "general/site-map_c.html", "general/site-map_c.html", false);
addSubSection(false, false, "general", "contact-us", "Contact Us", "聯絡我們", "聯絡我們", "contact/index.html", "contact/index_c.html", "contact/index_c.html", false);
addSubSection(false, false, "general", "disclaimer", "Disclaimer &amp; Copyright", "免責聲明及版權", "免責聲明及版權", "general/disclaimer.html", "general/disclaimer_c.html", "general/disclaimer_c.html", false);

addSubSection(false, false, "general", "disclaimer-copyright", "Disclaimer &amp; Copyright", "免責聲明及版權", "免責聲明及版權", "general/disclaimer.html", "general/disclaimer_c.html", "general/disclaimer_c.html", false);
addSubSection(false, false, "general", "jobs", "Jobs", "職位空缺", "職位空缺", "jobsopp/index.html", "jobsopp/index_c.html", "jobsopp/index_c.html", false);
addSubSection(false, false, "general", "fair-trade", "Fair Trade", "公平貿易工作間", "公平貿易工作間", "general/fair-trade.html", "general/fair-trade_c.html", "general/fair-trade_c.html", false);

addSubSection(false, false, "general", "project-links", "Project Links", "項目及計劃", "項目及計劃", "general/project-links.html", "general/project-links_c.html", "general/project-links_c.html", false);
addSection(false, false, "alumni", "Alumni", "Alumni", "Alumni", "alumni/index.html", "alumni/index_c.html", "alumni/index_c.html", false);
addSection(false, true, "334", "334 Academic Reform", "三三四學制改革", "三三四學制改革", "334/index.html", "334/index_c.html", "334/index_c.html", false);
addSection(false, true, "gallery_achievement", "Gallery of Achievements", "卓越篇", "卓越篇", "gallery_achievement/index.html", "gallery_achievement/index_c.html", "gallery_achievement/index_c.html", false);
addSection(false, true, "honorary", "Honorary Doctorate Conferment", "頒授榮譽博士", "頒授榮譽博士", "honorary/index.html", "honorary/index_c.html", "honorary/index_c.html", false);
addSection(false, true, "fellowship", "Honorary Fellowship Conferment", "頒授榮譽院士", "頒授榮譽院士", "fellowship/index.html", "fellowship/index_c.html", "fellowship/index_c.html", false);
addSection(false, false, "pro_student", "Prospective Students", "Prospective Students", "Prospective Students", "pro_student/index.html", "pro_student/index_c.html", "pro_student/index_c.html", false);
addSection(false, false, "cse", "Search", "Search", "Search", "", "", "", false);
addSection(false, false, "directory", "Directory", "Directory", "Directory", "", "", "", false);
addSection(false, false, "news", "News &amp; Events", "新聞及活動", "新聞及活動", "news/index.html", "news/index_c.html", "news/index_c.html", false);
addSubSection(false, false, "news", "events-2008", "Events", "活動", "活動", "", "", "", true);
addSubSection(false, false, "news", "2008", "News", "新聞", "新聞", "", "", "", true);
addSubSection(false, false, "news", "2007", "News", "新聞", "新聞", "", "", "", true);
addSubSection(false, false, "news", "2006", "News", "新聞", "新聞", "", "", "", true);

// write the logo
function writeLogo(relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}
var str = "<span><a href=\"" + relativePath + "index.html\"><img src=\"" + relativePath + "images/logo.gif\" border=\"0\" /></a></span>";
document.write(str);	
}
function writeLogoChi(relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}
var str = "<span><a href=\"" + relativePath + "index_c.html\"><img src=\"" + relativePath + "images/logo.gif\" border=\"0\" /></a></span>";
document.write(str);	
}
function writeLogoChs(relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}
var str = "<span><a href=\"" + relativePath + "index_s.html\"><img src=\"" + relativePath + "images/logo.gif\" border=\"0\" /></a></span>";
document.write(str);	
}

function writeLeft(section, subSection, relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}
var str = "";

str = "<div id=\"left\">";
document.write(str);
writeLogo(relativePath);
str = "";
	for (i = 0; i < sectionCodes.length; i++) {
		sectionCode = sectionCodes[i];
		
		if (sections[sectionCode]['showOnMenu']) {
			path = sections[sectionCode]['path'];
			if (!path.match(/^http:\/\//) && !path.match(/^https:\/\//)) {
				path = relativePath + path;
			}
			
			otherAttribute = "";
			if (sections[sectionCode]['newWindow']) {
				otherAttribute = " target=\"_blank\"";
			}

			if (sectionCode == section) {

str += "    <div id=\"nav\"><a href=\"" + path + "\"" + otherAttribute + ">" + sections[sectionCode]['name'] + "</a></div>";
str += "    <div id=\"nav_1\">";
str += "      <ul>";
				
				subSectionCodes = sections[sectionCode]['subSectionCodes'];
				subSections = sections[sectionCode]['subSections'];
				for (j = 0; j < subSectionCodes.length; j++) {
					subSectionCode = subSectionCodes[j];

					if (subSections[subSectionCode]['showOnMenu']) {
						path = subSections[subSectionCode]['path'];

						if (!path.match(/^http:\/\//) && !path.match(/^https:\/\//)) {
							path = relativePath + path;
						}

						otherAttribute = "";
						if (subSections[subSectionCode]['newWindow']) {
							otherAttribute = " target=\"_blank\"";
						}

						if (subSectionCode == subSection) {
str += "        <li id=\"current_menu_item\" class=\"selected\" onmouseover=\"highlightMenu(this);\" onmouseout=\"cancelHighlightMenu(this);\"><a href=\"" + path + "\"" + otherAttribute + ">" + subSections[subSectionCode]['name'] + "</a></li>";
						} else {
str += "        <li onmouseover=\"highlightMenu(this);\" onmouseout=\"cancelHighlightMenu(this);\"><a href=\"" + path + "\"" + otherAttribute + ">" + subSections[subSectionCode]['name'] + "</a></li>";
						}
					}
				}
str += "      </ul>";
str += "    </div>";
	
			} else {
str += "    <div id=\"nav_2\"><ul><li><a href=\"" + path + "\"" + otherAttribute + ">" + sections[sectionCode]['name'] + "</a></li></ul></div>";
			}
		}
	}

str += "    <div id=\"blueprint\">&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://www.ied.edu.hk/sp2009-12/\" target=\"_blank\"><img src=\"" + relativePath + "images/sp_eng_icon.jpg\" width=\"157\" height=\"51\" border=\"0\"/></a></div>";
str += "  </div>";
document.write(str);

}

function writeLeftChi(section, subSection, relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}
var str = "";

str = "<div id=\"left\">";
document.write(str);
writeLogoChi(relativePath);
str = "";
	for (i = 0; i < sectionCodes.length; i++) {
		sectionCode = sectionCodes[i];
		
		if (sections[sectionCode]['showOnMenu']) {
			path = sections[sectionCode]['pathChi'];
			if (!path.match(/^http:\/\//) && !path.match(/^https:\/\//)) {
				path = relativePath + path;
			}
			
			otherAttribute = "";
			if (sections[sectionCode]['newWindow']) {
				otherAttribute = " target=\"_blank\"";
			}

			if (sectionCode == section) {

str += "    <div id=\"nav\"><a href=\"" + path + "\"" + otherAttribute + ">" + sections[sectionCode]['nameChi'] + "</a></div>";
str += "    <div id=\"nav_1\">";
str += "      <ul>";
				
				subSectionCodes = sections[sectionCode]['subSectionCodes'];
				subSections = sections[sectionCode]['subSections'];
				for (j = 0; j < subSectionCodes.length; j++) {
					subSectionCode = subSectionCodes[j];

					if (subSections[subSectionCode]['showOnMenu']) {
						path = subSections[subSectionCode]['pathChi'];

						if (!path.match(/^http:\/\//) && !path.match(/^https:\/\//)) {
							path = relativePath + path;
						}

						otherAttribute = "";
						if (subSections[subSectionCode]['newWindow']) {
							otherAttribute = " target=\"_blank\"";
						}

						if (subSectionCode == subSection) {
str += "        <li id=\"current_menu_item\" class=\"selected\" onmouseover=\"highlightMenu(this);\" onmouseout=\"cancelHighlightMenu(this);\"><a href=\"" + path + "\"" + otherAttribute + ">" + subSections[subSectionCode]['nameChi'] + "</a></li>";
						} else {
str += "        <li onmouseover=\"highlightMenu(this);\" onmouseout=\"cancelHighlightMenu(this);\"><a href=\"" + path + "\"" + otherAttribute + ">" + subSections[subSectionCode]['nameChi'] + "</a></li>";
						}
					}
				}
str += "      </ul>";
str += "    </div>";
	
			} else {
str += "    <div id=\"nav_2\"><ul><li><a href=\"" + path + "\"" + otherAttribute + ">" + sections[sectionCode]['nameChi'] + "</a></li></ul></div>";
			}
		}
	}

str += "    <div id=\"blueprint\">&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://www.ied.edu.hk/sp2009-12/\" target=\"_blank\"><img src=\"" + relativePath + "images/sp_chi_icon.jpg\" width=\"157\" height=\"51\" border=\"0\"/></a></div>";

str += "  </div>";
document.write(str);

}

function writeLeftChs(section, subSection, relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}
var str = "";

str = "<div id=\"left\">";
document.write(str);
writeLogoChs(relativePath);
str = "";
	for (i = 0; i < sectionCodes.length; i++) {
		sectionCode = sectionCodes[i];
		
		if (sections[sectionCode]['showOnMenu']) {
			path = sections[sectionCode]['pathChs'];
			if (!path.match(/^http:\/\//) && !path.match(/^https:\/\//)) {
				path = relativePath + path;
			}
			
			otherAttribute = "";
			if (sections[sectionCode]['newWindow']) {
				otherAttribute = " target=\"_blank\"";
			}

			if (sectionCode == section) {

str += "    <div id=\"nav\"><a href=\"" + path + "\"" + otherAttribute + ">" + sections[sectionCode]['nameChs'] + "</a></div>";
str += "    <div id=\"nav_1\">";
str += "      <ul>";
				
				subSectionCodes = sections[sectionCode]['subSectionCodes'];
				subSections = sections[sectionCode]['subSections'];
				for (j = 0; j < subSectionCodes.length; j++) {
					subSectionCode = subSectionCodes[j];

					if (subSections[subSectionCode]['showOnMenu']) {
						path = subSections[subSectionCode]['pathChs'];

						if (!path.match(/^http:\/\//) && !path.match(/^https:\/\//)) {
							path = relativePath + path;
						}

						otherAttribute = "";
						if (subSections[subSectionCode]['newWindow']) {
							otherAttribute = " target=\"_blank\"";
						}

						if (subSectionCode == subSection) {
str += "        <li id=\"current_menu_item\" class=\"selected\" onmouseover=\"highlightMenu(this);\" onmouseout=\"cancelHighlightMenu(this);\"><a href=\"" + path + "\"" + otherAttribute + ">" + subSections[subSectionCode]['nameChs'] + "</a></li>";
						} else {
str += "        <li onmouseover=\"highlightMenu(this);\" onmouseout=\"cancelHighlightMenu(this);\"><a href=\"" + path + "\"" + otherAttribute + ">" + subSections[subSectionCode]['nameChs'] + "</a></li>";
						}
					}
				}
str += "      </ul>";
str += "    </div>";
	
			} else {
str += "    <div id=\"nav_2\"><ul><li><a href=\"" + path + "\"" + otherAttribute + ">" + sections[sectionCode]['nameChs'] + "</a></li></ul></div>";
			}
		}
	}

str += "    <div id=\"blueprint\"><a href=\"http://www.ied.edu.hk/news/hot/index_s.html\" target=\"_blank\"><img src=\"" + relativePath + "images/blueprint01_s.gif\" width=\"157\" height=\"51\" border=\"0\"/></a></div>";
str += "  </div>";
document.write(str);

}

function writeHeader(relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}
var str = "";
str += "    <div id=\"top_line\"><img src=\"" + relativePath + "images/top_line.gif\" /></div>";
str += "    <div id=\"nav_home\" align=\"right\">";
str += "      <ul>";
str += "        <li class=\"top_nav\"><a href=\"" + relativePath + "index.html\">Home</a></li>";
str += "        <li class=\"top_nav\"><a href=\"/apps/prog/comdir/publiccomdir.jsp\" target=\"_blank\">Directory</a></li>";
str += "        <li class=\"top_nav\"><a href=\"/cse/\" target=\"_blank\">Search</a></li>";
str += "        <li class=\"top_nav\"><a href=\"https://my.ied.edu.hk/\" target=\"_blank\">MyIEd</a></li>";
if (enableChi) {
str += "        <li class=\"top_nav\"><span><a href=\"javascript:verPathConvert()\">中文</a></span></li>";
}
if (enableChs) {
str += "        <li class=\"top_nav\"><span><a href=\"javascript:verPathConvert()\">簡體</a></span></li>";
}
str += "      </ul>";
str += "    </div>";
document.write(str);
}
function writeHeaderChi(relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}
var str = "";
str += "    <div id=\"top_line\"><img src=\"" + relativePath + "images/top_line.gif\" /></div>";
str += "    <div id=\"nav_home\" align=\"right\">";
str += "      <ul>";
str += "        <li class=\"top_nav\"><a href=\"" + relativePath + "index_c.html\">主頁</a></li>";
str += "        <li class=\"top_nav\"><a href=\"/apps/prog/comdir/publiccomdir.jsp\" target=\"_blank\">教職員通訊錄</a></li>";
str += "        <li class=\"top_nav\"><a href=\"/cse/\" target=\"_blank\">搜尋</a></li>";
str += "        <li class=\"top_nav\"><a href=\"https://my.ied.edu.hk/\" target=\"_blank\">內聯網</a></li>";
if (enableEng) {
str += "        <li class=\"top_nav\"><a href=\"javascript:verPathConvert()\">English</a></li>";
}
if (enableChs) {
str += "        <li class=\"top_nav\"><span><a href=\"javascript:verPathConvert()\">簡體</a></span></li>";
}
str += "      </ul>";
str += "    </div>";
document.write(str);
}
function writeHeaderChs(relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}
var str = "";
str += "    <div id=\"top_line\"><img src=\"" + relativePath + "images/top_line.gif\" /></div>";
str += "    <div id=\"nav_home\" align=\"right\">";
str += "      <ul>";
str += "        <li class=\"top_nav\"><a href=\"" + relativePath + "index_s.html\">主页</a></li>";
str += "        <li class=\"top_nav\"><a href=\"/apps/prog/comdir/publiccomdir.jsp\" target=\"_blank\">教职员通讯簿</a></li>";
str += "        <li class=\"top_nav\"><a href=\"/cse/\" target=\"_blank\">搜寻</a></li>";
str += "        <li class=\"top_nav\"><a href=\"https://my.ied.edu.hk/\" target=\"_blank\">内联网</a></li>";
if (enableEng) {
str += "        <li class=\"top_nav\"><a href=\"javascript:verPathConvert()\">English</a></li>";
}
if (enableChi) {
str += "        <li class=\"top_nav\"><span><a href=\"javascript:verPathConvert()\">中文</a></span></li>";
}
str += "      </ul>";
str += "    </div>";
document.write(str);
}

function writeTop(section, subSection, relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}

	writeHeader(relativePath);
	if (sections[section]['showBanner']) {
var str = "";
str += "    <div id=\"banner\">";
str += "      <script type=\"text/javascript\">";
str += "AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','695','height','170','src','" + relativePath + section + "/images/top-" + section + "','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','" + relativePath + section + "/images/top-" + section + "' ); //end AC code";
str += "</script>";
str += "      <noscript>";
str += "      <object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"695\" height=\"170\">";
str += "        <param name=\"movie\" value=\"" + relativePath + section + "/images/top-" + section + ".swf\" />";
str += "        <param name=\"quality\" value=\"high\" />";
str += "        <embed src=\"" + relativePath + section + "/images/top-" + section + ".swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"695\" height=\"170\"></embed>";
str += "      </object>";
str += "      </noscript>";
str += "    </div>";
document.write(str);
	}

}
function writeTopChi(section, subSection, relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}

	writeHeaderChi(relativePath);
	if (sections[section]['showBanner']) {
var str = "";
str += "    <div id=\"banner\">";
str += "      <script type=\"text/javascript\">";
str += "AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','695','height','170','src','" + relativePath + section + "/images/top-" + section + "_c','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','" + relativePath + section + "/images/top-" + section + "_c' ); //end AC code";
str += "</script>";
str += "      <noscript>";
str += "      <object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"695\" height=\"170\">";
str += "        <param name=\"movie\" value=\"" + relativePath + section + "/images/top-" + section + "_c.swf\" />";
str += "        <param name=\"quality\" value=\"high\" />";
str += "        <embed src=\"" + relativePath + section + "/images/top-" + section + "_c.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"695\" height=\"170\"></embed>";
str += "      </object>";
str += "      </noscript>";
str += "    </div>";
document.write(str);
	}

}
function writeTopChs(section, subSection, relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}

	writeHeaderChs(relativePath);
	if (sections[section]['showBanner']) {
var str = "";
str += "    <div id=\"banner\">";
str += "      <script type=\"text/javascript\">";
str += "AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','695','height','170','src','" + relativePath + section + "/images/top-" + section + "_s','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','" + relativePath + section + "/images/top-" + section + "_s' ); //end AC code";
str += "</script>";
str += "      <noscript>";
str += "      <object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"695\" height=\"170\">";
str += "        <param name=\"movie\" value=\"" + relativePath + section + "/images/top-" + section + "_s.swf\" />";
str += "        <param name=\"quality\" value=\"high\" />";
str += "        <embed src=\"" + relativePath + section + "/images/top-" + section + "_s.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"695\" height=\"170\"></embed>";
str += "      </object>";
str += "      </noscript>";
str += "    </div>";
document.write(str);
	}

}


function writeFooterLinks(relativePath) {
var str = "";
str += "    <ul class=\"footer_links\">";
str += "      <li><a href=\"" + relativePath + "p_policy/index.html\">Privacy Policy</a></li>";
str += "      <li class=\"separator\">|</li>";
str += "      <li><a href=\"" + relativePath + "general/site-map.html\">Site map</a></li>";
str += "      <li class=\"separator\">|</li>";
str += "      <li><a href=\"" + relativePath + "contact/index.html\">Contact Us</a></li>";
str += "      <li class=\"separator\">|</li>";
str += "      <li><a href=\"" + relativePath + "general/disclaimer.html#disclaimer\">Disclaimer</a></li>";
str += "      <li class=\"separator\">|</li>";
str += "      <li><a href=\"" + relativePath + "general/disclaimer.html#copyright\">Copyright</a></li>";
str += "    </ul>";
document.write(str);
}
function writeFooter(relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}

var str = "";
str = "  <div id=\"bottom\">";
document.write(str);
writeFooterLinks(relativePath);
str = "  </div>";
document.write(str);

//document.write("<pre>");
//document.write(tempStr);
//document.write("/<pre>");

}

function writeFooterLinksChi(relativePath) {
var str = "";
str += "    <ul class=\"footer_links\">";
str += "      <li><a href=\"" + relativePath + "p_policy/index_c.html\">私隱政策聲明</a></li>";
str += "      <li class=\"separator\">|</li>";
str += "      <li><a href=\"" + relativePath + "general/site-map_c.html\">網頁指南</a></li>";
str += "      <li class=\"separator\">|</li>";
str += "      <li><a href=\"" + relativePath + "contact/index_c.html\">聯絡我們</a></li>";
str += "      <li class=\"separator\">|</li>";
str += "      <li><a href=\"" + relativePath + "general/disclaimer_c.html#disclaimer\">免責聲明</a></li>";
str += "      <li class=\"separator\">|</li>";
str += "      <li><a href=\"" + relativePath + "general/disclaimer_c.html#copyright\">版權</a></li>";
str += "    </ul>";
document.write(str);
}
function writeFooterChi(relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}

var str = "";
str = "  <div id=\"bottom\">";
document.write(str);
writeFooterLinksChi(relativePath);
str = "  </div>";
document.write(str);
}


function writeFooterLinksChs(relativePath) {
var str = "";
str += "    <ul class=\"footer_links\">";
str += "      <li><a href=\"" + relativePath + "p_policy/index_s.html\">私隐政策声明</a></li>";
str += "      <li class=\"separator\">|</li>";
str += "      <li><a href=\"" + relativePath + "general/site-map_s.html\">网页指南</a></li>";
str += "      <li class=\"separator\">|</li>";
str += "      <li><a href=\"" + relativePath + "contact/index_s.html\">联络我们</a></li>";
str += "      <li class=\"separator\">|</li>";
str += "      <li><a href=\"" + relativePath + "general/disclaimer_s.html#disclaimer\">免责声明</a></li>";
str += "      <li class=\"separator\">|</li>";
str += "      <li><a href=\"" + relativePath + "general/disclaimer_s.html#copyright\">版权</a></li>";
str += "    </ul>";
document.write(str);
}
function writeFooterChs(relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}

var str = "";
str = "  <div id=\"bottom\">";
document.write(str);
writeFooterLinksChs(relativePath);
str = "  </div>";
document.write(str);
}

function writeNav(section, subSection, relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}

var str = "";
str += "<div id=\"nav_bar\">";
if (subSection != "") {
if (sections[section]['path'] != "") {
str += "<span class=\"title\">" + sections[section]['subSections'][subSection]['name'] + "</span> <span id=\"navigation_bar\"><a href=\"" + relativePath + "index.html\">Home</a> &gt; <a href=\"" + relativePath + sections[section]['path'] + "\">" + sections[section]['name'] + "</a> &gt; " + sections[section]['subSections'][subSection]['name'] + "</span>";
} else {
str += "<span class=\"title\">" + sections[section]['subSections'][subSection]['name'] + "</span> <span id=\"navigation_bar\"><a href=\"" + relativePath + "index.html\">Home</a> &gt; " + sections[section]['subSections'][subSection]['name'] + "</span>";
}
} else {
str += "<span class=\"title\">" + sections[section]['name'] + "</span> <span id=\"navigation_bar\"><a href=\"" + relativePath + "index.html\">Home</a> &gt; " + sections[section]['name'] + "</span>";
}
str += "</div>";
str += "<div class=\"line_img_left\"><img src=\"" + relativePath + "images/spacer.gif\" /></div>";
document.write(str);
}

function writeNavChi(section, subSection, relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}

var str = "";
str += "<div id=\"nav_bar\">";
if (subSection != "") {
if (sections[section]['pathChi'] != "") {
str += "<span class=\"title\">" + sections[section]['subSections'][subSection]['nameChi'] + "</span> <span id=\"navigation_bar\"><a href=\"" + relativePath + "index_c.html\">主頁</a> &gt; <a href=\"" + relativePath + sections[section]['pathChi'] + "\">" + sections[section]['nameChi'] + "</a> &gt; " + sections[section]['subSections'][subSection]['nameChi'] + "</span>";
} else {
str += "<span class=\"title\">" + sections[section]['subSections'][subSection]['nameChi'] + "</span> <span id=\"navigation_bar\"><a href=\"" + relativePath + "index_c.html\">主頁</a> &gt; " + sections[section]['subSections'][subSection]['nameChi'] + "</span>";
}
} else {
str += "<span class=\"title\">" + sections[section]['nameChi'] + "</span> <span id=\"navigation_bar\"><a href=\"" + relativePath + "index_c.html\">主頁</a> &gt; " + sections[section]['nameChi'] + "</span>";
}
str += "</div>";
str += "<div class=\"line_img_left\"><img src=\"" + relativePath + "images/spacer.gif\" /></div>";
document.write(str);
}

function writeNavChs(section, subSection, relativePath) {
	if (relativePath == null) {
		relativePath = defaultRelativePath;
	}

var str = "";
str += "<div id=\"nav_bar\">";
if (subSection != "") {
if (sections[section]['pathChs'] != "") {
str += "<span class=\"title\">" + sections[section]['subSections'][subSection]['nameChs'] + "</span> <span id=\"navigation_bar\"><a href=\"" + relativePath + "index_s.html\">主页</a> &gt; <a href=\"" + relativePath + sections[section]['pathChs'] + "\">" + sections[section]['nameChs'] + "</a> &gt; " + sections[section]['subSections'][subSection]['nameChs'] + "</span>";
} else {
str += "<span class=\"title\">" + sections[section]['subSections'][subSection]['nameChs'] + "</span> <span id=\"navigation_bar\"><a href=\"" + relativePath + "index_s.html\">主页</a> &gt; " + sections[section]['subSections'][subSection]['nameChs'] + "</span>";
}
} else {
str += "<span class=\"title\">" + sections[section]['nameChs'] + "</span> <span id=\"navigation_bar\"><a href=\"" + relativePath + "index_s.html\">主页</a> &gt; " + sections[section]['nameChs'] + "</span>";
}
str += "</div>";
str += "<div class=\"line_img_left\"><img src=\"" + relativePath + "images/spacer.gif\" /></div>";
document.write(str);
}


function getCopyright(lang) {
	
	var str;
	if (navigator.appName == "Netscape" && navigator.appVersion < "5" &&
  	      navigator.appVersion.lastIndexOf('Win16') > -1) {
        	d = new Date();
	} else {
        	d = new Date(document.lastModified);
        	var yy = d.getYear();
        	if (yy < 80) d = new Date();
	};
	var yy = d.getYear();
	if (yy < 1000) yy+=1900;
	mm = d.getMonth() + 1;
	
	if (lang == "eng") {
		if (mm == 1) { mon = "January"; }
		if (mm == 2) { mon = "February"; }
		if (mm == 3) { mon = "March"; }
		if (mm == 4) { mon = "April"; }
		if (mm == 5) { mon = "May"; }
		if (mm == 6) { mon = "June"; }
		if (mm == 7) { mon = "July"; }
		if (mm == 8) { mon = "August"; }
		if (mm == 9) { mon = "September"; }
		if (mm == 10) { mon = "October"; }
		if (mm == 11) { mon = "November"; }
		if (mm == 12) { mon = "December"; }
		dd = d.getDate();
		date = dd + " " + mon + " " + yy;
		
		str = '<font size="1" face="Arial, Helvetica, sans-serif" color="#7F7F7F">';
		str += 'Last Revised: ';
		str += date;
		str += '</font>';
		return str;
	}
	else {
		if (mm == 1) { mon = "1月"; }
		if (mm == 2) { mon = "2月"; }
		if (mm == 3) { mon = "3月"; }
		if (mm == 4) { mon = "4月"; }
		if (mm == 5) { mon = "5月"; }
		if (mm == 6) { mon = "6月"; }
		if (mm == 7) { mon = "7月"; }
		if (mm == 8) { mon = "8月"; }
		if (mm == 9) { mon = "9月"; }
		if (mm == 10) { mon = "10月"; }
		if (mm == 11) { mon = "11月"; }
		if (mm == 12) { mon = "12月"; }
		dd = d.getDate();
		date = yy + "年 " + mon + " " + dd + "日";
		
		str = '<font class="modiftyDateC" color="#7F7F7F">';
		str += '更新日期 : ';
		str += date;
		str += '</font>';
	
		return str;
	}
}

function highlightMenu(menuItem) {
	var current_menu_item = document.getElementById("current_menu_item");
	if (current_menu_item != null) {
		current_menu_item.className = '';
	}
	menuItem.className='highlight';
}
function cancelHighlightMenu(menuItem) {
	menuItem.className='';
	var current_menu_item = document.getElementById("current_menu_item");
	if (current_menu_item != null) {
		current_menu_item.className = 'selected';
	}
}



function gotonews(year) {
	location.href = year + ".html";
}
function gotoevent(year) {
	location.href = "events-" + year + ".html";
}

//if (pageSubSection == 'events') {
//str += "        <option value=\"events\" selected=\"selected\">Events</option>";
//} else {
//str += "        <option value=\"events\">Events</option>";
//}

function writeNewsTab() {
	var str = "";
str += "  <table id=\"news_tab\"><tr><td>";
str += "<select onchange=\"gotonews(this.value)\">";
for (i = 2008; i >= 2006; i--) {
		if (parseInt(pageSubSection) == i) {
str += "        <option value=\"" + i + "\" selected=\"selected\">" + i + "</option>";
		} else {
str += "        <option value=\"" + i + "\">" + i + "</option>";
		}
	}
str += "</select>";
str += "	<p><span><img src=\"images/news_on.gif\" /></span><span><a href=\"events.html\"><img src=\"images/events_off.gif\" border=\"0\" /></a></span></p>";
str += "  </tr></td></table>";
	document.write(str);
}

function writeNewsTabChi() {
	var str = "";
str += "  <table id=\"news_tab\"><tr><td>";
str += "<select onchange=\"gotonews(this.value + '_c')\">";
for (i = 2008; i >= 2006; i--) {
		if (parseInt(pageSubSection) == i) {
str += "        <option value=\"" + i + "\" selected=\"selected\">" + i + "</option>";
		} else {
str += "        <option value=\"" + i + "\">" + i + "</option>";
		}
	}
str += "</select>";
str += "	<p><span><img src=\"images/news_on_c.gif\" /></span><span><a href=\"events_c.html\"><img src=\"images/events_off_c.gif\" border=\"0\" /></a></span></p>";
str += "  </tr></td></table>";
	document.write(str);
}

function writeNewsTabChs() {
	var str = "";
str += "  <table id=\"news_tab\"><tr><td>";
str += "<select onchange=\"gotonews(this.value + '_s')\">";
for (i = 2008; i >= 2006; i--) {
		if (parseInt(pageSubSection) == i) {
str += "        <option value=\"" + i + "\" selected=\"selected\">" + i + "</option>";
		} else {
str += "        <option value=\"" + i + "\">" + i + "</option>";
		}
	}
str += "</select>";
str += "	<p><span><img src=\"images/news_on_s.gif\" /></span><span><a href=\"events_s.html\"><img src=\"images/events_off_s.gif\" border=\"0\" /></a></span></p>";
str += "  </tr></td></table>";
	document.write(str);
}



function writeEventTab() {
	var str = "";

str += "  <table id=\"news_tab\"><tr><td>";
	var tempPageSection = "";
	if (pageSubSection.length > "events-".length) {
		tempPageSection = pageSubSection.substring("events-".length);
	}
str += "<select onchange=\"gotoevent(this.value)\">";
for (i = 2008; i >= 2008; i--) {
		if (parseInt(tempPageSection) == i) {
str += "        <option value=\"" + i + "\" selected=\"selected\">" + i + "</option>";
		} else {
str += "        <option value=\"" + i + "\">" + i + "</option>";
		}
	}
str += "</select>";
str += "	<p><span><a href=\"index.html\"><img src=\"images/news_off.gif\" border=\"0\" /></a></span><span><img src=\"images/events_on.gif\" /></span></p>";
str += "  </tr></td></table>";
	document.write(str);
}

function writeEventTabChi() {
	var str = "";

str += "  <table id=\"news_tab\"><tr><td>";
	var tempPageSection = "";
	if (pageSubSection.length > "events-".length) {
		tempPageSection = pageSubSection.substring("events-".length);
	}
str += "<select onchange=\"gotoevent(this.value + '_c')\">";
for (i = 2008; i >= 2008; i--) {
		if (parseInt(tempPageSection) == i) {
str += "        <option value=\"" + i + "\" selected=\"selected\">" + i + "</option>";
		} else {
str += "        <option value=\"" + i + "\">" + i + "</option>";
		}
	}
str += "</select>";
str += "	<p><span><a href=\"index_c.html\"><img src=\"images/news_off_c.gif\" border=\"0\" /></a></span><span><img src=\"images/events_on_c.gif\" /></span></p>";
str += "  </tr></td></table>";
	document.write(str);
}

function writeEventTabChs() {
	var str = "";

str += "  <table id=\"news_tab\"><tr><td>";
	var tempPageSection = "";
	if (pageSubSection.length > "events-".length) {
		tempPageSection = pageSubSection.substring("events-".length);
	}
str += "<select onchange=\"gotoevent(this.value + '_s')\">";
for (i = 2008; i >= 2008; i--) {
		if (parseInt(tempPageSection) == i) {
str += "        <option value=\"" + i + "\" selected=\"selected\">" + i + "</option>";
		} else {
str += "        <option value=\"" + i + "\">" + i + "</option>";
		}
	}
str += "</select>";
str += "	<p><span><a href=\"index_s.html\"><img src=\"images/news_off_s.gif\" border=\"0\" /></a></span><span><img src=\"images/events_on_s.gif\" /></span></p>";
str += "  </tr></td></table>";
	document.write(str);
}


function verPathConvert() {
	var url_full = new String(window.location);
	var url_length = url_full.length;
	var tmp_url;
	var new_url;

	var arc_url;
	var arcSyb = 0;
	var i=0;

	
	for (i=url_length; i> 0; i--)
	{
		if (url_full.substring(i, i-1) == '#' ) {
			arcSyb = 1;
			break;
		}
	}
	
	if (!arcSyb) {
		tmp_url= url_full.substring(0, url_length-5);
		ver_url= url_full.substring(url_length-7, url_length);

			if (ver_url == "_c.html")
				tmp_url= url_full.substring(0, url_length-7) + ".html";
			else {
				if (url_full.substring(url_length-1) == '/') {
					tmp_url = url_full + "index_c.html";
				}
				else {
					tmp_url = tmp_url + "_c.html";
				}
			}
	}
	else {
		
		if (url_full.substring(url_length-1, url_length) == "#") {
			tmp_url= url_full.substring(0, url_length-5);
			ver_url= url_full.substring(url_length-7, url_length);
			
			if (ver_url == "c.html#") {
				tmp_url= url_full.substring(0, url_length-8) + ".html";
			}
			else {
				if (url_full.substring(url_length-2, url_length-1) == '/') {
					tmp_url = url_full.substring(0, url_length-1) + "index_c.html";
				}
				else {
					tmp_url = url_full.substring(0, url_length-6) + "_c.html";
				}
			}
		}
		else {
			arc_url = url_full.substring(i-1, url_length);
			tmp_url = url_full.substring(0, i-1);
			ver_url = tmp_url.substring(tmp_url.length -7, tmp_url.length);
			
			//alert(arc_url);
			//alert(tmp_url);
			//alert(ver_url);
			//alert(tmp_url.substring(0, tmp_url.length- 7));
			
			if (ver_url == "_c.html") {
				tmp_url = tmp_url.substring(0, tmp_url.length- 7) + ".html" + arc_url;
			}
			else {

				if (tmp_url.substring(tmp_url.length-1) == '/') {
					tmp_url = tmp_url + "index_c.html" + arc_url;
				}
				else {
					tmp_url = tmp_url.substring(0, tmp_url.length- 5) + "_c.html" + arc_url;
				}

			}
	

		}
	}
	
	window.location = tmp_url;
}

function issueAjaxRequest(url, hander) {
	var req = false;
	if (window.XMLHttpRequest) {// if Mozilla, Safari etc
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) { // if IE
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");

		} catch (e) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
			}
		}
	} else {
		return false;
	}

	req.onreadystatechange = function() {
		if (req.readyState == 4 && req.status == 200) {
			hander(req);
		}
	}
	try {
		req.open('GET', url, true);
		req.send(null);
	} catch (e) {
	}


}


timer=null;
function newsScroll(step){ 
	document.getElementById("news_box").scrollTop += step;
	timer=setTimeout("newsScroll("+step+")",64) 
} 

function clearNewsScroll(){ 
	clearTimeout(timer) 
}

function bannerScroll(step){ 
	document.getElementById("quick_link_icons").scrollTop += step;
	timer=setTimeout("bannerScroll("+step+")",64) 
} 

function clearBannerScroll(){ 
	clearTimeout(timer) 
}

