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 
        { 
        document.getElementById('imgCheck' + id).src = "img/true.gif"; //change the image 
        document.getElementById('recebeNews').value = "Sim"; //change the field value 
		document.getElementById('tableCheck' + id).style.display = "block";
        check[id] = true; //change the value for this checkbox in the array 
		
        } 
    else 
        { 
        document.getElementById('imgCheck' + id).src = "img/false.gif"; 
        document.getElementById('recebeNews').value = "Não"; 
		document.getElementById('tableCheck' + id).style.display = "none";
        check[id] = false; 
        } 
    }