<!--
// 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');
racepxml = "racephotos" + date + ".xml";
if (moz) {
	// instantiate and load the xml document
	docRequest = new XMLHttpRequest();
	docRequest.open("GET", racepxml, false);
	docRequest.send(null);
	xmlDoc = docRequest.responseXML;
	// instantiate and load the xsl document
	docRequest = new XMLHttpRequest();
	docRequest.open("GET", "crbmx_racephotos.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, "start", start);
	docProcessor.setParameter(null, "limit", limit);
	docProcessor.setParameter(null, "date", date);
	docProcessor.setParameter(null, "race", race);
	docProcessor.setParameter(null, "title", title);
	// clear the passed div if anything was in it
	document.getElementById("racephotos").innerHTML = "";
	// process the documents into html and submit to the passed div to the HMTL page
	docFragment = docProcessor.transformToFragment(xmlDoc, document);
	document.getElementById("racephotos").appendChild(docFragment);
} else if (ie) {
	// instantiate and load the xml document
	xmlDoc = new ActiveXObject("MSXML2.DOMDocument.3.0");
	xmlDoc.async = false;
	xmlDoc.load(racepxml);
	// instantiate and load the xsl document
	xslDoc = new ActiveXObject("MSXML2.FreeThreadedDOMDocument.3.0");
	xslDoc.async = false;
	xslDoc.load("crbmx_racephotos.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("start",start);
	docProcessor.addParameter("limit",limit);
	docProcessor.addParameter("date",date);
	docProcessor.addParameter("race",race);
	docProcessor.addParameter("title",title);	
	// process the documents into html and submit to the passed div to the HMTL page
	docProcessor.transform();
	document.write(docProcessor.output);
}
//   -->