// JScript File code by blackyaa

var var1 = '<tr class="content"><td align="center">';
var var2 = '</td><td align="center">';
//var var3 = '</td><td align="center" style="padding:0px 0px 0px 5px; width: 70px;">';

function AddFooter() {
    document.writeln('</table>');
}

function AddHeader(h) {

    document.writeln('<table border="0" cellpadding="0" cellspacing="0"  style="border-collapse:collapse; width: 173px;">');
}

function ShowForexRate() {
    AddHeader(_forex_price + "");

    function AddCurrencyRate(Currency, Rate) {
        document.writeln(var1, Currency, var2, Rate, '</td></tr><tr><td colspan="2"  height="15" background="images/boder_line.png"></td></tr>');
    }
    function AddCurrencyRate_no(Currency, Rate) {
        document.writeln(var1, Currency, var2, Rate, '</td></tr>');
    }

    if (typeof (vForexs[0]) != 'undefined' && typeof (vCosts[0]) != 'undefined') AddCurrencyRate(vForexs[0], vCosts[0]); //USD
    if (typeof (vForexs[1]) != 'undefined' && typeof (vCosts[1]) != 'undefined') AddCurrencyRate(vForexs[1], vCosts[1]); //GBP
    //	if (typeof(vForexs[2]) !='undefined' && typeof(vCosts[2]) !='undefined') AddCurrencyRate(vForexs[2], vCosts[2]);	//HKD
    //	if (typeof(vForexs[4]) !='undefined' && typeof(vCosts[4]) !='undefined') AddCurrencyRate(vForexs[4], vCosts[4]);	//CHF
    if (typeof (vForexs[6]) != 'undefined' && typeof (vCosts[6]) != 'undefined') AddCurrencyRate(vForexs[6], vCosts[6]); //JPY
    //	if (typeof(vForexs[7]) !='undefined' && typeof(vCosts[7]) !='undefined') AddCurrencyRate(vForexs[7], vCosts[7]);	//AUD
    //	if (typeof(vForexs[8]) !='undefined' && typeof(vCosts[8]) !='undefined') AddCurrencyRate(vForexs[8], vCosts[8]);	//CAD
    if (typeof (vForexs[9]) != 'undefined' && typeof (vCosts[9]) != 'undefined') AddCurrencyRate(vForexs[9], vCosts[9]); //SGD
    if (typeof (vForexs[10]) != 'undefined' && typeof (vCosts[10]) != 'undefined') AddCurrencyRate_no(vForexs[10], vCosts[10]); //EUR
    //	if (typeof(vForexs[11]) !='undefined' && typeof(vCosts[11]) !='undefined') AddCurrencyRate(vForexs[11], vCosts[11]);	//NZD
    //	if (typeof(vForexs[12]) !='undefined' && typeof(vCosts[12]) !='undefined') AddCurrencyRate(vForexs[12], vCosts[12]);

    AddFooter();
}

function ShowGoldPrice() {
    AddHeader(_gold_price + "");

    function AddGoldPrice(Currency, Rate) {
        document.writeln(var1, Currency, var2, Rate, '</td></tr>');
    }

    if (typeof (vGoldBuy) != 'undefined') AddGoldPrice(_sell + "", vGoldBuy);
    if (typeof (vGoldSell) != 'undefined') AddGoldPrice(_buy + "", vGoldSell);

    AddFooter();
}


function ShowWeather() {
    AddHeader(_weather + "");

    function AddCityWeather(City, Degree) {
        document.writeln(var1, City, var3, Degree, '</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('HCM', dHoChiMinh);

    AddFooter();
}

ShowForexRate();
//ShowWeather();
//ShowGoldPrice();

