/******************************************************************************/
function chequearElemento(elemento,inputid,alerta){
 var chequeados,i,id,obj;
		 chequeados =0;
 id="";

for (i=0;i<=document.formulario.length;i++){
	obj=eval('document.formulario.'+elemento+i);
	if (obj!= null && obj.checked){
		chequeados++;
		id=id +obj.value+',';
	}
}
id=id.substring(0,id.length-1);
obj = document.getElementById(inputid);

obj.value = id;

if (chequeados<1){
	if (alerta) alert('Debe Seleccionar algun Elemento de la lista');
	return false;
}
else
   return true;
}
/******************************************************************************/
function chequear(){
 var chequeados,i,id;
		 chequeados =0;
 id="";

for (i=0;i<=document.formulario.length;i++){
	obj=eval('document.formulario.elemento'+i);
	if (obj!= null && obj.checked){
		chequeados++;
		id=id +obj.value+',';
	}
}
id=id.substring(0,id.length-1);
document.formulario.id.value=id;

if (chequeados<1){
	alert('Debe Seleccionar algun Elemento de la lista');
	return false;
}
else
   return true;
}
/******************************************************************************/
function chequear2(){
 var chequeados,i,id;
		 chequeados =0;
 id="";

for (i=0;i<=document.formulario.length;i++){
	obj=eval('document.formulario.elemento_2'+i);
	if (obj!= null && obj.checked){
		chequeados++;
		id=id +obj.value+',';
	}
}
id=id.substring(0,id.length-1);
document.formulario.id2.value=id;

if (chequeados<1){
	alert('Debe Seleccionar algun Elemento de la lista');
	return false;
}
else
   return true;
}
/******************************************************************************/
function chequear3(){
 var chequeados,i,id;
		 chequeados =0;
 id="";

for (i=0;i<=document.formulario.length;i++){
	obj=eval('document.formulario.elemento_3'+i);
	if (obj!= null && obj.checked){
		chequeados++;
		id=id +obj.value+',';
	}
}
id=id.substring(0,id.length-1);
document.formulario.id3.value=id;

if (chequeados<1){
	alert('Debe Seleccionar algun Elemento de la lista');
	return false;
}
else
   return true;
}
/******************************************************************************/
function seleccionarTodos(){
for (i=0;i<=document.formulario.length;i++){
	obj=eval('document.formulario.elemento'+i);
	if (obj!= null){
		  obj.checked = true;
	}
}
}
/******************************************************************************/
function desseleccionarTodos(){
for (i=0;i<=document.formulario.length;i++){
	obj=eval('document.formulario.elemento'+i);
	if (obj!= null){
		  obj.checked = false;
	}
}
}
