// variables to keep tabs on the current page
var	pages = new Array(),
	main_group,
	submenu_group,
	submenu_marker,
	selected_page,
	lc_selected_page,
	regexp = /\s+/g;

// constant array that store the names of main menu options
// don't change these values, if more main menu options,　這裡不能改噢
// remember to add them here
var	main_menu_A = new Array();
	main_menu_A[0] = "Company",
	main_menu_A[1] = "Products",
	main_menu_A[2] = "Solutions",
//	main_menu_A[3] = "Services",
	main_menu_A[3] = "Support",
	main_menu_A[4] = "Contacts",
	main_menu_A[5] = "Site Map";

// status bar statements for home and sitemap
var	SB_home = "Return to the main page",
	SB_sitemap = "Visit our sitemap";

// status bar statements for main menu options
var	SBMain_company = "EZHi Company Info",
	SBMain_product = "EZHi Products",
	SBMain_solution = "EZHi Solutions",
//	SBMain_service = "EZHi Services",
	SBMain_support = "EZHi Support",
	SBMain_contact = "EZHi Contact Info";

// status bar statements for company
var	SBComp_aboutus = "Find out about EZHi",
	SBComp_news = "Check out the latest news in EZHi",
	SBComp_enews = "Check out the eNews in EZHi",
	SBComp_events = "See if EZHi is going to be near you",
	SBComp_careers = "See what EZHi can offer you";
	
// status bar statements for products
var	SBProd_ezlinx = "Check out EZLinx",
	SBProd_ezgoing = "Check out EZGoing",
	SBProd_ezfire = "Check out EZFire",
	SBProd_ezfighter = "Check out EZFighter",
	SBProd_ezsoc = "Check out EZSOC",
	SBProd_matrix = "Check out Matrix",
	SBProd_xsr = "Check out XSR",
	SBProd_netsight = "Check out NetSight",
	SBProd_dragon = "Check out Dragon",
	SBProd_webletCB = "Check out WebletCB",
	SBProd_webletSP = "Check out WebletSP",
	SBProd_webletDM = "Check out WebletDM";

// status bar statements for services
var	SBSolu_secure = "See the Secure Networks solution of ETS",
	SBSolu_running = "See the Ever Running solution of EZHi",
	SBSolu_case = "See the Successful Cases of EZHi";
	
// status bar statements for services
var	SBServ_design = "See what kind of designs EZHi have engineered",
	SBServ_pcblayout = "See what kind of PCB Layouts EZHi have constructed";

// status bar statements for support
var	SBSupp_training = "See if EZHi can help you",
	SBSupp_contact = "Help us help you";

// status bar statements for contacts
var	SBCont_corporate = "See where EZHi offices are",
	SBCont_sales = "Find out who to contact";
	
// status bar statements for news stories
var	SBNews_09_05_03 = "EZHi Technologies Releases EZGoing Videogoingerencing Device",
	SBNews_09_10_03 = "EZHi Technologies Releases First Intel&reg; XScale&#153;-based Weblet",
	SBNews_09_15_03 = "EZHi Technologies Unveils First Load Balancing Device for Video and VoIP Traffic";

var home_A 		= new Array("首頁","home",SB_home);
var sitemap_A	= new Array("網站地圖","sitemap",SB_sitemap);

// news articles
var news_09_05_03_A 	= new Array("09-05-03","news_09_05_03",SBNews_09_05_03);
var news_09_10_03_A 	= new Array("09-10-03","news_09_10_03",SBNews_09_10_03);
var news_09_15_03_A 	= new Array("09-15-03","news_09_15_03",SBNews_09_15_03);

var news_articles	= [ news_09_15_03_A,
					   	news_09_10_03_A,
						news_09_05_03_A];

var enews_articles	= [ news_09_15_03_A,
					   	news_09_10_03_A,
						news_09_05_03_A];

// company submenu arrays (name as shown on link, link reference, status bar message,submenu array)
var aboutus_A	= new Array("關於爭鋒","aboutus",SBComp_aboutus);
var news_A		= new Array("重要新聞","news",SBComp_news,news_articles);
var enews_A		= new Array("電子e報","enews",SBComp_enews,enews_articles);
var events_A	= new Array("活動訊息","events",SBComp_events);
var careers_A	= new Array("徵才項目","careers",SBComp_careers);

