function XmlRequest(url, cb)
{
	XmlHttp = GetXmlHttpObject();
		
	if(XmlHttp == null)
		return false;
			
	XmlHttp.onreadystatechange = cb;
	XmlHttp.open("GET", url, true);
	XmlHttp.send(null);
}
function GetXmlHttpObject()
{
	var XmlHttp = null;
	try
	{
		//firefox
		XmlHttp = new XMLHttpRequest();
	}
	catch(e)
	{
		//ie
		try
		{					
			XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return XmlHttp;
}	
function XmlRs(v)
{
	this.xml = v;
	this.idx = 0;
	this.root = v.firstChild;
	//should be like this?
	if(this.root.firstChild == null)
		this.length = 0;
	else
		this.length = this.xml.getElementsByTagName(this.root.firstChild.nodeName).length;
}
function _GET(v)
{
	try
	{
		var n = this.xml.getElementsByTagName(v);
		return n[this.idx].firstChild.nodeValue;
	}
	catch(e)
	{
		return "";
	}
}
function _EOF()
{
	if(this.idx < this.length)
		return false;
	else
		return true;
}
function _BOF()
{
	if(this.idx == 0)
		return true;
	else
		return false;
}
function _MOVENEXT()
{
	this.idx++;
	if(this.idx > this.length)
		this.idx = this.length;
}
function _MOVEPREV()
{
	this.idx--;
	if(this.idx < 0)
		this.idx = 0;
}	

function _RECORDCOUNT()
{
	return this.length;		
}	

XmlRs.prototype.Eof = _EOF;
XmlRs.prototype.Bof = _BOF;
XmlRs.prototype.Get = _GET;
XmlRs.prototype.MoveNext = _MOVENEXT;
XmlRs.prototype.MovePrev = _MOVEPREV;
XmlRs.prototype.RecordCount = _RECORDCOUNT;
