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">網上投保</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>最 後 更 新 日 期：</td>');
	document.write('<td>'+update_time[0]+'</td>');
	document.write('</tr>');
	document.write('<tr valign="middle">');
	document.write('<td>最 後 更 新 時 間：</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 nowrap="nowrap"><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 – 存款利率</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><font size="2" face="Verdana, Arial, Helvetica">');
			document.write(hkdRate[i][j]);
			document.write('</font></td>');
			}
		}
		document.write('</tr>');
	}
}

function show_5_1_2_latest_content() {

	document.write('<div id="lastestnews">');
	var time =data[0][0];
	if(time!=null) {
		var time2 = "20"+time.substr(0,2)+" 年 "+time.substr(2,2)+" 月 "+time.substr(4,2)+" 日";
		var content=data[0][1];
		document.write(' <p><strong>'+time2+'</strong></p>');
		document.write(' <p>'+content+'...... 更多<a href="#" onClick="go(\''+time+'\')"><img src="/en/images/but_press_pdf.gif" width="36" height="16" border="0" /></a></td></p>');
	}
	document.write('</div>');

}

function show_5_1_2_content() {

	for (i=1; i<data.length; i++) {
		var time =data[i][0];

		if(time!=null) {
			var time2 = "20"+time.substr(0,2)+" 年 "+time.substr(2,2)+" 月 "+time.substr(4,2)+" 日";
			document.write('<tr>');
			document.write('<td align="left">'+time2+'</td>');
			document.write('<td>'+data[i][1]+'</td>');
			document.write('<td align="left"><a href="javascript:go(\''+time+'\')"><img src="/en/images/but_press_pdf.gif" width="36" height="16" border="0" /></a></td>');
			document.write('</tr>');
		}
	}
}

function show_5_1_3_latest_content() {

	document.write('<div id="lastestnews">');
	var time =data[0][0];
	if(time!=null) {
		var time2 = "20"+time.substr(0,2)+" 年 "+time.substr(2,2)+" 月 "+time.substr(4,2)+" 日";
		var content=data[0][1]+"   "+data[0][2];
		document.write(' <p><strong>'+time2+'</strong></p>');
		document.write(' <p>'+content+'...... 更多<a href="#" onClick="go(\''+time+'\')"><img src="/en/images/but_press_pdf.gif" width="36" height="16" border="0" /></a></td></p>');
	}
	document.write('</div>');
}

function show_5_1_3_content() {

	//start from second record
	for (i=1; i<data.length; i++) {
		var time =data[i][0];
		if(time!=null) {
			var time2 = "20"+time.substr(0,2)+" 年 "+time.substr(2,2)+" 月 "+time.substr(4,2)+" 日";
			document.write('<tr>');
			document.write('<td align="left">'+time2+'</td>');
			document.write('<td align="left">'+data[i][1]+'</td>');
			document.write('<td align="left">'+data[i][2]+'</td>');
			document.write('<td align="left"><a href="javascript:go(\''+time+'\')"><img src="/en/images/but_press_pdf.gif" width="36" height="16" border="0" /></a></td>');
			document.write('</tr>');
		}
	}
}

function show_5_2_2_latest_content() {

	document.write('<div id="lastestnews">');
	var time =data[0][0];
	if(time!=null) {
		var time2 = "20"+time.substr(0,2)+" 年 "+time.substr(2,2)+" 月 "+time.substr(4,2)+" 日";
		var content=data[0][0];
		document.write(' <p><strong>'+time2+'</strong><a href="#" onClick="go(\''+time+'\')"><img src="/en/images/but_press_pdf.gif" width="36" height="16" border="0" /></a></p>');
	}
	document.write('</div>');

}
function show_5_2_2_content() {

	//start from second record
	for (i=1; i<data.length; i++) {
		var time =data[i][0];

		if(time!=null) {
			var time2 = "20"+time.substr(0,2)+" 年 "+time.substr(2,2)+" 月 "+time.substr(4,2)+" 日";
			document.write('<tr>');
			document.write('<td align="left">'+time2+'</td>');
			document.write('<td align="left"><a href="javascript:go(\''+time+'\')"><img src="/en/images/but_press_pdf.gif" width="36" height="16" border="0" /></a></td>');
			document.write('</tr>');
		}
	}
}

