function show_main_content() {

document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr>');
document.write('<td><img src="images/share/spacer.gif" width="1" height="8"></td>');
document.write('</tr>');

for (ii=0; ii<4; ii++) {
    document.write('<tr>');
    document.write('<td><table width="0" border="0" cellspacing="0" cellpadding="0">');
    document.write('<tr valign="top">');
    document.write('<td><img src="images/share/spacer.gif" width="14" height="1"></td>');

    for (jj=0; jj<2; jj++) {
        document.write('<td><table width="190" border="0" cellspacing="0" cellpadding="0">');
        document.write('<tr>');

        document.write('<td><img src="images/front/m0'+((ii*2)+jj+1)+'_title.gif"></td>');
/*
        document.write('<table width="100%" height="22"  border="1" cellpadding="0" cellspacing="0">');
        document.write('<tr>');

        document.write('<td align="center" bgcolor="#32327b"><img src="images/front/tit_0'+((ii*2)+jj+1)+'.gif" width="65" height="14"></td>');
//        document.write('<td align="center" class="main_content">ºô¤W§ë«O</td>');
        document.write('<td width="4" bgcolor="#7f9fd3"><img src="images/share/spacer.gif" width="4" height="1"></td>');
        document.write('<td width="25" bgcolor="#6dcff6"><img src="images/share/spacer.gif" width="25" height="8"></td>');
        document.write('<td width="77"><img src="images/front/img_table_small_end.gif" width="77" height="22"></td>');
        document.write('</tr>');
        document.write('</table>');
*/
        document.write('</tr>');

        document.write('<tr>');
        document.write('<td><img src="images/front/img_table_small_bar.gif" width="190" height="12"></td>');
        document.write('</tr>');
        document.write('<tr>');
        document.write('<td valign="top"><table width="0" border="0" cellspacing="0" cellpadding="0">');
        document.write('<tr valign="top">');
        document.write('<td width="75"><img src="images/front/m0'+((ii*2)+jj+1)+'a_title.gif" width="67" height="52"></td>');
        document.write('<td><table width="0" border="0" cellspacing="0" cellpadding="0">');
        document.write('<tr>');
        document.write('<td valign="top" class="news">'+url[((ii*2)+jj)]+contentText[((ii*2)+jj)]+'</a></td>');
        document.write('</tr>');
        document.write('</table></td>');
        document.write('</tr>');
        document.write('</table>');
        document.write('</td>');
        document.write('</tr>');
        document.write('</table></td>');
        document.write('<td width="15"><img src="images/share/spacer.gif" width="15" height="1"></td>');
    }
    document.write('</tr>');
    document.write('</table></td>');
    document.write('</tr>');
    document.write('<tr>');
    document.write('<td><img src="images/share/spacer.gif" width="1" height="12"></td>');
    document.write('</tr>');
}
document.write('<tr>');
document.write('<td><img src="images/share/spacer.gif" width="1" height="12"></td>');
document.write('</tr>');
document.write('</table>');
}  // end of show_main_content


function show_promo_content() {
    for (ii=0; ii<promoItem_text.length; ii++) {
        document.write('<tr>');
        document.write('<td valign="top">-&nbsp;&nbsp;</td>');
        document.write('<td width="240">');
        document.write(promoItem_linkHead[ii]);
        document.write(promoItem_text[ii]);
        document.write(promoItem_linkTail[ii]);
        document.write('</td>');
        document.write('</tr>');
        document.write('<tr>');
        document.write('<td colspan="2"><img src="images/share/1x1.gif" height="3"></td>');
        document.write('</tr>');
    }
} // end of show_promo_content

function show_time() {
	document.write('<tr valign="middle">');
	document.write('<td>Last Update Date:</td>');
	document.write('<td>'+update_time[0]+'</td>');
	document.write('</tr>');
	document.write('<tr valign="middle">');
	document.write('<td>Last Update Time:</td>');
	document.write('<td>'+update_time[1]+'</td>');
	document.write('</tr>');
}

function show_bestRate_content() {

	document.write('<tr align="center">');
	document.write('<td>'+bestRate+'%</td>');
	document.write('</tr>');
}
  
function show_savingRate_content() {
	document.write('<tr align="center">');
	document.write('<td>'+hkdRate[hkdRate.length-1][1]+'%</td>');
	document.write('</tr>');
}

function show_depositsfx_content() {
	for (i=0; i<exchangeRate.length; i++) {
		document.write('<tr align="center" bgcolor="#FFFFFF">');
		for (j=0; j<exchangeRate[i].length; j++) {
			document.write('<td width="30%"><font size="2" face="Verdana, Arial, Helvetica">');
			document.write(exchangeRate[i][j]);
			document.write('</font></td>');
		}
		document.write('</tr>');
	}
}

