function getHomepageNews() {

   var myNewsXML, names, dates, descriptions;
   var displaytxt="<p class='floatrightsidebox_normal_title'>Recent News:</p>";
   
	if (window.ActiveXObject) {	myNewsXML=new ActiveXObject("Microsoft.XMLDOM"); }
	// code for Mozilla, Firefox, Opera, etc.
	else if (document.implementation && document.implementation.createDocument) { myNewsXML= document.implementation.createDocument("", "", null); }
	// no good browser found
	else { alert ("Failed to load XML data source!"); }
	myNewsXML.async=false;
	myNewsXML.load("_database/news.xml"+"?xml="+Math.ceil(Math.random()*10000001));

   names=myNewsXML.getElementsByTagName("name");
   dates=myNewsXML.getElementsByTagName("date");
   descriptions=myNewsXML.getElementsByTagName("short_description");
     
   //Extract the different values using a loop.   
   if (names.length > 1) { 
	   for(var counter=0;counter<1;counter++) {
	      displaytxt += "<p class='floatrightnormal'><i>" + dates.item(counter).firstChild.nodeValue + "</i><br /><b>" + names.item(counter).firstChild.nodeValue + "</b><br />" + descriptions.item(counter).firstChild.nodeValue + "</p>";
	   }
	}
	else {
	   for(var counter=0;counter<names.length;counter++) {
	      displaytxt += "<p class='floatrightnormal'><i>" + dates.item(counter).firstChild.nodeValue + "</i><br /><b>" + names.item(counter).firstChild.nodeValue + "</b><br />" + descriptions.item(counter).firstChild.nodeValue + "</p>";
	   }
	}
	displaytxt += "<p class='normal'><a class='normal side-link' href='news.htm'>See all the NanoLAB news...</a></p>";
   	document.getElementById("HomepageNews").innerHTML=displaytxt;

}

function getHomepagePublications() {
   var myPublicationsXML, titles, authors, references, dates;
   var displaytxt="<p class='floatrightsidebox_normal_title'>Recent Publications:</p>";

	if (window.ActiveXObject) {	myPublicationsXML=new ActiveXObject("Microsoft.XMLDOM"); }
	// code for Mozilla, Firefox, Opera, etc.
	else if (document.implementation && document.implementation.createDocument) { myPublicationsXML= document.implementation.createDocument("", "", null); }
	// no good browser found
	else { alert ("Failed to load XML data source!"); }
	myPublicationsXML.async=false;
	myPublicationsXML.load("_database/publications.xml"+"?xml="+Math.ceil(Math.random()*10000001));

   //Put the <name> element into an object.
   
   titles=myPublicationsXML.getElementsByTagName("title");
   authors=myPublicationsXML.getElementsByTagName("authors");
   references=myPublicationsXML.getElementsByTagName("reference");
   dates=myPublicationsXML.getElementsByTagName("date");
   
   //Extract the different values using a loop.
   if (titles.length > 2) {
	   for(var counter=0;counter<2;counter++) {
	      displaytxt += "<p class='floatrightnormal'><b>" + titles.item(counter).firstChild.nodeValue + "</b><br /><i>" + authors.item(counter).firstChild.nodeValue + "</i><br />" + references.item(counter).firstChild.nodeValue + " (" + dates.item(counter).firstChild.nodeValue + ")</p>";
	   }
	}
	else {
	   for(var counter=0;counter<titles.length;counter++) {
	      displaytxt += "<p class='floatrightnormal'><b>" + titles.item(counter).firstChild.nodeValue + "</b><br /><i>" + authors.item(counter).firstChild.nodeValue + "</i><br />" + references.item(counter).firstChild.nodeValue + " (" + dates.item(counter).firstChild.nodeValue + ")</p>";
	   }
	}
	displaytxt += "<p class='normal'><a class='normal side-link' href='publications.htm'>See all our publications...</a></p>";
   	document.getElementById("HomepagePublications").innerHTML=displaytxt;
} 