// products submenu arrays (name as shown on link, link reference, status bar message)
<!--var ezhi_A		= new Array("EZHi Tech 資安產品系列"); -->
var ezlinx_A	= new Array("EZLinx \t多路寬頻管理系統","ezlinx",SBProd_ezlinx);
var ezgoing_A	= new Array("EZGoing 流量管理系統","ezgoing",SBProd_ezgoing);
var ezfire_A	= new Array("EZFire 硬體架構式防火牆","ezfire",SBProd_ezfire);
var ezfighter_A	= new Array("EZFighter 入侵阻絕系統","ezfighter",SBProd_ezfighter);
var ezsoc_A		= new Array("EZSOC 網路安全運作中心","ezsoc",SBProd_ezsoc);
<!--var ets_A		= new Array("Enterasys 網路產品系列"); -->
var matrix_A	= new Array("Matrix 網路交換器系列","matrix",SBProd_matrix);
var xsr_A		= new Array("XSR 路由防火牆系統","xsr",SBProd_xsr);
var netsight_A	= new Array("NetSight 網路管理系統","netsight",SBProd_netsight);
var dragon_A	= new Array("Dragon 入侵偵測阻絕系統","dragon",SBProd_dragon);
<!--var weblet_A	= new Array("Weblet 手持電腦系列"); -->
var webletCB_A	= new Array("Weblet CB - ComeBook","webletCB",SBProd_webletCB);
var webletSP_A	= new Array("Weblet SP - SmartPad","webletSP",SBProd_webletSP);
var webletDM_A	= new Array("Weblet DM - MP3000","webletDM",SBProd_webletDM);

// services submenu arrays (name as shown on link, link reference, status bar message)
var secure_A	= new Array("Secure Networks 安全網路","secure",SBSolu_secure);
var running_A	= new Array("Ever Running 永續經營","running",SBSolu_running);
var case_A		= new Array("Successful Stories 成功案例","case",SBSolu_case);

// services submenu arrays (name as shown on link, link reference, status bar message)
var design_A	= new Array("硬體設計","design",SBServ_design);
var pcblayout_A	= new Array("PCB Layout 設計","pcblayout",SBServ_pcblayout);

// support submenu arrays (name as shown on link, link reference, status bar message)
var training_A	= new Array("教育訓練","training",SBSupp_training);
var contact_A	= new Array("支援連繫","contact",SBSupp_contact);

// contacts submenu arrays (name as shown on link, link reference, status bar message)
var corporate_A	= new Array("國內外據點","corporate",SBCont_corporate);
var sales_A		= new Array("業務部門","sales",SBCont_sales);

// combined submenu multidimensional arrays
var SM_CompA 	= [	aboutus_A,
//					news_A,
					enews_A,
					events_A];
//					careers_A];
var SM_ProdA 	= [	
//                                      ezlinx_A,
//					ezgoing_A,
//					ezfire_A,
//					ezfighter_A,
//					ezsoc_A,
					matrix_A,
					xsr_A,
					netsight_A,
					dragon_A,
//					webletCB_A,
//					webletSP_A,
					webletDM_A];
var SM_SoluA	= [	secure_A,
				  	running_A,
				  	case_A];
//var SM_ServA	= [	design_A];
//					pcblayout_A];
var SM_SuppA	= [	//training_A,
					contact_A];
var SM_ContA	= [	corporate_A];
//					sales_A];

// main menu arrays (name as shown on link, link reference, status bar message, submenu array, 
//					 absolute left position on webpage, width of drop down menu)
var company_A	= new Array("公司簡介",SM_CompA[0][1],SBMain_company,SM_CompA,"12px",100);
var products_A	= new Array("產品介紹",SM_ProdA[0][1],SBMain_product,SM_ProdA,"126px",170);
var solutions_A	= new Array("解決方案",SM_SoluA[0][1],SBMain_solution,SM_SoluA,"238px",175);
//var services_A	= new Array("服務項目",SM_ServA[0][1],SBMain_service,SM_ServA,"352px",150);
//var support_A	= new Array("技術支援",SM_SuppA[0][1],SBMain_support,SM_SuppA,"464px",100);
//var contacts_A	= new Array("連絡資訊",SM_ContA[0][1],SBMain_contact,SM_ContA,"576px",100);
var support_A	= new Array("技術支援",SM_SuppA[0][1],SBMain_support,SM_SuppA,"420px",100);
var contacts_A	= new Array("連絡資訊",SM_ContA[0][1],SBMain_contact,SM_ContA,"556px",100);

