You have to check that the checkbox you want to check or uncheck is the same that has id "chkSingle". For this add another line:
var chkID = "chkSingle";
This way only those checkboxes wil be added to the array that have "chkSingle" in their id's.
inputElements[i].id.indexOf(chkID) != -1
function getCheckBoxesFrom(gv)
{
var checkboxesArray = new Array();
var inputElements = gv.getElementsByTagName("input");
var chkID = "chkSingle";
if (inputElements.length == 0) null;
for (i = 0; i <= inputElements.length -1; i++) {
if (isCheckBox(inputElements[i]) && (inputElements[i].id.indexOf(chkID) != -1)) {
checkboxesArray.push(inputElements[i]);
}
}