// JavaScript Document
//var PageBody = '2004 / 07 / 13#第四屆旺宏金矽獎-半導體設計與應用大賽 成績揭曉#../../h_6E24D6184C2DF9B448257065003026A4/9F23143D377E2D4C482570650030ADDD/?OpenDocument|2003 / 12 / 01#第三屆旺宏科學獎初審名單公佈#../../h_6E24D6184C2DF9B448257065003026A4/BDC39657F84B4410482570650030E64A/?OpenDocument|';
var _Items = new Array();
var _arrowImg = "/QuickPlace/mxedu/Main.nsf/h_Index/1F8F91B5A5C9534A4825706200204E6B/$File/2_3_main.gif?OpenElement";
function  InitializeContent(PageBody) {	
		PageBody = PageBody.substring(0, PageBody.length-1); //get rid of last "|"
		aSection = new Array();
		aSection = PageBody.split("|");  //  split pagebody into array (topic)
		var i=0;		
		for (i=0; i<aSection.length; i++)
		{
			_Items[i] = new Array();
			_Items[i]= aSection[i].split("#");
			//_Items[i][0] = month, _Items[i][1] = title; _Items[i][2] = url
		}
		
		// write content to page		
		var sContent = "<table width='97%'  border='0' align='right' cellspacing='0' cellpadding='0'>";
		for (i=0; i<_Items.length; i++) {
			sContent += "<tr>";
			sContent += "<td width='30%' align='left' valign='top' class='text1'>" + trimWS(_Items[i][0]) + "</td>";
			sContent += "<td width='70%' align='left' valign='top' class='text2'><a href='"+ _Items[i][2] + "' class='text2'>"+ _Items[i][1] + "</a></td>";
			sContent += "</tr>";
			sContent += "<tr><td colspan='2'>&nbsp;</td></tr>";			
		}
		sContent += "</table>";
		writeContent(sContent);		
}

function writeContent(sContent) {
	var sArea = "";
	sArea += "displayArea";	
	area = document.getElementById(sArea); 
	area.innerHTML = sContent;
}

function trimWS(str) {
	var w_space = String.fromCharCode(32);
	var strTemp = str;
	var i=0;
	for (i=0; i<strTemp.length; i++) {
		if (strTemp.charAt(i)==w_space) {
			strTemp = strTemp.substring(0, i) + strTemp.substring(i+1);
		}
	}
	return strTemp;
}