function ClickEnCheck(objeto)
{
	switch (objeto) {
		case "cb_pen":
			if (document.form1.cb_pen.checked==false) {
				document.form1.cb_vol.checked=false;
				document.form1.cb_vol.disabled=true;
				document.form1.cb_eje.checked=false;
				document.form1.cb_eje.disabled=true;
			} else {
				document.form1.cb_vol.checked=true;
				document.form1.cb_vol.disabled=false;
				document.form1.cb_eje.checked=true;
				document.form1.cb_eje.disabled=false;
			}
			break;
		case "cb_vol":
			if (!document.form1.cb_eje.checked) document.form1.cb_vol.checked=true;
			break;
		case "cb_eje":
			if (!document.form1.cb_vol.checked) document.form1.cb_eje.checked=true;
			break;
	}
}

function ventanaSecundaria (URL,altura,anchura)
{
	window.open(URL,"ventana1","width="+anchura+", height="+altura+", scrollbars=yes, menubar=no, location=no, resizable=no")
}

function ventanaSecundaria_nobars (URL,altura,anchura)
{
	window.open(URL,"ventana1","width="+anchura+", height="+altura+", scrollbars=no, menubar=no, location=no, resizable=no")
}

/* devuelve TRUE si el dígito de control es correcto, FALSE en caso contrario */
function comprobar_ccc(ccc)
{
	var entidad, sucursal, dc, numcuenta;
	var parte1, parte2;

	entidad = ccc.substr(0,4);
	sucursal = ccc.substr(4,4);
	dc = ccc.substr(8,2);
	numcuenta = ccc.substr(10,10);

	parte1 = entidad + sucursal;
	parte2 = numcuenta;

	Apesos = new Array(10, 9, 7, 3, 6, 1, 2, 4, 8, 5);
	DC1 = 0;
	DC2 = 0;

	for (i = 2; i < 10; i++) {
		digito = parte1.substr(i - 2, 1);
		DC1 = DC1 + (digito * Apesos[i]);
	}

	DC1 = DC1 % 11;
	if (DC1 == 10)
		DC1 = 1;

	for (i = 0; i < 10; i++) {
		digito = parte2.substr(i, 1);
		DC2 = DC2 + (digito * Apesos[i]);
	}

	DC2 = DC2 % 11;
	if (DC2 == 10)
		DC2 = 1;

	return(dc == ('' + DC1 + DC2));
}
