function Asynchronous() 
{
	this._xmlhttp = new FactoryXMLHttpRequest();
}

function Asynchronous_call(url, blockname, answertype, ifblank) 
{
	var instance = this;
	
	this._xmlhttp.open('GET', url, true);
	this._xmlhttp.onreadystatechange = function() 
	{
		switch(instance._xmlhttp.readyState) 
		{
			case 1:
				instance.loading(blockname, answertype);
				break;
			case 2:
				instance.loaded(blockname, answertype);
				break;
			case 3:
				instance.interactive(blockname, answertype);
				break;
			case 4:
				instance.complete(instance._xmlhttp.status, instance._xmlhttp.statusText, instance._xmlhttp.responseText, instance._xmlhttp.responseXML, blockname, answertype, ifblank);
				break;
		}
	}

	this._xmlhttp.send(null);
}

function Asynchronous_loading(blockname, answertype) 
{
    
}

function Asynchronous_loaded(blockname, answertype) 
{
    
}

function Asynchronous_interactive(blockname, answertype) 
{
    
}

function Asynchronous_complete(status, statusText, responseText, responseHTML, blockname, answertype, ifblank) 
{
    if(responseText == '' && ifblank != '')
    {
        document.getElementById(ifblank).style.display = 'none';
    }
    else if(responseText != '')
    {
        if(ifblank != '')
            document.getElementById(ifblank).style.display = '';
            
        if(blockname != '')
        {
            var bname = new Array();
            bname = blockname.split(',');
            
            for(var i=0; i<bname.length; i++)
            {
                if(answertype == '0')
                    document.getElementById(bname[i]).innerHTML = responseText;
                else
                    document.getElementById(bname[i]).innerHTML = document.getElementById(bname[i]).innerHTML + responseText;
            }
        }
        else
        {
            if(answertype == '9')
                alert(responseText);
        }
    }
}

Asynchronous.prototype.loading = Asynchronous_loading;
Asynchronous.prototype.loaded = Asynchronous_loaded;
Asynchronous.prototype.interactive = Asynchronous_interactive;
Asynchronous.prototype.complete = Asynchronous_complete;
Asynchronous.prototype.call = Asynchronous_call;