var HttpReq = null;

function amplia_imagem( imagem, title ) {
	PositionX = 0;
	PositionY = 0;
	window.open('imagem.php?imagem=' + imagem + '&title=' + title, '', 'resizable=1,scrollbars=no,width=100,height=100,left='+PositionX+',top='+PositionY);
}

function EnderecoEntrega(){
	Effect.toggle('EnderecoFixo','slide');
	Effect.toggle('EnderecoEntrega','appear');	
}

function EnderecoCobranca(){
	Effect.toggle('EnderecoCobrancaFix','slide');
	Effect.toggle('EnderecoCobranca','appear');	
}

// Função Ajax que escolhe o Tipo de Sócio e o valor.
function tipoSocio(url, select){

	var socioId = select.value
	url = url + '?tipo=' + socioId;
	if (document.getElementById) { // Verifica se o Browser suporta DHTML.
		if (window.XMLHttpRequest) {
			HttpReq = new XMLHttpRequest();
			HttpReq.onreadystatechange = XMLHttpRequestChangeAssociado;
			HttpReq.open("GET", url, true);
			HttpReq.send(null);
		} else if (window.ActiveXObject) {
			HttpReq = new ActiveXObject("Microsoft.XMLHTTP");
			if (HttpReq) {
				HttpReq.onreadystatechange = XMLHttpRequestChangeAssociado;
				HttpReq.open("GET", url, true);
				HttpReq.send();
			}
		}
	}
}

// Altera o valor do associado
function XMLHttpRequestChangeAssociado() {
	if (HttpReq.readyState == 4 && HttpReq.status == 200){
		document.getElementById('Contribuicao').value = HttpReq.responseText;
	}
}