window.onload = function() {
	var socio = document.getElementById('InscripcionSocio');
	var nosocio = document.getElementById('InscripcionNosocio');
	if(nosocio.checked) {
		disable(false);
	}
	else {
		disable(true);
		expandir(false);

	}
	socio.onclick = function() {
		if(this.checked) {
			nosocio.checked = false;
			disable(true);
		}
	}
	nosocio.onclick = function() {
		if(this.checked) {
			socio.checked = false;
			disable(false);
		}
		else {
			disable(true);
		}
	}
	document.forms[0]['data[Inscripcion][forma_pago]'][0].onclick = function() {
		expandir(false);
	}
	document.forms[0]['data[Inscripcion][forma_pago]'][1].onclick = function() {
		expandir(1);
	}
	document.forms[0]['data[Inscripcion][forma_pago]'][2].onclick = function() {
		expandir(2)
	}
	document.getElementById('InscripcionTarjeta').onchange = function() {
		if(this.value == 3) {
			alert(texto_cambio + tipo_cambio + " EUR/USD");
		}
	};
}

function disable(dis) {
	if(dis) {
		document.getElementById("forma_pago").className = "disabled";
		document.getElementById('InscripcionTarjeta').disabled = true;
	}
	else {
		document.getElementById("forma_pago").className = "";
		document.getElementById('InscripcionTarjeta').disabled = false;
	}
	expandir(false);
	for(var i=0;i<3;i++) {
		document.forms[0]['data[Inscripcion][forma_pago]'][i].disabled = dis;
		if(!dis) {
			if(i>0 && document.forms[0]['data[Inscripcion][forma_pago]'][i].checked) {
				expandir(i);
			}
		}
	}
}

function expandir(op) {
	if(op === false) {
		document.getElementById("expandir1").style.display='none';
		document.getElementById("expandir2").style.display='none';
	}
	else {
		document.getElementById("expandir"+op).style.display='block';
		op = (op + 2) % 2 + 1;
		document.getElementById("expandir"+op).style.display='none';
	}
}