﻿  	// set up drop downs anywhere in the body of the page. I think the bottom of the page is better.. 
	// but you can experiment with effect on loadtime.
	if (mtDropDown.isSupported()) {

		//==================================================================================================
		// create a set of dropdowns
		//==================================================================================================
		// the first param should always be down, as it is here
		//
		// The second and third param are the top and left offset positions of the menus from their actuators
		// respectively. To make a menu appear a little to the left and bottom of an actuator, you could use
		// something like -5, 5
		//
		// The last parameter can be .topLeft, .bottomLeft, .topRight, or .bottomRight to inidicate the corner
		// of the actuator from which to measure the offset positions above. Here we are saying we want the 
		// menu to appear directly below the bottom left corner of the actuator
		//==================================================================================================
		var ms = new mtDropDownSet(mtDropDown.direction.down, 5, 0, mtDropDown.reference.bottomLeft);

		//==================================================================================================
		// create a dropdown menu
		//==================================================================================================
		// the first parameter should be the HTML element which will act actuator for the menu
		//==================================================================================================
		var menu1 = ms.addMenu(document.getElementById("menu1"));
		menu1.addItem("關於我們", ""); //11mission.aspx
		menu1.addItem("產品及服務", ""); //12brokerage.aspx
		menu1.addItem("投資者關係", ""); // 13FinReport.aspx
		menu1.addItem("新聞中心", "14press.aspx");
		menu1.addItem("招聘人才", "17career.aspx");
		menu1.addItem("聯絡我們", "16contactus.aspx");

		//==================================================================================================

		//==================================================================================================
		 //add a sub-menu
		//==================================================================================================
		// to add a sub menu to an existing menu object, call it's addMenu method and pass it the item from
		// the parent menu which should act as it's actuator. To add a submenu to the fourth item of a menu
		// called "theMenu", you would do theMenu.addMenu(theMenu.items[3])
		//==================================================================================================
		var subMenu1 = menu1.addMenu(menu1.items[0]);
		subMenu1.addItem("使命", "11mission.aspx");
		subMenu1.addItem("歷史", "11history.aspx");
		subMenu1.addItem("董事", "11directors.aspx");
		subMenu1.addItem("高級管理層", "11s-mangement.aspx");
		subMenu1.addItem("集團架構", "11groupStructure.aspx");
		subMenu1.addItem("集團管理", "11CorpGoverance.aspx");

		var subMenu1 = menu1.addMenu(menu1.items[1]);
		subMenu1.addItem("證券買賣", "2Brokerage.aspx");
		subMenu1.addItem("企業融資", "3CorpFin.aspx");
		subMenu1.addItem("資產管理", "4Asset.aspx");

		var subMenu1 = menu1.addMenu(menu1.items[2]);
		subMenu1.addItem("年報", "13FinReport.aspx");
		subMenu1.addItem("中期報告", "13MidReport.aspx");
		subMenu1.addItem("通告及通函", "13Ann.aspx");		
		
		var menu2 = ms.addMenu(document.getElementById("menu2"));
		menu2.addItem("產品及服務","21product.aspx");
		menu2.addItem("收費及佣金", "");
		//menu2.addItem("開設戶口", "23account.aspx");
		menu2.addItem("常見問題", "24help.aspx");
		menu2.addItem("聯絡我們", "25contactus.aspx");
		
		var subMenu2 = menu2.addMenu(menu2.items[1]);
		subMenu2.addItem("&#28377;盈證券有限公司", "22fee.aspx");
		subMenu2.addItem("&#28377;盈期貨有限公司 ", "22fee_futures.aspx");
    
	  	//var menu3 = ms.addMenu(document.getElementById("menu3"));
    	//menu3.addItem("公司概要","31overview.aspx");
		//menu3.addItem("主要成就", "32achievements.aspx");
		//menu3.addItem("聯絡我們", "33contactus.aspx");

		//var menu4 = ms.addMenu(document.getElementById("menu4"));
		//menu4.addItem("公司概要","41overview.aspx");
		//menu4.addItem("聯絡我們","42contactus.aspx");
		



		//==================================================================================================
		// write drop downs into page
		//==================================================================================================
		// this method writes all the HTML for the menus into the page with document.write(). It must be
		// called within the body of the HTML page.
		//==================================================================================================
		mtDropDown.renderAll();
	}
