﻿var tempHtml;
var tempString;
var tempString02;
var tempString03;
var totalNum = sectionArray.length;
if (section == null)	var section;
if (subSection == null)	var subSection;
if (level1 == null)	var level1;
//if (linkArray == null)	var linkArray = new Array(1, 2, 3);
if (linkArray == null)	var linkArray = new Array("");

var theClass;
var theColor;
if (section > 4) {
	theClass = "green04";
	theColor = "green";
} else {
	theClass = "orange04";
	theColor = "orange";
}


tempHtml = '<table width="100%" border="0" cellspacing="0" cellpadding="0">';


// Banners Starts

if (rightBannerArray[section-1] != null) {
	for (i=0;i<rightBannerArray[section-1].length;i++) {

		tempHtml += '	<tr>';
		tempHtml += '		<td style="padding-bottom:4px;"><a href="'+path+rightBannerArray[section-1][i].link+'" target="'+rightBannerArray[section-1][i].target+'"><img src="'+path+rightBannerArray[section-1][i].image+'" width="158" border="0" alt="'+rightBannerArray[section-1][i].name+'"></a></td>';
		tempHtml += '	</tr>';

	}
}

// Banners Ends


tempHtml += '</table>';


tempHtml += '<table width="100%" border="0" cellpadding="0" cellspacing="0">';


// Links Starts

if (linkArray != null && linkArray[0] != "") {

	tempHtml += '	<tr>';
	tempHtml += '		<td width="20%"><img src="'+path+'images/common/icon_see.gif" width="27" height="23" vspace="5"></td>';
	tempHtml += '		<td valign="bottom" class="'+theClass+'" style="padding-bottom:3px; line-height:170%;"><strong>可參閱......</strong></td>';
	tempHtml += '	</tr>';

	tempHtml += '	<tr>';
	tempHtml += '		<td colspan="2" bgcolor="'+colorArray[section-1][5]+'"><img src="'+path+'images/common/spacer.gif" width="1" height="1"></td>';
	tempHtml += '	</tr>';


	tempHtml += '	<tr>';
	tempHtml += '		<td colspan="2" style="padding-top:5px; padding-bottom:5px" bgcolor="'+colorArray[section-1][4]+'"><table width="100%" border="0" cellpadding="0" cellspacing="0">';


	if (linkArray != null) {
		for (i=0;i<linkArray.length;i++) {
			tempString = Number(linkArray[i]) - 1;

			tempHtml += '	<tr valign="top">';
			tempHtml += '		<td width="16" align="center"><img src="'+path+'images/common/arrow_01.gif" width="3" height="5" vspace="8"></td>';
			tempHtml += '		<td style="padding-top:3px; padding-bottom:5px;"><a href="'+path+linkAllArray[tempString].link+'" target="'+linkAllArray[tempString].target+'" class="content" style="line-height:130%">'+linkAllArray[tempString].text+'</a></td>';
			tempHtml += '	</tr>';

		}
	}


	tempHtml += '		</table></td>';
	tempHtml += '	</tr>';

	tempHtml += '	<tr>';
	tempHtml += '		<td colspan="2" bgcolor="'+colorArray[section-1][5]+'"><img src="'+path+'images/common/spacer.gif" width="1" height="1"></td>';
	tempHtml += '	</tr>';

}

// Links Ends


// Tips Starts

if (tipsArray[section-1] != null) {

	var tipsNum = Math.floor(Math.random()*tipsArray[section-1].length);

	tempHtml += '	<tr>';
	tempHtml += '		<td colspan="2" style="padding-top:8px"><img src="'+path+'images/common/icon_know_'+theColor+'.gif" width="158" height="36"></td>';
	tempHtml += '	</tr>';


	tempHtml += '	<tr>';
	tempHtml += '		<td colspan="2" bgcolor="'+colorArray[section-1][0]+'" style="padding:1px; padding-top:0px"><table width="100%" border="0" cellpadding="6" cellspacing="0" bgcolor="'+colorArray[section-1][4]+'">';


	tempHtml += '<tr>';
	tempHtml += '	<td class="content" style="padding-bottom:15px">';
	
	if(tipsArray[section-1][tipsNum].link != "")	tempHtml += '<a href="'+path+tipsArray[section-1][tipsNum].link+'" target="'+tipsArray[section-1][tipsNum].target+'" class="content">';
	
	tempHtml += tipsArray[section-1][tipsNum].text;
	
	if(tipsArray[section-1][tipsNum].link != "")	tempHtml += '</a>';
	
	tempHtml += '	</td>';
	
	tempHtml += '</tr>';


	tempHtml += '	</table></td>';
	tempHtml += '</tr>';

	tempHtml += '	<tr>';
	tempHtml += '		<td colspan="2"><img src="'+path+'images/common/spacer.gif" width="1" height="2"></td>';
	tempHtml += '	</tr>';

	tempHtml += '	<tr>';
	tempHtml += '		<td colspan="2" bgcolor="'+colorArray[section-1][5]+'"><img src="'+path+'images/common/spacer.gif" width="1" height="1"></td>';
	tempHtml += '	</tr>';

}

// Tips Ends


tempHtml += '</table>';


document.write(tempHtml);

