// This file contains functions that load XML content and places such content on the website.
	
	function loadNewsXML(gno_language)
	{
		// This section takes care of loading the XML file.
		var xmlDoc=null;

		if (window.XMLHttpRequest)
		{
			xhttp=new XMLHttpRequest();
		}
		else // Internet Explorer 5/6
		{
			xhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		xhttp.open("GET","includes/news.xml?"+Math.random(),false); // Be sure to change this filename to the source file you want.
		xhttp.send("");
		xmlDoc=xhttp.responseXML;
		
		// If the source file exists and loaded properly, proceed with function.
		if (xmlDoc!=null)
		{
			var gno_date;
			var gno_link;
			var gno_description;
			var gno_htmlContent="";


			// Load the proper language section.
			var lang=xmlDoc.getElementsByTagName("LANGUAGE");
			var langIndex;
			for (i=0;i<lang.length;i++)
			{
				if(lang[i].attributes.getNamedItem("language").nodeValue == gno_language)
				{
					langIndex=i;
					i=lang.length;
				}
			}
			
			// Extract the information from the XML file.
			var baseItems=lang[langIndex].getElementsByTagName("NEWS");
			for (j=0;j<baseItems.length;j++)
			{
				gno_link=baseItems[j].getElementsByTagName("LINK")[0].childNodes[0].nodeValue;
				gno_date=baseItems[j].getElementsByTagName("DATE")[0].childNodes[0].nodeValue;
				gno_description=baseItems[j].getElementsByTagName("DESCRIPTION")[0].childNodes[0].nodeValue;
				
				gno_htmlContent=gno_htmlContent + '<p class="gno-news-item"><a href="' + gno_link + '">' + gno_date + '</a> - ' + gno_description + '</p> \n';
			}
			
			// Instert the content into the html file.
			document.getElementById("gno-newsbox").innerHTML = gno_htmlContent;
		}
		else
		{
			alert("Error loading XML");
		}
	}
	
	function loadSideArticleXML(gno_language,gno_subPath)
	{
		// Set number of levels to go down.
		var gno_prefix="";
		for (j=0;j<gno_subPath;j++)
		{
			gno_prefix=gno_prefix + "../";
		}

		// This section takes care of loading the XML file.
		var xmlDoc=null;

		if (window.XMLHttpRequest)
		{
			xhttp=new XMLHttpRequest();
		}
		else // Internet Explorer 5/6
		{
			xhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		xhttp.open("GET",gno_prefix + "includes/sidearticle.xml",false); // Be sure to change this filename to the source file you want.
		xhttp.send("");
		xmlDoc=xhttp.responseXML;
		
		// If the source file exists and loaded properly, proceed with function.
		if (xmlDoc!=null)
		{
			var gno_title;
			var gno_link;
			var gno_description;

			// Load the proper language section.
			var lang=xmlDoc.getElementsByTagName("LANGUAGE");
			var langIndex;
			for (i=0;i<lang.length;i++)
			{
				if(lang[i].attributes.getNamedItem("language").nodeValue == gno_language)
				{
					langIndex=i;
					i=lang.length;
				}
			}
			
			// Extract the information from the XML file.
			var baseItems=lang[langIndex].getElementsByTagName("ARTICLE");
			gno_title=baseItems[0].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue;
			gno_link=baseItems[0].getElementsByTagName("LINK")[0].childNodes[0].nodeValue;
			gno_description=baseItems[0].getElementsByTagName("DESCRIPTION")[0].childNodes[0].nodeValue;
			
			// Instert the content into the html file.
			document.getElementById("gno-article-title").childNodes[0].nodeValue = gno_title;
			document.getElementById("gno-article-link").href = gno_prefix + gno_link;
			document.getElementById("gno-article-description").childNodes[0].nodeValue = gno_description;
		}
		else
		{
			alert("Error loading XML");
		}
	}