// combined main menu multidimensional array
var MM_array 	= [	company_A,
					products_A,
					solutions_A,
//					services_A,
					support_A,
					contacts_A];

// writes the 'message' in the status bar for js files
function status_bar(message) {
	var my_message = "window.status = \'" + message + "\';return true";
	return my_message;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

// marks the current page
function page_marker() {
	var i;
	for (i = 0; i < arguments.length; i++) {
		pages[i] = arguments[i];
	}
	main_group = pages[0][0];
	if (i > 1) {
		submenu_group = pages[i-2][3];
		submenu_marker = pages[1][0];
	}
	selected_page = pages[i-1][0];
	//lc_selected_page = (selected_page.replace(regexp, "")).toLowerCase();
}

MM_reloadPage(true);
window.defaultStatus = ' ';
document.write('<script language="JavaScript" src="./js/mail_protection.js"></script>');
document.write('<script language="JavaScript" src="./js/html_linx.js"></script>');

/*	everything after this point is not used
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var SM_Comp_A = new Array();
SM_Comp_A["About Us"] 	= new Array("About Us","aboutus",SBComp_aboutus);
SM_Comp_A["News"]	 	= new Array("News","news",SBComp_news);
SM_Comp_A["eNews"]	 	= new Array("eNews","enews",SBComp_enews);
SM_Comp_A["Events"] 	= new Array("Events","events",SBComp_events);
SM_Comp_A["Careers"] 	= new Array("Careers","careers",SBComp_careers);

var SM_Prod_A = new Array();
//SM_Prod_A["EZLinx"]		= new Array("EZLinx","ezlinx",SBProd_ezlinx);
//SM_Prod_A["EZGoing"]	= new Array("EZGoing","ezgoing",SBProd_ezgoing);
//SM_Prod_A["EZFire"]		= new Array("EZFire","ezfire",SBProd_ezfire);
//SM_Prod_A["EZFighter"]	= new Array("EZFighter","ezfighter",SBProd_ezfighter);
//SM_Prod_A["EZSOC"]		= new Array("EZSOC","ezsoc",SBProd_ezsoc);
SM_Prod_A["Matrix"]		= new Array("Matrix","matrix",SBProd_matrix);
SM_Prod_A["XSR]			= new Array("XSR","xsr",SBProd_xsr);
SM_Prod_A["NetSight"]	= new Array("NetSight","netsight",SBProd_netsight);
SM_Prod_A["Dragon"]		= new Array("Dragon","dragon",SBProd_dragon);
//SM_Prod_A["WebletCB"]	= new Array("WebletCB","webletCB",SBProd_webletCB);
//SM_Prod_A["WebletSP"]	= new Array("WebletSP","webletSP",SBProd_webletSP);
SM_Prod_A["WebletDM"]	= new Array("WebletDM","webletDM",SBProd_webletDM);

var SM_Solu_A = new Array();
SM_Solu_A["Secure Networks"]	= new Array("Secure Networks","secure",SBSolu_secure);
SM_Solu_A["Ever Running"]		= new Array("Ever Running","running",SBSolu_running);
SM_Solu_A["Case Study"]			= new Array("Case Study","case",SBSolu_case);

//var SM_Serv_A = new Array();
//SM_Serv_A["Design Engineering"]	= new Array("Design Engineering","design",SBServ_design);
//SM_Serv_A["PCB Layout"]			= new Array("PCB Layout","pcblayout",SBServ_pcblayout);

var SM_Supp_A = new Array();
//SM_Supp_A["Training"]			= new Array("Training","training",SBSupp_training);
SM_Supp_A["Contact Support"]		= new Array("Contact Support","contact",SBSupp_contact);

var SM_Cont_A = new Array();
SM_Cont_A["Corporate"] 	= new Array("Corporate","corporate",SBCont_corporate);
//SM_Cont_A["Sales"] 		= new Array("Sales","sales",SBCont_sales);

// main menu array
var MM_array_A 	= [	new Array(Company,SM_CompA[0][1],SBMain_company,"12px",100,SM_Comp_A),
					new Array(Products,SM_ProdA[0][1],SBMain_product,"126px",170,SM_Prod_A),
					new Array(Solutions,SM_ProdA[0][1],SBMain_product,"238px",175,SM_Prod_A),
//					new Array(Services,SM_ServA[0][1],SBMain_service,"352px",150,SM_Serv_A),
					new Array(Support,SM_SuppA[0][1],SBMain_support,"464px",100,SM_Supp_A),
					new Array(Contacts,SM_ContA[0][1],SBMain_contact,"576px",100,SM_Cont_A)];

/*
var SM_CompA 	= [	new Array("About Us","aboutus",SBComp_aboutus),
					new Array("News","news",SBComp_news),
					new Array("eNews","enews",SBComp_enews),
					new Array("Events","events",SBComp_events),
					new Array("Careers","careers",SBComp_careers)];
var SM_ProdA 	= [	//new Array("EZLinx","ezlinx",SBProd_ezlinx),
//					new Array("EZGoing","ezgoing",SBProd_ezgoing)
//					new Array("EZFire","ezfire",SBProd_ezfire)
//					new Array("EZFighter","ezfighter",SBProd_ezfighter)
//					new Array("EZSOC","ezsoc",SBProd_ezsoc),
					new Array("Matrix","matrix",SBProd_matrix),
					new Array("XSR","xsr",SBProd_xsr),
					new Array("NetSight","netsight",SBProd_netsight),
					new Array("Dragon","dragon",SBProd_dragon),
//					new Array("WebletCB","wbeletCB",SBProd_webletCB),
//					new Array("WebletSP","wbeletSP",SBProd_webletSP),
					new Array("WebletDM","webletDM",SBProd_webletDM)];
var SM_SoluA	= [	new Array("Secure Networks","secure",SBSolu_secure),
				  	new Array("Ever Running","running",SBSolu_running),
				  	new Array("Case Study","case",SBSolu_case)];
//var SM_ServA	= [	new Array("Design Engineering","design",SBServ_design)];
//					new Array("PCB Layout","pcblayout",SBServ_pcblayout)];
var SM_SuppA	= [	//new Array("Training","training",SBSupp_training),
					new Array("Contact Support","contact",SBSupp_contact)];
var SM_ContA	= [	new Array("Corporate","corporate",SBCont_corporate)];
//					new Array("Sales","sales",SBCont_sales)];

// main menu array
var MM_array 	= [	new Array(Company,SM_CompA[0][1],SBMain_company,"12px",100,SM_CompA),
					new Array(Products,SM_ProdA[0][1],SBMain_product,"126px",170,SM_ProdA),
					new Array(Solutions,SM_SoluA[0][1],SBMain_solution,"238px",175,SM_SoluA),
//					new Array(Services,SM_ServA[0][1],SBMain_service,"352px",150,SM_ServA),
					new Array(Support,SM_SuppA[0][1],SBMain_support,"464px",100,SM_SuppA),
					new Array(Contacts,SM_ContA[0][1],SBMain_contact,"576px",100,SM_ContA)];

// drop down submenus appear based on which menu selection
function SM_appear(menu_selection) {
	switch(menu_selection) {
		case "Company":
			document.all.SM_Company.style.visibility="visible";
			break;
		case "Products":
			document.all.SM_Products.style.visibility="visible";
			break;
		case "Solutions":
			document.all.SM_Solutions.style.visibility="visible";
			break;
//		case "Services":
//			document.all.SM_Services.style.visibility="visible";
//			break;
		case "Support":
			document.all.SM_Support.style.visibility="visible";
			break;
		case "Contacts":
			document.all.SM_Contacts.style.visibility="visible";
			break;
	}
}

// drop down submenus disappear based on which menu selection
function SM_disappear(menu_selection) {
	switch(menu_selection) {
		case "Company":
			document.all.SM_Company.style.visibility="hidden";
			break;
		case "Products":
			document.all.SM_Products.style.visibility="hidden";
			break;
		case "Solutions":
			document.all.SM_Solutions.style.visibility="hidden";
			break;
//		case "Services":
//			document.all.SM_Services.style.visibility="hidden";
//			break;
		case "Support":
			document.all.SM_Support.style.visibility="hidden";
			break;
		case "Contacts":
			document.all.SM_Contacts.style.visibility="hidden";
			break;
	}
}
*/