function XMLConn(){
	// Create XML object
	var objXML;
	try{
		// NN, Opera 8.0+, Safari
		objXML = new XMLHttpRequest();
	}catch (e){
		// IE
		try{
			objXML = new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			try{
				objXML = new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e){
				alert('Your browser does not support AJAX!');
				return false;
			}
		}
	}
	this.connect = function(aMethod,aURL,aQuery,aAsync,fnDone){
		// Set defaults if no value sent
		if(!aMethod||aMethod==''){aMethod='GET';}
		if(!aURL||aURL==''){alert('No URL specified!');return false;}
		if(!aQuery||aQuery==''){aQuery=null;}
		if(!aAsync||aAsync==''){aAsync=true;}
		if(!fnDone||fnDone==''){alert('No handler function defined!');return false;}
		if(objXML){
			objXML.open(aMethod.toUpperCase(), aURL+'?'+aQuery, aAsync);
			objXML.onreadystatechange=function(){
				try{
					if(objXML.readyState==4 && (objXML.status || objXML.status==200)){
						fnDone(objXML);
						objXML.abort();
						objXML = null;
					}
				}catch(e){
					alert('There was an error in the AJAX\n'+e);
					return false;
				}
			}
			objXML.send(aQuery);
		}
	};
	
	return this;
}

function xmlParser(){
	this.getData = function(loc, tag){
		if(loc.getElementsByTagName(tag) && loc.getElementsByTagName(tag)[0] && loc.getElementsByTagName(tag)[0].childNodes[0]){
			return loc.getElementsByTagName(tag)[0].childNodes[0].data;
		}
	},
		
	this.moveNext = function(currLoc){
		if(currLoc.nextSibling){
			var nextSib = currLoc.nextSibling;
			if(nextSib.nodeType==3){
				var ret = nextSib.nextSibling;
			}else{
				var ret =  nextSib;
			}
			return ret;
		}else{
			return null;
		}
	};
}

