function checkBoxes (cuadro)
{

	form=parent.frames.izquierdo.document.formulario;

	ceros="00000000";
	parametrosB="";
	parametrosH="";
	p=0;
	for (var c = 0; c < form.elements.length; c++)

	{
		if (form.elements[c].type == 'checkbox')
			{
			 if (form.elements[c].checked == true)
				{
				 parametrosB+="1";
				}
			 else
				{
				 parametrosB+="0";
				}

			if (p++>=7)
				{
					parametrosH+=BinToHex(parametrosB);
					p=0;		
					parametrosB="";
				}

			}
	}

	parametrosB+=ceros.substring(0,8-p);

	parametrosH+=BinToHex(parametrosB);

//	parent.location=cuadro+"?selector="+parametrosH;
	top.location=cuadro+"?selector="+parametrosH;
}

function BinToDec(bin){
	var a = 1;
	var b = 0;
	for(n=bin.length; n>0; n--) {
		if (bin.charAt(n-1) == "1") b += a;
		a += a;
	}
	return b;
}
function DecToHex(dec){
	dec = Math.abs(dec);
	var hex = "";
	var a = "" + dec;
	a = a.length;
	var h = "0123456789ABCDEF";
	for (n=0; n<a; n++){
		he = h.charAt(dec-Math.floor(dec/16)*16);
		dec = (dec - h.indexOf(he)) / 16;
		hex = he + hex;
	}
	if (hex.charAt(0) == "0") hex = hex.substring(1,hex.length);
	if (hex.length==1) hex="0"+hex;
	if (hex==0) hex="00";
	return hex;
}
function BinToHex(bin)
{
	return DecToHex(BinToDec(bin));
}

