﻿function ShowForexRate()
{
	function AddCurrencyRate(Currency, Rate)
	{
		document.writeln('<tr bgcolor="#ffffff"><td class=BoxItem>&nbsp;', Currency, '</td><td class=BoxItem align=right>', Rate, '&nbsp;</td></tr>');
	}
	function AddCurrencyRate_Header(Currency, Rate)
	{
		document.writeln('<tr bgcolor="#fa4100" style="height:20px;"><td style="color:#fff;font-weight:bold;font-size:8pt;font-family:arial; text-align:center;">', Currency, '</td><td style="color:#fff;font-weight:bold;font-size:8pt;font-family:arial; text-align:center;">', Rate, '</td></tr>');
	}
	if (!AddForexHeader('Forex', 'T&#7927; gi&#225;', 3, PageHost.concat('/Present/Library/Images/i_Stock.gif')))
		return;
		
	AddCurrencyRate_Header("Mã", "Bán ra");
	for(var i=0;i<vForexs.length;i++){
		if (typeof(vForexs[i]) !='undefined' && typeof(vCosts[i]) !='undefined'){
		    AddCurrencyRate(vForexs[i], vCosts[i]);
		}
	}


	AddForexFooter();
}
ShowForexRate();

function AddForexHeader(Name, Header, Buttons, Symbol, AddChildTable)
{
	document.writeln('<table width="100%" border=0 cellspacing=0 cellpadding=1 bgcolor="#AB973D"><tr><td>');

	if (Header!='')
	{
		document.writeln('<table width="100%" border=0 cellspacing=0 cellpadding=0>');
		document.writeln('<tr>');

		if (typeof(Symbol)!='undefined')
		{
			document.writeln('<td height="16px" class=BoxHeader><img src="', Symbol, '" border=0></td>');
		}

		document.writeln('<td height="16px" width="100%" align=left class=BoxHeader>&nbsp;', Header, '</td>');

		if ((Buttons & 1) && fDSp)
		{
			document.write('<td width="15px" align=right>');
			document.write('<a href="JavaScript:ItemMinimize(\x27', Name, '\x27)">');
			document.write('<img src="/Present/Library/Images/min.gif" name="IDI_', Name, '" border=0 alt="Minimize | Maximize">');
			document.write('</a></td>');
		}

		document.writeln('</tr></table>');
	}

	//document.writeln('<table width="100%" border=0 cellspacing=0 cellpadding=0 id="tIDM_', Name, '"><tr><td><div class=BreakLine id="IDM_', Name, '">');
	document.writeln('<table width="100%" border=0 cellspacing=0 cellpadding=0><tr><td id="IDM_', Name, '">');
	document.writeln('<table width="100%" border=0 cellspacing=0 cellpadding=0><tr><td style="background-color:#ffffff;">');
	if (typeof(AddChildTable)=='undefined')
	{
		document.writeln('<marquee onmouseover=this.stop() onmouseout=this.start() scrollAmount=1 scrollDelay=100 height=65 direction=up>');
		document.writeln('<div style="position:related; width:100%;background-color:#ffffff; height:100%;">');
		document.writeln('<table align=center width="100%" cellspacing=0 cellpadding=0 border=1>');
		LastChild = 1;
	}
	else
	{
		LastChild = 0;
	}
	return true;
}

function AddForexFooter()
{
	document.writeln('</table>');
	document.writeln('</div>');
	document.writeln('</marquee>');
	document.writeln('</td></tr>');
	document.writeln('<tr bgcolor="#ffffff"><td colspan=1 class=BoxItem align=center><i>(Ngu&#7891;n: NH Ngo&#7841;i th&#432;&#417;ng VN)</td></tr>');
	document.writeln('</table>');
	document.writeln('</td></tr></table>');
	document.writeln('</td></tr></table>');
}

