function doInvertSelection( frm, nam ){
for (var i = 0; i < frm.elements.length; i++) {
if (frm.elements[i].type == "checkbox") {
if (frm.elements[i].name == nam) {
frm.elements[i].checked = (frm.elements[i].checked) ? false:true;
}
}
}
return false;
}