function ajaxObj(url, elmnts)
{
	this.obj = new Object();
	this.url = url;
	this.loadInto = elmnts;
	loadingMsg = 'Carregando!!';
	

	if(loadingMsg)
	{
		if(typeof(this.loadInto) != 'object')
      	document.getElementById(this.loadInto).innerHTML.innerHTML = loadingMsg;
      else
      {
      	for(i in this.loadInto)
      	{
      		document.getElementById(this.loadInto[i]).innerHTML = loadingMsg;
      	}
      }
	}
	
	this.init();
	pagina = url;
	IDdiv = elmnts;
	
	//setTimeout("ajaxObj(pagina,IDdiv,mensagem,tp)", tp);
} 


ajaxObj.prototype.create = function()
{
	try
   {
   	xmlHttp = new XMLHttpRequest();
   }
   catch(e)
   {
   	try
      {
      	xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
      }
      catch(e)
      {
      	try
        	{
         	xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        	}
      	catch(e)
        	{
        		return false;
        	}
      }
   } 
	
	this.obj = xmlHttp;
	
}

ajaxObj.prototype.handle = function()
{
	var o = this.obj;
	var into = this.loadInto;
	
	o.onreadystatechange = function()
   {
   	if(o.readyState == 4)
      {
      	if(typeof(into) != 'object')
      		document.getElementById(into).innerHTML = o.responseText;
      	else
      	{
      		temp = o.responseText.split("@@");
      		
      		for(i in into)
      		{
      			document.getElementById(into[i]).innerHTML = temp[i];
      		}
      	}
      }
	}
}

ajaxObj.prototype.send = function()
{
   this.obj.open('GET', this.url, true);
   this.obj.send(null);
}

ajaxObj.prototype.init = function()
{
	this.obj = null;
	
	this.create();
	
	this.handle();
	
	this.send();
}

