<!--
var xmlHttp;
var myid = null;

var notWhitespace = /\S/;
function cleanWhite(node) {
for (var x = 0; x < node.childNodes.length; x++) {
var childNode = node.childNodes[x];
if ((childNode.nodeType == 3)&&(!notWhitespace.test(childNode.nodeValue))) {
// that is, if it's a whitespace text node
node.removeChild(node.childNodes[x])
x--;
}
if (childNode.nodeType == 1) {
// elements can have text child nodes of their own
cleanWhite(childNode);
}
}
}

function showproject(varid)
{ 

myid=varid;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET","projects.xml",true);
xmlHttp.send(null);


}

function stateChanged() 

{ 
if (xmlHttp.readyState==4)
{
	
	
var xmlDoc=xmlHttp.responseXML;
/*document.getElementById("newsid").href=
"newnews.php?NewsID="+xmlDoc.getElementsByTagName("newsidd")[0].childNodes[0].nodeValue;
document.getElementById("newsdel").href=
"delete.php?NewsID="+xmlDoc.getElementsByTagName("newsidd")[0].childNodes[0].nodeValue;*/
//xmlDoc.getElementsByTagName("project");
//document.getElementById("projectname").innerHTML=xmlDoc.documentElement.childNodes[1].firstChild.text;
var projects=xmlDoc.documentElement;
cleanWhite(projects);




document.getElementById("projectname").innerHTML=projects.childNodes[myid-1].childNodes[0].childNodes[0].nodeValue;
<!--document.getElementById("projectsummary").innerHTML=projects.childNodes[myid-1].childNodes[1].childNodes[0].nodeValue;-->
document.getElementById("projectdescription").innerHTML=projects.childNodes[myid-1].childNodes[2].childNodes[0].nodeValue;

<!--<img src="images/map_small.jpg" />-->

var imgWrapper = document.createElement("img");
imgWrapper.setAttribute("src", projects.childNodes[myid-1].childNodes[3].childNodes[0].nodeValue);

var imgDetails = document.getElementById("projectimg");
while(imgDetails.hasChildNodes()){
	imgDetails.removeChild(imgDetails.lastChild);
}
imgDetails.appendChild(imgWrapper)




}
}

function GetXmlHttpObject()
{
	
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

// 	Run showproject function once JS is loaded
window.onload = runOnLoad;

function runOnLoad(){
	showproject(3);
}
//-->