/**
 * Read XMLFile
 * Reads any XML file
 * 
 * Version 1.0
 * Created 08/03/2010
 *
 * Author: henworx-ASA 
 *
 */

XMLReader=function(){
	this.readFor;
	this.callerObject
	this.read=function(xmlFile,objectRef,readFor){
	
			this.callerObject=objectRef;
			this.readFor=readFor;
			// code for IE7+, Firefox, Chrome, Opera, Safari
			if (window.XMLHttpRequest){
				xmlhttp=new XMLHttpRequest();
			}else{
				// code for IE6, IE5
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			xmlhttp.open("GET",xmlFile,false);
			xmlhttp.send(null);
			this.convertXML(xmlhttp.responseXML);
	}
		//converts xml into an array 
		this.convertXML=function(xml){
			
				//returns an array converted from xml to a cllback function
				_callerObj=this.callerObject;
				o=xml2array(xml)
				//return the array to the caller
				_callerObj.afterXMLRead(o,this.readFor)
			
		}
		
		
}
