var oDate = new Date();
var ret = "";
ret = oDate.getFullYear();
var m = oDate.getMonth() + 1;
var mm = m < 10 ? "0" + m : m;
ret = ret + mm;
var d = oDate.getDate();
var dd = d < 10 ? "0" + d : d;
ret = ret + dd;

// declare the local variables
var xmlDoc, xslDoc, docProcessor, docCache, DocRequest, docFragment;

var moz = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined'); 
var ie = (typeof window.ActiveXObject != 'undefined'); 

if (moz) { 
	// instantiate and load the xml document
	docRequest = new XMLHttpRequest();
	docRequest.open("GET", "schedule.xml", false);
	docRequest.send(null);
	xmlDoc = docRequest.responseXML;
	// instantiate and load the xsl document
	docRequest = new XMLHttpRequest();
	docRequest.open("GET", "crbmx_results.xsl", false);
	docRequest.send(null);
	xslDoc = docRequest.responseXML;
	// instantiate the document processor and submit the xsl document
	docProcessor = new XSLTProcessor();
	docProcessor.importStylesheet(xslDoc);
	// add parameters to the xsl document
	docProcessor.setParameter(null, "cdate", ret);
	// clear the passed div if anything was in it
	document.getElementById("schedule").innerHTML = "";
	// process the documents into html and submit to the passed div to the HMTL page
	docFragment = docProcessor.transformToFragment(xmlDoc, document);
	document.getElementById("schedule").appendChild(docFragment);
} else if (ie) { 
	// instantiate and load the xml document
	xmlDoc = new ActiveXObject("MSXML2.DOMDocument.3.0");
	xmlDoc.async = false;
	xmlDoc.load("schedule.xml");
	// instantiate and load the xsl document
	xslDoc = new ActiveXObject("MSXML2.FreeThreadedDOMDocument.3.0");
	xslDoc.async = false;
	xslDoc.load("crbmx_results.xsl");
	// prepare the xsl document for transformation
	docCache = new ActiveXObject("MSXML2.XSLTemplate.3.0");
	docCache.stylesheet = xslDoc;
	// instantiate the document processor and submit the xml document
	docProcessor = docCache.createProcessor();
	docProcessor.input = xmlDoc;
	// add parameters to the xsl document
	docProcessor.addParameter("cdate",ret);
	// process the documents into html and submit to the passed div to the HMTL page
	docProcessor.transform();
	document.write(docProcessor.output);
} 

