try {
        x = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e) {
        try {
                x = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(ex) {
                try {
                        x = new XMLHttpRequest();
                }
                catch(exc) {
                        alert("Esse browser não tem recursos para uso do Ajax");
                        x = null;
                }
        }
}
function buscaProduto()
{
	var chave = document.getElementById('busca').value;
	window.location = 'produtos.php?pagina=produtos&busca='+chave;
}
function enter(evento)
{
  tecla = evento.keyCode;
        if(tecla == 0)
        {
                tecla = evento.charCode;
        }
        if(tecla == 13)
        {
               buscaProduto();
        }
}

function addNews()
{
 	email = document.getElementById('campoEmail').value;
	var url = 'pcontrole/paginas/ajax.php?tipo=news&email='+email;
    var conteudo=document.getElementById('alvo');
	conteudo.innerHTML='Verificando';
    x.open('GET',url);
	alert(url);
	x.onreadystatechange= function stateChangedE(){
									if( x.readyState == 4 ){
									document.getElementById('alvo').innerHTML = x.responseText;
        							}
							};
	x.send(null);
 
}
