function ShowForexRate()
{
	var tdForexRate = document.getElementById('tdForexRate');	
	var sHTML = '';
	sHTML = sHTML.concat('<table border="1px" style="margin-top:3px" class="ld-TableStandard" cellpadding="3px" cellspacing="1px" class="Goldprice">');
	for(var i=0;i<vForexs.length;i++){
		sHTML = sHTML.concat('	<tr>');
		sHTML = sHTML.concat('		<td class="td-Goldprice-title">').concat(vForexs[i]).concat('</td>');
		sHTML = sHTML.concat('		<td class="td-Goldprice-data">').concat(vCosts[i]).concat('</td>');
		sHTML = sHTML.concat('	</tr>');
	}
	sHTML = sHTML.concat('</table>');
	if(tdForexRate!= null)
		tdForexRate.innerHTML  = sHTML;
}
ShowForexRate();

function ShowGoldPrice()
{
	var tdGoldPrice = document.getElementById('tdGoldPrice');	
	var sHTML = '';
	sHTML = sHTML.concat('<table border="1px" style="margin-top:3px" class="ld-TableStandard" cellpadding="2px" cellspacing="1px" class="Goldprice">');
	sHTML = sHTML.concat('	<tr>');
	sHTML = sHTML.concat('		<td class="td-Goldprice-title">Mua</td>');
	sHTML = sHTML.concat('		<td class="td-Goldprice-data">').concat(vGoldBuy).concat('</td>');
	sHTML = sHTML.concat('	</tr>');
	sHTML = sHTML.concat('	<tr>');
	sHTML = sHTML.concat('		<td class="td-Goldprice-title">B&#225;n</td>');
	sHTML = sHTML.concat('		<td class="td-Goldprice-data">').concat(vGoldSell).concat('</td>');
	sHTML = sHTML.concat('	</tr>');
	sHTML = sHTML.concat('</table>');
	if(tdGoldPrice != null)
		tdGoldPrice.innerHTML = sHTML;
}

ShowGoldPrice();

//-----------------------------------
function parseXML()
{
	var xmlDoc;
	//alert('Hello');
	try //Internet Explorer
	  {
	  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	  }
	catch(e)
	  {
		  try //Firefox, Mozilla, Opera, etc.
		    {
		    xmlDoc=document.implementation.createDocument("","",null);
		    }
		  catch(e)
		    {
		    alert(e.message);
		    return;
		    }
	  }	
	xmlDoc.async=false;	
	xmlDoc.load("http://vietcombank.com.vn/ExchangeRates/ExrateXML.aspx");	
	//alert('Hello - ok');
	var noteCount = xmlDoc.getElementsByTagName("Exrate").length;
	//alert(noteCount);
	var html = '<table border="1px" style="margin-top:3px" class="ld-TableStandard" cellpadding="2px" cellspacing="1px" class="Goldprice">';
		for (var i=0;i<noteCount;i++)
		{
			 html += '<tr><td class="td-Goldprice-title">' + xmlDoc.getElementsByTagName("Exrate")[i].attributes.getNamedItem("CurrencyCode").nodeValue +'</td>';
			 //html += '<td class="td-Goldprice-title">' + xmlDoc.getElementsByTagName("Exrate")[i].attributes.getNamedItem("Buy").nodeValue +"</td>";
			 //html += '<td class="td-Goldprice-title">' + xmlDoc.getElementsByTagName("Exrate")[i].attributes.getNamedItem("Transfer").nodeValue +"</td>";
			 html += '<td class="td-Goldprice-title">' + xmlDoc.getElementsByTagName("Exrate")[i].attributes.getNamedItem("Sell").nodeValue +"</td></tr>";		
		}
	html +="</table>";
	var dvForexRate = document.getElementById("dvForexRate");
	if(dvForexRate !=null)
		dvForexRate.innerHTML = html;
}
//parseXML();
