var xmlDoc=null;
if (window.ActiveXObject)
{// code for IE
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
else if (document.implementation.createDocument)
{// code for Mozilla, Firefox, Opera, etc.
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}
if (xmlDoc!=null)
{
xmlDoc.async=false;
xmlDoc.load("/xml_training/training_dates.xml");
var x=xmlDoc.getElementsByTagName("training");
var ab=new Date();

document.write("<br />");
document.write("<table border='0' cellpadding='0' cellspacing='0'>");
var h=0;
for (i=0;i<x.length;i++)
		{
		if(((Date.parse(ab)).valueOf())<((Date.parse(x[i].getElementsByTagName("date")[0].childNodes[0].nodeValue)).valueOf())&&h<50)
			{
		document.write("<tr><td colspan=3><hr /></td></tr>");
		document.write("<tr valign='top'>");
		document.write("<td cellpadding='5' valign='top' width='130'><p class='datescolumn01a'>");
		document.write(x[i].getElementsByTagName("full_date")[0].childNodes[0].nodeValue);
		document.write("</p></td>");
		document.write("<td cellpadding='5' valign='top' width='120'><p class='datescolumn02a'>");
		document.write(x[i].getElementsByTagName("city")[0].childNodes[0].nodeValue);
		document.write("</p></td>");
		document.write("<td cellpadding='5' valign='top' width='330'>");
		document.write(x[i].getElementsByTagName("building")[0].childNodes[0].nodeValue);
		document.write("<br />");
		document.write(x[i].getElementsByTagName("address")[0].childNodes[0].nodeValue);
		document.write("<br />");
		document.write(x[i].getElementsByTagName("phone")[0].childNodes[0].nodeValue);
		document.write("</td>");
		document.write("</tr>");
		h=h+1;
			}
		}
		document.write("</table>");
}
