//Ajax funcional criado por Leandro Cunha!
// Contato leandrocunha01@gmail.com
// Todos direitos reservados.
var xmlhttp = null;
function httprequest() {
    try { 
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
    } catch (e) { 
        try { 
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
        } catch (E) { 
            xmlhttp = false; 
        } 
    } 
    if  (!xmlhttp && typeof  XMLHttpRequest != 'undefined' ) { 
        try  { 
            xmlhttp = new  XMLHttpRequest(); 
        } catch  (e) { 
            xmlhttp = false ; 
        } 
    }
    if (xmlhttp) {
        xmlhttp.onreadystatechange = retorno;
        xmlhttp.open(metodo, url,true);
		if(metodo=='POST'){
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		}
        xmlhttp.send(dados);
    }
}
function retorno () {
	//obj_status.innerHTML = 'Analisando pedido...';
    if ( xmlhttp.readyState == 4) {
        if ( xmlhttp.status == 200) { 
            obj_retorno.innerHTML = xmlhttp.responseText;
        } else { 
           // obj_status.innerHTML = xmlhttp.statusText;
			alert('Erro: '+ xmlhttp.statusText);
        } 
    }
}

