﻿function ShowForexRate()
{
	var strHtml = "";
	//var obj = document.getElementById("forex");
	function AddCurrencyRate(Currency, Rate)
	{
		strHtml += "<tr><td align='left'>&nbsp;"+Currency+"</td><td align='right'>&nbsp;"+Rate+"&nbsp;</td></tr>";
		strHtml += "<tr><td colspan='2' ><hr color='#f3e63e' size='0.2'></td></tr>";
		//document.writeln(s);
	}
	function AddHeader()
	{
		strHtml += '<table bordercolor="#C0C0C0" class="Normal" width="99%" border="0" cellSpacing="0" cellPadding="0">';
		//strHtml += '<tr><td class="NormalBold" align="left">&nbsp;Đơn vị</td><td class="NormalBold" align="right">VNĐ&nbsp;</td></tr>'
	}
	function AddFooter()
	{
		strHtml +='</table>';
		document.writeln(strHtml);
		//obj.value = strHtml;
	}
	AddHeader();
	if (typeof(vForexs[0]) !='undefined' && typeof(vCosts[0]) !='undefined') AddCurrencyRate(vForexs[0], vCosts[0]);
	if (typeof(vForexs[1]) !='undefined' && typeof(vCosts[1]) !='undefined') AddCurrencyRate(vForexs[1], vCosts[1]);
	if (typeof(vForexs[2]) !='undefined' && typeof(vCosts[2]) !='undefined') AddCurrencyRate(vForexs[2], vCosts[2]);
	//if (typeof(vForexs[3]) !='undefined' && typeof(vCosts[3]) !='undefined') AddCurrencyRate(vForexs[3], vCosts[3]);
	//if (typeof(vForexs[4]) !='undefined' && typeof(vCosts[4]) !='undefined') AddCurrencyRate(vForexs[4], vCosts[4]);
	//if (typeof(vForexs[5]) !='undefined' && typeof(vCosts[5]) !='undefined') AddCurrencyRate(vForexs[5], vCosts[5]);
	if (typeof(vForexs[6]) !='undefined' && typeof(vCosts[6]) !='undefined') AddCurrencyRate(vForexs[6], vCosts[6]);
	//if (typeof(vForexs[7]) !='undefined' && typeof(vCosts[7]) !='undefined') AddCurrencyRate(vForexs[7], vCosts[7]);
	//if (typeof(vForexs[8]) !='undefined' && typeof(vCosts[8]) !='undefined') AddCurrencyRate(vForexs[8], vCosts[8]);
	//if (typeof(vForexs[9]) !='undefined' && typeof(vCosts[9]) !='undefined') AddCurrencyRate(vForexs[9], vCosts[9]);
	if (typeof(vForexs[10]) !='undefined' && typeof(vCosts[10]) !='undefined') AddCurrencyRate(vForexs[10], vCosts[10]);
	//if (typeof(vForexs[11]) !='undefined' && typeof(vCosts[11]) !='undefined') AddCurrencyRate(vForexs[11], vCosts[11]);	
	AddFooter();
}
ShowForexRate();