	var http = new XMLHttpRequest();
	
	function CheckAssociate(strKey, intType) {
		showLayer('lyCheckAssociate');
		document.forms[0].numero_chave.disabled = !(document.forms[0].numero_chave.disabled);
		http.open("GET", "associate_check.asp?key=" + strKey + "&id_tb_associado_tipo_pessoa=" + intType, true);
		http.onreadystatechange = CheckAssociateResponse;
		http.send(null);
	}
	
	function CheckAssociateResponse() {
		if (http.readyState == 4) {
			strReturn = http.responseText;
			//alert(strReturn);
			hideLayer('lyCheckAssociate');
			document.forms[0].numero_chave.disabled = !(document.forms[0].numero_chave.disabled);
			eval(strHide);
			eval(strShow);

			if (strReturn != '') {	
				alert(strReturn);
				arForm = strReturn.split('|');
				for(i=1; i<arForm.length; i++) {
					eval(arForm[i]);
				}
	/*				if (strReturn.substring(0,1)!=0) {
					alert('O CPF ' + strReturn + ' já está sendo usado. Para alterar os dados informe sua senha');
					window.location.href = 'login.asp?referer=formulario.asp&cpf=' + strReturn;
	
				}
	*/
			}
		}
	}

