var tmpRLA=null;
function AsyncMarqueeList(marqID,reqUrl,callback)
{
    this.CtrlID = marqID;
    this.Url=reqUrl;
    this.callback=callback;
    this.getXMLHttp=function (){
        if (window.XMLHttpRequest){
            return new XMLHttpRequest();
        }else{
            var obj = new ActiveXObject('msxml2.xmlhttp');
            return obj;
        }
    };
    this.safeCallback=function (){
        try
        {
            if (this.callback !=null && this.callback != undefined)
            {
                callback();
            }
        }catch(ex)
        {
                }
    }
    this.loadXML=function (url){
        var xmlHttp = this.getXMLHttp();
        xmlHttp.open('get',url,true);
        xmlHttp.onreadystatechange = new Function("tmpRLA.RSCH();");
        this.xH=xmlHttp;
        xmlHttp.send(null);
    };
    this.Init=function(){
        tmpRLA=this;
        this.loadXML(this.Url);
    }
    this.RSCH = function(){
        if (this.xH.readyState==4)
        {
            if (this.xH.status==200)
            {
                try
                {
                    var xdoc = this.xH.responseXML;
                    
                    var contNode = xdoc.getElementsByTagName("content")[0];
                    var cont = "";
                    if (__IsIE())
                        cont = contNode.text;
                    else
                        cont = contNode.textContent;
                    document.getElementById(this.CtrlID).innerHTML = cont;
                    this.safeCallback();
                }catch(ex)
                {
                    if (__IsIE())
                        document.getElementById(this.CtrlID).innerText = "Failed to load data. " + ex.description;
                    else
                        document.getElementById(this.CtrlID).innerText = "Failed to load data. " + ex.message;
                    this.safeCallback();
                }
            }else{
                document.getElementById(this.CtrlID).innerText = "Failed to load data. Server responded with status code " + this.xH.status.toString();
                this.safeCallback();
            }
        }
    };
}