function getHTTPObject()
{
	var req;
	try
	{
		if (window.XMLHttpRequest)
		{
			req = new XMLHttpRequest();

			if (req.readyState == null)
			{
				req.readyState = 1;
				req.addEventListener("load", function () {
				req.readyState = 4;

				if (typeof req.onReadyStateChange == "function")
				req.onReadyStateChange();
				}, false);
			}
			return req;
		}

		if (window.ActiveXObject)
		{
			var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];
			for (var i = 0; i < prefixes.length; i++)
			{
				try
				{
					req = new ActiveXObject(prefixes[i] + ".XmlHttp");
					return req;
				}
				catch (ex) {};
			}
		}
	}
	catch (ex) {}
	alert("Objetos XMLHttp não suportados pelo seu browser.");
}
var http = getHTTPObject();

var obj_ult;
function dadosProdutos(id, obj)
{
	obj_ult = obj;
	if ( document.getElementById('end_' + obj).style.display == 'none' )
	{
		document.getElementById('end_' + obj).style.display = 'block';
		http.open('GET', 'publicacoes_dados.asp?id='+ id +'', true);
		http.onreadystatechange = mostrarDadosProdutos;
		http.send(null);
	}
	else
	{
		document.getElementById('end_' + obj).style.display = 'none';
		document.getElementById('end_' + obj).innerHTML = ' <img src=""imagens/ico_sinc.gif"" width=""21"" height=""25""> ';
	}
}

function mostrarDadosProdutos()
{
	if (http.readyState == 4)
	{
		str_Texto  = '<table  border="0" cellspacing="0" cellpadding="2">';
		str_Texto += '<tr>';
		str_Texto += '<td valign="top"></td>';
		str_Texto += '<td><b>'+ http.responseText +'</b></td>';
		str_Texto += '</tr>';
		str_Texto += '</table>';

		document.getElementById('end_' + obj_ult).innerHTML = str_Texto;
	}
}