var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
var quoteYear='' ;
var quoteTitle = '' ;
var quoteQuotation = '' ;

function loadXML(xmlFile) {
	xmlDoc.async="false"; 
	xmlDoc.onreadystatechange=verify; 
	xmlDoc.load(xmlFile); 
	xmlObj=xmlDoc.documentElement; 
	}

function verify() {
	// 0 Object is not initialized 
	// 1 Loading object is loading data 
	// 2 Loaded object has loaded data 
	// 3 Data from object can be worked with 
	// 4 Object completely initialized 
	if (xmlDoc.readyState != 4) 
		return false; 
	}

loadXML('quotes/quotes.xml') ;

function getQuote() {
	var quoteCount 	= xmlObj.childNodes.length ;
	var quoteNumber = Math.floor (Math.random() * quoteCount) ; // the minus one is to ensure that element zero is selectable

	quoteYear 	= xmlObj.childNodes(quoteNumber).getAttribute('year') ;
	quoteTitle 	= xmlObj.childNodes(quoteNumber).getAttribute('title') ;
	quoteQuotation	= xmlObj.childNodes(quoteNumber).getAttribute('quotation') ;

	}