function mostra_anunc (ID) {
  document.getElementById(ID).style.display= "";
}
function esconde_anunc (ID) {
  document.getElementById(ID).style.display= "none";
}
function pesquisar_dados( valor )
{
  http.open("GET", "index.asp?acao=ajax&id=" + valor, true);
  http.onreadystatechange = handleHttpResponse;
  http.send(null);
}

function handleHttpResponse()
{
  campo_select = document.forms[0].subcategorias;
  if (http.readyState == 4) {
   campo_select.options.length = 0;
   campo_select.options[0] = new Option( '', '' );
    results = http.responseText.split(",");
    for( i = 1; i < results.length; i++ )
    {
      string = results[i].split( "|" );
      campo_select.options[i] = new Option( string[0], string[1] );
    }
  }
}

function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
var http = getHTTPObject();


function pesquisar_dados2( valor )
{
  http.open("GET", "index.asp?acao=ajax&id=" + valor, true);
  http.onreadystatechange = handleHttpResponse2;
  http.send(null);
}

function handleHttpResponse2()
{
  campo_select = document.forms[0].subcategorias2;
  if (http.readyState == 4) {
   campo_select.options.length = 0;
   campo_select.options[0] = new Option( '', '' );
    results = http.responseText.split(",");
    for( i = 1; i < results.length; i++ )
    {
      string = results[i].split( "|" );
      campo_select.options[i] = new Option( string[0], string[1] );
    }
  }
}

function pesquisar_dados3( valor )
{
  http.open("GET", "index.asp?acao=ajax&id=" + valor, true);
  http.onreadystatechange = handleHttpResponse3;
  http.send(null);
}

function handleHttpResponse3()
{
  campo_select = document.forms[0].subcategorias3;
  if (http.readyState == 4) {
   campo_select.options.length = 0;
   campo_select.options[0] = new Option( '', '' );
    results = http.responseText.split(",");
    for( i = 1; i < results.length; i++ )
    {
      string = results[i].split( "|" );
      campo_select.options[i] = new Option( string[0], string[1] );
    }
  }
}

function pesquisar_dados4( valor )
{
  http.open("GET", "index.asp?acao=ajax&id=" + valor, true);
  http.onreadystatechange = handleHttpResponse4;
  http.send(null);
}

function handleHttpResponse4()
{
  campo_select = document.forms[0].subcategorias4;
  if (http.readyState == 4) {
   campo_select.options.length = 0;
   campo_select.options[0] = new Option( '', '' );
    results = http.responseText.split(",");
    for( i = 1; i < results.length; i++ )
    {
      string = results[i].split( "|" );
      campo_select.options[i] = new Option( string[0], string[1] );
    }
  }
}

function pesquisar_dados5( valor )
{
  http.open("GET", "index.asp?acao=ajax&id=" + valor, true);
  http.onreadystatechange = handleHttpResponse5;
  http.send(null);
}

function handleHttpResponse5()
{
  campo_select = document.forms[0].subcategorias5;
  if (http.readyState == 4) {
   campo_select.options.length = 0;
   campo_select.options[0] = new Option( '', '' );
    results = http.responseText.split(",");
    for( i = 1; i < results.length; i++ )
    {
      string = results[i].split( "|" );
      campo_select.options[i] = new Option( string[0], string[1] );
    }
  }
}

function pesquisar_dados6( valor )
{
  http.open("GET", "index.asp?acao=ajax&id=" + valor, true);
  http.onreadystatechange = handleHttpResponse6;
  http.send(null);
}

function handleHttpResponse6()
{
  campo_select = document.forms[0].subcategorias6;
  if (http.readyState == 4) {
   campo_select.options.length = 0;
   campo_select.options[0] = new Option( '', '' );
    results = http.responseText.split(",");
    for( i = 1; i < results.length; i++ )
    {
      string = results[i].split( "|" );
      campo_select.options[i] = new Option( string[0], string[1] );
    }
  }
}