check = []; //this is an array that stores all the true/false values for each checkbox

function checkBox(id)
	{

	if(check[id] != true) //if a value is not true, use this rather than == false, 'cos the first time no value will be set and it will be undefined, not true or false
		{

		for (i=parseInt(id/3)*3;i<parseInt(id/3)*3+3;i++)
		 {
			check[i] = false;			
			document.getElementById('imgCheck' + i).src = "/imagens_site/"+parseInt(i%3)+".png";
			document.getElementById('inputCheck' + i).value = "false";		 
		 }
		document.getElementById('imgCheck' + id).src = "/imagens_site/xbold.png"; //change the image
		document.getElementById('inputCheck' + id).value = "true"; //change the field value
		check[id] = true; //change the value for this checkbox in the array
		}
	else
		{
		/*if (('imgCheck' + id) == "imgCheck0") {
		document.getElementById('imgCheck' + id).src = "/imagens_site/0.png";
		document.getElementById('inputCheck' + id).value = "false";	
		}else if (('imgCheck' + id) == "imgCheck1") {
		document.getElementById('imgCheck' + id).src = "/imagens_site/1.png";
		document.getElementById('inputCheck' + id).value = "false";		
		}else if (('imgCheck' + id) == "imgCheck2") {
		document.getElementById('imgCheck' + id).src = "/imagens_site/2.png";
		document.getElementById('inputCheck' + id).value = "false";			
		}else if (('imgCheck' + id) == "imgCheck3") {
		document.getElementById('imgCheck' + id).src = "/imagens_site/0.png";
		document.getElementById('inputCheck' + id).value = "false";			
		}else if (('imgCheck' + id) == "imgCheck4") {
		document.getElementById('imgCheck' + id).src = "/imagens_site/1.png";
		document.getElementById('inputCheck' + id).value = "false";			
		}else if (('imgCheck' + id) == "imgCheck5") {
		document.getElementById('imgCheck' + id).src = "/imagens_site/2.png";
		document.getElementById('inputCheck' + id).value = "false";			
		}else if (('imgCheck' + id) == "imgCheck6") {
		document.getElementById('imgCheck' + id).src = "/imagens_site/0.png";
		document.getElementById('inputCheck' + id).value = "false";			
		}else if (('imgCheck' + id) == "imgCheck7") {
		document.getElementById('imgCheck' + id).src = "/imagens_site/1.png";
		document.getElementById('inputCheck' + id).value = "false";			
		}else if (('imgCheck' + id) == "imgCheck8") {
		document.getElementById('imgCheck' + id).src = "/imagens_site/2.png";
		document.getElementById('inputCheck' + id).value = "false";			
		}
		
		//document.getElementById('imgCheck' + id).src = "/imagens_site/x.png";
		//document.getElementById('inputCheck' + id).value = "false";
		check[id] = false;*/
		}
	}