function getModDate() 
{
	/* If the instance of the ajax object has not yet been generated, do it now. */
	if (!ajax.exists)
	{
		ajax = new ajax();
		ajax.method = 'POST';
		ajax.mimeType = 'text/xml';
	}
	else
	if (ajax.method != 'POST') 
	{
		ajax.method = 'POST';
	}
	
	ajax.mimeType = 'text/xml';
	
	var filestring = location.toString();
	//alert (filestring);
	var arrFileString = filestring.split('/');
	var fileName = '.';
	for (var i = 3; i < (arrFileString.length - 1); i++) 
	{
		fileName += '/';
		fileName += arrFileString[i];
	}
	fileName += '/';
	fileName += arrFileString[arrFileString.length - 1];
	
	if (fileName.indexOf("?")!=-1){
	var index=fileName.indexOf("?")
	fileName=fileName.substring(0,index)
	}
	else if (fileName.indexOf("#")!=-1){
	var index=fileName.indexOf("#")
	fileName=fileName.substring(0,index)
	}
	//alert(fileName);
	var postData = 'filename=' + fileName;
	/* Use the ajax object to call the getcentres.php file and retrieve the centre information. The 
	   information will be returned as an xml file. */
	ajax.doGet('http://isaac.auckland.ac.nz/lastrevised.php', processDate, 'xml', postData);
	
}

function processDate(resp) 
{
	var xmlDoc = resp;
	var modDate = xmlDoc.getElementsByTagName("moddate");
	var dateVal = modDate[0].childNodes[0].nodeValue;
	var dateSpan = document.getElementById("lastrevised");
	if (dateSpan.hasChildNodes()) 
	{
		while (dateSpan.hasChildNodes()) 
		{
			dateSpan.removeChild(dateSpan.firstChild);
		}
	}
	dateSpan.appendChild(document.createTextNode(dateVal));
}

function openWin(file)
{
NewWindow=window.open(file + '.pdf', 'pdf','width=800,height=500,location=yes,menubar=yes,resizable=yes');
  }
function openUrl(url)
{
NewWindow=window.open(url,'url' ,'width=800,height=500,location=yes,toolbar=yes,menubar=yes,directories=yes,resizable=yes,scrollbars=yes');
  }
 function openNews(news)
{
NewWindow=window.open('./newsletters/news'+news+'.pdf', 'pdf','width=800,height=500,location=yes,menubar=yes,resizable=yes');
  }
  
  function submitform()
{
  document.myform.submit();
}

