﻿__BASE_INFO_B = new Array(2);
__BASE_INFO_B[0] = "股票報價";
__BASE_INFO_B[1] = "查詢股票編號";

__BASE_INFO_G = new Array(2);
__BASE_INFO_G[0] = "股票報價";
__BASE_INFO_G[1] = "查詢股票代號";

__BASE_INFO_E = new Array(2);
__BASE_INFO_E[0] = "Stock Quote";
__BASE_INFO_E[1] = "Stock Code Enquiry";


function __get_tab_item_html(text, link, startClass, endClass, height){
	var html="";
	html += "<td class=\"aahsbcAlign04 " + startClass + "\" style=height:" + height + "px\">";
	html += "<a href=\"" + link + "\" class=\"" + endClass + "\">";
	html += text;
	html += "</a>";
	html += "</td>";
	html += "<td style=\"width:5px\">&nbsp;</td>";
	return html;
}

function __get_menu_tab_item(text, link, selected, height){
	var start, end;
	if (selected){
		start = "aahsbcTabStart01";
		end = "aahsbcTabEnd01";
	}else{
		start = "aahsbcTabStart02";
		end = "aahsbcTabEnd02";
	}
	return __get_tab_item_html(text, link, start, end, height);
}

function __gen_quote_enquiry_box(lang){
	var quote, stock_code, img, link, width, width1, width2, width3;
	if (lang == "E"){
		quote = __BASE_INFO_E[0];
		stock_code = __BASE_INFO_E[1];
		img = "../../images/en/but_search.gif";
		link = "#";
		width = 300;
		width1 = 80;
		width2 = 40;
		width3 = 30;
	}else if (lang == "G"){
		quote = __BASE_INFO_G[0];
		stock_code = __BASE_INFO_G[1];
		img = "../../images/zh/but_search.gif";
		link = "#";
		width = 250;
		width1 = 60;
		width2 = 40;
		width3 = 30;
	}else{
		quote = __BASE_INFO_B[0];
		stock_code = __BASE_INFO_B[1];
		img = "../../images/zh_HK/but_search.gif";
		link = "#";
		width = 250;
		width1 = 60;
		width2 = 40;
		width3 = 30;
	}
	document.writeln("<div class=\"aahsbcLayout02 aahsbcToolbox01\" style=\"width:" + width + "px;\">");
	document.writeln("<div class=\"aahsbcToolboxContent01\">");
	document.writeln("<form name=\"quote_enquiry\" id=\"quote_enquiry\" action=\"#\">");
	document.writeln("<table cellpadding=2 cellspacing=0>");
	document.writeln("<tr>");
	document.writeln("<td class=\"hsbcSpacing38 aahsbcAlign06\" width=" + width1 + ">" + quote + "</td>");
	document.writeln("<td class=\"hsbcSpacing38 aahsbcAlign05\" width=" + width2 + "><INPUT type=\"text\" name=\"stock_code\" id=\"stock_code\" style=\"width:50px;\"></td>");
	document.writeln("<td class=\"hsbcSpacing38 aahsbcAlign05\" width=" + width3 + "><a href=\"" + link + "\"><img src=\"" + img + "\" class=\"aahsbcLayout02\"></a></td>");
	document.writeln("<td class=\"hsbcSpacing38 aahsbcAlign06\"><a href=\"../stock/stock_search.html\" class=\"aahsbcLink04\">" + stock_code + "</a></td>");
	document.writeln("</tr>");
	document.writeln("</table>");
	document.writeln("</form>");
	document.writeln("</div>");
	document.writeln("</div>");
}



function openwin(link, name, width, height){
	window.open(link, name, "width=" + width + ", height=" + height + ", location=0, menu=0");
}

function openNews(link, name, width, height){
	var win = window.open(link, name, "width=" + width + ", height=" + height + ", location=0, menu=0, scrollbars=1");
	win.focus();
}

function __gen_aastocks_disclaimer(lang){
	var source, disclaimer;
	if (lang == "E"){
		source = "Information provided by AASTOCKS";
		disclaimer = "Disclaimer";
	}else if (lang == "G"){
		source = "資料由AASTOCKS提供";
		disclaimer = "免責聲明";
	}else{
		source = "資料由AASTOCKS提供";
		disclaimer = "免責聲明";
	}

	document.writeln("<p class=\"hsbcSizeText01\"><img src=\"../../images/aalogo.gif\">&nbsp;<span style=\"vertical-align:50%\"><label>" + source + "</label>&nbsp;<a href=\"#\" class=\"aahsbcLink04\">" + disclaimer + "</a></span></p>");
}


function __gen_small_aastocks_disclaimer(lang){
	var source, disclaimer;
	if (lang == "E"){
		source = "Information provided by AASTOCKS";
		disclaimer = "Disclaimer";
	}else if (lang == "G"){
		source = "資料由AASTOCKS提供";
		disclaimer = "免責聲明";
	}else{
		source = "資料由AASTOCKS提供";
		disclaimer = "免責聲明";
	}

	document.writeln("<img src=\"../../images/aalogo.gif\">&nbsp;<span style=\"vertical-align:0%\"><label>" + source + "</label>&nbsp;<a href=\"#\" class=\"aahsbcLink04\">" + disclaimer + "</a></span>");
}

String.prototype.Trim = function() 
{ 
return this.replace(/(^\s*)|(\s*$)/g, ""); 
}