﻿// JScript File code by Blackyaa

function AddFooter()
{
    document.writeln('</table>');
}

function togglect(o)
{
    var obj = document.getElementById(o);
    
    if(obj.style.display == 'none') obj.style.display = 'block';
    else obj.style.display = 'none';
}

function AddHeader(h)
{
    document.writeln('<table border="1" cellpadding="0" cellspacing="0" bordercolor="#FFC022" class="box_head stext">');
    
    var id = 'goldtbl';
    if(h == _forex_price) id = 'forextbl';
    
    document.writeln('<tr><td class="box_w80 btn" onclick="togglect(\'' + id + '\')">' + h + '</td></tr>');
    document.writeln('</table>');
    
    
    document.writeln('<table id="' + id + '" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFC022" class="box_tbl frm" style="display: none">');
}

function ShowForexRate()
{
	function AddCurrencyRate(Currency, Rate)
	{
		document.writeln('<tr><td class="box_w80" align="left">', Currency, '</td><td class="box_w134" align="left">', Rate, '</td></tr>');
	}
    
    AddHeader(_forex_price + "");
    
	
	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]);
	if (typeof(vForexs[12]) !='undefined' && typeof(vCosts[12]) !='undefined') AddCurrencyRate(vForexs[12], vCosts[12]);
	if (typeof(vForexs[13]) !='undefined' && typeof(vCosts[13]) !='undefined') AddCurrencyRate(vForexs[13], vCosts[13]);
	
	
	AddFooter();
}

function ShowGoldPrice()
{
    AddHeader(_gold_price + "");

	function AddGoldPrice(Currency, Rate)
	{
		document.writeln('<tr><td class="box_w80" align="left">', Currency, '</td><td class="box_w134" align="left">', Rate, '</td></tr>');
	}
	
	if (typeof(vGoldBuy) !='undefined') AddGoldPrice(_sell + "", vGoldBuy);
	if (typeof(vGoldSell)!='undefined') AddGoldPrice(_buy + "", vGoldSell);
	
	AddFooter();
}

ShowGoldPrice();
ShowForexRate();