var xmlhttp

function loadXMLDoc(url) 
{
xmlhttp=null
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=onResponse;
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
  }
else
  {
  alert("Your browser does not support XMLHTTP.")
  }
}

/////////////////////////////

function checkReadyState(obj)
{
  if(obj.readyState == 4)
  {
    if(obj.status == 200)
    {
      return true;
    }
    else
    {
      alert("Problem retrieving XML data");
    }
  }
}



// TABELA DE MILHO

function onResponse() 
{
  if(checkReadyState(xmlhttp))
  {
  var response = xmlhttp.responseXML.documentElement;
  txt="<table border='0'>"
  x=response.getElementsByTagName("NEWS")
  for (i=0;i<3;i++)
    {
    txt=txt + "<tr height='20'>"

    xx=x[i].getElementsByTagName("DATA")
      {
      try
        {
        txt=txt + "<td class='normal'><b>" + xx[0].firstChild.data + "</b>"
        }
      catch (er)
        {
        txt=txt + "<td>&nbsp;</td>"
        }
      }
	  
	   xx=x[i].getElementsByTagName("INTEGRA")
      {
      try
        {
        txt=txt + "<a class='linkamarelo' href='internas/mercado.php?texto=" + xx[0].firstChild.data + "&"
        }
      catch (er)
        {
        txt=txt + "<td>&nbsp;</td>"
        }
      }

xx=x[i].getElementsByTagName("MANCHETE")
      {
      try
        {
        txt=txt + "titulo=" + xx[0].firstChild.data + "'>" + xx[0].firstChild.data.toLowerCase() + "</a></td>"
        }
      catch (er)
        {
        txt=txt + "<td>&nbsp;</td>"
        }
      }

    txt=txt + "</tr>"
    }
  txt=txt + "</table>"
  txt = txt.replace(/\n/ig,"<br>");
  document.getElementById('mercado').innerHTML=txt
  }
}