function changePage(nodenm){
	//Find location of new information
	var target=document.getElementById('placetext');
	//Load XML source
	//var source = new ActiveXObject("Msxml2.DOMDocument.4.0");
  	var source, stylesheet;	
	if (window.ActiveXObject)
	{
	source = new ActiveXObject("Microsoft.XMLDOM");
	source.async = false;
   	source.load("research.xml");
	stylesheet = new ActiveXObject("Microsoft.XMLDOM");
  	stylesheet.async = false;
	stylesheet.load("index.xls");
	var newtext = source.getElementsByTagName('page');
	}
	// code for Mozilla, etc.
	else if (document.implementation && document.implementation.createDocument)
	{
	
	 var xsltProcessor = new XSLTProcessor();
	// *** load the XSL file
	
	var myXMLHTTPRequest = new XMLHttpRequest();
	myXMLHTTPRequest.open("GET", "index.xls", false);
	myXMLHTTPRequest.send(null);
	// *** get the XML document
	
	//var xslStylesheet = myXMLHTTPRequest.responseXML;
	//xsltProcessor.importStylesheet(xslStylesheet);
	// *** load the xml file
	
	myXMLHTTPRequest = new XMLHttpRequest();
	myXMLHTTPRequest.open("GET", "research.xml", false);
	myXMLHTTPRequest.send(null);
	
	var xmlSource = myXMLHTTPRequest.responseXML;
	
	var newtext=xmlSource.getElementsByTagName('page');
	
	}
	else
	{
	alert('Your browser cannot handle this script');
	}

	// Get location of all pages in XML
	
	
	var string;
  	

	if(nodenm==1){
	var mynode=newtext[0];
	// Parse results into a result DOM Document.
	}
	if(nodenm==2){
	var mynode=newtext[1];
	// Parse results into a result DOM Document.
	}
 	if(nodenm==3){
	var mynode=newtext[2];
	}
	if(nodenm==4){
	var mynode=newtext[3];
	}
	if (window.ActiveXObject){
		string=mynode.transformNode(stylesheet);
		target.innerHTML=string;
	}
	else{
	var resultDocument = xsltProcessor.transformToFragment(xmlSource, document);
	target.appendChild(resultDocument);
	}
	//string=mynode.transformToDocument(stylesheet);
	document.getElementById('textbox').value=string;
	
	
	if(nodenm ==3){
	alternate("table");
}
	
}


function alternate(id){
 if(document.getElementsByTagName){  
   var table = document.getElementById('table');  
   var rows = table.getElementsByTagName("tr"); 
	var divs= table.getElementsByTagName("div");
   for(i = 0; i < rows.length; i++){          
     if(i % 2 == 0){
		rows[i].style.backgroundColor = "#E7F1F8";
     
     }      
   }
}
}

function Research(newDoc){
//Change all corresponding backgrounds
changebackground(newDoc,2);
}

function Home(newDoc){
changebackground(newDoc,1);
}

function changebackground(newDoc,x){
var activelink="#BFDDED";
var inactivelink="#E7F1F8";
var homey=newDoc.getElementById('home');					
var research=newDoc.getElementById('who');
var publications=newDoc.getElementById('serv');
var press=newDoc.getElementById('cont');
//change everything to light blue
homey.firstChild.style.background=inactivelink;
research.firstChild.style.background=inactivelink;
publications.firstChild.style.background=inactivelink;
press.firstChild.style.background=inactivelink;
if(x==1){
homey.firstChild.style.background=activelink;
}
if(x==2){
research.firstChild.style.background=activelink;
}
if(x==3){
publications.firstChild.style.background=activelink;
}
if(x==4){
press.firstChild.style.background="#BFDDED";
}
}





