function XmlHandler()
{
	// this object
	var that = this;
	// xml-document
	this.xmlDoc = null;
	
	this.getValues = function(url, tagName)
	{
		if(that.xmlDoc == null) {
			that.loadDocument(url);
		}
		
		var values = [];
		var tempValues = that.xmlDoc.getElementsByTagName(tagName);
		
		
		var key = null;
		var value = null;
		//Log('***' + tagName + '***');
		for(i=0; i<tempValues.length; i++) {
			key = tempValues[i].getElementsByTagName('k')[0].childNodes[0].nodeValue;
			value = tempValues[i].getElementsByTagName('v')[0].childNodes[0].nodeValue;
			//Log(key + " - " + value);
			values[key] = value;
		}
		
		return values;
	};
	
	this.loadDocument = function(url)
	{
		try //Internet Explorer
		{
			that.xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
			that.xmlDoc.async=false;
			that.xmlDoc.load(url);
		}
		catch(e)
		{
			try //Firefox, Chrome
			{
			    var xmlhttp = new window.XMLHttpRequest();
				xmlhttp.open("GET",url,false);
				xmlhttp.send(null);
				that.xmlDoc = xmlhttp.responseXML.documentElement;
			}
			catch(e)
			{
				try // Operata etc.
				{
					that.xmlDoc = document.implementation.createDocument("","",null);
				}
				catch(e)
				{
					alert(e.message);
			    	return;
				}
				
			}
		}
	};
}