function show_5_2_3_latest_content() {

	document.write('<div id="lastestnews">');
	var time =data[0][3];

	if(time!=null) {
		var time2 = "20"+time.substr(0,2)+" 年 "+time.substr(2,2)+" 月 "+time.substr(4,2)+" 日";
		var content=data[0][0]+ " "+data[0][1];
		document.write(' <p><strong>'+time2+'</strong></p>');
		document.write(' <p>'+content+'...... 更多<a href="#" onClick="go(\''+data[0][0]+'\')"><img src="/en/images/but_press_pdf.gif" width="36" height="16" border="0" /></a></td></p>');
	}
	document.write('</div>');

}
function show_5_2_3_content() {

	//start from second record
	for (i=1; i<data.length; i++) {
		var time =data[i][3];
		if(time!=null) {
			var time2 = "20"+time.substr(0,2)+" 年 "+time.substr(2,2)+" 月 "+time.substr(4,2)+" 日";
			var content = data[i][0]+ " "+data[i][1];
			document.write('<tr>');
			document.write('<td align="left">'+time2+'</td>');
			document.write('<td align="left">'+content+'</td>');
			document.write('<td align="left"><a href="javascript:go(\''+data[i][0]+'\')"><img src="/en/images/but_press_pdf.gif" width="36" height="16" border="0" /></a></td>');
			document.write('</tr>');
		}
	}
}

function show_5_3_1_latest_content() {

	document.write('<div id="lastestnews">');
	var time =data[0][0];
	if(time!=null) {
		var time2 = "20"+time.substr(0,2)+" 年 "+time.substr(2,2)+" 月 "+time.substr(4,2)+" 日";
		var content=data[0][1];
		document.write(' <p><strong>'+time2+'</strong><a href="#" onClick="go(\''+time+'\')"><img src="/en/images/but_press_pdf.gif" width="36" height="16" border="0" /></a></p>');
	}
	document.write('</div>');

}
function show_5_3_1_content() {

	//start from second record
	for (i=1; i<data.length; i++) {
		var time =data[i][0];

		if(time!=null) {
			var time2 = "20"+time.substr(0,2)+" 年 "+time.substr(2,2)+" 月 "+time.substr(4,2)+" 日";
			document.write('<tr>');
			document.write('<td align="left">'+time2+'</td>');
			document.write('<td align="left"><a href="javascript:go(\''+time+'\')"><img src="/en/images/but_press_pdf.gif" width="36" height="16" border="0" /></a></td>');
			document.write('</tr>');
		}
	}
}

function show_5_3_2_latest_content() {

	document.write('<div id="lastestnews">');
	var time =data[0][0];

	if(time!=null) {
		var time2 = "20"+time.substr(0,2)+" 年 "+time.substr(2,2)+" 月 "+time.substr(4,2)+" 日";
		var content=data[0][1];
		document.write(' <p><strong>'+time2+'</strong><a href="#" onClick="go(\''+time+'\')"><img src="/en/images/but_press_pdf.gif" width="36" height="16" border="0" /></a></p>');
	}
	document.write('</div>');

}
function show_5_3_2_content() {

	//start from second record
	for (i=1; i<data.length; i++) {
		var time =data[i][0];
		if(time!=null) {
			var time2 = "20"+time.substr(0,2)+" 年 "+time.substr(2,2)+" 月 "+time.substr(4,2)+" 日";
			document.write('<tr>');
			document.write('<td align="left">'+time2+'</td>');
			document.write('<td align="left"><a href="javascript:go(\''+time+'\')"><img src="/en/images/but_press_pdf.gif" width="36" height="16" border="0" /></a></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>貨幣</strong></div></th><th width="400"><div align="center"><strong>銀行買入</strong></div></th><th width="400"><div align="center"><strong>銀行賣出</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="700" align="center"><label>'+foreignRate[i][k]+'</label></td>';
  else
  str+='<td width="200" align="center"><label>'+foreignRate[i][k]+'</label></td>';
  }
  str+='</tr>';
  }
  str+='</table>';
  document.getElementById("rate").innerHTML=str;
  }
