PageHost = '';
var fBrw=(navigator.userAgent.indexOf('MSIE')!= -1 && navigator.userAgent.indexOf('Windows')!= -1);
var fDSp=(typeof(document.getElementById)!='undefined');

function AddHeader(Name, Header, Buttons, Symbol, AddChildTable)
{
	document.writeln('<table width="100%" border=0 cellspacing=0 cellpadding=1 bgcolor="#DDDDDD"><tr><td>');

	if (Header!='')
	{
		document.writeln('<table width="100%" border=0 cellspacing=0 cellpadding=0>');
		document.writeln('<tr>');
		document.writeln('<td height=16 width="100%" align=left class=BoxHeader>&nbsp;', Header, '</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, '">');
	if (typeof(AddChildTable)=='undefined')
	{
		document.writeln('<table align=center width="100%" cellspacing=1 cellpadding=0 border=0>');
		LastChild = 1;
	}
	else
	{
		LastChild = 0;
	}
	return true;
}

function AddFooter()
{
	if (LastChild)
	{
		document.writeln('</table></td></tr></table></td></tr></table>');
	}
	else
	{
		document.writeln('</td></tr></table></td></tr></table>');
	}
}


function ShowGoldPrice()
{
	function AddGoldPrice(Currency, Rate)
	{
		document.writeln('<tr><td bgcolor="#FFFFFF" width="30%" >&nbsp;<b>', Currency, '</b></td><td align=right bgcolor="#CCCCCC" width="70%">', Rate, ' VNĐ&nbsp;</td></tr>');
	}
	if (typeof(vGoldBuy) !='undefined') AddGoldPrice('Mua', vGoldBuy);
	if (typeof(vGoldSell)!='undefined') AddGoldPrice('Bán', vGoldSell);

}

function ShowWeather()
{
	function AddCityWeather(City, Degree)
	{
		document.writeln('<tr><td  bgcolor="#FFFFFF" width="60%">&nbsp;<b>', City , '</b></strong></td><td width="40%" bgcolor="#CCCCCC" align="right" >', Degree, ' <sup>o</sup>C&nbsp;</td></tr>');
	}
	if (typeof(vHanoi)!='undefined'     && typeof(dHanoi)    !='undefined') AddCityWeather(vHanoi, dHanoi);
	if (typeof(vHaiPhong)!='undefined'       && typeof(dHaiPhong)      !='undefined') AddCityWeather(vHaiPhong, dHaiPhong);
	if (typeof(vDaNang)!='undefined'    && typeof(dDaNang)   !='undefined') AddCityWeather(vDaNang, dDaNang);
	if (typeof(vHoChiMinh)!='undefined' && typeof(dHoChiMinh)!='undefined') AddCityWeather(vHoChiMinh, dHoChiMinh);
}

function ShowForexRate()
{
	var vForex;
	vForex='';
				
	for(var i=0;i<vForexs.length;i++)
	{
		if (typeof(vForexs[i]) !='undefined' && typeof(vCosts[i]) !='undefined')
		{
			vForex += '<tr height="17px"><td bgcolor="#EEEEEE" align="center" width="60">'+vForexs[i]+'</td><td bgcolor="#FFFFFF" align="right" width="100">'+vCosts[i]+' VNĐ</td></tr>';
		}
	}
	
	document.write(vForex);
}