function createAjaxObj(){
	var httprequest=false
	if (window.XMLHttpRequest){ // if Mozilla, Safari etc
		httprequest=new XMLHttpRequest()
		if (httprequest.overrideMimeType)
			httprequest.overrideMimeType('text/xml')
	}
	else 
	if (window.ActiveXObject){ // if IE
		try {
			httprequest=new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e){
			try{
				httprequest=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e){}
		}
	}
	return httprequest
}


function cargarArchivo(xmlfile){
	this.xmlfile=xmlfile //Variable pointing to the local ticker xml file (txt)
	this.ajaxobj=createAjaxObj()
	this.getXMLfile()
}


cargarArchivo.prototype.getXMLfile=function(){
	if (this.ajaxobj){
		var instanceOfTicker=this
		var url=this.xmlfile
		this.ajaxobj.onreadystatechange=function(){instanceOfTicker.initialize()}
		this.ajaxobj.open('GET', url, true)
		this.ajaxobj.send(null)
	}
}


cargarArchivo.prototype.initialize=function(){ 

	if (this.ajaxobj.readyState == 4){ //if request of file completed
		if (this.ajaxobj.status==200 || window.location.href.indexOf("http")==-1){ //if request was successful
			var response=this.ajaxobj.responseText
			eval(response);
			}
		}
}


/*
	var xmlfile="http://drone.hopto.org:81/livehelp/livehelp_js.php?department=2&pingtimes=15" 
	new cargarArchivo(xmlfile)


*/