//-- ***************** SCRIPT PARA IMPLEMENTAR O AJAX *************************-->

function criaXMLHttp() {

if (typeof XMLHttpRequest != "undefined")

return new XMLHttpRequest();

else if (window.ActiveXObject){

var versoes = ["MSXML2.XMLHttp.5.0",

"MSXML2.XMLHttp.4.0", "MSXML2.XMLHttp.3.0",

"MSXML2.XMLHttp", "Microsoft.XMLHttp"

];

}

for (var i = 0; i < versoes.length; i++){

try{

return new ActiveXObject(versoes[i]);

}catch (e) {}

}

throw new Error("Seu browser nao suporta AJAX");

}



function BuscaId($valor){

var id = document.getElementById("id");

var divInfo = document.getElementById("pagina");

var XMLHttp = criaXMLHttp();

switch ($valor)

{

	case 1:

    XMLHttp.open("get", "home.html", true);

    break;

	case 2:

    XMLHttp.open("get", "historico.html", true);

    break;

	case 3:

    XMLHttp.open("get", "localizacao.html", true);

    break;

	case 4:

    XMLHttp.open("get", "associados.html", true);

    break;

	case 5:

    XMLHttp.open("get", "contato.html", true);

    break;

	case 6:

    XMLHttp.open("get", "convencoes.html", true);

    break;

	case 7:

    XMLHttp.open("get", "medicos.html", true);

    break;

	case 8:

    XMLHttp.open("get", "vagas.php", true);

    break;	

	case 9:

    XMLHttp.open("get", "advogados.html", true);

    break;	

	case 10:

    XMLHttp.open("get", "links.html", true);

    break;

	case 11:

    XMLHttp.open("get", "convencao2000.html", true);

    break;

	case 12:

    XMLHttp.open("get", "convencao2001.html", true);

    break;

	case 13:

    XMLHttp.open("get", "convencao2002.html", true);

    break;

	case 14:

    XMLHttp.open("get", "convencao2003.html", true);

    break;

	case 15:

    XMLHttp.open("get", "convencao2004.html", true);

    break;

	case 16:

    XMLHttp.open("get", "convencao2005.html", true);

    break;

	case 17:

    XMLHttp.open("get", "convencao2006.html", true);

    break;

	case 18:

    XMLHttp.open("get", "convencao2007.html", true);

    break;

	case 19:

    XMLHttp.open("get", "beneficiarios.html", true);

    break;

	case 20:

    XMLHttp.open("get", "profissoes.html", true);

    break;	

	case 21:

    XMLHttp.open("get", "esportes.html", true);

    break;	

	case 22:

    XMLHttp.open("get", "edital.html", true);

    break;	

	case 23:

    XMLHttp.open("get", "filiacao.html", true);

    break;	

	case 24:

    XMLHttp.open("get", "guia_contribuicao.html", true);

    break;	

	case 25:

    XMLHttp.open("get", "convencao2008.html", true);

    break;	

	case 26:

    XMLHttp.open("get", "convencao2009.html", true);

    break;	

	case 27:

    XMLHttp.open("get", "convencao2010.html", true);

    break;	
	case 28:

    XMLHttp.open("get", "piso_regional.html", true);

    break;
	
	case 29:

    XMLHttp.open("get", "convencao2011.html", true);

    break;	

	

}

XMLHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");

XMLHttp.onreadystatechange = function () {

if (XMLHttp.readyState == 4)

if (XMLHttp.status == 200){

divInfo.innerHTML = XMLHttp.responseText;





} else {

divInfo.innerHTML = "Um erro ocorreu" + XMLHttp.statusText;

}

};

XMLHttp.send(null);

}



function enviar_arquivo($id_vaga) {

  var divInfo = document.getElementById("pagina");

  var XMLHttp = criaXMLHttp();

  // código para carregar a linha de produtos

  //XMLHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");

  XMLHttp.open('GET', 'curriculo.php?id_vaga='+$id_vaga, true);

  XMLHttp.onreadystatechange = function () {

  if (XMLHttp.readyState == 4)

     if (XMLHttp.status == 200){

        divInfo.innerHTML = XMLHttp.responseText;

     }

     else{

     divInfo.innerHTML = "Um erro ocorreu: " + XMLHttp.statusText;

        }

     }

     XMLHttp.send(null);

  }




