<!--
//=========================================================
// This function does the HTML for the "latest news" page. 
// The data comes from the news XML file.
// Parameter CountryCode is GB or SA.  
//=========================================================
function doLatestNewsTable1(CountryCode) {
	var xmlDoc, NewsArray;
	var Title = "", File = "";
	var i=0, j=0, iStoriesDisp = 0, TotNumStories = 0; 
	var XMLFile = "", Country = "", NewsDir = ""; 
	var Str = ""; 
	var TitleDef = "No Title Found";

	//-----------------------
	// Open up news XML file
	//-----------------------
	if (CountryCode == "SA") 
	{
		NewsDir = "SANews/"; 
		XMLFile = "SANews/AllSANews.xml";
		Country = "South African";
	}
	if (CountryCode == "GB") 
	{
		NewsDir = "GBNews/"; 
		XMLFile = "GBNews/AllGBNews.xml"; 
		Country = "Great Britain";
	}

	if (XMLFile == "" || Country == "" || NewsDir == "") return 1;
	else
	{
		xmlDoc = XMLFileLoad(XMLFile, true, true); 
		if (xmlDoc == null) return 2;
		else
		{
			//-----------------
			// Fill news array
			//-----------------
			NewsArray = xmlDoc.getElementsByTagName("STORY");
			TotNumStories = NewsArray.length; 
			if (TotNumStories <= 0) return 3;
			else 
			{
				document.write("<td align=\"left\">");
				iStoriesDisp = 3;
				if (iStoriesDisp > TotNumStories) iStoriesDisp = TotNumStories;
				for (i=0; i<iStoriesDisp; i++)
				{
					//-------------------------------------------------------
					// Get titles and files etc. of most recent news stories
					//-------------------------------------------------------
					Title = TrimString(getChildNode(NewsArray[i], "TITLE", 1, true, TitleDef));
					File = TrimString(getChildNode(NewsArray[i], "FILE", 1, true, "?"));
					//-------------------------------------------
					// HTML for the most recent news stories. 
					// Create link to story if we have the file. 
					//-------------------------------------------
					if (File != "?") document.write("<a href=\""+NewsDir+File+".xml\">");
					document.write("<p>");
					document.write(Title);
					document.write("</p>");
					if (File != "?") document.write("</a>");
				}
				document.write("</td>");
				return 0;
			}
		}
	}
} // End of function doLatestNewsTable1(CountryCode)
-->
