function classXML(handle)
{
	this.doc 		= false;
	
	this.handle		= handle;
	this.request	= false;
	
	this.process	= false;
	this.init		= classXML_init;
	this.load		= classXML_load;
	this.set		= classXML_set;
	this.safari		= classXML_safari;
}

function classXML_init(text)
{
	if(typeof text == "undefined") { text = false; }
	
	if(text)
	{
		if(window.ActiveXObject)
  		{
  			this.doc = new ActiveXObject("Microsoft.XMLDOM");
 			this.doc.async = "false";
  			this.doc.loadXML(text);
  		}
		else
  		{
 		 	var parser = new DOMParser();
 			this.doc = parser.parseFromString(text, "text/xml");
  		}
	}
	else
	{
		if(navigator.vendor == "Apple Computer, Inc.")
		{
			this.request = new XMLHttpRequest(); 
			eval("this.request.onreadystatechange = function () { if ("+this.handle+".request.readyState == 4) { "+this.handle+".safari(); } };");
		}
		else
		{
			if(document.implementation && document.implementation.createDocument)
			{
				this.doc = document.implementation.createDocument("", "", null);
				this.doc.onload = this.process;
			}
			else if(window.ActiveXObject)
			{
				this.doc  = new ActiveXObject("Microsoft.XMLDOM");
				eval("this.doc.onreadystatechange = function () { if ("+this.handle+".doc.readyState == 4) { "+this.handle+".process(); } };");
			}
		}
	}	
	
	this.doc.async = "false";
}

function classXML_safari()
{
	this.init(this.request.responseText);
	this.process();
}

function classXML_load(filename)
{
	if(navigator.vendor == "Apple Computer, Inc.")
	{
		this.init();
		this.request.open('GET', filename, true);                  
		this.request.send(null); 
	}
	else
	{
		this.init();
		this.doc.load(filename);	
	}
}

function classXML_set(content)
{
	this.init(content);
}

