var SITE_URLS = [[
		"/company.php",
		"/company.php?c=1",
		"/company.php?c=2",
		"/company.php?c=3",
		"/company.php?c=4"
	], [
		"/realtimequotation.php",
		"/realtimequotation.php",
		"/realtimequotation.php?c=2",//add
		{link: "http://optionprice.emperorforex.com/", type: "popup"}
	], [
		"/products_services.php",
		"/products_services.php?c=1",
		"/products_services.php?c=2",
		"/products_services.php?c=3"
	], [
		"/dailymarketing.php",
		"/dailymarketing.php",
		"/weeklyreview.php",
		"/marketnews.php"
	], [
		"/professionalanalysis.php"
	], [
		"/investingschool.php",
		"/investingschool.php?c=1",
		"/investingschool.php?c=2"
	], [
		"/seminal.php"//7
	], [
		"/strategicpartners.php"
	], [
		"/news.php"
	], [
		"/branchinformation.php",
		"/branchinformation.php?c=32",
		"/branchinformation.php?c=33&category=branchinformationmacao",
		"/branchinformation.php?c=34&category=branchinformationasia_wc",
		{link: "http://www.egoldsilver.com/html/index.php?lang=e&id=19", type: "popup"} ////"/branchinformation.php?c=35&category=branchinformationonline"
	], [
		"/career.php?companyCode=hk",//11
		"/career.php?companyCode=hk",
		"/career.php?companyCode=macau",
		"/career.php?companyCode=asia",
		"/career.php?companyCode=online"
	]
];

function resizeListener() {
	updateScreenSize();

	topnavResizeHandler();
}

function topnavResizeHandler() {
	getSwf("topnav").setScreenWidth(screenW);
}

function flashClickLink(eventID) {
	switch (eventID) {
		case "logo":
			location.href = "/";
			break;
		case "menu":
		case "submenu":
			goMenuUrl(arguments[1], arguments[2]);
			break;
		case "register":
			location.href = "/member_registration.php";
			break;
		case "editAccount":
			location.href = "/member_registration.php";
			//alert('edit');
			break;
		case "forget":
			location.href = "/forget_password.php";
			break;
	}
}

function goMenuUrl(sec, subsec) { // v1.0, Cody.Ng, 2008.3.11
	var url;
	var openType = null;
	var how = null;
	var offset = (subsec == undefined ? 0 : subsec);
	
	if (sec <= 0) {
		alert("Section value must be >= 1");
		return;
	}
	if (subsec < 0) {
		alert("Subsection value must be >= 0");
		return;
	}

	if (SITE_URLS[sec - 1][offset].type == undefined)
		url = SITE_URLS[sec - 1][offset];
	else {
		url = SITE_URLS[sec - 1][offset].link;
		openType = SITE_URLS[sec - 1][offset].type;
		how = SITE_URLS[sec - 1][offset].how;
	}
	if (url != '' && url != undefined) {
		if (openType == null) {
			location.href = url;
		} else if (openType == "popup") {
			window.open(url, '', (how == null ? '' : how));
		}
	}
}