function show_club_content() {

	for (i=2; i<clubRate.length; i++) {
		document.write('<tr align="center" bgcolor="#FFFFFF">');
		for (j=0; j<clubRate[i].length; j++) {
			document.write('<td nowrap="nowrap"><font size="-2" face="Verdana, Arial, Helvetica">');
			document.write(clubRate[i][j]);
			document.write('</font></td>');
		}
		document.write('</tr>');
	}

}

function show_foreign_content() {

	for (i=0; i<foreignRate.length; i++) {
        document.write('<tr align="center" bgcolor="#FFFFFF">');
        document.write('<td ><font size="2" face="Verdana, Arial, Helvetica">');
        document.write(foreignRate[i][0]);
        document.write('</font></td>');
        for (j=1; j<9; j++) {
            document.write('<td ><font size="2" face="Verdana, Arial, Helvetica">');
            document.write(foreignRate[i][j]);
            document.write('</font></td>');
        }       
        document.write('</tr>');
        /*
        document.write('<tr align="center" bgcolor="#FFFFFF">');
        document.write('<td nowrap="nowrap"><font size="2" face="Verdana, Arial, Helvetica">');
        document.write('e-Deposit rate</font></td>');
        for (j=9; j<17; j++) {              
            document.write('<td><font size="2" face="Verdana, Arial, Helvetica">');
            document.write(foreignRate[i][j]);
            document.write('</font></td>');
        }*/       
        document.write('</tr>');
    }

}

function show_hkd_content() {

	for (i=0; i<hkdRate.length-2; i++) {
		document.write('<tr align="center" bgcolor="#FFFFFF">');
		for (j=0; j<hkdRate[i].length; j++) {
		if(j==0||j==1||j==3||j==5){
			document.write('<td nowrap="nowrap" width="130"><font size="2" face="Verdana, Arial, Helvetica">');
			document.write(hkdRate[i][j]);
			document.write('</font></td>');
			}
		}
		document.write('</tr>');
	}
}


function show_news_content() {
    var showtext  = '';
    for (ii=0; ii<newsItem.length; ii++) {
        //document.write('<p><b>'+newsDate[ii]+'</b><br>');
        //document.write(newsItem[ii]);
        //document.write('</p>');
        showtext = showtext + '<p><b>'+newsDate[ii]+'</b><br>'+newsItem_linkHead[ii]+newsItem[ii]+newsItem_linkTail[ii]+'</p>';
    }
    return showtext;
} // end of show_news_content


function show_ad_content() {
	var numBanner = 3;
	var type;
	document.write('<table width="0" border="0" cellspacing="0" cellpadding="0">');
	for (ii=0; ii<numBanner; ii++) {
		document.write('<tr>');
		document.write('<td>');
		type = bannertype[ii].substring(bannertype[ii].indexOf("."));
		if (type == ".swf") {
			// Flash banner
			document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" ID=pc WIDTH=161 HEIGHT=84>');
			document.write('<PARAM NAME=movie VALUE="images/front/'+bannertype[ii]+'"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="images/front/'+bannertype[ii]+'" quality=high bgcolor=#FFFFFF  WIDTH=161 HEIGHT=84 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
			document.write('</OBJECT>');
		} else {
			// other banner
			document.write(banner_linkHead[ii]+'<img src="images/front/'+bannertype[ii]+'" Width="161" height="84" border="0">'+banner_linkTail[ii]);
		}
		document.write('</td>');
		document.write('</tr>');
		document.write('<tr>');
		document.write('<td><img src="images/share/spacer.gif" width="1" height="12"></td>');
		document.write('</tr>');
	}
	document.write('</table>');
}
function displayRate(ccy){
  getData(ccy);
  var str='<table class="contTable1"><tr><th><div align="center"><strong>Currency Code</strong></div></th><th width="200"><div align="center"><strong>Bank Buy</strong></div></th><th width="200"><div align="center"><strong>Bank Sell</strong></div></th></tr>';
  for(var i=0;i<foreignRate.length;i++){
  str+='<tr>';
  for(var k=0;k<foreignRate[i].length;k++){
  if(k==0)
  str+='<td width="600" align="center"><label>'+foreignRate[i][k]+'</label></td>';
  else
  str+='<td width="100" align="center"><label>'+foreignRate[i][k]+'</label></td>';
  }
  str+='</tr>';
  }
  str+='</table>';
  document.getElementById("rate").innerHTML=str;
  }

