
function pesquisaEmail(email) {
	var xmlhttp = false;
	var v_texto = '', v_resp = '', v_page = '';
	
	try {
    	xmlhttp = new XMLHttpRequest();
	} catch(e){
	    try{
	        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	    } catch(e){
	        try{
	            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	        }catch(e){
	            xmlhttp = false;}
	    }
	}
	
	v_page = 'procemail.asp';
	v_page += '?email='+ email.value;
	xmlhttp.open('get', v_page,true);
	xmlhttp.onreadystatechange = function(){
		if(xmlhttp.readyState == 4){ 
	        if(xmlhttp.status == 200) {
				v_texto = unescape(xmlhttp.responseText);
				if(v_texto.indexOf('|') >= 0) {
					v_resp = v_texto.split('|');
					if(v_resp[0] == 1) {
						alert(v_resp[1]);
						email.value	  = '';
					}
				}
			} else alert("Houve um problema ao obter os dados:\n" + xmlhttp.statusText);
		}
	}
	void(xmlhttp.send(null));
}

function pesquisaPagina(pag) {
	var xmlhttp = false;
	var v_texto = '', v_resp = '', v_page = '';
	
	try {
    	xmlhttp = new XMLHttpRequest();
	} catch(e){
	    try{
	        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	    } catch(e){
	        try{
	            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	        }catch(e){
	            xmlhttp = false;}
	    }
	}
	
	v_page = 'procpag.asp';
	v_page += '?pag='+ pag.value;
	xmlhttp.open('get', v_page,true);
	xmlhttp.onreadystatechange = function(){
		if(xmlhttp.readyState == 4){ 
	        if(xmlhttp.status == 200) {
				v_texto = unescape(xmlhttp.responseText);
				if(v_texto.indexOf('|') >= 0) {
					v_resp = v_texto.split('|');
					if(v_resp[0] == 1) {
						alert(v_resp[1]);
						pag.value	  = '';
					}
				}
			} else alert("Houve um problema ao obter os dados:\n" + xmlhttp.statusText);
		}
	}
	void(xmlhttp.send(null));
}
