//-- ***************** 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 0:
    XMLHttp.open("get", "curiosidades.html", true);
    break;
    case 1:
    XMLHttp.open("get", "home.html", true);
    break;

    case 2:
    XMLHttp.open("get", "produtos.html", true);
    break;
	   
	   case 2.1:
    XMLHttp.open("get", "produtos_presentes.html", true);
    break;
		   case 2.2:
    XMLHttp.open("get", "produtos_cestas.html", true);
    break;
	  case 2.3:
    XMLHttp.open("get", "produtos_chocolates.html", true);
    break;
    
    case 3:
    XMLHttp.open("get", "empresa.html", true);
    break;

    case 4:
    XMLHttp.open("get", "lojas.html", true);
    break;

    case 5:
    XMLHttp.open("get", "contato.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 Servico($valor) {
var id = document.getElementById("id");
var divInfo = document.getElementById("servico");
var XMLHttp = criaXMLHttp();
switch ($valor)
{
	case 0:
    XMLHttp.open("get", "motores.html", true);
    break;
    case 1:
    XMLHttp.open("get", "motobombas.html", true);
    break;

    case 2:
    XMLHttp.open("get", "lavadoras.html", true);
    break;
    
    case 3:
    XMLHttp.open("get", "aspiradores.html", true);
    break;

    case 4:
    XMLHttp.open("get", "jardin.html", true);
    break;

    case 5:
    XMLHttp.open("get", "rural.html", true);
    break;
	
	case 6:
    XMLHttp.open("get", "geradores.html", true);
    break;
	
	case 7:
    XMLHttp.open("get", "pal_emp.html", true);
    break;
	
	case 8:
    XMLHttp.open("get", "esmilha.html", true);
    break;
	
	case 9:
    XMLHttp.open("get", "falha_mot.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);
}
